text stringlengths 8 4.13M |
|---|
extern crate clap;
extern crate daemonize;
extern crate log;
//default plugins;
extern crate gary_docker;
mod cli;
mod cluster_api;
mod cluster_management;
mod deployment_management;
mod runtime_plugin_manager;
fn main() {
cli::cli();
}
|
#!/usr/bin/env rust-script
//! ```cargo
//! [package]
//! name = "trianglearea"
//! authors = ["Evan Boehs"]
//! version = "0.1.0"
//! license = "Commons Clause Apache-2.0"
//! edition = "2018"
//!
//! [dependencies]
//!
//! ```
// Copyright 2021, Evan Boehs
#![forbid(unsafe_code)]
use std::io::stdin;
struct Triangle {
lineone: f64,
linetwo: f64,
linethree: f64,
}
impl Triangle {
fn area(&self) -> f64 {
let s = (self.lineone + self.linetwo + self.linethree) / 2.0;
(s * (s - self.lineone) * (s - self.linetwo) * (s - self.linethree)).sqrt()
}
}
fn main() {
fn gentri(n: String) -> f64 {
println!("Enter the length of the {} line", n);
let mut tri = String::new();
stdin()
.read_line(&mut tri)
.ok()
.expect("Failed to read line");
tri.trim().parse().unwrap()
}
let tri = Triangle {
lineone: { gentri(format!("first")) },
linetwo: { gentri(format!("second")) },
linethree: { gentri(format!("third")) },
};
println!("The result is {}", tri.area());
}
// vim: set ft=rust sw=4 sts=4 expandtab :
|
use super::*;
use std::convert::TryInto;
use liblumen_alloc::erts::term::prelude::SmallInteger;
#[test]
fn with_small_integer_returns_small_integer() {
run!(
|arc_process| {
(
Just(arc_process.clone()),
strategy::term::integer::small::isize(),
)
.prop_map(|(arc_process, integer)| {
(
arc_process.clone(),
integer,
arc_process.charlist_from_str(&integer.to_string()),
)
})
},
|(arc_process, integer, list)| {
let result = result(&arc_process, list);
prop_assert!(result.is_ok());
let term = result.unwrap();
let small_integer_result: core::result::Result<SmallInteger, _> = term.try_into();
prop_assert!(small_integer_result.is_ok());
let small_integer = small_integer_result.unwrap();
let small_integer_isize: isize = small_integer.into();
prop_assert_eq!(small_integer_isize, integer);
Ok(())
},
);
}
#[test]
fn with_big_integer_returns_big_integer() {
run!(
|arc_process| {
(
Just(arc_process.clone()),
strategy::term::integer::big::isize(),
)
.prop_map(|(arc_process, integer)| {
(
arc_process.clone(),
integer,
arc_process.charlist_from_str(&integer.to_string()),
)
})
},
|(arc_process, integer, list)| {
let result = result(&arc_process, list);
prop_assert!(result.is_ok());
let term = result.unwrap();
prop_assert!(term.is_boxed_bigint());
prop_assert_eq!(term, arc_process.integer(integer));
Ok(())
},
);
}
#[test]
fn with_non_decimal_errors_badarg() {
with_process_arc(|arc_process| {
let string = "FF";
let list = arc_process.charlist_from_str(&string);
assert_badarg!(
result(&arc_process, list),
format!("list ({}) is not base 10", list)
);
});
}
|
use chrono;
// https://github.com/diesel-rs/diesel/issues/1785
#[allow(proc_macro_derive_resolution_fallback)]
use super::schema::{
wcf1_user,
wcf1_user_group,
wcf1_user_to_group,
wcf1_user_activity_event,
organizations,
users,
user_file_entries,
user_file_entry_types
};
#[derive(Identifiable, Serialize, Deserialize, Queryable)]
#[table_name = "wcf1_user"]
#[primary_key(user_id)]
pub struct WcfUser {
pub user_id: i32,
pub username: String,
pub email: String,
pub password: String,
pub access_token: String,
pub language_id: i32,
pub registration_date: i32,
pub style_id: i32,
pub banned: bool,
pub ban_reason: Option<String>,
pub ban_expires: i32,
pub activation_code: i32,
pub last_lost_password_request_time: i32,
pub lost_password_key: String,
pub last_username_change: i32,
// pub newEmail: String,
// pub oldUsername: String,
// pub quitStarted: i32,
// pub reactivationCode: i32,
// pub registrationIpAddress: String,
// pub avatarID: Option<i32>,
// pub disableAvatar: bool,
// pub disableAvatarReason: Option<String>,
// pub disableAvatarExpires: i32,
// pub enableGravatar: bool,
// pub gravatarFileExtension: String,
// pub signature: Option<String>,
// pub signatureEnableBBCodes: bool,
// pub signatureEnableHtml: bool,
// pub signatureEnableSmilies: bool,
// pub disableSignature: bool,
// pub disableSignatureReason: Option<String>,
// pub disableSignatureExpires: i32,
pub last_activity_time: i32,
// pub profileHits: i32,
// pub rankID: Option<i32>,
pub user_title: String,
pub user_online_group_id: Option<i32>,
// pub activityPoints: i32,
// pub notificationMailToken: String,
// pub authData: String,
// pub likesReceived: i32,
// pub socialNetworkPrivacySettings: Option<String>,
// pub wbbPosts: i32
}
#[derive(Identifiable, Serialize, Deserialize, Queryable)]
#[table_name = "wcf1_user_group"]
#[primary_key(group_id)]
pub struct WcfUserGroup {
pub group_id: i32,
pub group_name: String
}
#[derive(Identifiable, Serialize, Deserialize, Queryable)]
#[table_name = "wcf1_user_to_group"]
#[primary_key(group_id, user_id)]
pub struct WcfUserToGroup {
pub group_id: i32,
pub user_id: i32
}
#[derive(Identifiable, Serialize, Deserialize, Queryable)]
#[table_name = "wcf1_user_activity_event"]
#[primary_key(event_id)]
pub struct WcfUserActivityEvent {
pub event_id: i32,
pub user_id: i32,
pub time: i32
}
#[derive(Serialize, Deserialize, Queryable)]
pub struct WcfUserOptionValue {
pub user_id: i32,
pub user_avatar_id: i32
}
#[derive(Serialize, Deserialize, Queryable)]
pub struct WcfUserAvatar {
pub avatar_id: i32,
pub user_id: i32,
pub avatar_name: String,
pub file_hash: String
}
impl WcfUserAvatar {
/// Builds the avatar's URL.
///
/// Format: "/{fileHash[0..2]}/{userID}-{fileHash}/{size: 32|96|128|256}.png"
pub fn get_avatar_url(&self) -> String {
return format!(
"{}/{}-{}-128.png",
&self.file_hash[0..2],
&self.user_id.to_string(),
&self.file_hash
);
}
}
#[derive(Serialize, Deserialize, Queryable)]
pub struct WcfAclOptionCategory {
id: i32,
category_name: String
}
#[derive(Serialize, Deserialize, Queryable)]
pub struct WcfAclOption {
id: i32,
option_name: String,
category_name: String
}
#[derive(Serialize, Deserialize, Queryable)]
pub struct WcfAclOptionToGroup {
option_id: i32,
group_id: i32,
option_value: bool
}
#[derive(Serialize, Deserialize, Queryable)]
pub struct WcfAclOptionToUser {
option_id: i32,
user_id: i32,
option_value: bool
}
#[derive(Serialize, Queryable)]
pub struct UserAclEntry {
group_id: i32,
option_id: i32
}
#[derive(Serialize, Deserialize, Queryable)]
pub struct WcfBranch {
pub branch_id: i32,
pub name: String,
pub image: String,
pub rank_unavailable_image: String,
pub is_disabled: bool
}
#[derive(Identifiable, Serialize, Deserialize, Queryable)]
#[table_name = "organizations"]
pub struct TitanOrganization {
pub id: i32,
pub name: String,
pub slug: String,
pub group_type: String,
pub wcf_user_group_id: i32,
pub is_enabled: bool
}
#[derive(Insertable)]
#[table_name = "users"]
pub struct NewTitanUser {
pub wcf_id: i32,
pub legacy_player_id: Option<i32>,
pub rank_id: Option<i32>,
pub username: String,
pub orientation: Option<i32>,
pub bct_e0: Option<i32>,
pub bct_e1: Option<i32>,
pub bct_e2: Option<i32>,
pub bct_e3: Option<i32>,
pub loa: Option<i32>,
pub a15: Option<i32>,
pub date_joined: Option<chrono::NaiveDateTime>,
pub date_created: chrono::NaiveDateTime,
pub date_modified: Option<chrono::NaiveDateTime>,
pub modified_by: Option<i32>,
pub last_activity: chrono::NaiveDateTime,
pub is_active: bool
}
#[derive(Identifiable, Serialize, Deserialize, Queryable)]
#[table_name = "users"]
pub struct TitanUser {
pub id: i32,
pub wcf_id: i32,
pub legacy_player_id: Option<i32>,
pub rank_id: Option<i32>,
pub username: String,
pub orientation: Option<i32>,
pub bct_e0: Option<i32>,
pub bct_e1: Option<i32>,
pub bct_e2: Option<i32>,
pub bct_e3: Option<i32>,
pub loa: Option<i32>,
pub a15: Option<i32>,
pub date_joined: Option<chrono::NaiveDateTime>,
pub date_created: chrono::NaiveDateTime,
pub date_modified: Option<chrono::NaiveDateTime>,
pub modified_by: Option<i32>,
pub last_activity: chrono::NaiveDateTime,
pub is_active: bool
}
#[derive(Serialize, Deserialize)]
pub struct TitanUserProfile {
pub id: i32,
pub wcf_id: i32,
pub legacy_player_id: Option<i32>,
pub rank_id: Option<i32>,
pub username: String,
pub orientation: Option<i32>,
pub bct_e0: Option<i32>,
pub bct_e1: Option<i32>,
pub bct_e2: Option<i32>,
pub bct_e3: Option<i32>,
pub loa: Option<i32>,
pub a15: Option<i32>,
pub date_joined: Option<chrono::NaiveDateTime>,
pub last_activity: chrono::NaiveDateTime,
pub wcf: WcfUserProfile
}
#[derive(Serialize, Deserialize)]
pub struct WcfUserProfile {
pub avatar_url: Option<String>,
pub last_activity_time: i32,
pub user_title: String,
pub username: String,
}
#[derive(Serialize, Deserialize)]
pub struct NewUserFileEntryType {
pub name: String
}
#[derive(Identifiable, Serialize, Deserialize, Queryable)]
#[table_name = "user_file_entry_types"]
#[primary_key(id)]
pub struct UserFileEntryType {
pub id: i32,
pub name: String
}
#[derive(Insertable)]
#[table_name = "user_file_entries"]
pub struct NewUserFileEntry {
pub user_file_entry_type_id: i32,
pub user_id: i32,
pub start_date: chrono::NaiveDateTime,
pub end_date: chrono::NaiveDateTime,
pub comments: String,
pub date_modified: Option<chrono::NaiveDateTime>,
pub modified_by: Option<i32>
}
#[derive(Identifiable, Serialize, Deserialize, Queryable)]
#[table_name = "user_file_entries"]
pub struct UserFileEntry {
pub id: i32,
pub user_file_entry_type_id: i32,
pub user_id: i32,
pub start_date: chrono::NaiveDateTime,
pub end_date: chrono::NaiveDateTime,
pub comments: String,
pub date_modified: Option<chrono::NaiveDateTime>,
pub modified_by: Option<i32>
}
#[derive(Serialize, Deserialize)]
pub struct UserFileEntryWithType {
pub id: i32,
pub file_entry_type: UserFileEntryType,
pub user_id: i32,
pub start_date: chrono::NaiveDateTime,
pub end_date: chrono::NaiveDateTime,
pub comments: String,
pub date_modified: Option<chrono::NaiveDateTime>,
pub modified_by: Option<i32>
} |
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from ../gir-files
// DO NOT EDIT
use crate::Auth;
use crate::Message;
use crate::SessionFeature;
use crate::URI;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;
glib::wrapper! {
#[doc(alias = "SoupAuthManager")]
pub struct AuthManager(Object<ffi::SoupAuthManager, ffi::SoupAuthManagerClass>) @implements SessionFeature;
match fn {
type_ => || ffi::soup_auth_manager_get_type(),
}
}
pub const NONE_AUTH_MANAGER: Option<&AuthManager> = None;
pub trait AuthManagerExt: 'static {
#[cfg(any(feature = "v2_58", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_58")))]
#[doc(alias = "soup_auth_manager_clear_cached_credentials")]
fn clear_cached_credentials(&self);
#[doc(alias = "soup_auth_manager_use_auth")]
fn use_auth<P: IsA<Auth>>(&self, uri: &mut URI, auth: &P);
#[doc(alias = "authenticate")]
fn connect_authenticate<F: Fn(&Self, &Message, &Auth, bool) + 'static>(&self, f: F) -> SignalHandlerId;
}
impl<O: IsA<AuthManager>> AuthManagerExt for O {
#[cfg(any(feature = "v2_58", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_58")))]
fn clear_cached_credentials(&self) {
unsafe {
ffi::soup_auth_manager_clear_cached_credentials(self.as_ref().to_glib_none().0);
}
}
fn use_auth<P: IsA<Auth>>(&self, uri: &mut URI, auth: &P) {
unsafe {
ffi::soup_auth_manager_use_auth(self.as_ref().to_glib_none().0, uri.to_glib_none_mut().0, auth.as_ref().to_glib_none().0);
}
}
fn connect_authenticate<F: Fn(&Self, &Message, &Auth, bool) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn authenticate_trampoline<P: IsA<AuthManager>, F: Fn(&P, &Message, &Auth, bool) + 'static>(this: *mut ffi::SoupAuthManager, msg: *mut ffi::SoupMessage, auth: *mut ffi::SoupAuth, retrying: glib::ffi::gboolean, f: glib::ffi::gpointer) {
let f: &F = &*(f as *const F);
f(AuthManager::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_borrow(msg), &from_glib_borrow(auth), from_glib(retrying))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"authenticate\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(authenticate_trampoline::<Self, F> as *const ())), Box_::into_raw(f))
}
}
}
impl fmt::Display for AuthManager {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("AuthManager")
}
}
|
#[doc = r" Register block"]
#[repr(C)]
pub struct RegisterBlock {
_reserved0: [u8; 264usize],
#[doc = "0x108 - TXD byte sent and RXD byte received."]
pub events_ready: EVENTS_READY,
_reserved1: [u8; 504usize],
#[doc = "0x304 - Interrupt enable set register."]
pub intenset: INTENSET,
#[doc = "0x308 - Interrupt enable clear register."]
pub intenclr: INTENCLR,
_reserved2: [u8; 500usize],
#[doc = "0x500 - Enable SPI."]
pub enable: ENABLE,
_reserved3: [u8; 4usize],
#[doc = "0x508 - Pin select for SCK."]
pub pselsck: PSELSCK,
#[doc = "0x50c - Pin select for MOSI."]
pub pselmosi: PSELMOSI,
#[doc = "0x510 - Pin select for MISO."]
pub pselmiso: PSELMISO,
_reserved4: [u8; 4usize],
#[doc = "0x518 - RX data."]
pub rxd: RXD,
#[doc = "0x51c - TX data."]
pub txd: TXD,
_reserved5: [u8; 4usize],
#[doc = "0x524 - SPI frequency"]
pub frequency: FREQUENCY,
_reserved6: [u8; 44usize],
#[doc = "0x554 - Configuration register."]
pub config: CONFIG,
}
#[doc = "TXD byte sent and RXD byte received."]
pub struct EVENTS_READY {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "TXD byte sent and RXD byte received."]
pub mod events_ready;
#[doc = "Interrupt enable set register."]
pub struct INTENSET {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "Interrupt enable set register."]
pub mod intenset;
#[doc = "Interrupt enable clear register."]
pub struct INTENCLR {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "Interrupt enable clear register."]
pub mod intenclr;
#[doc = "Enable SPI."]
pub struct ENABLE {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "Enable SPI."]
pub mod enable;
#[doc = "Pin select for SCK."]
pub struct PSELSCK {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "Pin select for SCK."]
pub mod pselsck;
#[doc = "Pin select for MOSI."]
pub struct PSELMOSI {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "Pin select for MOSI."]
pub mod pselmosi;
#[doc = "Pin select for MISO."]
pub struct PSELMISO {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "Pin select for MISO."]
pub mod pselmiso;
#[doc = "RX data."]
pub struct RXD {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "RX data."]
pub mod rxd;
#[doc = "TX data."]
pub struct TXD {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "TX data."]
pub mod txd;
#[doc = "SPI frequency"]
pub struct FREQUENCY {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "SPI frequency"]
pub mod frequency;
#[doc = "Configuration register."]
pub struct CONFIG {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "Configuration register."]
pub mod config;
|
extern crate encoding;
#[macro_use]
mod logging;
mod mem_map;
pub mod game_pad;
pub mod instruction;
pub mod interconnect;
pub mod rom;
pub mod sinks;
pub mod sram;
pub mod time_source;
pub mod timer;
pub mod v810;
pub mod vip;
pub mod virtual_boy;
pub mod vsu;
pub mod wram;
pub use rom::*;
pub use sram::*;
pub use vsu::*;
|
//! Timers
use crate::ccu::{Ccu, Clocks};
use crate::hal::timer::{Cancel, CountDown, Periodic};
use crate::pac::ccu::{BusClockGating0, BusSoftReset0};
use crate::pac::hstimer::{self, HSTIMER};
use crate::pac::timer::{
Control, IrqEnable, IrqStatus, RegisterBlock as TimerRegisterBlock, TIMER,
};
use core::convert::Infallible;
use core::ops::{Deref, DerefMut};
use cortex_a::asm;
use embedded_time::rate::Hertz;
use void::Void;
// TODO
// - macro impl for timer 0/1
// - prescale config
pub trait TimerExt {
type Parts;
fn split(self) -> Self::Parts;
}
pub struct Parts {
pub tim0: TIM0,
//pub tim1: TIM1,
}
pub struct TIM0 {
_tim: (),
}
pub struct TIM1 {
_tim: (),
}
impl TimerExt for TIMER {
type Parts = Parts;
fn split(self) -> Self::Parts {
Parts {
tim0: TIM0 { _tim: () },
}
}
}
/// Interrupt events
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum Event {
/// Timer timed out / count down ended
TimeOut,
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum ClockSource {
Osc24M,
Osc32K,
}
impl ClockSource {
fn frequency(self) -> Hertz {
match self {
ClockSource::Osc24M => Clocks::OSC_24M_FREQ,
ClockSource::Osc32K => Clocks::OSC_32K_FREQ,
}
}
}
/// Hardware timer
pub struct Timer<TIM> {
tim: TIM,
clock_src: ClockSource,
clock: Hertz,
timeout: Hertz,
}
impl Timer<TIM0> {
pub fn timer0(tim: TIM0, clock: ClockSource) -> Self {
// TIMER doesn't have reset or gating CCU registers
let mut timer = Timer {
tim,
clock_src: clock,
clock: clock.frequency(),
timeout: Hertz(0),
};
timer.disable();
timer.unlisten(Event::TimeOut);
timer
}
pub fn unlisten(&mut self, event: Event) {
match event {
Event::TimeOut => {
self.tim
.irq_enable
.modify(IrqEnable::Timer0IrqEnable::Clear);
}
}
}
fn enable(&mut self) {
self.tim.ctrl0.modify(Control::Enable::Set);
}
fn disable(&mut self) {
self.tim.ctrl0.modify(Control::Enable::Clear);
}
}
impl Periodic for Timer<TIM0> {}
impl CountDown for Timer<TIM0> {
type Time = Hertz;
fn start<T>(&mut self, timeout: T)
where
T: Into<Hertz>,
{
self.disable();
self.timeout = timeout.into();
let ticks = self.clock.0 / self.timeout.0;
let clock_src = match self.clock_src {
ClockSource::Osc24M => Control::ClockSrc::Clock24M,
ClockSource::Osc32K => Control::ClockSrc::Clock32K,
};
self.tim.intv0.write(ticks);
self.tim
.ctrl0
.modify(Control::Mode::Continuous + Control::Prescale::Div1 + clock_src);
self.tim.ctrl0.modify(Control::Reload::Set);
while self.tim.ctrl0.is_set(Control::Reload::Set) {
asm::nop();
}
self.enable();
}
fn wait(&mut self) -> nb::Result<(), Void> {
if !self
.tim
.irq_status
.is_set(IrqStatus::Timer0IrqPending::Read)
{
Err(nb::Error::WouldBlock)
} else {
self.tim.irq_status.modify(IrqStatus::Timer0IrqPending::Set);
Ok(())
}
}
}
impl Cancel for Timer<TIM0> {
type Error = Infallible;
fn cancel(&mut self) -> Result<(), Self::Error> {
self.disable();
Ok(())
}
}
impl Timer<HSTIMER> {
pub fn hstimer(tim: HSTIMER, clocks: Clocks, ccu: &mut Ccu) -> Self {
ccu.bsr0.rstr().modify(BusSoftReset0::HsTimer::Clear);
ccu.bsr0.rstr().modify(BusSoftReset0::HsTimer::Set);
ccu.bcg0.enr().modify(BusClockGating0::HsTimer::Set);
let mut timer = Timer {
tim,
clock_src: ClockSource::Osc24M, // Not used by HS timer
clock: clocks.ahb1(),
timeout: Hertz(0),
};
timer.disable();
timer.unlisten(Event::TimeOut);
timer
}
pub fn unlisten(&mut self, event: Event) {
match event {
Event::TimeOut => {
self.tim
.irq_enable
.modify(hstimer::IrqEnable::Enable::Clear);
}
}
}
fn enable(&mut self) {
self.tim.ctrl.modify(hstimer::Control::Enable::Set);
}
fn disable(&mut self) {
self.tim.ctrl.modify(hstimer::Control::Enable::Clear);
}
}
impl Periodic for Timer<HSTIMER> {}
impl CountDown for Timer<HSTIMER> {
type Time = Hertz;
fn start<T>(&mut self, timeout: T)
where
T: Into<Hertz>,
{
self.disable();
self.timeout = timeout.into();
let ticks_lo = self.clock.0 / self.timeout.0;
self.tim
.intv_hi
.modify(hstimer::IntervalHigh::Value::Field::new(0).unwrap());
self.tim.intv_lo.write(ticks_lo);
self.tim
.ctrl
.modify(hstimer::Control::Mode::Continuous + hstimer::Control::Prescale::Div1);
self.tim.ctrl.modify(hstimer::Control::Reload::Set);
self.enable();
}
fn wait(&mut self) -> nb::Result<(), Void> {
if !self
.tim
.irq_status
.is_set(hstimer::IrqStatus::IrqPending::Read)
{
Err(nb::Error::WouldBlock)
} else {
self.tim
.irq_status
.modify(hstimer::IrqStatus::IrqPending::Set);
Ok(())
}
}
}
impl Cancel for Timer<HSTIMER> {
type Error = Infallible;
fn cancel(&mut self) -> Result<(), Self::Error> {
self.disable();
Ok(())
}
}
impl Deref for TIM0 {
type Target = TimerRegisterBlock;
fn deref(&self) -> &Self::Target {
unsafe { &*TIMER::ptr() }
}
}
impl DerefMut for TIM0 {
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { &mut *TIMER::mut_ptr() }
}
}
|
// 这个example暂时跑不了,过会儿修
// // Example taken from https://serde.rs/json.html
// use serde::Serialize;
// use coruscant_nbt::to_string_transcript;
// #[derive(Serialize)]
// struct Wrap {
// inner: E,
// }
// #[derive(Serialize)]
// enum E {
// W { a: i32, b: i32 },
// X(i32, i32),
// Y(i32),
// Z,
// }
// /*
// Compound ''
// Compound 'inner'
// Int a 0
// Int b 0
// EndCompound
// EndCompound
// Compound ''
// Int inner 0
// EndCompound
// */
// fn main () -> coruscant_nbt::Result<()> {
// let w = E::W { a: 0, b: 0 };
// let x = E::X(0, 0);
// let y = E::Y(0);
// let z = E::Z;
// let (w, x, y, z) = (
// Wrap { inner: w }, Wrap { inner: x },
// Wrap { inner: y }, Wrap { inner: z }
// );
// println!("w => {}", to_string_transcript(&w)?);
// // println!("x => {}", to_string_transcript(&x)?);
// println!("y => {}", to_string_transcript(&y)?);
// println!("z => {}", to_string_transcript(&z)?);
// Ok(())
// }
fn main() {}
|
use darling::ast::Data;
use proc_macro::TokenStream;
use proc_macro2::Span;
use quote::quote;
use syn::{Error, LitInt};
use crate::{
args::{self, RenameTarget},
utils::{get_crate_name, get_rustdoc, visible_fn, GeneratorResult},
};
pub fn generate(object_args: &args::MergedObject) -> GeneratorResult<TokenStream> {
let crate_name = get_crate_name(object_args.internal);
let ident = &object_args.ident;
let (impl_generics, ty_generics, where_clause) = object_args.generics.split_for_impl();
let extends = object_args.extends;
let shareable = object_args.shareable;
let inaccessible = object_args.inaccessible;
let tags = object_args
.tags
.iter()
.map(|tag| quote!(::std::string::ToString::to_string(#tag)))
.collect::<Vec<_>>();
let gql_typename = if !object_args.name_type {
let name = object_args
.name
.clone()
.unwrap_or_else(|| RenameTarget::Type.rename(ident.to_string()));
quote!(::std::borrow::Cow::Borrowed(#name))
} else {
quote!(<Self as #crate_name::TypeName>::type_name())
};
let desc = get_rustdoc(&object_args.attrs)?
.map(|s| quote! { ::std::option::Option::Some(::std::string::ToString::to_string(#s)) })
.unwrap_or_else(|| quote! {::std::option::Option::None});
let s = match &object_args.data {
Data::Struct(e) => e,
_ => {
return Err(
Error::new_spanned(ident, "MergedObject can only be applied to an struct.").into(),
)
}
};
let mut types = Vec::new();
for field in &s.fields {
types.push(&field.ty);
}
let create_merged_obj = {
let mut obj = quote! { #crate_name::MergedObjectTail };
for i in 0..types.len() {
let n = LitInt::new(&format!("{}", i), Span::call_site());
obj = quote! { #crate_name::MergedObject(&self.#n, #obj) };
}
quote! {
#obj
}
};
let merged_type = {
let mut obj = quote! { #crate_name::MergedObjectTail };
for ty in &types {
obj = quote! { #crate_name::MergedObject::<#ty, #obj> };
}
obj
};
let visible = visible_fn(&object_args.visible);
let resolve_container = if object_args.serial {
quote! { #crate_name::resolver_utils::resolve_container_serial(ctx, self).await }
} else {
quote! { #crate_name::resolver_utils::resolve_container(ctx, self).await }
};
let expanded = quote! {
#[allow(clippy::all, clippy::pedantic)]
#[#crate_name::async_trait::async_trait]
impl #impl_generics #crate_name::resolver_utils::ContainerType for #ident #ty_generics #where_clause {
async fn resolve_field(&self, ctx: &#crate_name::Context<'_>) -> #crate_name::ServerResult<::std::option::Option<#crate_name::Value>> {
#create_merged_obj.resolve_field(ctx).await
}
async fn find_entity(&self, ctx: &#crate_name::Context<'_>, params: &#crate_name::Value) -> #crate_name::ServerResult<::std::option::Option<#crate_name::Value>> {
#create_merged_obj.find_entity(ctx, params).await
}
}
#[allow(clippy::all, clippy::pedantic)]
#[#crate_name::async_trait::async_trait]
impl #impl_generics #crate_name::OutputType for #ident #ty_generics #where_clause {
fn type_name() -> ::std::borrow::Cow<'static, ::std::primitive::str> {
#gql_typename
}
fn create_type_info(registry: &mut #crate_name::registry::Registry) -> ::std::string::String {
registry.create_output_type::<Self, _>(#crate_name::registry::MetaTypeId::Object, |registry| {
let mut fields = ::std::default::Default::default();
let mut cache_control = ::std::default::Default::default();
if let #crate_name::registry::MetaType::Object {
fields: obj_fields,
cache_control: obj_cache_control,
..
} = registry.create_fake_output_type::<#merged_type>() {
fields = obj_fields;
cache_control = obj_cache_control;
}
#crate_name::registry::MetaType::Object {
name: ::std::borrow::Cow::into_owned(#gql_typename),
description: #desc,
fields,
cache_control,
extends: #extends,
shareable: #shareable,
inaccessible: #inaccessible,
tags: ::std::vec![ #(#tags),* ],
keys: ::std::option::Option::None,
visible: #visible,
is_subscription: false,
rust_typename: ::std::option::Option::Some(::std::any::type_name::<Self>()),
}
})
}
async fn resolve(&self, ctx: &#crate_name::ContextSelectionSet<'_>, _field: &#crate_name::Positioned<#crate_name::parser::types::Field>) -> #crate_name::ServerResult<#crate_name::Value> {
#resolve_container
}
}
impl #impl_generics #crate_name::ObjectType for #ident #ty_generics #where_clause {}
};
Ok(expanded.into())
}
|
fn main() {
println!("Hellowo world!");
} |
mod parser;
use winnow::prelude::*;
use parser::expr;
#[allow(clippy::eq_op, clippy::erasing_op)]
fn arithmetic(c: &mut criterion::Criterion) {
let data = " 2*2 / ( 5 - 1) + 3 / 4 * (2 - 7 + 567 *12 /2) + 3*(1+2*( 45 /2));";
assert_eq!(
expr.parse_peek(data),
Ok((";", 2 * 2 / (5 - 1) + 3 * (1 + 2 * (45 / 2)),))
);
c.bench_function("arithmetic", |b| {
b.iter(|| expr.parse_peek(data).unwrap());
});
}
criterion::criterion_group!(benches, arithmetic);
criterion::criterion_main!(benches);
|
/*!
This crate provides an "expert" API for executing regular expressions using
finite automata.
**WARNING**: This `0.2` release of `regex-automata` was published
before it was ready to unblock work elsewhere that needed some
of the new APIs in this release. At the time of writing, it is
strongly preferred that you continue using the
[`regex-automata 0.1`](https://docs.rs/regex-automata/0.1/regex_automata/)
release. Since this release represents an unfinished state, please do not
create issues for this release unless it's for a critical bug.
*/
#![allow(warnings)]
// #![deny(missing_docs)]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(not(any(
target_pointer_width = "16",
target_pointer_width = "32",
target_pointer_width = "64"
)))]
compile_error!("regex-automata currently not supported on non-{16,32,64}");
#[cfg(feature = "alloc")]
extern crate alloc;
#[doc(inline)]
pub use crate::util::id::PatternID;
#[cfg(feature = "alloc")]
pub use crate::util::syntax::SyntaxConfig;
pub use crate::util::{
bytes::{DeserializeError, SerializeError},
matchtypes::{HalfMatch, Match, MatchError, MatchKind, MultiMatch},
};
#[macro_use]
mod macros;
pub mod dfa;
#[cfg(feature = "alloc")]
pub mod hybrid;
#[doc(hidden)]
#[cfg(feature = "alloc")]
pub mod nfa;
#[doc(hidden)]
pub mod util;
|
#![feature(proc_macro)]
#![feature(proc_macro_path_invoc)]
#[macro_use]
extern crate pyo3;
use pyo3::prelude::*;
#[py::modinit(_pyo3typeerror)]
fn init(py: Python, m: &PyModule) -> PyResult<()> {
#[pyfn(m, "loads")]
fn loads(py: Python, s: &str) -> PyResult<PyObject> {
Ok(s.to_object(py))
}
Ok(())
}
|
use crate::context::RpcContext;
use anyhow::Context;
use pathfinder_common::BlockId;
#[derive(serde::Deserialize, Debug, PartialEq, Eq)]
pub struct GetBlockTransactionCountInput {
block_id: BlockId,
}
type BlockTransactionCount = u64;
crate::error::generate_rpc_error_subset!(GetBlockTransactionCountError: BlockNotFound);
pub async fn get_block_transaction_count(
context: RpcContext,
input: GetBlockTransactionCountInput,
) -> Result<BlockTransactionCount, GetBlockTransactionCountError> {
let block_id = match input.block_id {
BlockId::Pending => {
if let Some(pending) = context.pending_data.as_ref() {
if let Some(block) = pending.block().await.as_ref() {
return Ok(block.transactions.len() as BlockTransactionCount);
}
}
return Ok(0);
}
other => other.try_into().expect("Only pending cast should fail"),
};
let storage = context.storage.clone();
let span = tracing::Span::current();
let jh = tokio::task::spawn_blocking(move || {
let _g = span.enter();
let mut db = storage
.connection()
.context("Opening database connection")?;
let tx = db.transaction().context("Creating database transaction")?;
let block_transaction_count = tx
.transaction_count(block_id)
.context("Reading transaction count from database")?;
// Check if the value was 0 because there were no transactions, or because the block hash is invalid.
if block_transaction_count == 0 {
let header = tx
.block_header(block_id)
.context("Querying block existence")?;
return if header.is_some() {
Ok(0)
} else {
Err(GetBlockTransactionCountError::BlockNotFound)
};
}
Ok(block_transaction_count as BlockTransactionCount)
});
jh.await.context("Database read panic or shutting down")?
}
#[cfg(test)]
mod tests {
use super::*;
use pathfinder_common::macro_prelude::*;
use pathfinder_common::{BlockHash, BlockNumber};
use stark_hash::Felt;
mod json {
use super::*;
fn check(chunk: &str, block_id: BlockId) {
let json = format!("{{ \"block_id\": {chunk} }}");
let input =
serde_json::from_str::<GetBlockTransactionCountInput>(&json).expect("JSON parsing");
assert_eq!(input.block_id, block_id, "JSON: '{json}'");
}
#[test]
fn test_latest() {
check("\"latest\"", BlockId::Latest);
}
#[test]
fn test_pending() {
check("\"pending\"", BlockId::Pending);
}
#[test]
fn test_block_number() {
check(
"{ \"block_number\": 42 }",
BlockId::Number(BlockNumber::new_or_panic(42)),
);
}
#[test]
fn test_block_hash() {
check(
"{ \"block_hash\": \"0xFACE\" }",
BlockId::Hash(block_hash!("0xface")),
);
}
}
async fn check_count(context: RpcContext, block_id: BlockId, count: u64) {
let input = GetBlockTransactionCountInput { block_id };
let result = get_block_transaction_count(context, input)
.await
.expect("block transaction count");
assert_eq!(result, count);
}
async fn check_error(context: RpcContext, block_id: BlockId) {
let input = GetBlockTransactionCountInput { block_id };
let result = get_block_transaction_count(context, input).await;
assert!(result.is_err());
}
async fn get_count(context: &RpcContext) -> BlockTransactionCount {
if let Some(pending) = context.pending_data.as_ref() {
if let Some(block) = pending.block().await.as_ref() {
return block.transactions.len() as BlockTransactionCount;
}
}
0
}
#[tokio::test]
async fn test_genesis() {
let context = RpcContext::for_tests();
let block_id = BlockId::Hash(block_hash_bytes!(b"genesis"));
check_count(context, block_id, 1).await;
}
#[tokio::test]
async fn test_latest() {
let context = RpcContext::for_tests();
let block_id = BlockId::Latest;
check_count(context, block_id, 5).await;
}
#[tokio::test]
async fn test_pending() {
let context = RpcContext::for_tests();
let count = get_count(&context).await;
let block_id = BlockId::Pending;
check_count(context, block_id, count).await;
}
#[tokio::test]
async fn test_invalid_hash() {
let context = RpcContext::for_tests();
let block_id = BlockId::Hash(BlockHash(Felt::ZERO));
check_error(context, block_id).await;
}
#[tokio::test]
async fn test_invalid_number() {
let context = RpcContext::for_tests();
let block_id = BlockId::Number(BlockNumber::new_or_panic(123));
check_error(context, block_id).await;
}
}
|
#[doc = r"Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r"Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::LCRH {
#[doc = r"Modifies the contents of the register"]
#[inline(always)]
pub fn modify<F>(&self, f: F)
where
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
{
let bits = self.register.get();
self.register.set(f(&R { bits }, &mut W { bits }).bits);
}
#[doc = r"Reads the contents of the register"]
#[inline(always)]
pub fn read(&self) -> R {
R {
bits: self.register.get(),
}
}
#[doc = r"Writes to the register"]
#[inline(always)]
pub fn write<F>(&self, f: F)
where
F: FnOnce(&mut W) -> &mut W,
{
self.register.set(
f(&mut W {
bits: Self::reset_value(),
})
.bits,
);
}
#[doc = r"Reset value of the register"]
#[inline(always)]
pub const fn reset_value() -> u32 {
0
}
#[doc = r"Writes the reset value to the register"]
#[inline(always)]
pub fn reset(&self) {
self.register.set(Self::reset_value())
}
}
#[doc = r"Value of the field"]
pub struct UART_LCRH_BRKR {
bits: bool,
}
impl UART_LCRH_BRKR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _UART_LCRH_BRKW<'a> {
w: &'a mut W,
}
impl<'a> _UART_LCRH_BRKW<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(1 << 0);
self.w.bits |= ((value as u32) & 1) << 0;
self.w
}
}
#[doc = r"Value of the field"]
pub struct UART_LCRH_PENR {
bits: bool,
}
impl UART_LCRH_PENR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _UART_LCRH_PENW<'a> {
w: &'a mut W,
}
impl<'a> _UART_LCRH_PENW<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(1 << 1);
self.w.bits |= ((value as u32) & 1) << 1;
self.w
}
}
#[doc = r"Value of the field"]
pub struct UART_LCRH_EPSR {
bits: bool,
}
impl UART_LCRH_EPSR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _UART_LCRH_EPSW<'a> {
w: &'a mut W,
}
impl<'a> _UART_LCRH_EPSW<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(1 << 2);
self.w.bits |= ((value as u32) & 1) << 2;
self.w
}
}
#[doc = r"Value of the field"]
pub struct UART_LCRH_STP2R {
bits: bool,
}
impl UART_LCRH_STP2R {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _UART_LCRH_STP2W<'a> {
w: &'a mut W,
}
impl<'a> _UART_LCRH_STP2W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(1 << 3);
self.w.bits |= ((value as u32) & 1) << 3;
self.w
}
}
#[doc = r"Value of the field"]
pub struct UART_LCRH_FENR {
bits: bool,
}
impl UART_LCRH_FENR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _UART_LCRH_FENW<'a> {
w: &'a mut W,
}
impl<'a> _UART_LCRH_FENW<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(1 << 4);
self.w.bits |= ((value as u32) & 1) << 4;
self.w
}
}
#[doc = "Possible values of the field `UART_LCRH_WLEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum UART_LCRH_WLENR {
#[doc = "5 bits (default)"]
UART_LCRH_WLEN_5,
#[doc = "6 bits"]
UART_LCRH_WLEN_6,
#[doc = "7 bits"]
UART_LCRH_WLEN_7,
#[doc = "8 bits"]
UART_LCRH_WLEN_8,
}
impl UART_LCRH_WLENR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
match *self {
UART_LCRH_WLENR::UART_LCRH_WLEN_5 => 0,
UART_LCRH_WLENR::UART_LCRH_WLEN_6 => 1,
UART_LCRH_WLENR::UART_LCRH_WLEN_7 => 2,
UART_LCRH_WLENR::UART_LCRH_WLEN_8 => 3,
}
}
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _from(value: u8) -> UART_LCRH_WLENR {
match value {
0 => UART_LCRH_WLENR::UART_LCRH_WLEN_5,
1 => UART_LCRH_WLENR::UART_LCRH_WLEN_6,
2 => UART_LCRH_WLENR::UART_LCRH_WLEN_7,
3 => UART_LCRH_WLENR::UART_LCRH_WLEN_8,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `UART_LCRH_WLEN_5`"]
#[inline(always)]
pub fn is_uart_lcrh_wlen_5(&self) -> bool {
*self == UART_LCRH_WLENR::UART_LCRH_WLEN_5
}
#[doc = "Checks if the value of the field is `UART_LCRH_WLEN_6`"]
#[inline(always)]
pub fn is_uart_lcrh_wlen_6(&self) -> bool {
*self == UART_LCRH_WLENR::UART_LCRH_WLEN_6
}
#[doc = "Checks if the value of the field is `UART_LCRH_WLEN_7`"]
#[inline(always)]
pub fn is_uart_lcrh_wlen_7(&self) -> bool {
*self == UART_LCRH_WLENR::UART_LCRH_WLEN_7
}
#[doc = "Checks if the value of the field is `UART_LCRH_WLEN_8`"]
#[inline(always)]
pub fn is_uart_lcrh_wlen_8(&self) -> bool {
*self == UART_LCRH_WLENR::UART_LCRH_WLEN_8
}
}
#[doc = "Values that can be written to the field `UART_LCRH_WLEN`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum UART_LCRH_WLENW {
#[doc = "5 bits (default)"]
UART_LCRH_WLEN_5,
#[doc = "6 bits"]
UART_LCRH_WLEN_6,
#[doc = "7 bits"]
UART_LCRH_WLEN_7,
#[doc = "8 bits"]
UART_LCRH_WLEN_8,
}
impl UART_LCRH_WLENW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline(always)]
pub fn _bits(&self) -> u8 {
match *self {
UART_LCRH_WLENW::UART_LCRH_WLEN_5 => 0,
UART_LCRH_WLENW::UART_LCRH_WLEN_6 => 1,
UART_LCRH_WLENW::UART_LCRH_WLEN_7 => 2,
UART_LCRH_WLENW::UART_LCRH_WLEN_8 => 3,
}
}
}
#[doc = r"Proxy"]
pub struct _UART_LCRH_WLENW<'a> {
w: &'a mut W,
}
impl<'a> _UART_LCRH_WLENW<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: UART_LCRH_WLENW) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "5 bits (default)"]
#[inline(always)]
pub fn uart_lcrh_wlen_5(self) -> &'a mut W {
self.variant(UART_LCRH_WLENW::UART_LCRH_WLEN_5)
}
#[doc = "6 bits"]
#[inline(always)]
pub fn uart_lcrh_wlen_6(self) -> &'a mut W {
self.variant(UART_LCRH_WLENW::UART_LCRH_WLEN_6)
}
#[doc = "7 bits"]
#[inline(always)]
pub fn uart_lcrh_wlen_7(self) -> &'a mut W {
self.variant(UART_LCRH_WLENW::UART_LCRH_WLEN_7)
}
#[doc = "8 bits"]
#[inline(always)]
pub fn uart_lcrh_wlen_8(self) -> &'a mut W {
self.variant(UART_LCRH_WLENW::UART_LCRH_WLEN_8)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(3 << 5);
self.w.bits |= ((value as u32) & 3) << 5;
self.w
}
}
#[doc = r"Value of the field"]
pub struct UART_LCRH_SPSR {
bits: bool,
}
impl UART_LCRH_SPSR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _UART_LCRH_SPSW<'a> {
w: &'a mut W,
}
impl<'a> _UART_LCRH_SPSW<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(1 << 7);
self.w.bits |= ((value as u32) & 1) << 7;
self.w
}
}
impl R {
#[doc = r"Value of the register as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bit 0 - UART Send Break"]
#[inline(always)]
pub fn uart_lcrh_brk(&self) -> UART_LCRH_BRKR {
let bits = ((self.bits >> 0) & 1) != 0;
UART_LCRH_BRKR { bits }
}
#[doc = "Bit 1 - UART Parity Enable"]
#[inline(always)]
pub fn uart_lcrh_pen(&self) -> UART_LCRH_PENR {
let bits = ((self.bits >> 1) & 1) != 0;
UART_LCRH_PENR { bits }
}
#[doc = "Bit 2 - UART Even Parity Select"]
#[inline(always)]
pub fn uart_lcrh_eps(&self) -> UART_LCRH_EPSR {
let bits = ((self.bits >> 2) & 1) != 0;
UART_LCRH_EPSR { bits }
}
#[doc = "Bit 3 - UART Two Stop Bits Select"]
#[inline(always)]
pub fn uart_lcrh_stp2(&self) -> UART_LCRH_STP2R {
let bits = ((self.bits >> 3) & 1) != 0;
UART_LCRH_STP2R { bits }
}
#[doc = "Bit 4 - UART Enable FIFOs"]
#[inline(always)]
pub fn uart_lcrh_fen(&self) -> UART_LCRH_FENR {
let bits = ((self.bits >> 4) & 1) != 0;
UART_LCRH_FENR { bits }
}
#[doc = "Bits 5:6 - UART Word Length"]
#[inline(always)]
pub fn uart_lcrh_wlen(&self) -> UART_LCRH_WLENR {
UART_LCRH_WLENR::_from(((self.bits >> 5) & 3) as u8)
}
#[doc = "Bit 7 - UART Stick Parity Select"]
#[inline(always)]
pub fn uart_lcrh_sps(&self) -> UART_LCRH_SPSR {
let bits = ((self.bits >> 7) & 1) != 0;
UART_LCRH_SPSR { bits }
}
}
impl W {
#[doc = r"Writes raw bits to the register"]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bit 0 - UART Send Break"]
#[inline(always)]
pub fn uart_lcrh_brk(&mut self) -> _UART_LCRH_BRKW {
_UART_LCRH_BRKW { w: self }
}
#[doc = "Bit 1 - UART Parity Enable"]
#[inline(always)]
pub fn uart_lcrh_pen(&mut self) -> _UART_LCRH_PENW {
_UART_LCRH_PENW { w: self }
}
#[doc = "Bit 2 - UART Even Parity Select"]
#[inline(always)]
pub fn uart_lcrh_eps(&mut self) -> _UART_LCRH_EPSW {
_UART_LCRH_EPSW { w: self }
}
#[doc = "Bit 3 - UART Two Stop Bits Select"]
#[inline(always)]
pub fn uart_lcrh_stp2(&mut self) -> _UART_LCRH_STP2W {
_UART_LCRH_STP2W { w: self }
}
#[doc = "Bit 4 - UART Enable FIFOs"]
#[inline(always)]
pub fn uart_lcrh_fen(&mut self) -> _UART_LCRH_FENW {
_UART_LCRH_FENW { w: self }
}
#[doc = "Bits 5:6 - UART Word Length"]
#[inline(always)]
pub fn uart_lcrh_wlen(&mut self) -> _UART_LCRH_WLENW {
_UART_LCRH_WLENW { w: self }
}
#[doc = "Bit 7 - UART Stick Parity Select"]
#[inline(always)]
pub fn uart_lcrh_sps(&mut self) -> _UART_LCRH_SPSW {
_UART_LCRH_SPSW { w: self }
}
}
|
extern crate iron;
extern crate multipart;
use iron::prelude::*;
use multipart::server::Entries;
use multipart::server::iron::Intercept;
fn main() {
// We start with a basic request handler chain.
let mut chain = Chain::new(|req: &mut Request|
if let Some(entries) = req.extensions.get::<Entries>() {
Ok(Response::with(format!("{:?}", entries)))
} else {
Ok(Response::with("Not a multipart request"))
}
);
// `Intercept` will read out the entries and place them as an extension in the request.
// It has various builder-style methods for changing how it will behave, but has sane settings
// by default.
chain.link_before(Intercept::default());
Iron::new(chain).http("localhost:80").unwrap();
} |
pub mod home;
pub mod sms_app;
pub mod sms_setting;
pub mod sms_try;
pub mod email_app;
pub mod email_setting;
pub mod email_try; |
use core::ops::{ControlFlow, Try};
use redoxfs::{BLOCK_SIZE, Disk};
use syscall::{EIO, Error, Result};
use std::proto::Protocol;
use uefi::guid::{Guid, BLOCK_IO_GUID};
use uefi::block_io::BlockIo as UefiBlockIo;
pub struct DiskEfi(pub &'static mut UefiBlockIo);
impl Protocol<UefiBlockIo> for DiskEfi {
fn guid() -> Guid {
BLOCK_IO_GUID
}
fn new(inner: &'static mut UefiBlockIo) -> Self {
Self(inner)
}
}
impl Disk for DiskEfi {
fn read_at(&mut self, block: u64, buffer: &mut [u8]) -> Result<usize> {
let block_size = self.0.Media.BlockSize as u64;
let lba = block * BLOCK_SIZE / block_size;
match (self.0.ReadBlocks)(self.0, self.0.Media.MediaId, lba, buffer.len(), buffer.as_mut_ptr()).branch() {
ControlFlow::Continue(_) => Ok(buffer.len()),
ControlFlow::Break(err) => {
println!("DiskEfi::read_at 0x{:X} failed: {:?}", block, err);
Err(Error::new(EIO))
}
}
}
fn write_at(&mut self, block: u64, _buffer: &[u8]) -> Result<usize> {
println!("DiskEfi::write_at 0x{:X} not implemented", block);
Err(Error::new(EIO))
}
fn size(&mut self) -> Result<u64> {
println!("DiskEfi::size not implemented");
Err(Error::new(EIO))
}
}
|
use std::io::BufRead;
use std::io::{self};
use std::str::FromStr;
use Direction::*;
use NavAction::*;
#[derive(Debug, PartialEq)]
struct Ship {
east_pos: i32,
north_pos: i32,
dir_faced: Direction,
waypoint: (i32, i32),
}
#[derive(Debug, PartialEq, Clone, Copy)]
enum Direction {
East,
South,
West,
North,
}
#[derive(Debug, PartialEq)]
struct NavInstruction {
action: NavAction,
value: i32,
}
#[derive(Debug, PartialEq)]
enum NavAction {
Move(Direction),
F,
L,
R,
}
impl FromStr for NavAction {
type Err = ();
fn from_str(s: &str) -> Result<NavAction, ()> {
match s {
"N" => Ok(Move(North)),
"S" => Ok(Move(South)),
"E" => Ok(Move(East)),
"W" => Ok(Move(West)),
"L" => Ok(L),
"R" => Ok(R),
"F" => Ok(F),
_ => Err(()),
}
}
}
fn main() {
let stdin = io::stdin();
let handle = stdin.lock();
let mut ship = Ship::new();
let instructions: Vec<_> =
NavInstruction::parse(handle.lines().filter_map(Result::ok)).collect();
for instr in instructions.iter() {
ship.apply1(&instr);
}
println!("Part 1 manhattan distance is {}", ship.manhattan_distance());
let mut ship = Ship::new();
for instr in instructions.iter() {
ship.apply2(&instr);
}
println!("Part 2 manhattan distance is {}", ship.manhattan_distance())
}
impl Ship {
fn new() -> Ship {
Ship {
east_pos: 0,
north_pos: 0,
dir_faced: East,
waypoint: (10, 1),
}
}
#[allow(dead_code)]
fn pos(self: &Ship) -> (i32, i32) {
(self.east_pos, self.north_pos)
}
fn apply1(self: &mut Ship, instr: &NavInstruction) {
match instr.action {
F => self.apply1(&NavInstruction {
action: Move(self.dir_faced),
value: instr.value,
}),
Move(East) => self.east_pos += instr.value,
Move(South) => self.north_pos -= instr.value,
Move(West) => self.east_pos -= instr.value,
Move(North) => self.north_pos += instr.value,
L => self.dir_faced = self.dir_faced.turn_left(instr.value),
R => self.dir_faced = self.dir_faced.turn_right(instr.value),
}
}
fn apply2(self: &mut Ship, instr: &NavInstruction) {
let NavInstruction { action, value } = instr;
match action {
F => {
let (e, n) = self.waypoint;
self.east_pos += value * e;
self.north_pos += value * n;
}
Move(East) => self.waypoint.0 += value,
Move(South) => self.waypoint.1 -= value,
Move(West) => self.waypoint.0 -= value,
Move(North) => self.waypoint.1 += value,
R => {
for _ in 0..(value / 90) % 4 {
let (e, n) = self.waypoint;
self.waypoint = (n, -e);
}
}
L => {
for _ in 0..(value / 90) % 4 {
let (e, n) = self.waypoint;
self.waypoint = (-n, e);
}
}
}
}
fn manhattan_distance(self: &Ship) -> i32 {
self.east_pos.abs() + self.north_pos.abs()
}
}
impl NavInstruction {
fn parse(it: impl Iterator<Item = String>) -> impl Iterator<Item = NavInstruction> {
it.map(|line| {
let action: NavAction = line[0..=0].parse().unwrap();
let value = line[1..].parse().unwrap();
NavInstruction { action, value }
})
}
}
impl From<i32> for Direction {
fn from(n: i32) -> Self {
let n = if n < 0 { n % 4 + 4 } else { n % 4 };
match n {
0 => East,
1 => South,
2 => West,
3 => North,
_ => unreachable!("Invalid integer for direction"),
}
}
}
impl From<Direction> for i32 {
fn from(d: Direction) -> Self {
match d {
East => 0,
South => 1,
West => 2,
North => 3,
}
}
}
impl Direction {
fn turn_right(self: &Direction, degrees: i32) -> Direction {
let delta = degrees / 90;
Direction::from(i32::from(*self) + delta % 4)
}
fn turn_left(self: &Direction, degrees: i32) -> Direction {
let delta = degrees / 90;
Direction::from(i32::from(*self) - delta % 4)
}
}
#[cfg(test)]
mod tests {
use super::*;
static EXAMPLE: &str = "\
F10
N3
F7
R90
F11
";
#[test]
fn test_parse_instructions() {
assert_eq!(
NavInstruction::parse(EXAMPLE.lines().map(|str| str.to_string())).collect::<Vec<_>>(),
vec![
NavInstruction {
action: F,
value: 10
},
NavInstruction {
action: Move(North),
value: 3
},
NavInstruction {
action: F,
value: 7
},
NavInstruction {
action: R,
value: 90
},
NavInstruction {
action: F,
value: 11
},
]
)
}
#[test]
fn test_execute_one_instruction() {
let mut ship = Ship::new();
ship.apply1(&NavInstruction {
action: F,
value: 10,
});
assert_eq!(ship.east_pos, 10);
assert_eq!(ship.north_pos, 0);
assert_eq!(ship.dir_faced, East);
}
#[test]
fn execute_simple_instructions() {
let mut ship = Ship::new();
for instr in vec![
NavInstruction {
action: F,
value: 10,
},
NavInstruction {
action: Move(North),
value: 3,
},
NavInstruction {
action: F,
value: 7,
},
] {
ship.apply1(&instr);
}
assert_eq!(ship.east_pos, 17);
assert_eq!(ship.north_pos, 3);
assert_eq!(ship.dir_faced, East);
}
#[test]
fn turn_ship_right() {
let mut ship = Ship::new();
ship.apply1(&NavInstruction {
action: R,
value: 90,
});
assert_eq!(ship.dir_faced, South);
}
#[test]
fn execute_example_instructions() {
let mut ship = Ship::new();
for instr in NavInstruction::parse(EXAMPLE.lines().map(|l| l.to_string())) {
ship.apply1(&instr);
}
assert_eq!(ship.east_pos, 17);
assert_eq!(ship.north_pos, -8);
assert_eq!(ship.dir_faced, South);
assert_eq!(ship.manhattan_distance(), 25);
}
#[test]
fn apply_part2_instructions() {
let mut ship = Ship::new();
let instructions =
NavInstruction::parse(EXAMPLE.lines().map(|l| l.to_string())).collect::<Vec<_>>();
ship.apply2(&instructions[0]);
assert_eq!(ship.pos(), (100, 10));
ship.apply2(&instructions[1]);
assert_eq!(ship.pos(), (100, 10));
assert_eq!(ship.waypoint, (10, 4));
ship.apply2(&instructions[2]);
assert_eq!(ship.pos(), (170, 38));
assert_eq!(ship.waypoint, (10, 4));
ship.apply2(&instructions[3]);
assert_eq!(ship.pos(), (170, 38));
assert_eq!(ship.waypoint, (4, -10));
ship.apply2(&instructions[4]);
assert_eq!(ship.pos(), (214, -72));
assert_eq!(ship.waypoint, (4, -10));
assert_eq!(ship.manhattan_distance(), 286)
}
}
|
{{#if use_old~}}
store.get_old_{{name}}({{>choice.arg_ids}}diff)
{{~else~}}
store.get_{{name}}({{>choice.arg_ids}})
{{~/if~}}
|
use std::fmt;
#[derive(Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum ChessPiece {
NoPiece = 0x00,
WhitePawn = 0x01,
WhiteKnight = 0x02,
WhiteBishop = 0x03,
WhiteRook = 0x04,
WhiteQueen = 0x05,
WhiteKing = 0x06,
BlackPawn = 0x09,
BlackKnight = 0x0A,
BlackBishop = 0x0B,
BlackRook = 0x0C,
BlackQueen = 0x0D,
BlackKing = 0x0E,
}
impl From<u8> for ChessPiece {
fn from(byte: u8) -> Self {
match byte {
0x00 => Self::NoPiece,
0x01 => Self::WhitePawn,
0x02 => Self::WhiteKnight,
0x03 => Self::WhiteBishop,
0x04 => Self::WhiteRook,
0x05 => Self::WhiteQueen,
0x06 => Self::WhiteKing,
0x09 => Self::BlackPawn,
0x0A => Self::BlackKnight,
0x0B => Self::BlackBishop,
0x0C => Self::BlackRook,
0x0D => Self::BlackQueen,
0x0E => Self::BlackKing,
_ => panic!("Invalid chess representation: 0x{:02X}", byte),
}
}
}
impl From<ChessPiece> for u8 {
fn from(piece: ChessPiece) -> Self {
match piece {
ChessPiece::NoPiece => 0x00,
ChessPiece::WhitePawn => 0x01,
ChessPiece::WhiteKnight => 0x02,
ChessPiece::WhiteBishop => 0x03,
ChessPiece::WhiteRook => 0x04,
ChessPiece::WhiteQueen => 0x05,
ChessPiece::WhiteKing => 0x06,
ChessPiece::BlackPawn => 0x09,
ChessPiece::BlackKnight => 0x0A,
ChessPiece::BlackBishop => 0x0B,
ChessPiece::BlackRook => 0x0C,
ChessPiece::BlackQueen => 0x0D,
ChessPiece::BlackKing => 0x0E,
}
}
}
// Unicode values are the opposite of what they should be.
// (White --> Black, Black --> White)
// Maybe this is a windows specific issue?
impl From<ChessPiece> for char {
fn from(piece: ChessPiece) -> Self {
match piece {
ChessPiece::NoPiece => '\u{0020}',
ChessPiece::WhitePawn => '\u{265F}',
ChessPiece::WhiteKnight => '\u{265E}',
ChessPiece::WhiteBishop => '\u{265D}',
ChessPiece::WhiteRook => '\u{265C}',
ChessPiece::WhiteQueen => '\u{265B}',
ChessPiece::WhiteKing => '\u{265A}',
ChessPiece::BlackPawn => '\u{2659}',
ChessPiece::BlackKnight => '\u{2658}',
ChessPiece::BlackBishop => '\u{2657}',
ChessPiece::BlackRook => '\u{2656}',
ChessPiece::BlackQueen => '\u{2655}',
ChessPiece::BlackKing => '\u{2654}',
}
}
}
/// Represents a chess board as nibbles
#[derive(PartialEq, Eq)]
pub struct Bitboard {
internal: [u8; 32],
}
impl Bitboard {
pub fn new() -> Self {
Self {
#[rustfmt::skip]
internal: [
0x42, 0x35, 0x63, 0x24,
0x11, 0x11, 0x11, 0x11,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x99, 0x99, 0x99, 0x99,
0xCA, 0xBD, 0xEB, 0xAC,
],
}
}
pub fn from_bytes(internal: [u8; 32]) -> Self {
Self {
#[rustfmt::skip]
internal,
}
}
pub fn blank() -> Self {
Self {
#[rustfmt::skip]
internal: [
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
],
}
}
pub fn set_position(&mut self, position: (usize, usize), piece: ChessPiece) {
let position = position.1 * 8 + position.0;
let is_low_nibble = (position % 2 == 0) as usize * 4;
let new_byte = Into::<u8>::into(piece) << is_low_nibble;
let old_byte = self.internal[position / 2] & (0xF0 >> is_low_nibble);
self.internal[position / 2] = new_byte | old_byte;
}
pub fn get_position(&self, position: (usize, usize)) -> ChessPiece {
let position = position.1 * 8 + position.0;
let is_low_nibble = (position % 2 == 0) as usize * 4;
Into::into(self.internal[position / 2] >> is_low_nibble & 0x0F)
}
pub fn move_piece(&mut self, begin: (usize, usize), end: (usize, usize)) -> Option<ChessPiece> {
let old_piece = self.get_position(begin);
let occupied = self.get_position(end);
self.set_position(end, old_piece);
self.set_position(begin, ChessPiece::NoPiece);
match occupied {
ChessPiece::NoPiece => None,
piece => Some(piece),
}
}
}
// Add color to me?
impl fmt::Display for Bitboard {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
for file in (0..8).rev() {
write!(f, "{} ", file + 1)?;
for rank in 0..8 {
write!(
f,
"{} ",
Into::<char>::into(self.get_position((rank, file)))
)?;
}
write!(f, "\n")?;
}
write!(f, " A B C D E F G H\n")?;
fmt::Result::Ok(())
}
}
impl fmt::Debug for Bitboard {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
for file in (0..8).rev() {
for rank in 0..8 {
let position = file * 8 + rank;
if position % 2 == 0 {
write!(f, "{:02X?}", self.internal[position / 2])?;
}
}
write!(f, "\n")?;
}
fmt::Result::Ok(())
}
}
#[cfg(test)]
mod test {
use super::{Bitboard, ChessPiece};
#[test]
fn initializers() {
let mut actual = Bitboard::blank();
{
// Block for collapsing this section
actual.set_position((0, 0), ChessPiece::WhiteRook);
actual.set_position((1, 0), ChessPiece::WhiteKnight);
actual.set_position((2, 0), ChessPiece::WhiteBishop);
actual.set_position((3, 0), ChessPiece::WhiteQueen);
actual.set_position((4, 0), ChessPiece::WhiteKing);
actual.set_position((5, 0), ChessPiece::WhiteBishop);
actual.set_position((6, 0), ChessPiece::WhiteKnight);
actual.set_position((7, 0), ChessPiece::WhiteRook);
actual.set_position((0, 1), ChessPiece::WhitePawn);
actual.set_position((1, 1), ChessPiece::WhitePawn);
actual.set_position((2, 1), ChessPiece::WhitePawn);
actual.set_position((3, 1), ChessPiece::WhitePawn);
actual.set_position((4, 1), ChessPiece::WhitePawn);
actual.set_position((5, 1), ChessPiece::WhitePawn);
actual.set_position((6, 1), ChessPiece::WhitePawn);
actual.set_position((7, 1), ChessPiece::WhitePawn);
actual.set_position((0, 6), ChessPiece::BlackPawn);
actual.set_position((1, 6), ChessPiece::BlackPawn);
actual.set_position((2, 6), ChessPiece::BlackPawn);
actual.set_position((3, 6), ChessPiece::BlackPawn);
actual.set_position((4, 6), ChessPiece::BlackPawn);
actual.set_position((5, 6), ChessPiece::BlackPawn);
actual.set_position((6, 6), ChessPiece::BlackPawn);
actual.set_position((7, 6), ChessPiece::BlackPawn);
actual.set_position((0, 7), ChessPiece::BlackRook);
actual.set_position((1, 7), ChessPiece::BlackKnight);
actual.set_position((2, 7), ChessPiece::BlackBishop);
actual.set_position((3, 7), ChessPiece::BlackQueen);
actual.set_position((4, 7), ChessPiece::BlackKing);
actual.set_position((5, 7), ChessPiece::BlackBishop);
actual.set_position((6, 7), ChessPiece::BlackKnight);
actual.set_position((7, 7), ChessPiece::BlackRook);
}
let expected = Bitboard::new();
assert_eq!(actual, expected, "Default board initializer");
#[rustfmt::skip]
let actual = Bitboard::from_bytes([
0x42, 0x35, 0x63, 0x24,
0x11, 0x11, 0x11, 0x11,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x99, 0x99, 0x99, 0x99,
0xCA, 0xBD, 0xEB, 0xAC,
]);
let expected = Bitboard::new();
assert_eq!(actual, expected, "From bytes initializer");
}
#[test]
fn get_position() {
let actual = Bitboard::new().get_position((0, 0));
let expected = ChessPiece::WhiteRook;
assert_eq!(actual, expected, "Get high nibble");
let actual = Bitboard::new().get_position((1, 0));
let expected = ChessPiece::WhiteKnight;
assert_eq!(actual, expected, "Get low nibble");
}
#[test]
fn set_position() {
#[rustfmt::skip]
let expected = Bitboard::from_bytes([
0x10, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
]);
let mut actual = Bitboard::blank();
actual.set_position((0, 0), ChessPiece::WhitePawn);
assert_eq!(actual, expected, "Set high nibble");
#[rustfmt::skip]
let expected = Bitboard::from_bytes([
0x09, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
]);
let mut actual = Bitboard::blank();
actual.set_position((1, 0), ChessPiece::BlackPawn);
assert_eq!(actual, expected, "Set low nibble");
let mut actual = Bitboard::blank();
actual.set_position((0, 0), ChessPiece::WhitePawn);
actual.set_position((1, 0), ChessPiece::BlackPawn);
#[rustfmt::skip]
let expected = Bitboard::from_bytes([
0x19, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
]);
assert_eq!(actual, expected, "Set low nibble then high nibble");
let mut actual = Bitboard::blank();
actual.set_position((1, 0), ChessPiece::WhitePawn);
actual.set_position((0, 0), ChessPiece::BlackPawn);
#[rustfmt::skip]
let expected = Bitboard::from_bytes([
0x91, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
]);
assert_eq!(actual, expected, "Set high nibble then low nibble");
}
#[test]
fn move_piece() {
#[rustfmt::skip]
let mut actual = Bitboard::from_bytes([
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x90, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
]);
actual.move_piece((4, 4), (4, 3));
let actual = actual.move_piece((3, 1), (4, 3)).unwrap();
let expected = ChessPiece::BlackPawn;
assert_eq!(actual, expected, "Returns captured piece");
#[rustfmt::skip]
let mut actual = Bitboard::from_bytes([
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x90, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
]);
actual.move_piece((4, 4), (4, 3));
actual.move_piece((3, 2), (4, 3));
#[rustfmt::skip]
let expected = Bitboard::from_bytes([
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
]);
assert_eq!(actual, expected, "Unsets previous position");
}
#[test]
fn debug() {
let actual = format!("{:?}", Bitboard::new());
#[rustfmt::skip]
let expected = { r#"CABDEBAC
99999999
00000000
00000000
00000000
00000000
11111111
42356324
"# };
assert_eq!(actual, expected, "Renders properly");
}
#[test]
fn display() {
let actual = format!("{}", Bitboard::new());
#[rustfmt::skip]
let expected = { r#"8 ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
7 ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
6
5
4
3
2 ♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
1 ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
A B C D E F G H
"# };
assert_eq!(actual, expected, "Renders properly");
}
}
|
use std::convert::From;
// TODO: consider adding keyword associations like: prefer, exclude
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)]
pub struct Keyword {
pub id: String,
}
impl From<&'static str> for Keyword {
fn from(original: &'static str) -> Keyword {
Keyword {
id: original.to_owned(),
}
}
}
impl From<String> for Keyword {
fn from(original: String) -> Keyword {
Keyword { id: original }
}
}
impl AsRef<Keyword> for Keyword {
fn as_ref(&self) -> &Keyword {
&self
}
}
|
use na::{DMatrix, Real};
use nt::{DiscreteSystemMatrix, ContinuousSystemMatrix, DiscreteInputMatrix, ContinuousInputMatrix};
pub struct DiscreteSystemEqMatrices<N : Real> {
pub mat_f : DiscreteSystemMatrix<N>,
pub mat_h : DiscreteInputMatrix<N>,
}
/// ```math
/// F = F(dt) = exp(A*dt) = SUM_i=0...infinite ( (A*dt)^i / i! )
/// = I + A*dt
/// + ( (A*dt)^2 / 2 )
/// + ( (A*dt)^3 / 6 )
/// + ...
/// H = H(dt) = INTEGRAL_v=0...T ( F(v) ) * B
/// ```
pub fn continuous_to_discrete<N : Real>(mat_a : &ContinuousSystemMatrix<N>,
mat_b: &ContinuousInputMatrix<N>, dt : N, eps: N)
-> DiscreteSystemEqMatrices<N> {
assert_eq!(mat_a.0.nrows(), mat_a.0.ncols());
let mat_f = mat_a_to_mat_f(&mat_a, dt, eps);
let mat_h;
let mut inverse_mat_a = mat_a.0.clone_owned();
if inverse_mat_a.try_inverse_mut() {
// A is regular
// H(dt) = A^-1 [ F(dt) - I ] B
let mat_i = DMatrix::from_diagonal_element(mat_a.0.nrows(), mat_a.0.nrows(), N::one());
mat_h = DiscreteInputMatrix( inverse_mat_a * ( &mat_f.0 - &mat_i ) * &mat_b.0 );
} else {
// A is singular
// H(dt) = SUM_v=1...infinite ( A^(v-1) * dt^v / v! )
mat_h = calc_mat_h(mat_a, mat_b, dt, eps);
}
DiscreteSystemEqMatrices {
mat_f : mat_f,
mat_h : mat_h,
}
}
/// Expects a to be square
fn mat_a_to_mat_f<N : Real>(mat_a : &ContinuousSystemMatrix<N>, dt : N, eps: N) -> DiscreteSystemMatrix<N> {
let adt = &mat_a.0 * dt;
// tmp will be (A*dt), then (A*dt)^2, then (A*dt)^3 and so on
let mut tmp = adt.clone();
// i = 0
let mut factorial : N = N::one();
let mut mat_f = DMatrix::from_diagonal_element(mat_a.0.nrows(), mat_a.0.nrows(), N::one());
// i = 1
let mut factorial_cnt : N = N::one();
mat_f += &tmp;
for i in 2..20 {
tmp *= &adt;
factorial_cnt += N::one();
factorial *= factorial_cnt;
let tmp2 = &tmp / factorial;
mat_f += &tmp2;
let max = tmp2.iter().fold(N::zero(), |store, item| { store.max(*item) });
if max <= eps {
break;
}
}
DiscreteSystemMatrix(mat_f)
}
/// H(dt) = SUM_v=1...infinite ( A^(v-1) * dt^v / v! )
/// = I * dt / 1!
/// + (A*dt) * dt / 2!
/// + (A*dt)^2 * dt / 3!
/// + ...
fn calc_mat_h<N : Real>(mat_a : &ContinuousSystemMatrix<N>,
mat_b : &ContinuousInputMatrix<N>, dt : N, eps: N) -> DiscreteInputMatrix<N> {
let adt = &mat_a.0 * dt;
// tmp will be (I*dt), then dt*(A*dt)^2, then dt*(A*dt)^3 and so on
let mut tmp = DMatrix::from_diagonal_element(mat_a.0.nrows(), mat_a.0.nrows(), N::one());
tmp *= dt;
// v = 1
let mut factorial : N = N::one();
let mut factorial_cnt : N = N::one();
let mut mat_h = tmp.clone(); // I * dt
for v in 2..20 {
tmp *= &adt;
factorial_cnt += N::one();
factorial *= factorial_cnt;
let tmp2 = &tmp / factorial;
mat_h += &tmp2;
let max = tmp2.iter().fold(N::zero(), |store, item| { store.max(*item) });
if max <= eps {
break;
}
}
mat_h *= &mat_b.0;
DiscreteInputMatrix(mat_h)
} |
use futures::channel::mpsc as channel;
use futures::stream::{FusedStream, Stream};
use std::collections::HashMap;
use std::fmt;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
use libp2p::core::{
connection::{ConnectedPoint, ConnectionId, ListenerId},
Multiaddr, PeerId,
};
use libp2p::floodsub::{Floodsub, FloodsubConfig, FloodsubEvent, FloodsubMessage, Topic};
use libp2p::swarm::{
ConnectionHandler, DialError, NetworkBehaviour, NetworkBehaviourAction, PollParameters,
};
/// Currently a thin wrapper around Floodsub, perhaps supporting both Gossipsub and Floodsub later.
/// Allows single subscription to a topic with only unbounded senders. Tracks the peers subscribed
/// to different topics. The messages in the streams are wrapped in `Arc` as they technically could
/// be sent to multiple topics, but this api is not provided.
pub struct Pubsub {
// Tracks the topic subscriptions.
streams: HashMap<Topic, channel::UnboundedSender<Arc<PubsubMessage>>>,
// A collection of peers and the topics they are subscribed to.
peers: HashMap<PeerId, Vec<Topic>>,
floodsub: Floodsub,
// the subscription streams implement Drop and will send out their topic name through the
// sender cloned from here if they are dropped before the stream has ended.
unsubscriptions: (
channel::UnboundedSender<String>,
channel::UnboundedReceiver<String>,
),
}
/// Adaptation hopefully supporting both Floodsub and Gossipsub Messages in the future
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct PubsubMessage {
/// Peer address of the message sender.
pub source: PeerId,
/// The message data.
pub data: Vec<u8>,
/// The sequence number of the message.
// this could be an enum for gossipsub message compat, it uses u64, though the floodsub
// sequence numbers looked like 8 bytes in testing..
pub sequence_number: Vec<u8>,
/// The recepients of the message (topic IDs).
// TODO: gossipsub uses topichashes, haven't checked if we could have some unifying abstraction
// or if we should have a hash to name mapping internally?
pub topics: Vec<String>,
}
impl From<FloodsubMessage> for PubsubMessage {
fn from(
FloodsubMessage {
source,
data,
sequence_number,
topics,
}: FloodsubMessage,
) -> Self {
PubsubMessage {
source,
data,
sequence_number,
topics: topics.into_iter().map(String::from).collect(),
}
}
}
/// Stream of a pubsub messages. Implements [`FusedStream`].
pub struct SubscriptionStream {
on_drop: Option<channel::UnboundedSender<String>>,
topic: Option<String>,
inner: channel::UnboundedReceiver<Arc<PubsubMessage>>,
}
impl Drop for SubscriptionStream {
fn drop(&mut self) {
// the on_drop option allows us to disable this unsubscribe on drop once the stream has
// ended.
if let Some(sender) = self.on_drop.take() {
if let Some(topic) = self.topic.take() {
let _ = sender.unbounded_send(topic);
}
}
}
}
impl fmt::Debug for SubscriptionStream {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
if let Some(topic) = self.topic.as_ref() {
write!(
fmt,
"SubscriptionStream {{ topic: {:?}, is_terminated: {} }}",
topic,
self.is_terminated()
)
} else {
write!(
fmt,
"SubscriptionStream {{ is_terminated: {} }}",
self.is_terminated()
)
}
}
}
impl Stream for SubscriptionStream {
type Item = Arc<PubsubMessage>;
fn poll_next(mut self: Pin<&mut Self>, ctx: &mut Context) -> Poll<Option<Self::Item>> {
use futures::stream::StreamExt;
let inner = &mut self.as_mut().inner;
match inner.poll_next_unpin(ctx) {
Poll::Ready(None) => {
// no need to unsubscribe on drop as the stream has already ended, likely via
// unsubscribe call.
self.on_drop.take();
Poll::Ready(None)
}
other => other,
}
}
}
impl FusedStream for SubscriptionStream {
fn is_terminated(&self) -> bool {
self.on_drop.is_none()
}
}
impl Pubsub {
/// Delegates the `peer_id` over to [`Floodsub::new`] and internally only does accounting on
/// top of the floodsub.
pub fn new(peer_id: PeerId) -> Self {
let (tx, rx) = channel::unbounded();
let mut config = FloodsubConfig::new(peer_id);
config.subscribe_local_messages = true;
Pubsub {
streams: HashMap::new(),
peers: HashMap::new(),
floodsub: Floodsub::from_config(config),
unsubscriptions: (tx, rx),
}
}
/// Subscribes to a currently unsubscribed topic.
/// Returns a receiver for messages sent to the topic or `None` if subscription existed
/// already.
pub fn subscribe(&mut self, topic: impl Into<String>) -> Option<SubscriptionStream> {
use std::collections::hash_map::Entry;
let topic = Topic::new(topic);
match self.streams.entry(topic) {
Entry::Vacant(ve) => {
// TODO: this could also be bounded; we could send the message and drop the
// subscription if it ever became full.
let (tx, rx) = channel::unbounded();
// there are probably some invariants which need to hold for the topic...
assert!(
self.floodsub.subscribe(ve.key().clone()),
"subscribing to a unsubscribed topic should have succeeded"
);
let name = ve.key().id().to_string();
ve.insert(tx);
Some(SubscriptionStream {
on_drop: Some(self.unsubscriptions.0.clone()),
topic: Some(name),
inner: rx,
})
}
Entry::Occupied(_) => None,
}
}
/// Unsubscribes from a topic. Unsubscription is usually done through dropping the
/// SubscriptionStream.
///
/// Returns true if an existing subscription was dropped, false otherwise
pub fn unsubscribe(&mut self, topic: impl Into<String>) -> bool {
let topic = Topic::new(topic);
if self.streams.remove(&topic).is_some() {
assert!(
self.floodsub.unsubscribe(topic),
"sender removed but unsubscription failed"
);
true
} else {
false
}
}
/// See [`Floodsub::publish_any`]
pub fn publish(&mut self, topic: impl Into<String>, data: impl Into<Vec<u8>>) {
self.floodsub.publish_any(Topic::new(topic), data);
}
/// Returns the known peers subscribed to any topic
pub fn known_peers(&self) -> Vec<PeerId> {
self.peers.keys().cloned().collect()
}
/// Returns the peers known to subscribe to the given topic
pub fn subscribed_peers(&self, topic: &Topic) -> Vec<PeerId> {
self.peers
.iter()
.filter_map(|(k, v)| if v.contains(topic) { Some(*k) } else { None })
.collect()
}
/// Returns the list of currently subscribed topics. This can contain topics for which stream
/// has been dropped but no messages have yet been received on the topics after the drop.
pub fn subscribed_topics(&self) -> Vec<String> {
self.streams
.keys()
.map(Topic::id)
.map(String::from)
.collect()
}
/// See [`Floodsub::add_node_from_partial_view`]
pub fn add_node_to_partial_view(&mut self, peer_id: PeerId) {
self.floodsub.add_node_to_partial_view(peer_id);
}
/// See [`Floodsub::remove_node_from_partial_view`]
pub fn remove_node_from_partial_view(&mut self, peer_id: &PeerId) {
self.floodsub.remove_node_from_partial_view(peer_id);
}
}
type PubsubNetworkBehaviourAction = NetworkBehaviourAction<
<Floodsub as NetworkBehaviour>::OutEvent,
<Pubsub as NetworkBehaviour>::ConnectionHandler,
<<Pubsub as NetworkBehaviour>::ConnectionHandler as ConnectionHandler>::InEvent,
>;
impl NetworkBehaviour for Pubsub {
type ConnectionHandler = <Floodsub as NetworkBehaviour>::ConnectionHandler;
type OutEvent = FloodsubEvent;
fn new_handler(&mut self) -> Self::ConnectionHandler {
self.floodsub.new_handler()
}
fn addresses_of_peer(&mut self, peer_id: &PeerId) -> Vec<Multiaddr> {
self.floodsub.addresses_of_peer(peer_id)
}
fn inject_connection_established(
&mut self,
peer_id: &PeerId,
connection_id: &ConnectionId,
endpoint: &ConnectedPoint,
failed_addresses: Option<&Vec<Multiaddr>>,
other_established: usize,
) {
self.floodsub.inject_connection_established(
peer_id,
connection_id,
endpoint,
failed_addresses,
other_established,
)
}
fn inject_connection_closed(
&mut self,
peer_id: &PeerId,
connection_id: &ConnectionId,
endpoint: &ConnectedPoint,
handler: Self::ConnectionHandler,
remaining_established: usize,
) {
self.floodsub.inject_connection_closed(
peer_id,
connection_id,
endpoint,
handler,
remaining_established,
)
}
fn inject_event(
&mut self,
peer_id: PeerId,
connection: ConnectionId,
event: <Self::ConnectionHandler as ConnectionHandler>::OutEvent,
) {
self.floodsub.inject_event(peer_id, connection, event)
}
fn inject_dial_failure(
&mut self,
peer_id: Option<PeerId>,
handler: Self::ConnectionHandler,
error: &DialError,
) {
self.floodsub.inject_dial_failure(peer_id, handler, error)
}
fn inject_new_listen_addr(&mut self, id: ListenerId, addr: &Multiaddr) {
self.floodsub.inject_new_listen_addr(id, addr)
}
fn inject_expired_listen_addr(&mut self, id: ListenerId, addr: &Multiaddr) {
self.floodsub.inject_expired_listen_addr(id, addr)
}
fn inject_new_external_addr(&mut self, addr: &Multiaddr) {
self.floodsub.inject_new_external_addr(addr)
}
fn inject_listener_error(&mut self, id: ListenerId, err: &(dyn std::error::Error + 'static)) {
self.floodsub.inject_listener_error(id, err)
}
fn poll(
&mut self,
ctx: &mut Context,
poll: &mut impl PollParameters,
) -> Poll<PubsubNetworkBehaviourAction> {
use futures::stream::StreamExt;
use std::collections::hash_map::Entry;
loop {
match self.unsubscriptions.1.poll_next_unpin(ctx) {
Poll::Ready(Some(dropped)) => {
let topic = Topic::new(dropped);
if self.streams.remove(&topic).is_some() {
debug!("unsubscribing via drop from {:?}", topic.id());
assert!(
self.floodsub.unsubscribe(topic),
"Failed to unsubscribe a dropped subscription"
);
} else {
// unsubscribed already by `unsubscribe`
// TODO: not sure if the unsubscribe functionality is needed as the
// unsubscribe on drop seems to work
}
}
Poll::Ready(None) => unreachable!("we own the sender"),
Poll::Pending => break,
}
}
loop {
match futures::ready!(self.floodsub.poll(ctx, poll)) {
NetworkBehaviourAction::GenerateEvent(FloodsubEvent::Message(msg)) => {
let topics = msg.topics.clone();
let msg = Arc::new(PubsubMessage::from(msg));
let mut buffer = None;
for topic in topics {
if let Entry::Occupied(oe) = self.streams.entry(topic) {
let sent = buffer.take().unwrap_or_else(|| Arc::clone(&msg));
if let Err(se) = oe.get().unbounded_send(sent) {
// receiver has dropped
let (topic, _) = oe.remove_entry();
debug!("unsubscribing via SendError from {:?}", topic.id());
assert!(
self.floodsub.unsubscribe(topic),
"Failed to unsubscribe following SendError"
);
buffer = Some(se.into_inner());
}
} else {
// we had unsubscribed from the topic after Floodsub had received the
// message
}
}
continue;
}
NetworkBehaviourAction::GenerateEvent(FloodsubEvent::Subscribed {
peer_id,
topic,
}) => {
self.add_node_to_partial_view(peer_id);
let topics = self.peers.entry(peer_id).or_insert_with(Vec::new);
let appeared = topics.is_empty();
if !topics.contains(&topic) {
topics.push(topic);
}
if appeared {
debug!("peer appeared as pubsub subscriber: {}", peer_id);
}
continue;
}
NetworkBehaviourAction::GenerateEvent(FloodsubEvent::Unsubscribed {
peer_id,
topic,
}) => {
if let Entry::Occupied(mut oe) = self.peers.entry(peer_id) {
let topics = oe.get_mut();
if let Some(pos) = topics.iter().position(|t| t == &topic) {
topics.swap_remove(pos);
}
if topics.is_empty() {
debug!("peer disappeared as pubsub subscriber: {}", peer_id);
oe.remove();
self.remove_node_from_partial_view(&peer_id);
}
}
continue;
}
action @ NetworkBehaviourAction::Dial { .. } => {
return Poll::Ready(action);
}
NetworkBehaviourAction::NotifyHandler {
peer_id,
event,
handler,
} => {
return Poll::Ready(NetworkBehaviourAction::NotifyHandler {
peer_id,
event,
handler,
});
}
NetworkBehaviourAction::ReportObservedAddr { address, score } => {
return Poll::Ready(NetworkBehaviourAction::ReportObservedAddr {
address,
score,
});
}
NetworkBehaviourAction::CloseConnection {
peer_id,
connection,
} => {
return Poll::Ready(NetworkBehaviourAction::CloseConnection {
peer_id,
connection,
});
}
}
}
}
}
|
use dump_parser::Error as DumpParsingError;
use std::{fmt::Display, io::Error as IoError, path::PathBuf};
pub type Result<T> = std::result::Result<T, Error>;
#[derive(Debug)]
pub enum Error {
IoError {
action: &'static str,
path: PathBuf,
cause: IoError,
},
InvalidNameToCodeFormat {
path: PathBuf,
line_number: usize,
line: String,
},
InvalidLanguageCode {
path: PathBuf,
line_number: usize,
line: String,
},
DumpParsingError(DumpParsingError),
}
impl Error {
pub fn from_io(
cause: IoError,
action: &'static str,
path: impl Into<PathBuf>,
) -> Error {
Error::IoError {
action,
path: path.into(),
cause,
}
}
}
impl Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::InvalidNameToCodeFormat {
path,
line_number,
line,
} => write!(
f,
"line #{} in {} did not contain a language name, a tab, and a language code: {}",
line_number,
path.display(),
line
),
Error::InvalidLanguageCode {
path,
line_number,
line,
} => write!(
f,
"line #{} in {} contained an invalid language code: {}",
line_number,
path.display(),
line
),
Error::DumpParsingError(e) => {
write!(f, "error while parsing XML: {}", e)
}
Error::IoError {
action,
path,
cause,
} => {
write!(f, "failed to {} {}: {}", action, path.display(), cause)
}
}
}
}
impl From<DumpParsingError> for Error {
fn from(e: DumpParsingError) -> Self {
Error::DumpParsingError(e)
}
}
|
#![allow(dead_code)]
extern crate rand;
extern crate mpc_framework;
use mpc_framework::*;
use rand::distributions::{IndependentSample, Range};
use rand::ThreadRng;
use std::path::Path;
use std::env;
use std::fs::File;
use std::io::{BufReader, BufRead, Write};
fn main() {
let args = env::args().collect::<Vec<_>>();
let dir = Path::new(&args[1]);
let parameters = File::open(dir.join(Path::new(&args[2] as &str))).unwrap();
let reader_parameters = BufReader::new(parameters);
let mut this_party = 0;
let mut num_inputs = 0;
let mut k = 0;
let mut threshold = 0.0;
let mut max = 0;
let mut decimal_points = 0;
for l in reader_parameters.lines().take(6) {
let split = l.unwrap().clone();
let split = split.split(' ').collect::<Vec<_>>();
match split[0] {
"party" => this_party = (&split[1]).parse::<usize>().unwrap(),
"n" => num_inputs = (&split[1]).parse::<u64>().unwrap(),
"k" => k = (&split[1]).parse::<usize>().unwrap(),
"max" => max = (&split[1]).parse::<uint_t>().unwrap(),
"threshold" => threshold = (&split[1]).parse::<f64>().unwrap(),
"decimal_points" => decimal_points = (&split[1]).parse::<usize>().unwrap(),
_ => unreachable!(),
}
}
//gen_input(num_inputs as usize, max as u64, dir);
//return;
let input = File::open(&args[3] as &str).unwrap();
let reader_input = BufReader::new(input);
let mut bs = Vec::new();
let mut cs = Vec::new();
let mut id_map = Vec::new();
for l in reader_input.lines().skip(1).take(num_inputs as usize) {
let split = l.unwrap().clone();
let split = split.split(' ').collect::<Vec<_>>();
if split.len()!=3 { break; }
id_map.push(split[0].to_string());
bs.push((&split[1]).parse::<uint_t>().unwrap());
cs.push((&split[2]).parse::<uint_t>().unwrap());
}
let shifts = (10 as usize).pow(decimal_points as u32).next_power_of_two()
.trailing_zeros() as usize;
let threshold = (threshold*((2 as int_t).pow(shifts as u32) as f64))
as uint_t;
let state = new_state(3, this_party, Vec::new(), Vec::new());
let mut obliv_b = Vec::new();
let mut obliv_c = Vec::new();
for p in 0..this_party {
obliv_b.push((0..(num_inputs as usize))
.map(|_| OblivUInt::new_from_max(None, max, p,
state.clone()))
.collect::<Vec<_>>());
obliv_c.push((0..(num_inputs as usize))
.map(|_| OblivUInt::new_from_max(None, max, p,
state.clone()))
.collect::<Vec<_>>());
}
obliv_b.push(bs.clone().into_iter()
.map(|x| OblivUInt::new_from_max(Some(x), max, this_party,
state.clone()))
.collect::<Vec<_>>());
obliv_c.push(cs.clone().into_iter()
.map(|x| OblivUInt::new_from_max(Some(x), max, this_party,
state.clone()))
.collect::<Vec<_>>());
for p in (this_party+1)..3{
obliv_b.push((0..(num_inputs as usize))
.map(|_| OblivUInt::new_from_max(None, max, p,
state.clone()))
.collect::<Vec<_>>());
obliv_c.push((0..(num_inputs as usize))
.map(|_| OblivUInt::new_from_max(None, max, p,
state.clone()))
.collect::<Vec<_>>());
}
let obliv_bs = obliv_b[0].iter().zip(obliv_b[1].iter())
.zip(obliv_b[2].iter())
.map(|((b0, b1), b2)| b0.clone()+b1.clone()+b2.clone())
.collect::<Vec<_>>();
let obliv_cs = obliv_c[0].iter().zip(obliv_c[1].iter())
.zip(obliv_c[2].iter())
.map(|((c0, c1), c2)| c0.clone()+c1.clone()+c2.clone())
.collect::<Vec<_>>();
//let obliv_bs = obliv_b[0].iter().zip(obliv_b[1].iter())
//.zip(obliv_b[2].iter())
//.map(|((b0, b1), b2)| b0.clone())
//.collect::<Vec<_>>();
//let obliv_cs = obliv_c[0].iter().zip(obliv_c[1].iter())
//.zip(obliv_c[2].iter())
//.map(|((c0, c1), c2)| c0.clone())
//.collect::<Vec<_>>();
let mut heap = vec![(OblivUInt::new_pub_from_max(num_inputs, num_inputs,
state.clone()),
(OblivUInt::get_free_zero(state.clone()))); k];
for (new_id, (b, c)) in obliv_bs.into_iter().zip(obliv_cs.into_iter())
.enumerate()
{
let mut new_tdt = tdt_score(b, c, shifts);
let mut new_id = OblivUInt::new_pub_from_max(new_id as u64, num_inputs,
state.clone());
for &mut(ref mut id, ref mut tdt) in heap.iter_mut() {
let gt = new_tdt.obliv_gt(tdt);
let swap_tdt = OblivUInt::swap(tdt.clone(), new_tdt, gt.clone());
*tdt = swap_tdt.0;
new_tdt = swap_tdt.1;
let swap_id = OblivUInt::swap(id.clone(), new_id, gt);
*id = swap_id.0;
new_id = swap_id.1;
//*id = new_id.clone();
//*tdt = new_tdt.clone();
//break;
}
}
let threshold = OblivUInt::new_pub(threshold, state.clone());
for &mut (ref mut id, ref mut tdt) in heap.iter_mut() {
let le = threshold.obliv_le(tdt);
*id = id.clone()*le.clone();
*tdt = tdt.clone()*le;
}
for &mut (ref mut id, ref mut obv) in heap.iter_mut() {
id.obliv_bits = id.obliv_bits.iter().map(|x| x.clone() ^ false).collect();
obv.obliv_bits = obv.obliv_bits.iter().map(|x| x.clone() ^ false).collect();
}
for i in heap {
let _ = i.0.reveal(0);
let _ = i.1.reveal(0);
//println!("ID: {:3}, TDT: {:.4}", i.0.get_debug_value().unwrap(),
//(i.1.get_debug_value().unwrap() as f64)/((2 as u64)
//.pow(shifts as u32) as f64));
}
//state.borrow_mut().report();
translate(&state.borrow_mut().circuit, &dir);
}
fn tdt_score(b: OblivUInt, c: OblivUInt, shifts: usize) -> OblivUInt {
let mut ret = (b.clone().into_int()-c.clone().into_int()).pow_uint(2)
.into_uint();
let new_size = ret.get_size()+shifts;
ret.set_size(new_size);
ret=ret<<shifts;
ret=ret/(b.clone()+c.clone());
ret
//let mut b = b;
//b.set_size(new_size);
//b
}
fn gen_input(num_inputs: usize, max: u64, dir: &Path) {
let mut inputs = Vec::new();
let mut rng = rand::thread_rng();
let between = Range::new(0, max+1);
for _ in 0..num_inputs {
inputs.push(get_random_six(&between, &mut rng));
}
let mut f0 = File::create(dir.join(Path::new("rand_input_0.txt"))).unwrap();
let mut f1 = File::create(dir.join(Path::new("rand_input_1.txt"))).unwrap();
let mut f2 = File::create(dir.join(Path::new("rand_input_2.txt"))).unwrap();
write!(&mut f0, "SNP b c\n").ok();
write!(&mut f1, "SNP b c\n").ok();
write!(&mut f2, "SNP b c\n").ok();
for (i, ((b0, b1, b2), (c0, c1, c2))) in inputs.into_iter().enumerate() {
write!(&mut f0, "{} {} {}\n", i, b0, c0).ok();
write!(&mut f1, "{} {} {}\n", i, b1, c1).ok();
write!(&mut f2, "{} {} {}\n", i, b2, c2).ok();
}
}
fn get_random_six(between: &Range<uint_t>, rng_thread: &mut ThreadRng) ->
((uint_t, uint_t, uint_t), (uint_t, uint_t, uint_t))
{
let mut triples = (0..6).map(|_| between.ind_sample(rng_thread))
.collect::<Vec<_>>();
triples.sort();
triples = (0..1).chain(triples.into_iter()).collect();
triples = triples.windows(2).map(|x| x[1]-x[0]).collect::<Vec<_>>();
((triples[0], triples[1], triples[2]),
(triples[3], triples[4], triples[5]))
}
|
fn get_input() -> Vec<u64> {
let vec: Vec<u64> = include_str!("../input.txt")
.split("\r\n")
.map(|s| {
// dbg!(s);
s.parse().unwrap()
})
.collect();
assert_eq!(vec.len(), 200);
vec
}
fn part_one() {
let mut vec = get_input();
vec.sort_unstable();
for n in &vec {
if let Ok(i) = vec.binary_search(&(2020u64 - n)) {
let m = vec.get(i).unwrap();
println!(
"first: {}; second: {}; first+second: {}; multiplied: {}",
n,
m,
n + m,
n * m
);
return;
}
}
}
fn part_two() {
let mut vec = get_input();
vec.sort_unstable();
for n in &vec {
for m in &vec {
if let Ok(i) = vec.binary_search(&(2020u64 - n - m)) {
let o = vec.get(i).unwrap();
println!(
"first: {}; second: {}; third: {}; first+second+third: {}; multiplied: {}",
n,
m,
o,
n + m + o,
n * m * o
);
return;
}
}
}
}
fn main() {
part_one();
part_two();
}
|
// Copyright 2022 Datafuse Labs.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use std::sync::Arc;
use common_base::runtime::execute_futures_in_parallel;
use common_catalog::table_context::TableContext;
use common_exception::Result;
use opendal::Operator;
// File related operations.
pub struct Files {
ctx: Arc<dyn TableContext>,
operator: Operator,
}
impl Files {
pub fn create(ctx: Arc<dyn TableContext>, operator: Operator) -> Self {
Self { ctx, operator }
}
/// Removes a batch of files asynchronously by splitting a list of file locations into smaller groups of size 1000,
/// and then deleting each group of files using the delete_files function.
#[tracing::instrument(level = "debug", skip_all)]
pub async fn remove_file_in_batch(
&self,
file_locations: impl IntoIterator<Item = impl AsRef<str>>,
) -> Result<()> {
let batch_size = 1000;
let locations = Vec::from_iter(file_locations.into_iter().map(|v| v.as_ref().to_string()));
if locations.len() <= batch_size {
Self::delete_files(self.operator.clone(), locations).await?;
} else {
let mut chunks = locations.chunks(batch_size);
let tasks = std::iter::from_fn(move || {
chunks
.next()
.map(|location| Self::delete_files(self.operator.clone(), location.to_vec()))
});
let threads_nums = self.ctx.get_settings().get_max_threads()? as usize;
let permit_nums = self.ctx.get_settings().get_max_storage_io_requests()? as usize;
execute_futures_in_parallel(
tasks,
threads_nums,
permit_nums,
"batch-remove-files-worker".to_owned(),
)
.await?;
}
Ok(())
}
async fn delete_files(op: Operator, locations: Vec<String>) -> Result<()> {
op.remove(locations).await?;
Ok(())
}
}
|
use canvas::Canvas;
use rand;
use rand::distributions::{IndependentSample, Range as Uniform};
use nalgebra::{Vector2, Point2};
use num::{Float, cast};
use std::ops::Range;
use std::rc::Rc;
use std::convert::{From, Into};
pub struct Parametric<F: Fn(N) -> Point2> {
f: F
range: Uniform<N>,
samples: usize
}
impl Sampler for Parametric {
fn sample(&self, rng: &mut rand::ThreadRng) -> Point {
let c = self.range.ind_sample(rng);
(self.f)(c)
}
fn domain(&self) -> Domain {
self.domain
}
}
pub struct Figure {
domain: (Range<Real>, Range<Real>),
items: Vec<Box<Parametric>>,
ratio: Scale
}
impl Flex for Figure {
}
impl Object for Figure {
fn measure(&self, primary: Length) -> FlexMeasure {
FlexMeasure {
shrink: primary,
stretch: primary,
width: primary,
height: primary * self.ratio
}
}
fn show(&self, out: &mut Output) {
}
fn glue(&self) -> (Glue, Glue) {
(Glue::newline(), Glue::newline())
}
}
impl<'a> Figure<'a> {
pub fn new(x: Range<N>, y: Range<N>) -> Figure<'a> {
Figure {
domain: Vector2::new(x, y),
items: Vec::new()
}
}
pub fn xy<F>(&mut self, f: F, samples: usize)
where F: Fn(Real) -> Real
{
let range = self.range.0;
self.items.push(
Box::new(Parametric {
f: |x| (x, f(x)),
range: Uniform::new(range.start, range.end),
domain: Domain(Bound::Closed(range.start), Bound::Open(range.end))
})
);
self
}
pub fn parametric<F>(&mut self, f: F, range: Range<Real>, samples: usize)
where F: Fn(Real) -> (Real, Real)
{
self.items.push(
Box::new(Parametric {
f: f,
range: Uniform::new(range.start, range.end),
})
);
self
}
}
}
#[test]
fn test_plot() {
Figure::new(-5.0 .. 5.0, -5.0 .. 5.0)
.add(&XY::new(Box::new(|x: f64| (1.0/x).sin()), -5.0 .. 5.0), 10_000);
}
|
use serde::{Deserialize, Serialize};
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct StartResponse {
color: String,
head_type: String,
tail_type: String,
}
impl StartResponse {
pub fn new(color: String, head_type: String, tail_type: String) -> StartResponse {
StartResponse {
color,
head_type,
tail_type,
}
}
}
#[derive(Clone, Debug, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum Move {
Left,
Right,
Up,
Down,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct MoveResponse {
r#move: Move,
}
impl MoveResponse {
pub fn new(r#move: Move) -> MoveResponse {
MoveResponse {
r#move,
}
}
}
#[derive(Deserialize, Debug)]
pub struct Game {
id: String,
}
#[derive(Clone, Deserialize, Debug)]
pub struct Point {
pub x: u8,
pub y: u8,
}
#[derive(Deserialize, Debug)]
pub struct Snake {
pub id: String,
pub name: String,
pub health: u8,
pub body: Vec<Point>,
}
#[derive(Deserialize, Debug)]
pub struct Board {
pub height: u8,
pub width: u8,
pub food: Vec<Point>,
pub snakes: Vec<Snake>,
}
#[derive(Deserialize, Debug)]
pub struct GameEnvironment {
pub game: Game,
pub turn: u16,
pub board: Board,
pub you: Snake,
}
pub static POSSIBLE_MOVES: [Move; 4] = [Move::Left, Move::Right, Move::Up, Move::Down];
|
use bevy::math::*;
use bevy::prelude::*;
use meshie::Meshie;
use rand::Rng;
use crate::equations_of_motion::{Destination, EquationsOfMotion, Momentum};
pub struct Sectors;
impl Plugin for Sectors {
fn build(&self, app: &mut AppBuilder) {
app.add_startup_system(sector_init.system())
.add_startup_system(sector_movement_test_init.system())
.add_system(movement.system())
.add_system(sector_tick.system());
}
}
#[derive(Debug, Default)]
struct Sector {
iter_count: u32,
}
struct SectorMesh;
fn sector_init(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
) {
let mut rng = rand::thread_rng();
let mut vec_to_spawn = Vec::new();
let mut mesh = Mesh::from(shape::Icosphere {
radius: 10.0,
subdivisions: 2,
});
for _ in 0..10000 {
let mut trans = Transform::default();
let x = rng.gen_range(-15000., 15000.);
let y = rng.gen_range(-15000., 15000.);
let z = rng.gen_range(0.0, 1.0);
trans.translate(Vec3::new(x, y, z));
vec_to_spawn.push((trans, Sector::default()));
let other = Mesh::from(shape::Icosphere {
radius: 100.0,
subdivisions: 2,
});
// return the indicies added
let verts = mesh.add_mesh(&other);
mesh.translate_mesh(verts, Vec3::new(x, y, z));
}
let meshie_handle = meshes.add(mesh);
commands.spawn_batch(vec_to_spawn);
commands
.spawn(PbrComponents {
mesh: meshie_handle,
draw: Draw {
is_transparent: true,
..Default::default()
},
material: materials.add(StandardMaterial {
albedo: Color::rgba(
rng.gen_range(0.0, 1.0),
rng.gen_range(0.0, 1.0),
rng.gen_range(0.0, 1.0),
rng.gen_range(0.3, 0.7),
),
..Default::default()
}),
..Default::default()
})
.with(SectorMesh);
}
fn sector_tick(mut query: Query<(&Transform, &mut Sector)>) {
for (_trans, mut sector) in &mut query.iter() {
sector.iter_count += 1;
}
}
fn sector_movement_test_init(
mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>,
) {
let mesh = Mesh::from(shape::Cube { size: 160.0 });
let cube_handle = meshes.add(mesh);
commands
.spawn(PbrComponents {
mesh: cube_handle,
material: materials.add(StandardMaterial {
albedo: Color::rgb(1.0, 0.0, 1.0),
shaded: false,
..Default::default()
}),
transform: Transform::from_rotation(Quat::from_rotation_z(0.0)),
..Default::default()
})
.with(Momentum {
max_rotation: 0.01,
thrust: 0.01,
inertia: vec2(10.01, 0.01),
})
.with(Destination {
d: Vec3::new(2000., 3000., 0.0),
})
.with(MoveLogic {
state: MovementState::CancelBadMomentumVector,
});
}
struct MoveLogic {
state: MovementState,
}
enum MovementState {
Stop,
FlyTo,
CancelBadMomentumVector,
Turning,
}
const ANGLE_EPSILON: f32 = 0.0001;
impl MovementState {
fn evaluate_state(&mut self, current: &Vec3, momentum: &Vec3, dest: &Vec3) {
match self {
Self::Stop => {
if self.distance_to(current, dest) > 30.0 {
*self = Self::Turning;
}
}
Self::FlyTo => {
let bad_mom_vector = self.get_bad_mom(&momentum, &dest);
if bad_mom_vector.angle_between(*momentum) < ANGLE_EPSILON {}
// apply thrust
}
Self::CancelBadMomentumVector => {
let x = self.get_bad_mom(&momentum, &dest);
// apply thrust
}
Self::Turning => {
// figure out where to point....
let bad_mom_vector = self.get_bad_mom(&momentum, &dest);
if (-bad_mom_vector).angle_between(*momentum) < ANGLE_EPSILON {
if current.angle_between(*dest) < ANGLE_EPSILON {
*self = Self::FlyTo;
}
// fallthrough - still turning
} else {
*self = Self::CancelBadMomentumVector;
}
}
}
}
fn apply_thrust() {}
fn apply_momentum() {}
fn distance_to(&self, a: &Vec3, b: &Vec3) -> f32 {
(a.length() - b.length()).abs()
}
fn get_bad_mom(&self, momentum: &Vec3, dest: &Vec3) -> Vec3 {
// momentum.length() - dest.length()
*momentum - *dest
}
}
fn movement(
mut query: Query<(
&mut Momentum,
&mut Destination,
&mut Transform,
&mut MoveLogic,
)>,
mut sector_query: Query<(&Transform, &mut Sector)>,
) {
for (mut momentum, mut destination, mut transform, mut move_logic) in &mut query.iter() {
let dist = momentum.distance(&transform.translation(), &destination.d);
print!("{}", dist);
if dist < 10.0 {
destination.d = sector_query
.iter()
.iter()
.find(|(t, _)| {
if momentum.distance(&transform.translation(), &t.translation()) > 5000. {
true
} else {
false
}
})
.and_then(|(v, _)| Some(v.translation()))
.unwrap();
}
let mut pos = transform.translation();
let null = Vec3::new(0.0, 0.0, 0.0);
let mask = pos.cmpeq(null);
if mask.all() {
pos.set_x(1.0);
}
let facing = (transform.rotation().mul_vec3(Vec3::unit_y())).normalize();
let vector_to_dest = (destination.d - pos).normalize();
let mut bad_vec = vector_to_dest - momentum.inertia.extend(0.00001).normalize();
if bad_vec.length() < momentum.thrust * 2.0 {
bad_vec = vector_to_dest
}
// let new_vec: Vector3D<f32, euclid::UnknownUnit> = EuclidFrom::from(bad_vec);
// print!(" {} {}", bad_vec, bad_vec * momentum.inertia.extend(0.00001));
let (_axis, angle) = momentum.turn_to(facing, bad_vec);
let s = (momentum.max_rotation() / angle).abs();
println!(
" maxrot: {} angle: {} s: {} min: {}",
momentum.max_rotation(),
angle,
s,
s.min(1.0)
);
let look_at = Quat::default_to_vec3(bad_vec);
let rot = transform.rotation().normalize();
if rot.dot(look_at) < 0.0 {
transform.set_rotation(rot.slerp(-look_at, s.min(1.0)));
} else {
transform.set_rotation(rot.slerp(look_at, s.min(1.0)));
}
// let s = momentum.max_rotation() / facing.angle_between(vector_to_dest);
// let dot = facing.dot(vector_to_dest);
// // let final_angle = Vec3::unit_y().angle_between(vector_to_dest);
// // let facing_angle = Vec3::unit_y().angle_between(facing);
// // let turn_angle = final_angle - facing_angle;
// // let final_angle = momentum.turn_to(facing, vector_to_dest);
// // if final_angle > 0.00001 {
// // transform.set_rotation(Quat::from_rotation_z(facing_angle+turn_angle));
// // }
// let (axis, angle) = momentum.turn_to(facing, vector_to_dest);
// transform.rotate(Quat::from_axis_angle(axis, angle).normalize());
let thrust = momentum.thrust();
// momentum.inertia += vec2(0.0, 0.1);
momentum.inertia += vec2(
facing.x().sin() * thrust,
(facing.y().cos() * thrust).copysign(facing.y()),
);
transform.translate(momentum.inertia().extend(0.0));
// println!(
// "a {:<13?} d {:<13?} t {:<13?} f {:<13?} ax {:<13?}",
// angle,
// // 0,0
// // angle_to_turn,
// momentum.inertia,
// transform.translation(),
// // transform.rotation().to_axis_angle(),
// facing,
// axis
// );
}
}
trait QuatMath {
fn from_to_vec3(from: Vec3, to: Vec3) -> Quat;
fn default_to_vec3(to: Vec3) -> Quat;
}
impl QuatMath for Quat {
fn from_to_vec3(from: Vec3, to: Vec3) -> Quat {
let from_vec = from.normalize();
let to_vec = to.normalize();
let dot = from_vec.dot(to_vec);
if dot >= 1.0 {
return Quat::identity();
}
if dot < 1e-6_f32 - 1.0 {
let mut axis = Vec3::unit_x().cross(from);
if axis.length() == 0.0 {
axis = Vec3::unit_y().cross(from);
}
return Quat::from_axis_angle(axis.normalize(), std::f32::consts::PI);
}
let angle = dot.acos();
Quat::from_axis_angle(from_vec.cross(to_vec).normalize(), angle).normalize()
}
fn default_to_vec3(forward: Vec3) -> Quat {
Quat::from_to_vec3(Vec3::unit_y(), forward)
}
}
|
//! Logging for _trace_ logs
use tracing_subscriber::{
fmt::format::{Format, JsonFields},
prelude::*,
EnvFilter, Registry,
};
use crate::{SystemError, SystemResult};
mod middleware;
pub use middleware::{
LoggerMiddleware,
LoggerLayer,
};
pub struct Logger {
is_prod: bool,
level: String,
path: String,
filename: String,
}
impl Logger {
pub fn init(env: &str, path: &str, filename: &str) -> SystemResult<Self> {
let (is_prod, level) = match env {
"production" => (true, string!("error")),
_ => (false, string!("info")),
};
let path = path.to_string();
let filename = filename.to_string();
Ok(Self {
is_prod,
level,
path,
filename,
})
}
fn format(&self) -> Format {
tracing_subscriber::fmt::format()
.with_level(true) // don't include levels in formatted output
.with_target(true) // don't include targets
.with_thread_ids(true) // include the thread ID of the current thread
.with_thread_names(true) // include the name of the current thread
.with_file(true)
.with_line_number(true)
}
fn filter(&self) -> EnvFilter {
EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new(&self.level))
}
pub fn subscribe(&self) -> SystemResult<()> {
let formatter = self.format();
let filter = self.filter();
if self.is_prod {
let file_appender = tracing_appender::rolling::daily(&self.path, &self.filename);
let layer = tracing_subscriber::fmt::layer()
.with_ansi(false)
.event_format(formatter.json())
.fmt_fields(JsonFields::new())
.with_writer(file_appender);
let subscriber = Registry::default().with(filter).with(layer);
tracing::subscriber::set_global_default(subscriber)
.map_err(|err| SystemError::ConfigError(err.to_string()))?;
} else {
let layer = tracing_subscriber::fmt::layer()
.with_ansi(true)
.event_format(formatter.pretty())
.with_writer(std::io::stdout);
let subscriber = Registry::default().with(filter).with(layer);
tracing::subscriber::set_global_default(subscriber)
.map_err(|err| SystemError::ConfigError(err.to_string()))?;
}
Ok(())
}
}
|
#[derive(Debug, Clone, Copy)]
pub struct Flags {
pub z: bool, // zero
pub n: bool, // subtract
pub h: bool, // half carry
pub c: bool, // carry
}
impl Flags {
pub fn clear() -> Self {
Flags {
z: false,
n: false,
h: false,
c: false,
}
}
pub fn u8_from_c(&self) -> u8 {
if self.c { 1 } else { 0 }
}
}
#[derive(Debug, Clone, Copy)]
pub struct Registers {
pub sp: u16,
pub b: u8,
pub c: u8,
pub d: u8,
pub e: u8,
pub h: u8,
pub l: u8,
pub a: u8,
pub f: Flags,
}
impl Registers {
pub fn new() -> Self {
Registers {
sp: 0x0000,
b: 0x00,
c: 0x00,
d: 0x00,
e: 0x00,
h: 0x00,
l: 0x00,
a: 0x00,
f: Flags::clear()
}
}
pub fn bc(&self) -> u16 {
(self.b as u16) << 8 | self.c as u16
}
pub fn set_bc(&mut self, n: u16) {
self.b = Registers::hi(n);
self.c = Registers::lo(n);
}
pub fn inc_bc(&mut self) {
self.set_bc(self.bc().wrapping_add(1));
}
pub fn dec_bc(&mut self) {
self.set_bc(self.bc().wrapping_sub(1));
}
pub fn de(&self) -> u16 {
(self.d as u16) << 8 | self.e as u16
}
pub fn set_de(&mut self, n: u16) {
self.d = Registers::hi(n);
self.e = Registers::lo(n);
}
pub fn inc_de(&mut self) {
self.set_de(self.de().wrapping_add(1));
}
pub fn dec_de(&mut self) {
self.set_de(self.de().wrapping_sub(1));
}
pub fn hl(&self) -> u16 {
(self.h as u16) << 8 | self.l as u16
}
pub fn set_hl(&mut self, n: u16) {
self.h = Registers::hi(n);
self.l = Registers::lo(n);
}
pub fn inc_hl(&mut self) {
self.set_hl(self.hl().wrapping_add(1));
}
pub fn dec_hl(&mut self) {
self.set_hl(self.hl().wrapping_sub(1));
}
fn hi(n: u16) -> u8 {
((n & 0xff00) >> 8) as u8
}
fn lo(n: u16) -> u8 {
(n & 0x00ff) as u8
}
}
#[cfg(test)]
mod test {
use super::Registers;
#[test]
fn hi_lo() {
let value: u16 = 0xA3B4;
assert_eq!(Registers::hi(value), 0xA3);
assert_eq!(Registers::lo(value), 0xB4);
}
#[test]
fn read_register() {
let mut r = Registers::new();
r.b = 0x22;
r.c = 0x13;
assert_eq!(r.bc(), 0x2213);
}
#[test]
fn set_register() {
let mut r = Registers::new();
r.set_bc(0x2213);
assert_eq!(r.b, 0x22);
assert_eq!(r.c, 0x13);
}
#[test]
fn inc_register() {
let mut r = Registers::new();
r.set_bc(0x2213);
r.inc_bc();
assert_eq!(r.bc(), 0x2214);
assert_eq!(r.b, 0x22);
assert_eq!(r.c, 0x14);
}
}
|
use super::{hashes, types, converters};
use super::types::curve::big::BIG;
use amcl::rand::RAND;
use rand::Rng;
use std::cmp::Ordering;
use sha3::Shake256;
use sha3::digest::{Input, ExtendableOutput ,XofReader};
pub fn rand_big(rng: &mut RAND) -> BIG {
BIG::random(rng)
}
pub fn new_seeded_rand(seed: &[u8]) -> RAND {
let mut rng = RAND::new();
let seed_len = seed.len();
rng.clean();
rng.seed(seed_len,&seed);
rng
}
pub fn new_rand<R: Rng>(rng: &mut R) -> RAND {
let seed_len = 1024;
let mut seed = vec![0; seed_len];
for i in 0..seed_len {
let r = rng.gen();
seed[i] = r;
}
new_seeded_rand(&seed)
}
pub fn new_rand_vec<R: Rng>(size: usize, rng: &mut R) -> Vec<u8> {
let mut bytes = vec![0; size];
for i in 0..size {
let r = rng.gen();
bytes[i] = r;
}
bytes
}
pub fn init_prng(points: &[&types::curve::ecp::ECP]) -> impl XofReader {
let mut hasher = Shake256::default();
let z = hashes::hash_points(&points);
hasher.input(&z);
let prng = hasher.xof_result();
prng
}
pub fn rand_scalar_from_rng<R: Rng>(rng: &mut R) -> types::curve::big::BIG {
let seed = new_rand_vec(256, rng);
let mut hasher = Shake256::default();
hasher.input(&seed);
let mut prng = hasher.xof_result();
rand_scalar_from_prng(&mut prng)
}
pub fn rand_scalar_from_prng(prng: &mut XofReader) -> types::curve::big::BIG {
let curve_order_big = types::curve::big::BIG::new_ints(&types::curve::rom::CURVE_ORDER);
let zero = types::curve::big::BIG::new();
let bytes_len = types::curve::big::MODBYTES;
let mut bytes = vec![0; bytes_len];
prng.read(&mut bytes);
let mut c = converters::big_from_bytes(&bytes);
c.norm();
if c.cmp(&curve_order_big) != Ordering::Less {
c.sub(&curve_order_big);
}
if c.cmp(&zero) != Ordering::Greater {
c.add(&curve_order_big);
}
c.norm();
c
}
#[test]
fn test_new_seeded_rand() {
let seed : [u8; 24] = [1; 24];
let mut r = new_seeded_rand(&seed);
assert!(r.getbyte() == (173 as u8));
}
#[test]
fn test_new_rand() {
let mut rng = rand::thread_rng();
new_rand(&mut rng);
}
#[test]
fn test_new_rand_vec() {
let mut rng = rand::thread_rng();
let rand_vec_len = 1024;
let bs = new_rand_vec(rand_vec_len, &mut rng);
assert!(bs.len() == rand_vec_len);
}
|
use super::Cartridge;
use crate::ines::File;
use crate::ines::Mirroring;
use std::mem;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct NROM {
#[serde(skip)]
pub file: File,
sram: Vec<u8>,
chr_ram: Vec<u8>,
}
impl NROM {
pub fn new(file: File) -> NROM {
NROM {
file,
sram: vec![0; 0x2000],
chr_ram: vec![0; 0x2000],
}
}
}
impl Cartridge for NROM {
fn read(&mut self, address: u16) -> u8 {
match address {
0x4020...0x5FFF => panic!("Read in unused ROM region? {:X}", address),
0x6000...0x7FFF => self.file.prg_rom[address as usize - 0x6000],
0x8000...0xFFFF => {
self.file.prg_rom[(address as usize - 0x8000)
% if self.file.prg_rom_blocks == 1 {
0x4000
} else {
0x8000
}]
}
_ => panic!("NROM Read outside ROM region: {:X}", address),
}
}
fn write(&mut self, address: u16, byte: u8) {
match address {
0x6000...0x7FFF => self.sram[(address as usize - 0x6000) % 0x2000] = byte,
_ => panic!("Attempt to write to NROM: {:04X} = {:02X}", address, byte),
}
}
fn ppu_read(&mut self, address: u16) -> u8 {
if self.file.chr_rom_blocks == 0 {
self.chr_ram[address as usize]
} else {
match address {
0x0000...0x1FFF => self.file.chr_rom[address as usize],
_ => panic!("PPU read outside of range"),
}
}
}
fn ppu_write(&mut self, address: u16, byte: u8) {
if self.file.chr_rom_blocks == 0 {
self.chr_ram[address as usize] = byte;
} else {
println!(
"PPU: Attempt to write to NROM: {:04X} = {:02X}",
address, byte
);
}
}
fn mirroring(&self) -> Mirroring {
self.file.mirroring
}
fn to_json(&self) -> String {
serde_json::to_string(self).unwrap()
}
fn from_json(&mut self, json: &str) {
let mut nrom: NROM = serde_json::from_str(json).unwrap();
mem::swap(&mut self.sram, &mut nrom.sram);
mem::swap(&mut self.chr_ram, &mut nrom.chr_ram);
}
}
|
use crate::*;
use winapi::um::winuser::WM_LBUTTONUP;
use std::cell::RefCell;
struct MessageBoxOnDrop {}
impl Drop for MessageBoxOnDrop {
fn drop(&mut self) {
simple_message("Dropped", "A MessageBoxOnDrop object was dropped");
}
}
#[derive(Default)]
struct FreeingData {
raw_handler_bound: bool,
raw_callback_id: usize,
raw_handler: Option<RawEventHandler>,
handler_bound: bool,
handler: Option<EventHandler>,
}
#[derive(Default)]
pub struct FreeingTest {
data: RefCell<FreeingData>,
pub window: Window,
layout: GridLayout,
bind_handler_btn: Button,
custom_bind_button: Button,
bind_handler_btn2: Button,
custom_bind_button2: Button,
}
impl FreeingTest {
pub fn destroy(&self) {
let mut data = self.data.borrow_mut();
if data.raw_handler_bound {
data.raw_handler_bound = false;
drop(unbind_raw_event_handler(&data.raw_handler.take().unwrap()));
}
}
fn bind_raw_handler(&self) {
let mut data = self.data.borrow_mut();
if data.raw_handler_bound {
self.bind_handler_btn.set_text("Bind raw handler");
data.raw_handler_bound = false;
if let Err(_) = unbind_raw_event_handler(&data.raw_handler.take().unwrap()) {
error_message("Error", "Failed to free event handler");
}
assert!(has_raw_handler(&self.custom_bind_button.handle, data.raw_callback_id) == false);
} else {
self.bind_handler_btn.set_text("Unbind raw handler");
data.raw_handler_bound = true;
data.raw_callback_id += 1;
let message = MessageBoxOnDrop{};
let handler = bind_raw_event_handler_inner(&self.custom_bind_button.handle, data.raw_callback_id, move |_hwnd, msg, _w, _l| {
if msg == WM_LBUTTONUP {
&message;
simple_message("Raw handler", &"Hello from raw dynamic handler");
}
None
});
assert!(has_raw_handler(&self.custom_bind_button.handle, data.raw_callback_id));
data.raw_handler = Some(handler.unwrap());
}
}
fn bind_handler(&self) {
let mut data = self.data.borrow_mut();
if data.handler_bound {
self.bind_handler_btn2.set_text("Bind handler");
data.handler_bound = false;
unbind_event_handler(&data.handler.take().unwrap());
} else {
self.bind_handler_btn2.set_text("Unbind handler");
data.handler_bound = true;
let message = MessageBoxOnDrop{};
let bind_handler_btn2 = self.custom_bind_button2.handle;
let handler = bind_event_handler(&self.custom_bind_button2.handle, &self.window.handle, move |event, _event_data, ctrl| {
match event {
Event::OnButtonClick => {
if &ctrl == &bind_handler_btn2 {
&message;
simple_message("Handler", &"Hello from dynamic handler");
}
},
_ => {}
}
()
});
data.handler = Some(handler);
}
}
}
mod partial_freeing_test_ui {
use super::*;
use crate::{PartialUi, NwgError, ControlHandle};
impl PartialUi for FreeingTest {
fn build_partial<W: Into<ControlHandle>>(data: &mut FreeingTest, _parent: Option<W>) -> Result<(), NwgError> {
Window::builder()
.flags(WindowFlags::WINDOW)
.size((400, 150))
.position((450, 100))
.title("Freeing stuff")
.build(&mut data.window)?;
Button::builder()
.text("Bind raw handler")
.parent(&data.window)
.build(&mut data.bind_handler_btn)?;
Button::builder()
.text("Do something!")
.parent(&data.window)
.build(&mut data.custom_bind_button)?;
Button::builder()
.text("Bind handler")
.parent(&data.window)
.build(&mut data.bind_handler_btn2)?;
Button::builder()
.text("Do something else!")
.parent(&data.window)
.build(&mut data.custom_bind_button2)?;
GridLayout::builder()
.parent(&data.window)
.max_column(Some(2))
.max_row(Some(2))
.child(0, 0, &data.bind_handler_btn)
.child(1, 0, &data.custom_bind_button)
.child(0, 1, &data.bind_handler_btn2)
.child(1, 1, &data.custom_bind_button2)
.build(&data.layout)?;
Ok(())
}
fn process_event<'a>(&self, evt: Event, mut _evt_data: &EventData, handle: ControlHandle) {
use crate::Event as E;
match evt {
E::OnButtonClick =>
if &handle == &self.bind_handler_btn {
FreeingTest::bind_raw_handler(self)
} else if &handle == &self.bind_handler_btn2 {
FreeingTest::bind_handler(self)
}
_ => {}
}
}
fn handles(&self) -> Vec<&ControlHandle> {
vec![&self.window.handle]
}
}
}
|
extern crate capnp;
#[macro_use]
extern crate capnp_rpc;
extern crate native_tls;
extern crate tokio;
extern crate tokio_tls;
extern crate helloworld;
use std::env;
use std::fs::read;
use std::io::BufWriter;
use std::net::SocketAddr;
use capnp::capability::Promise;
use capnp::Error;
use capnp::message::HeapAllocator;
use capnp_rpc::{ImbuedMessageBuilder, RpcSystem, Server};
use capnp_rpc::rpc_twoparty_capnp::Side;
use capnp_rpc::twoparty::VatNetwork;
use native_tls::{Identity, TlsAcceptor as NativeAcceptor};
use tokio::io::AsyncRead;
use tokio::net::TcpListener;
use tokio::prelude::{Future, Stream};
use tokio::runtime::current_thread;
use tokio_tls::TlsAcceptor as TokioAcceptor;
use helloworld::{Server as SayHelloServer, SayHelloParams, SayHelloResults, ToClient};
use helloworld::hello_reply::Builder as ReplyBuilder;
struct ServerImpl {
builder: ImbuedMessageBuilder<HeapAllocator>
}
impl ServerImpl {
fn new() -> Self {
ServerImpl {
builder: ImbuedMessageBuilder::new(HeapAllocator::new())
}
}
}
impl SayHelloServer for ServerImpl {
fn say_hello(&mut self, params: SayHelloParams, mut results: SayHelloResults) -> Promise<(), Error> {
// Get name from request
let request = pry!(pry!(params.get()).get_request());
let name = pry!(request.get_name());
println!("Received message from {}.", name);
// Build reply
let message = format!("Hello, {}!", name);
let mut reply_builder = pry!(self.builder.get_root::<ReplyBuilder>());
reply_builder.set_message(&message);
// 'Return' reply
results.get().set_reply(reply_builder.into_reader()).unwrap();
Promise::ok(())
}
}
fn main() {
let args: Vec<String> = env::args().collect();
// TCP listener
let addr = args[1].parse::<SocketAddr>().unwrap();
let listener = TcpListener::bind(&addr).unwrap();
// TLS acceptor
let cert = read(&args[2]).unwrap();
let identity = Identity::from_pkcs12(cert.as_slice(), "").unwrap();
let tls_acceptor = NativeAcceptor::builder(identity).build().unwrap();
let tls_acceptor = TokioAcceptor::from(tls_acceptor);
// RPC client
let client = ToClient::new(ServerImpl::new()).into_client::<Server>();
println!("Starting server...");
current_thread::block_on_all(listener.incoming().for_each(move |stream| {
stream.set_nodelay(true)?;
let client = client.clone();
let tls_accept = tls_acceptor
.accept(stream)
.and_then(move |stream| {
let (reader, writer) = stream.split();
let writer = BufWriter::new(writer);
let network = VatNetwork::new(
reader,
writer,
Side::Server,
Default::default()
);
let rpc_system = RpcSystem::new(
Box::new(network),
Some(client.client)
);
current_thread::spawn(rpc_system.map_err(|e| eprintln!("{:?}", e)));
Ok(())
});
current_thread::spawn(tls_accept.map_err(|e| eprintln!("{:?}", e)));
Ok(())
})).unwrap();
}
|
//! Crate specific errors.
//
use crate::{ import::*, CloseEvent };
/// The error type for errors happening in `ws_stream_wasm`.
///
/// Use [`Error::kind()`] to know which kind of error happened.
//
#[ derive( Debug, Clone, PartialEq, Eq ) ]
//
pub struct Error
{
pub(crate) kind: ErrorKind
}
/// The different kind of errors that can happen when you use the `ws_stream` API.
//
#[ derive( Debug, Clone, PartialEq, Eq ) ]
//
pub enum ErrorKind
{
/// Invalid input to [WsState::try_from( u16 )](crate::WsState)
//
InvalidWsState
{
/// The user supplied value that is in valid
//
supplied: u16
},
/// When trying to send and [WsState](crate::WsState) is anything but [WsState::Open](crate::WsState::Open) this error is returned. //
ConnectionNotOpen,
/// Browsers will forbid making websocket connections to certain ports. See this [Stack Overflow question](https://stackoverflow.com/questions/4313403/why-do-browsers-block-some-ports/4314070).
//
ForbiddenPort,
/// An invalid URL was given to [WsStream::connect](crate::WsStream::connect), please see:
/// [HTML Living Standard](https://html.spec.whatwg.org/multipage/web-sockets.html#dom-websocket)
//
InvalidUrl
{
/// The user supplied value that is in valid
//
supplied: String
},
/// An invalid close code was given to a close method. For valid close codes, please see:
/// [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes)
//
InvalidCloseCode
{
/// The user supplied value that is in valid
//
supplied: u16
},
/// The reason string given to a close method is longer than 123 bytes, please see:
/// [MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close)
//
ReasonStringToLong,
/// Failed to connect to the server.
//
ConnectionFailed
{
/// The close event that might hold extra code and reason information.
//
event: CloseEvent
},
#[ doc( hidden ) ]
//
__NonExhaustive__
}
impl ErrorTrait for Error {}
impl fmt::Display for ErrorKind
{
fn fmt( &self, f: &mut fmt::Formatter<'_> ) -> fmt::Result
{
match self
{
Self::InvalidWsState{ supplied } =>
write!( f, "Invalid input to conversion to WsReadyState: {}", supplied ),
Self::ConnectionNotOpen => write!( f, "The connection state is not \"Open\"." ),
Self::ForbiddenPort =>
write!( f, "The port to which the connection is being attempted is not allowed." ),
Self::InvalidUrl{ supplied } =>
write!( f, "An invalid URL was given to the connect method: {}", supplied ),
Self::InvalidCloseCode{ supplied } =>
write!( f, "An invalid close code was given to a close method: {}", supplied ),
Self::ReasonStringToLong =>
write!( f, "The reason string given to a close method is to long." ),
Self::ConnectionFailed{ event } =>
write!( f, "Failed to connect to the server. CloseEvent: {:?}", event ),
Self::__NonExhaustive__ => unreachable!(),
}
}
}
impl fmt::Display for Error
{
fn fmt( &self, f: &mut fmt::Formatter<'_> ) -> fmt::Result
{
write!( f, "ws_stream::Error: {}", self.kind )
}
}
impl Error
{
/// Allows matching on the error kind
//
pub fn kind( &self ) -> &ErrorKind
{
&self.kind
}
}
impl From<ErrorKind> for Error
{
fn from( kind: ErrorKind ) -> Error
{
Error { kind }
}
}
|
use ggez;
use ggez::graphics;
use ggez_goodies::scene;
use log::*;
use legion::prelude as legion_p;
use warmy;
use crate::components as c;
use crate::input;
use crate::resources;
use crate::scenes;
use crate::world::World;
use legion::prelude::IntoQuery;
pub struct LevelScene {
done: bool,
kiwi: warmy::Res<resources::Image>,
dispatcher: legion_p::Schedule
}
impl LevelScene {
pub fn new(ctx: &mut ggez::Context, world: &mut World) -> Self {
let done = false;
let kiwi = world
.resources
.get::<resources::Image>(&resources::Key::from_path("/images/kiwi.png"), ctx)
.unwrap();
let mut dispatcher = Self::register_systems();
LevelScene {
done,
kiwi,
dispatcher,
}
}
fn register_systems() -> legion_p::Schedule {
let update_positions = legion_p::SystemBuilder::new("update_positions")
.with_query(<(legion_p::Write<c::Position>, legion_p::Read<c::Motion>)>::query())
.build(|_, mut world, _, query| {
for (mut pos, motion) in query.iter(&mut world) {
pos.0 += motion.velocity;
}
});
let mut system_dispatcher = legion_p::Schedule::builder()
.add_system(update_positions)
.build();
system_dispatcher
}
}
impl scene::Scene<World, input::Event> for LevelScene {
fn update(&mut self, gameworld: &mut World, _ctx: &mut ggez::Context) -> scenes::Switch {
self.dispatcher.execute(&mut gameworld.specs_world);
if self.done {
scene::SceneSwitch::Pop
} else {
scene::SceneSwitch::None
}
}
fn draw(&mut self, gameworld: &mut World, ctx: &mut ggez::Context) -> ggez::GameResult<()> {
// update positions
let mut query = <(legion_p::Read<c::Position>)>::query();
for (mut p) in query.iter(&mut gameworld.specs_world) {
graphics::draw(
ctx,
&(self.kiwi.borrow().0),
graphics::DrawParam::default().dest(p.0),
)?;
}
Ok(())
}
fn name(&self) -> &str {
"LevelScene"
}
fn input(&mut self, gameworld: &mut World, ev: input::Event, _started: bool) {
debug!("Input: {:?}", ev);
if gameworld.input.get_button_pressed(input::Button::Menu) {
self.done = true;
}
}
}
|
use flexi_logger::Logger;
use hdbconnect::{Connection, HdbError, HdbResult};
use log::{debug, error, info};
use serde::Deserialize;
use serde_bytes::ByteBuf;
pub fn connect_string_from_file(s: &'static str) -> HdbResult<String> {
std::fs::read_to_string(s).map_err(|e| HdbError::ConnParams {
source: Box::new(e),
})
}
fn get_authenticated_connection() -> HdbResult<Connection> {
let s = connect_string_from_file("db_access.json")?;
Connection::new(s)
}
pub fn main() {
Logger::try_with_env_or_str("info")
.unwrap()
.start()
.unwrap();
match run() {
Err(e) => {
error!("run() failed with {:?}", e);
std::process::exit(-1);
}
Ok(_) => debug!("run() ended successful"),
}
}
fn run() -> HdbResult<()> {
let mut connection = get_authenticated_connection()?;
deserialize_strings_to_bytes(&mut connection)?;
info!("{} calls to DB were executed", connection.get_call_count()?);
Ok(())
}
fn deserialize_strings_to_bytes(connection: &mut Connection) -> HdbResult<()> {
// prepare the db table
connection.multiple_statements_ignore_err(vec!["drop table TEST_STRINGS"]);
connection.multiple_statements(vec![
"create table TEST_STRINGS (f1 CHAR(10) primary key, f2 NCHAR(10), f3 NVARCHAR(10))",
"insert into TEST_STRINGS (f1, f2, f3) values('Foobar01', 'Foobar02', 'Foobar03')",
])?;
let query = "select f1 || f2 || f3 from TEST_STRINGS";
let result: String = connection.query(query)?.try_into()?;
info!("String: {:?}", result);
let result: ByteBuf = connection.query(query)?.try_into()?;
info!("ByteBuf: {:?}", result);
// wahrscheinlich das gleiche, nur handgemacht:
#[derive(Debug, Deserialize)]
struct VData(#[serde(with = "serde_bytes")] Vec<u8>);
let result: VData = connection.query(query)?.try_into()?;
info!("{:?}", result);
Ok(())
}
|
use juniper::graphql_scalar;
#[graphql_scalar(transparent)]
struct ScalarSpecifiedByUrl;
fn main() {}
|
///! `StandardAlloc` is a general purpose allocator that divides allocations into two major
///! categories: multi-block carriers up to a certain threshold, after which allocations use
///! single-block carriers.
///!
///! Allocations that use multi-block carriers are filled by searching in a balanced
///! binary tree for the first carrier with free blocks of suitable size, then finding the
///! block with the best fit within that carrier.
///!
///! Multi-block carriers are allocated using super-aligned boundaries. Specifically, this is
///! 262144 bytes, or put another way, 64 pages that are 4k large. Since that page size is not
///! guaranteed across platforms, it is not of particular significance. However the purpose of
///! super-alignment is to make it trivial to calculate a pointer to the carrier header given
///! a pointer to a block or data within the bounds of that carrier. It is also a convenient
///! size as allocations of all size classes both fit into the super-aligned size, and can fit
///! multiple blocks in that carrier. For example, the largest size class, 32k, can fit 7
///! blocks of that size, and have room remaining for smaller blocks (carrier and block
///! headers take up some space).
///! Single-block carriers are allocated for any allocation requests above the maximum
///! multi-block size class, also called the "single-block carrier threshold". Currently this
///! is statically set to the size class already mentioned (32k).
///!
///! The primary difference between the carrier types, other than the size of allocations they
///! handle, is that single-block carriers are always freed, where multi-block carriers are
///! retained and reused, the allocator effectively maintaining a cache to more efficiently
///! serve allocations.
///! The allocator starts with a single multi-block carrier, and additional multi-block
///! carriers are allocated as needed when the current carriers are unable to satisfy
///! allocation requests. As stated previously, large allocations always allocate in
///! single-block carriers, but none are allocated up front.
///!
///! NOTE: It will be important in the future to support carrier migration to allocators in
///! other threads to avoid situations where an allocator on one thread is full, so additional
///! carriers are allocated when allocators on other threads have carriers that could have
///! filled the request. See [CarrierMigration.md] in the OTP documentation for information
///! about how that works and the rationale.
use std::cmp;
use std::ptr::{self, NonNull};
use cfg_if::cfg_if;
use lazy_static::lazy_static;
use intrusive_collections::LinkedListLink;
use intrusive_collections::{Bound, UnsafeRef};
use intrusive_collections::{RBTree, RBTreeLink};
use liblumen_core::alloc::mmap;
use liblumen_core::alloc::prelude::*;
use liblumen_core::locks::SpinLock;
use liblumen_core::util::cache_padded::CachePadded;
use crate::carriers::{superalign_down, SUPERALIGNED_CARRIER_SIZE};
use crate::carriers::{MultiBlockCarrier, SingleBlockCarrier};
use crate::carriers::{MultiBlockCarrierTree, SingleBlockCarrierList};
use crate::erts::exception::AllocResult;
use crate::sorted::{SortKey, SortOrder, SortedKeyAdapter};
use crate::AllocatorInfo;
// The global instance of StandardAlloc
cfg_if! {
if #[cfg(feature = "instrument")] {
use crate::StatsAlloc;
lazy_static! {
static ref STD_ALLOC: StatsAlloc<StandardAlloc> = {
StatsAlloc::new(StandardAlloc::new())
};
}
} else {
lazy_static! {
static ref STD_ALLOC: StandardAlloc = StandardAlloc::new();
}
}
}
/// Allocates a new block of memory using the given layout
pub fn allocate(layout: Layout) -> AllocResult<NonNull<[u8]>> {
unsafe { STD_ALLOC.allocate(layout) }
}
/// Deallocates a previously allocated block of memory
pub unsafe fn deallocate(ptr: NonNull<u8>, layout: Layout) {
STD_ALLOC.deallocate(ptr, layout);
}
/// Grows a previously allocated block of memory, in-place if possible
pub unsafe fn grow(
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> AllocResult<NonNull<[u8]>> {
STD_ALLOC.reallocate(ptr, old_layout, new_layout)
}
/// Shrinks a previously allocated block of memory, in-place if possible
pub unsafe fn shrink(
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> AllocResult<NonNull<[u8]>> {
STD_ALLOC.reallocate(ptr, old_layout, new_layout)
}
/// Gets information about the global standard allocator
pub fn alloc_info() -> AllocatorInfo {
STD_ALLOC.info()
}
struct StandardAlloc {
sbc_threshold: usize,
sbc: CachePadded<SpinLock<SingleBlockCarrierList>>,
mbc: CachePadded<SpinLock<MultiBlockCarrierTree>>,
}
impl StandardAlloc {
const MAX_SIZE_CLASS: usize = 32 * 1024;
/// Create a new instance of this allocator
pub fn new() -> Self {
// Allocate a default carrier
// TODO: In the future we may want to do like the BEAM does and
// have a separate struct field for the main carrier, so that allocations
// have a fast path if the main carrier has available space
let main_carrier = unsafe {
create_multi_block_carrier().expect("unable to allocate main multi-block carrier")
};
let mut mbc = RBTree::new(SortedKeyAdapter::new(SortOrder::SizeAddressOrder));
mbc.insert(main_carrier);
Self {
sbc: CachePadded::new(SpinLock::new(SingleBlockCarrierList::default())),
mbc: CachePadded::new(SpinLock::new(mbc)),
sbc_threshold: Self::MAX_SIZE_CLASS,
}
}
/// Gets information about this allocator
pub fn info(&self) -> AllocatorInfo {
let num_mbc = self.count_mbc();
let num_sbc = self.count_sbc();
AllocatorInfo {
num_multi_block_carriers: num_mbc,
num_single_block_carriers: num_sbc,
}
}
// Counts the number of multi-block carriers this allocator holds
fn count_mbc(&self) -> usize {
let mbc = self.mbc.lock();
mbc.iter().count()
}
// Counts the number of single-block carriers this allocator holds
fn count_sbc(&self) -> usize {
let sbc = self.sbc.lock();
sbc.iter().count()
}
unsafe fn allocate(&self, layout: Layout) -> AllocResult<NonNull<[u8]>> {
let size = layout.size();
if size >= self.sbc_threshold {
return self.alloc_large(layout);
}
// From this point onwards, we're working with multi-block carriers
// First, find a carrier large enough to hold the requested allocation
// Ensure allocated region has enough space for carrier header and aligned block
// Start with the first carrier with a usable size of at least `block_size` bytes
let bound = SortKey::new(SortOrder::SizeAddressOrder, size, 0);
let mbc = self.mbc.lock();
let cursor = mbc.lower_bound(Bound::Included(&bound));
// Try each carrier, from smallest to largest, until we find a fit
while let Some(carrier) = cursor.get() {
// In each carrier, try to find a best fit block and allocate it
if let Some(data) = carrier.alloc_block(&layout) {
return Ok(NonNull::slice_from_raw_parts(data, size));
}
}
drop(mbc);
// If we reach this point, no carriers with suitable blocks were available
// Allocate a new carrier of adequate size and use it to satisfy request
//
// Multi-block carriers are currently super-aligned by default, which means
// we always allocate carriers of the same size, and since the super-aligned size
// is always larger than the single-block threshold, new multi-block carriers are
// guaranteed to fulfill the allocation request that caused their creation
let carrier = create_multi_block_carrier()?;
let mut mbc = self.mbc.lock();
mbc.insert(carrier.clone());
drop(mbc);
// Allocate block using newly allocated carrier
// NOTE: It should never be possible for this to fail
let data = carrier
.alloc_block(&layout)
.expect("unexpected block allocation failure");
// Return data pointer
Ok(NonNull::slice_from_raw_parts(data, size))
}
unsafe fn reallocate(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> AllocResult<NonNull<[u8]>> {
let raw = ptr.as_ptr();
let old_size = old_layout.size();
if old_size >= self.sbc_threshold {
// This was a single-block carrier
//
// Even if the new size would fit in a multi-block carrier, we're going
// to keep the allocation in the single-block carrier, to avoid the extra
// complexity, as there is little payoff
return self.realloc_large(ptr, old_layout, new_layout);
}
// From this point onwards, we're working with multi-block carriers
// Locate the owning carrier and try to reallocate using it
let key = SortKey::new(SortOrder::AddressOrder, 0, raw as usize);
let mut mbc = self.mbc.lock();
let cursor = mbc.lower_bound_mut(Bound::Included(&key));
// This cursor should always return the owning carrier,
// if it does not, then either the given pointer was allocated
// using a different allocator, or there is a bug in this implementation
let carrier = cursor.get().expect("realloc called with invalid pointer");
let carrier_ptr = superalign_down(raw as usize) as *const u8;
debug_assert!((carrier as *const _ as *const u8) == carrier_ptr);
let new_size = new_layout.size();
// Attempt reallocation
if let Some(data) = carrier.realloc_block(raw, &old_layout, &new_layout) {
return Ok(NonNull::slice_from_raw_parts(data, new_size));
}
drop(mbc);
// If we reach this point, we have to try allocating a new block and
// copying the data from the old block to the new one
// Allocate new block
let non_null_byte_slice = self.allocate(new_layout)?;
// Copy data from old block into new block
let byte_ptr = non_null_byte_slice.as_mut_ptr();
let copy_size = cmp::min(old_size, new_size);
ptr::copy_nonoverlapping(raw, byte_ptr, copy_size);
// Free old block
self.deallocate(ptr, old_layout);
// Return new data pointer
Ok(non_null_byte_slice)
}
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
let ptr = ptr.as_ptr();
let size = layout.size();
if size >= self.sbc_threshold {
// This block would have to be in a single-block carrier
return self.dealloc_large(ptr);
}
// Multi-block carriers are always super-aligned, and no larger
// than the super-aligned size, so we can find the carrier header
// trivially using the pointer itself
let carrier_ptr = superalign_down(ptr as usize) as *const MultiBlockCarrier<RBTreeLink>;
let carrier = UnsafeRef::from_raw(carrier_ptr);
// TODO: Perform conditional release of memory back to operating system,
// for now, we always free single-block carriers, but never multi-block carriers
let mbc = self.mbc.lock();
carrier.free_block(ptr, layout);
drop(mbc)
}
/// This function handles allocations which exceed the single-block carrier threshold
unsafe fn alloc_large(&self, layout: Layout) -> AllocResult<NonNull<[u8]>> {
// Ensure allocated region has enough space for carrier header and aligned block
let data_layout = layout.clone();
let carrier_layout = Layout::new::<SingleBlockCarrier<LinkedListLink>>();
let (carrier_layout, data_offset) = carrier_layout.extend(data_layout).unwrap();
// Track total size for carrier metadata
let size = carrier_layout.size();
// Allocate region
match mmap::map(carrier_layout) {
Ok(ptr) => {
// Get pointer to carrier header location
let carrier = ptr.as_ptr() as *mut SingleBlockCarrier<LinkedListLink>;
// Write initial carrier header
ptr::write(
carrier,
SingleBlockCarrier {
size,
layout,
link: LinkedListLink::new(),
},
);
// Get pointer to data region in allocated carrier+block
let data = (carrier as *mut u8).add(data_offset);
// Cast carrier pointer to UnsafeRef and add to linked list
// This implicitly mutates the link in the carrier
let carrier = UnsafeRef::from_raw(carrier);
let mut sbc = self.sbc.lock();
sbc.push_front(carrier);
// Return data pointer
let block = NonNull::slice_from_raw_parts(NonNull::new(data).unwrap(), size);
Ok(block)
}
Err(AllocError) => Err(alloc!()),
}
}
unsafe fn realloc_large(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> AllocResult<NonNull<[u8]>> {
// Allocate new carrier
let non_null_byte_slice = self.alloc_large(Layout::from_size_align_unchecked(
new_layout.size(),
new_layout.align(),
))?;
// Copy old data into new carrier
let old_ptr = ptr.as_ptr();
let old_size = old_layout.size();
ptr::copy_nonoverlapping(
old_ptr,
non_null_byte_slice.as_mut_ptr(),
cmp::min(old_size, non_null_byte_slice.len()),
);
// Free old carrier
self.dealloc_large(old_ptr);
// Return new carrier
Ok(non_null_byte_slice)
}
/// This function handles allocations which exceed the single-block carrier threshold
unsafe fn dealloc_large(&self, ptr: *const u8) {
// In the case of single-block carriers,
// we must walk the list until we find the owning carrier
let mut sbc = self.sbc.lock();
let mut cursor = sbc.front_mut();
loop {
let next = cursor.get();
debug_assert!(next.is_some(), "invalid free of carrier");
let carrier = next.unwrap();
if !carrier.owns(ptr) {
cursor.move_next();
continue;
}
let carrier_ptr = carrier as *const _ as *mut u8;
// Calculate the layout of the allocated carrier
// - First, get layout of carrier header
// - Extend the layout with the block layout to get the original layout used in
// `try_alloc`
let (layout, _) = Layout::new::<SingleBlockCarrier<LinkedListLink>>()
.extend(carrier.layout())
.unwrap();
// Unlink the carrier from the linked list
let _ = cursor.remove();
// Release memory for carrier to OS
mmap::unmap(carrier_ptr, layout);
return;
}
}
}
unsafe impl Allocator for StandardAlloc {
#[inline]
fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
unsafe { self.allocate(layout).map_err(|_| AllocError) }
}
#[inline]
unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
self.deallocate(ptr, layout)
}
#[inline]
unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError> {
self.reallocate(ptr, old_layout, new_layout)
.map_err(|_| AllocError)
}
unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError> {
self.grow(ptr, old_layout, new_layout).map(|ptr| {
let old_size = old_layout.size();
let dst = ptr.as_mut_ptr().add(old_size);
let count = new_layout.size() - old_size;
ptr::write_bytes(dst, 0, count);
ptr
})
}
#[inline]
unsafe fn shrink(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout,
) -> Result<NonNull<[u8]>, AllocError> {
self.reallocate(ptr, old_layout, new_layout)
.map_err(|_| AllocError)
}
}
impl Drop for StandardAlloc {
fn drop(&mut self) {
// Drop single-block carriers
let mut sbc = self.sbc.lock();
// We have to dynamically allocate this vec because the only
// other method we have of collecting the pointer/layout combo
// is by using a cursor, and the current API is not flexible enough
// to allow us to walk the tree freeing each element after we've moved
// the cursor past it. Instead we gather all the pointers to clean up
// and do it all at once at the end
//
// NOTE: May be worth exploring a `Drop` impl for the carriers
let mut carriers = sbc
.iter()
.map(|carrier| (carrier as *const _ as *mut _, carrier.layout()))
.collect::<Vec<_>>();
// Prevent the list from trying to drop memory that has now been freed
sbc.fast_clear();
// Actually drop the carriers
for (ptr, layout) in carriers.drain(..) {
unsafe {
mmap::unmap(ptr, layout);
}
}
// Drop multi-block carriers
let mbc_size = SUPERALIGNED_CARRIER_SIZE;
let mbc_layout = unsafe { Layout::from_size_align_unchecked(mbc_size, mbc_size) };
let mut mbc = self.mbc.lock();
let mut carriers = mbc
.iter()
.map(|carrier| (carrier as *const _ as *mut _, mbc_layout.clone()))
.collect::<Vec<_>>();
// Prevent the tree from trying to drop memory that has now been freed
mbc.fast_clear();
for (ptr, layout) in carriers.drain(..) {
unsafe {
mmap::unmap(ptr, layout);
}
}
}
}
unsafe impl Sync for StandardAlloc {}
unsafe impl Send for StandardAlloc {}
/// Creates a new, empty multi-block carrier, unlinked to the allocator
///
/// The carrier is allocated via mmap on supported platforms, or the system
/// allocator otherwise.
///
/// NOTE: You must make sure to add the carrier to the free list of the
/// allocator, or it will not be used, and will not be freed
unsafe fn create_multi_block_carrier() -> AllocResult<UnsafeRef<MultiBlockCarrier<RBTreeLink>>> {
let size = SUPERALIGNED_CARRIER_SIZE;
let carrier_layout = Layout::from_size_align_unchecked(size, size);
// Allocate raw memory for carrier
match mmap::map(carrier_layout) {
Ok(ptr) => {
// Initialize carrier in memory
let carrier = MultiBlockCarrier::init(ptr, size);
// Return an unsafe ref to this carrier back to the caller
Ok(UnsafeRef::from_raw(carrier))
}
Err(AllocError) => Err(alloc!()),
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn std_alloc_small_test() {
let allocator = StandardAlloc::new();
// Allocate an object on the heap
{
let phrase = "just a test";
let len = phrase.bytes().len();
let mut foo = Vec::with_capacity_in(len, &allocator);
unsafe {
ptr::copy_nonoverlapping(phrase.as_ptr(), foo.as_mut_ptr(), len);
}
let phrase_copied = unsafe {
let bytes = core::slice::from_raw_parts(foo.as_mut_ptr(), len);
core::str::from_utf8(bytes).unwrap()
};
assert_eq!(phrase, phrase_copied);
// Drop the allocated vec here to test for panics during deallocation
}
}
#[test]
fn std_alloc_large_test() {
let allocator = StandardAlloc::new();
// Allocate a large object on the heap
{
let mut foo = Vec::with_capacity_in(StandardAlloc::MAX_SIZE_CLASS + 1, &allocator);
let ptr: *mut i32 = foo.as_mut_ptr();
let bytes = unsafe {
ptr.write(100);
core::slice::from_raw_parts(foo.as_mut_ptr(), 1)
};
assert_eq!(&[100], bytes);
// Drop the allocated vec here to test for panics during deallocation
}
}
}
|
//! This module contains the `EvalContext` methods for executing a single step of the interpreter.
//!
//! The main entry point is the `step` method.
use rustc::mir;
use rustc::mir::interpret::EvalResult;
use super::{EvalContext, Machine};
impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M> {
pub fn inc_step_counter_and_detect_loops(&mut self) -> EvalResult<'tcx, ()> {
/// The number of steps between loop detector snapshots.
/// Should be a power of two for performance reasons.
const DETECTOR_SNAPSHOT_PERIOD: isize = 256;
{
let steps = &mut self.steps_since_detector_enabled;
*steps += 1;
if *steps < 0 {
return Ok(());
}
*steps %= DETECTOR_SNAPSHOT_PERIOD;
if *steps != 0 {
return Ok(());
}
}
if self.loop_detector.is_empty() {
// First run of the loop detector
// FIXME(#49980): make this warning a lint
self.tcx.sess.span_warn(self.frame().span,
"Constant evaluating a complex constant, this might take some time");
}
self.loop_detector.observe_and_analyze(&self.machine, &self.stack, &self.memory)
}
/// Returns true as long as there are more things to do.
pub fn step(&mut self) -> EvalResult<'tcx, bool> {
if self.stack.is_empty() {
return Ok(false);
}
let block = self.frame().block;
let stmt_id = self.frame().stmt;
let mir = self.mir();
let basic_block = &mir.basic_blocks()[block];
let old_frames = self.cur_frame();
if let Some(stmt) = basic_block.statements.get(stmt_id) {
assert_eq!(old_frames, self.cur_frame());
self.statement(stmt)?;
return Ok(true);
}
self.inc_step_counter_and_detect_loops()?;
let terminator = basic_block.terminator();
assert_eq!(old_frames, self.cur_frame());
self.terminator(terminator)?;
Ok(true)
}
fn statement(&mut self, stmt: &mir::Statement<'tcx>) -> EvalResult<'tcx> {
trace!("{:?}", stmt);
use rustc::mir::StatementKind::*;
// Some statements (e.g. box) push new stack frames. We have to record the stack frame number
// *before* executing the statement.
let frame_idx = self.cur_frame();
self.tcx.span = stmt.source_info.span;
self.memory.tcx.span = stmt.source_info.span;
match stmt.kind {
Assign(ref place, ref rvalue) => self.eval_rvalue_into_place(rvalue, place)?,
SetDiscriminant {
ref place,
variant_index,
} => {
let dest = self.eval_place(place)?;
let dest_ty = self.place_ty(place);
self.write_discriminant_value(dest_ty, dest, variant_index)?;
}
// Mark locals as alive
StorageLive(local) => {
let old_val = self.storage_live(local)?;
self.deallocate_local(old_val)?;
}
// Mark locals as dead
StorageDead(local) => {
let old_val = self.frame_mut().storage_dead(local);
self.deallocate_local(old_val)?;
}
// No dynamic semantics attached to `ReadForMatch`; MIR
// interpreter is solely intended for borrowck'ed code.
ReadForMatch(..) => {}
// Validity checks.
Validate(op, ref places) => {
for operand in places {
M::validation_op(self, op, operand)?;
}
}
EndRegion(ce) => {
M::end_region(self, Some(ce))?;
}
UserAssertTy(..) => {}
// Defined to do nothing. These are added by optimization passes, to avoid changing the
// size of MIR constantly.
Nop => {}
InlineAsm { .. } => return err!(InlineAsm),
}
self.stack[frame_idx].stmt += 1;
Ok(())
}
fn terminator(&mut self, terminator: &mir::Terminator<'tcx>) -> EvalResult<'tcx> {
trace!("{:?}", terminator.kind);
self.tcx.span = terminator.source_info.span;
self.memory.tcx.span = terminator.source_info.span;
self.eval_terminator(terminator)?;
if !self.stack.is_empty() {
trace!("// {:?}", self.frame().block);
}
Ok(())
}
}
|
// Cates
extern crate chrono;
extern crate time;
// Crate imports
use chrono::{NaiveDate};
const YEAR_OFFSET: i32 = 1900;
pub mod ddate;
/// Enum containing all supported calendars
#[allow(dead_code)]
#[derive(Debug)]
enum Calendar {
Discordian,
}
/// Enum containing all the supported time input formats
#[derive(Debug)]
pub enum InputType {
Iso6801,
UnixTimestamp,
}
/// Parses a string to a date
///
/// Returns a date with astronomicaly numbered years. This means there is a year zero.
pub fn parse_date(raw_date: &String, input_type: InputType) -> NaiveDate {
match input_type {
InputType::UnixTimestamp => {
let timestamp = time::at(time::Timespec{
sec: raw_date.parse().expect("Could not parse timestamp"),
nsec: 0});
NaiveDate::from_yo(timestamp.tm_year + YEAR_OFFSET, timestamp.tm_yday as u32)
},
InputType::Iso6801 => NaiveDate::parse_from_str(raw_date.as_str(), "%Y-%m-%d")
.expect("Could not parse date")
}
}
|
#![feature(no_coverage)]
pub mod arg;
#[derive(Clone, Copy, Default)]
pub struct FuzzerStats {
pub total_number_of_runs: usize,
pub number_of_runs_since_last_reset_time: usize,
pub exec_per_s: usize,
}
#[derive(Clone, Copy)]
pub enum FuzzerEvent {
Start,
Stop,
End,
CrashNoInput,
Pulse,
Done,
Replace(usize, usize),
DidReadCorpus,
CaughtSignal(i32),
TestFailure,
None,
}
|
pub use VkIOSSurfaceCreateFlagsMVK::*;
#[repr(u32)]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum VkIOSSurfaceCreateFlagsMVK {
VK_IOS_SURFACE_CREATE_NULL_BIT = 0,
}
use crate::SetupVkFlags;
#[repr(C)]
#[derive(Clone, Copy, Eq, PartialEq, Hash)]
pub struct VkIOSSurfaceCreateFlagBitsMVK(u32);
SetupVkFlags!(VkIOSSurfaceCreateFlagsMVK, VkIOSSurfaceCreateFlagBitsMVK);
|
use std::cmp::{max, min};
use std::collections::{HashMap, HashSet};
use itertools::Itertools;
use whiteread::parse_line;
const ten97: usize = 1000000007;
fn alphabet2idx(c: char) -> usize {
if c.is_ascii_lowercase() {
c as u8 as usize - 'a' as u8 as usize
} else if c.is_ascii_uppercase() {
c as u8 as usize - 'A' as u8 as usize
} else {
panic!("wtf")
}
}
fn main() {
let n: usize = parse_line().unwrap();
let mut hm: HashSet<String> = HashSet::new();
for i in 0..n {
if hm.insert(parse_line().unwrap()) {
println!("{}", i + 1);
}
}
}
|
fn main() {
yew::start_app::<todomvc_std_web::Model>();
}
|
fn naive(n: i64, k: i64) -> i64 {
let mut res = 0;
for a in 1..=n {
for b in 1..=n {
for c in 1..=n {
for d in 1..=n {
if a + b - (c + d) == k {
res += 1;
}
}
}
}
}
res
}
fn main() {
let stdin = std::io::stdin();
let mut rd = ProconReader::new(stdin.lock());
let n: i64 = rd.get();
let k: i64 = rd.get();
// println!("{}", naive(n, k));
let n = n as usize;
let mut num = vec![0; n * 2 + 1];
for i in 2..=(n * 2) {
if i <= n + 1 {
num[i] = num[i - 1] + 1;
} else {
num[i] = num[i - 1] - 1;
}
}
let mut ans: u64 = 0;
for ab in 2..=(n * 2) {
let cd = ab as i64 - k;
if 2 <= cd && cd <= (n * 2) as i64 {
ans += num[ab] * num[cd as usize];
}
}
// println!("{:?}", num);
// println!("{}", naive(n as i64, k));
println!("{}", ans);
}
pub struct ProconReader<R: std::io::Read> {
reader: R,
}
impl<R: std::io::Read> ProconReader<R> {
pub fn new(reader: R) -> Self {
Self { reader }
}
pub fn get<T: std::str::FromStr>(&mut self) -> T {
use std::io::Read;
let buf = self
.reader
.by_ref()
.bytes()
.map(|b| b.unwrap())
.skip_while(|&byte| byte == b' ' || byte == b'\n' || byte == b'\r')
.take_while(|&byte| byte != b' ' && byte != b'\n' && byte != b'\r')
.collect::<Vec<_>>();
std::str::from_utf8(&buf)
.unwrap()
.parse()
.ok()
.expect("Parse Error.")
}
}
|
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! Codegen the completed AST to the LLVM IR.
//!
//! Some functions here, such as codegen_block and codegen_expr, return a value --
//! the result of the codegen to LLVM -- while others, such as codegen_fn
//! and mono_item, are called only for the side effect of adding a
//! particular definition to the LLVM IR output we're producing.
//!
//! Hopefully useful general knowledge about codegen:
//!
//! * There's no way to find out the Ty type of a Value. Doing so
//! would be "trying to get the eggs out of an omelette" (credit:
//! pcwalton). You can, instead, find out its llvm::Type by calling val_ty,
//! but one llvm::Type corresponds to many `Ty`s; for instance, tup(int, int,
//! int) and rec(x=int, y=int, z=int) will have the same llvm::Type.
use super::ModuleLlvm;
use super::ModuleSource;
use super::ModuleCodegen;
use super::ModuleKind;
use abi;
use back::link;
use back::write::{self, OngoingCodegen};
use llvm::{self, TypeKind, get_param};
use metadata;
use rustc::hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use rustc::middle::lang_items::StartFnLangItem;
use rustc::middle::weak_lang_items;
use rustc::mir::mono::{Linkage, Visibility, Stats};
use rustc::middle::cstore::{EncodedMetadata};
use rustc::ty::{self, Ty, TyCtxt};
use rustc::ty::layout::{self, Align, TyLayout, LayoutOf};
use rustc::ty::query::Providers;
use rustc::dep_graph::{DepNode, DepConstructor};
use rustc::middle::cstore::{self, LinkMeta, LinkagePreference};
use rustc::middle::exported_symbols;
use rustc::util::common::{time, print_time_passes_entry};
use rustc::util::profiling::ProfileCategory;
use rustc::session::config::{self, DebugInfo, EntryFnType};
use rustc::session::Session;
use rustc_incremental;
use allocator;
use mir::place::PlaceRef;
use attributes;
use builder::{Builder, MemFlags};
use callee;
use common::{C_bool, C_bytes_in_context, C_i32, C_usize};
use rustc_mir::monomorphize::collector::{self, MonoItemCollectionMode};
use rustc_mir::monomorphize::item::DefPathBasedNames;
use common::{self, C_struct_in_context, C_array, val_ty};
use consts;
use context::CodegenCx;
use debuginfo;
use declare;
use meth;
use mir;
use monomorphize::Instance;
use monomorphize::partitioning::{self, PartitioningStrategy, CodegenUnit, CodegenUnitExt};
use rustc_codegen_utils::symbol_names_test;
use time_graph;
use mono_item::{MonoItem, BaseMonoItemExt, MonoItemExt};
use type_::Type;
use type_of::LayoutLlvmExt;
use rustc::util::nodemap::{FxHashMap, FxHashSet, DefIdSet};
use CrateInfo;
use rustc_data_structures::small_c_str::SmallCStr;
use rustc_data_structures::sync::Lrc;
use std::any::Any;
use std::ffi::CString;
use std::sync::Arc;
use std::time::{Instant, Duration};
use std::i32;
use std::cmp;
use std::sync::mpsc;
use syntax_pos::Span;
use syntax_pos::symbol::InternedString;
use syntax::attr;
use rustc::hir::{self, CodegenFnAttrs};
use value::Value;
use mir::operand::OperandValue;
use rustc_codegen_utils::check_for_rustc_errors_attr;
pub struct StatRecorder<'a, 'll: 'a, 'tcx: 'll> {
cx: &'a CodegenCx<'ll, 'tcx>,
name: Option<String>,
istart: usize,
}
impl StatRecorder<'a, 'll, 'tcx> {
pub fn new(cx: &'a CodegenCx<'ll, 'tcx>, name: String) -> Self {
let istart = cx.stats.borrow().n_llvm_insns;
StatRecorder {
cx,
name: Some(name),
istart,
}
}
}
impl Drop for StatRecorder<'a, 'll, 'tcx> {
fn drop(&mut self) {
if self.cx.sess().codegen_stats() {
let mut stats = self.cx.stats.borrow_mut();
let iend = stats.n_llvm_insns;
stats.fn_stats.push((self.name.take().unwrap(), iend - self.istart));
stats.n_fns += 1;
// Reset LLVM insn count to avoid compound costs.
stats.n_llvm_insns = self.istart;
}
}
}
pub fn bin_op_to_icmp_predicate(op: hir::BinOpKind,
signed: bool)
-> llvm::IntPredicate {
match op {
hir::BinOpKind::Eq => llvm::IntEQ,
hir::BinOpKind::Ne => llvm::IntNE,
hir::BinOpKind::Lt => if signed { llvm::IntSLT } else { llvm::IntULT },
hir::BinOpKind::Le => if signed { llvm::IntSLE } else { llvm::IntULE },
hir::BinOpKind::Gt => if signed { llvm::IntSGT } else { llvm::IntUGT },
hir::BinOpKind::Ge => if signed { llvm::IntSGE } else { llvm::IntUGE },
op => {
bug!("comparison_op_to_icmp_predicate: expected comparison operator, \
found {:?}",
op)
}
}
}
pub fn bin_op_to_fcmp_predicate(op: hir::BinOpKind) -> llvm::RealPredicate {
match op {
hir::BinOpKind::Eq => llvm::RealOEQ,
hir::BinOpKind::Ne => llvm::RealUNE,
hir::BinOpKind::Lt => llvm::RealOLT,
hir::BinOpKind::Le => llvm::RealOLE,
hir::BinOpKind::Gt => llvm::RealOGT,
hir::BinOpKind::Ge => llvm::RealOGE,
op => {
bug!("comparison_op_to_fcmp_predicate: expected comparison operator, \
found {:?}",
op);
}
}
}
pub fn compare_simd_types(
bx: &Builder<'a, 'll, 'tcx>,
lhs: &'ll Value,
rhs: &'ll Value,
t: Ty<'tcx>,
ret_ty: &'ll Type,
op: hir::BinOpKind
) -> &'ll Value {
let signed = match t.sty {
ty::TyFloat(_) => {
let cmp = bin_op_to_fcmp_predicate(op);
return bx.sext(bx.fcmp(cmp, lhs, rhs), ret_ty);
},
ty::TyUint(_) => false,
ty::TyInt(_) => true,
_ => bug!("compare_simd_types: invalid SIMD type"),
};
let cmp = bin_op_to_icmp_predicate(op, signed);
// LLVM outputs an `< size x i1 >`, so we need to perform a sign extension
// to get the correctly sized type. This will compile to a single instruction
// once the IR is converted to assembly if the SIMD instruction is supported
// by the target architecture.
bx.sext(bx.icmp(cmp, lhs, rhs), ret_ty)
}
/// Retrieve the information we are losing (making dynamic) in an unsizing
/// adjustment.
///
/// The `old_info` argument is a bit funny. It is intended for use
/// in an upcast, where the new vtable for an object will be derived
/// from the old one.
pub fn unsized_info(
cx: &CodegenCx<'ll, 'tcx>,
source: Ty<'tcx>,
target: Ty<'tcx>,
old_info: Option<&'ll Value>,
) -> &'ll Value {
let (source, target) = cx.tcx.struct_lockstep_tails(source, target);
match (&source.sty, &target.sty) {
(&ty::TyArray(_, len), &ty::TySlice(_)) => {
C_usize(cx, len.unwrap_usize(cx.tcx))
}
(&ty::TyDynamic(..), &ty::TyDynamic(..)) => {
// For now, upcasts are limited to changes in marker
// traits, and hence never actually require an actual
// change to the vtable.
old_info.expect("unsized_info: missing old info for trait upcast")
}
(_, &ty::TyDynamic(ref data, ..)) => {
let vtable_ptr = cx.layout_of(cx.tcx.mk_mut_ptr(target))
.field(cx, abi::FAT_PTR_EXTRA);
consts::ptrcast(meth::get_vtable(cx, source, data.principal()),
vtable_ptr.llvm_type(cx))
}
_ => bug!("unsized_info: invalid unsizing {:?} -> {:?}",
source,
target),
}
}
/// Coerce `src` to `dst_ty`. `src_ty` must be a thin pointer.
pub fn unsize_thin_ptr(
bx: &Builder<'a, 'll, 'tcx>,
src: &'ll Value,
src_ty: Ty<'tcx>,
dst_ty: Ty<'tcx>
) -> (&'ll Value, &'ll Value) {
debug!("unsize_thin_ptr: {:?} => {:?}", src_ty, dst_ty);
match (&src_ty.sty, &dst_ty.sty) {
(&ty::TyRef(_, a, _),
&ty::TyRef(_, b, _)) |
(&ty::TyRef(_, a, _),
&ty::TyRawPtr(ty::TypeAndMut { ty: b, .. })) |
(&ty::TyRawPtr(ty::TypeAndMut { ty: a, .. }),
&ty::TyRawPtr(ty::TypeAndMut { ty: b, .. })) => {
assert!(bx.cx.type_is_sized(a));
let ptr_ty = bx.cx.layout_of(b).llvm_type(bx.cx).ptr_to();
(bx.pointercast(src, ptr_ty), unsized_info(bx.cx, a, b, None))
}
(&ty::TyAdt(def_a, _), &ty::TyAdt(def_b, _)) if def_a.is_box() && def_b.is_box() => {
let (a, b) = (src_ty.boxed_ty(), dst_ty.boxed_ty());
assert!(bx.cx.type_is_sized(a));
let ptr_ty = bx.cx.layout_of(b).llvm_type(bx.cx).ptr_to();
(bx.pointercast(src, ptr_ty), unsized_info(bx.cx, a, b, None))
}
(&ty::TyAdt(def_a, _), &ty::TyAdt(def_b, _)) => {
assert_eq!(def_a, def_b);
let src_layout = bx.cx.layout_of(src_ty);
let dst_layout = bx.cx.layout_of(dst_ty);
let mut result = None;
for i in 0..src_layout.fields.count() {
let src_f = src_layout.field(bx.cx, i);
assert_eq!(src_layout.fields.offset(i).bytes(), 0);
assert_eq!(dst_layout.fields.offset(i).bytes(), 0);
if src_f.is_zst() {
continue;
}
assert_eq!(src_layout.size, src_f.size);
let dst_f = dst_layout.field(bx.cx, i);
assert_ne!(src_f.ty, dst_f.ty);
assert_eq!(result, None);
result = Some(unsize_thin_ptr(bx, src, src_f.ty, dst_f.ty));
}
let (lldata, llextra) = result.unwrap();
// HACK(eddyb) have to bitcast pointers until LLVM removes pointee types.
(bx.bitcast(lldata, dst_layout.scalar_pair_element_llvm_type(bx.cx, 0, true)),
bx.bitcast(llextra, dst_layout.scalar_pair_element_llvm_type(bx.cx, 1, true)))
}
_ => bug!("unsize_thin_ptr: called on bad types"),
}
}
/// Coerce `src`, which is a reference to a value of type `src_ty`,
/// to a value of type `dst_ty` and store the result in `dst`
pub fn coerce_unsized_into(
bx: &Builder<'a, 'll, 'tcx>,
src: PlaceRef<'ll, 'tcx>,
dst: PlaceRef<'ll, 'tcx>
) {
let src_ty = src.layout.ty;
let dst_ty = dst.layout.ty;
let coerce_ptr = || {
let (base, info) = match src.load(bx).val {
OperandValue::Pair(base, info) => {
// fat-ptr to fat-ptr unsize preserves the vtable
// i.e. &'a fmt::Debug+Send => &'a fmt::Debug
// So we need to pointercast the base to ensure
// the types match up.
let thin_ptr = dst.layout.field(bx.cx, abi::FAT_PTR_ADDR);
(bx.pointercast(base, thin_ptr.llvm_type(bx.cx)), info)
}
OperandValue::Immediate(base) => {
unsize_thin_ptr(bx, base, src_ty, dst_ty)
}
OperandValue::Ref(..) => bug!()
};
OperandValue::Pair(base, info).store(bx, dst);
};
match (&src_ty.sty, &dst_ty.sty) {
(&ty::TyRef(..), &ty::TyRef(..)) |
(&ty::TyRef(..), &ty::TyRawPtr(..)) |
(&ty::TyRawPtr(..), &ty::TyRawPtr(..)) => {
coerce_ptr()
}
(&ty::TyAdt(def_a, _), &ty::TyAdt(def_b, _)) if def_a.is_box() && def_b.is_box() => {
coerce_ptr()
}
(&ty::TyAdt(def_a, _), &ty::TyAdt(def_b, _)) => {
assert_eq!(def_a, def_b);
for i in 0..def_a.variants[0].fields.len() {
let src_f = src.project_field(bx, i);
let dst_f = dst.project_field(bx, i);
if dst_f.layout.is_zst() {
continue;
}
if src_f.layout.ty == dst_f.layout.ty {
memcpy_ty(bx, dst_f.llval, src_f.llval, src_f.layout,
src_f.align.min(dst_f.align), MemFlags::empty());
} else {
coerce_unsized_into(bx, src_f, dst_f);
}
}
}
_ => bug!("coerce_unsized_into: invalid coercion {:?} -> {:?}",
src_ty,
dst_ty),
}
}
pub fn cast_shift_expr_rhs(
cx: &Builder<'_, 'll, '_>, op: hir::BinOpKind, lhs: &'ll Value, rhs: &'ll Value
) -> &'ll Value {
cast_shift_rhs(op, lhs, rhs, |a, b| cx.trunc(a, b), |a, b| cx.zext(a, b))
}
fn cast_shift_rhs<'ll, F, G>(op: hir::BinOpKind,
lhs: &'ll Value,
rhs: &'ll Value,
trunc: F,
zext: G)
-> &'ll Value
where F: FnOnce(&'ll Value, &'ll Type) -> &'ll Value,
G: FnOnce(&'ll Value, &'ll Type) -> &'ll Value
{
// Shifts may have any size int on the rhs
if op.is_shift() {
let mut rhs_llty = val_ty(rhs);
let mut lhs_llty = val_ty(lhs);
if rhs_llty.kind() == TypeKind::Vector {
rhs_llty = rhs_llty.element_type()
}
if lhs_llty.kind() == TypeKind::Vector {
lhs_llty = lhs_llty.element_type()
}
let rhs_sz = rhs_llty.int_width();
let lhs_sz = lhs_llty.int_width();
if lhs_sz < rhs_sz {
trunc(rhs, lhs_llty)
} else if lhs_sz > rhs_sz {
// FIXME (#1877: If shifting by negative
// values becomes not undefined then this is wrong.
zext(rhs, lhs_llty)
} else {
rhs
}
} else {
rhs
}
}
/// Returns whether this session's target will use SEH-based unwinding.
///
/// This is only true for MSVC targets, and even then the 64-bit MSVC target
/// currently uses SEH-ish unwinding with DWARF info tables to the side (same as
/// 64-bit MinGW) instead of "full SEH".
pub fn wants_msvc_seh(sess: &Session) -> bool {
sess.target.target.options.is_like_msvc
}
pub fn call_assume(bx: &Builder<'_, 'll, '_>, val: &'ll Value) {
let assume_intrinsic = bx.cx.get_intrinsic("llvm.assume");
bx.call(assume_intrinsic, &[val], None);
}
pub fn from_immediate(bx: &Builder<'_, 'll, '_>, val: &'ll Value) -> &'ll Value {
if val_ty(val) == Type::i1(bx.cx) {
bx.zext(val, Type::i8(bx.cx))
} else {
val
}
}
pub fn to_immediate(
bx: &Builder<'_, 'll, '_>,
val: &'ll Value,
layout: layout::TyLayout,
) -> &'ll Value {
if let layout::Abi::Scalar(ref scalar) = layout.abi {
return to_immediate_scalar(bx, val, scalar);
}
val
}
pub fn to_immediate_scalar(
bx: &Builder<'_, 'll, '_>,
val: &'ll Value,
scalar: &layout::Scalar,
) -> &'ll Value {
if scalar.is_bool() {
return bx.trunc(val, Type::i1(bx.cx));
}
val
}
pub fn call_memcpy(
bx: &Builder<'_, 'll, '_>,
dst: &'ll Value,
src: &'ll Value,
n_bytes: &'ll Value,
align: Align,
flags: MemFlags,
) {
if flags.contains(MemFlags::NONTEMPORAL) {
// HACK(nox): This is inefficient but there is no nontemporal memcpy.
let val = bx.load(src, align);
let ptr = bx.pointercast(dst, val_ty(val).ptr_to());
bx.store_with_flags(val, ptr, align, flags);
return;
}
let cx = bx.cx;
let ptr_width = &cx.sess().target.target.target_pointer_width;
let key = format!("llvm.memcpy.p0i8.p0i8.i{}", ptr_width);
let memcpy = cx.get_intrinsic(&key);
let src_ptr = bx.pointercast(src, Type::i8p(cx));
let dst_ptr = bx.pointercast(dst, Type::i8p(cx));
let size = bx.intcast(n_bytes, cx.isize_ty, false);
let align = C_i32(cx, align.abi() as i32);
let volatile = C_bool(cx, flags.contains(MemFlags::VOLATILE));
bx.call(memcpy, &[dst_ptr, src_ptr, size, align, volatile], None);
}
pub fn memcpy_ty(
bx: &Builder<'_, 'll, 'tcx>,
dst: &'ll Value,
src: &'ll Value,
layout: TyLayout<'tcx>,
align: Align,
flags: MemFlags,
) {
let size = layout.size.bytes();
if size == 0 {
return;
}
call_memcpy(bx, dst, src, C_usize(bx.cx, size), align, flags);
}
pub fn call_memset(
bx: &Builder<'_, 'll, '_>,
ptr: &'ll Value,
fill_byte: &'ll Value,
size: &'ll Value,
align: &'ll Value,
volatile: bool,
) -> &'ll Value {
let ptr_width = &bx.cx.sess().target.target.target_pointer_width;
let intrinsic_key = format!("llvm.memset.p0i8.i{}", ptr_width);
let llintrinsicfn = bx.cx.get_intrinsic(&intrinsic_key);
let volatile = C_bool(bx.cx, volatile);
bx.call(llintrinsicfn, &[ptr, fill_byte, size, align, volatile], None)
}
pub fn codegen_instance<'a, 'tcx>(cx: &CodegenCx<'a, 'tcx>, instance: Instance<'tcx>) {
let _s = if cx.sess().codegen_stats() {
let mut instance_name = String::new();
DefPathBasedNames::new(cx.tcx, true, true)
.push_def_path(instance.def_id(), &mut instance_name);
Some(StatRecorder::new(cx, instance_name))
} else {
None
};
// this is an info! to allow collecting monomorphization statistics
// and to allow finding the last function before LLVM aborts from
// release builds.
info!("codegen_instance({})", instance);
let fn_ty = instance.ty(cx.tcx);
let sig = common::ty_fn_sig(cx, fn_ty);
let sig = cx.tcx.normalize_erasing_late_bound_regions(ty::ParamEnv::reveal_all(), &sig);
let lldecl = match cx.instances.borrow().get(&instance) {
Some(&val) => val,
None => bug!("Instance `{:?}` not already declared", instance)
};
cx.stats.borrow_mut().n_closures += 1;
// The `uwtable` attribute according to LLVM is:
//
// This attribute indicates that the ABI being targeted requires that an
// unwind table entry be produced for this function even if we can show
// that no exceptions passes by it. This is normally the case for the
// ELF x86-64 abi, but it can be disabled for some compilation units.
//
// Typically when we're compiling with `-C panic=abort` (which implies this
// `no_landing_pads` check) we don't need `uwtable` because we can't
// generate any exceptions! On Windows, however, exceptions include other
// events such as illegal instructions, segfaults, etc. This means that on
// Windows we end up still needing the `uwtable` attribute even if the `-C
// panic=abort` flag is passed.
//
// You can also find more info on why Windows is whitelisted here in:
// https://bugzilla.mozilla.org/show_bug.cgi?id=1302078
if !cx.sess().no_landing_pads() ||
cx.sess().target.target.options.requires_uwtable {
attributes::emit_uwtable(lldecl, true);
}
let mir = cx.tcx.instance_mir(instance.def);
mir::codegen_mir(cx, lldecl, &mir, instance, sig);
}
pub fn set_link_section(llval: &Value, attrs: &CodegenFnAttrs) {
let sect = match attrs.link_section {
Some(name) => name,
None => return,
};
unsafe {
let buf = SmallCStr::new(§.as_str());
llvm::LLVMSetSection(llval, buf.as_ptr());
}
}
/// Create the `main` function which will initialize the rust runtime and call
/// users main function.
fn maybe_create_entry_wrapper(cx: &CodegenCx) {
let (main_def_id, span) = match *cx.sess().entry_fn.borrow() {
Some((id, span, _)) => {
(cx.tcx.hir.local_def_id(id), span)
}
None => return,
};
let instance = Instance::mono(cx.tcx, main_def_id);
if !cx.codegen_unit.contains_item(&MonoItem::Fn(instance)) {
// We want to create the wrapper in the same codegen unit as Rust's main
// function.
return;
}
let main_llfn = callee::get_fn(cx, instance);
let et = cx.sess().entry_fn.get().map(|e| e.2);
match et {
Some(EntryFnType::Main) => create_entry_fn(cx, span, main_llfn, main_def_id, true),
Some(EntryFnType::Start) => create_entry_fn(cx, span, main_llfn, main_def_id, false),
None => {} // Do nothing.
}
fn create_entry_fn(
cx: &CodegenCx<'ll, '_>,
sp: Span,
rust_main: &'ll Value,
rust_main_def_id: DefId,
use_start_lang_item: bool,
) {
let llfty = Type::func(&[Type::c_int(cx), Type::i8p(cx).ptr_to()], Type::c_int(cx));
let main_ret_ty = cx.tcx.fn_sig(rust_main_def_id).output();
// Given that `main()` has no arguments,
// then its return type cannot have
// late-bound regions, since late-bound
// regions must appear in the argument
// listing.
let main_ret_ty = cx.tcx.erase_regions(
&main_ret_ty.no_late_bound_regions().unwrap(),
);
if declare::get_defined_value(cx, "main").is_some() {
// FIXME: We should be smart and show a better diagnostic here.
cx.sess().struct_span_err(sp, "entry symbol `main` defined multiple times")
.help("did you use #[no_mangle] on `fn main`? Use #[start] instead")
.emit();
cx.sess().abort_if_errors();
bug!();
}
let llfn = declare::declare_cfn(cx, "main", llfty);
// `main` should respect same config for frame pointer elimination as rest of code
attributes::set_frame_pointer_elimination(cx, llfn);
attributes::apply_target_cpu_attr(cx, llfn);
let bx = Builder::new_block(cx, llfn, "top");
debuginfo::gdb::insert_reference_to_gdb_debug_scripts_section_global(&bx);
// Params from native main() used as args for rust start function
let param_argc = get_param(llfn, 0);
let param_argv = get_param(llfn, 1);
let arg_argc = bx.intcast(param_argc, cx.isize_ty, true);
let arg_argv = param_argv;
let (start_fn, args) = if use_start_lang_item {
let start_def_id = cx.tcx.require_lang_item(StartFnLangItem);
let start_fn = callee::resolve_and_get_fn(
cx,
start_def_id,
cx.tcx.intern_substs(&[main_ret_ty.into()]),
);
(start_fn, vec![bx.pointercast(rust_main, Type::i8p(cx).ptr_to()),
arg_argc, arg_argv])
} else {
debug!("using user-defined start fn");
(rust_main, vec![arg_argc, arg_argv])
};
let result = bx.call(start_fn, &args, None);
bx.ret(bx.intcast(result, Type::c_int(cx), true));
}
}
fn write_metadata<'a, 'gcx>(tcx: TyCtxt<'a, 'gcx, 'gcx>,
llvm_module: &ModuleLlvm,
link_meta: &LinkMeta)
-> EncodedMetadata {
use std::io::Write;
use flate2::Compression;
use flate2::write::DeflateEncoder;
let (metadata_llcx, metadata_llmod) = (&*llvm_module.llcx, llvm_module.llmod());
#[derive(PartialEq, Eq, PartialOrd, Ord)]
enum MetadataKind {
None,
Uncompressed,
Compressed
}
let kind = tcx.sess.crate_types.borrow().iter().map(|ty| {
match *ty {
config::CrateType::Executable |
config::CrateType::Staticlib |
config::CrateType::Cdylib => MetadataKind::None,
config::CrateType::Rlib => MetadataKind::Uncompressed,
config::CrateType::Dylib |
config::CrateType::ProcMacro => MetadataKind::Compressed,
}
}).max().unwrap_or(MetadataKind::None);
if kind == MetadataKind::None {
return EncodedMetadata::new();
}
let metadata = tcx.encode_metadata(link_meta);
if kind == MetadataKind::Uncompressed {
return metadata;
}
assert!(kind == MetadataKind::Compressed);
let mut compressed = tcx.metadata_encoding_version();
DeflateEncoder::new(&mut compressed, Compression::fast())
.write_all(&metadata.raw_data).unwrap();
let llmeta = C_bytes_in_context(metadata_llcx, &compressed);
let llconst = C_struct_in_context(metadata_llcx, &[llmeta], false);
let name = exported_symbols::metadata_symbol_name(tcx);
let buf = CString::new(name).unwrap();
let llglobal = unsafe {
llvm::LLVMAddGlobal(metadata_llmod, val_ty(llconst), buf.as_ptr())
};
unsafe {
llvm::LLVMSetInitializer(llglobal, llconst);
let section_name = metadata::metadata_section_name(&tcx.sess.target.target);
let name = SmallCStr::new(section_name);
llvm::LLVMSetSection(llglobal, name.as_ptr());
// Also generate a .section directive to force no
// flags, at least for ELF outputs, so that the
// metadata doesn't get loaded into memory.
let directive = format!(".section {}", section_name);
let directive = CString::new(directive).unwrap();
llvm::LLVMSetModuleInlineAsm(metadata_llmod, directive.as_ptr())
}
return metadata;
}
pub struct ValueIter<'ll> {
cur: Option<&'ll Value>,
step: unsafe extern "C" fn(&'ll Value) -> Option<&'ll Value>,
}
impl Iterator for ValueIter<'ll> {
type Item = &'ll Value;
fn next(&mut self) -> Option<&'ll Value> {
let old = self.cur;
if let Some(old) = old {
self.cur = unsafe { (self.step)(old) };
}
old
}
}
pub fn iter_globals(llmod: &'ll llvm::Module) -> ValueIter<'ll> {
unsafe {
ValueIter {
cur: llvm::LLVMGetFirstGlobal(llmod),
step: llvm::LLVMGetNextGlobal,
}
}
}
pub fn codegen_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
rx: mpsc::Receiver<Box<dyn Any + Send>>)
-> OngoingCodegen {
check_for_rustc_errors_attr(tcx);
if let Some(true) = tcx.sess.opts.debugging_opts.thinlto {
if unsafe { !llvm::LLVMRustThinLTOAvailable() } {
tcx.sess.fatal("this compiler's LLVM does not support ThinLTO");
}
}
if (tcx.sess.opts.debugging_opts.pgo_gen.is_some() ||
!tcx.sess.opts.debugging_opts.pgo_use.is_empty()) &&
unsafe { !llvm::LLVMRustPGOAvailable() }
{
tcx.sess.fatal("this compiler's LLVM does not support PGO");
}
let crate_hash = tcx.crate_hash(LOCAL_CRATE);
let link_meta = link::build_link_meta(crate_hash);
// Codegen the metadata.
tcx.sess.profiler(|p| p.start_activity(ProfileCategory::Codegen));
let llmod_id = "metadata";
let metadata_llvm_module = ModuleLlvm::new(tcx.sess, llmod_id);
let metadata = time(tcx.sess, "write metadata", || {
write_metadata(tcx, &metadata_llvm_module, &link_meta)
});
tcx.sess.profiler(|p| p.end_activity(ProfileCategory::Codegen));
let metadata_module = ModuleCodegen {
name: link::METADATA_MODULE_NAME.to_string(),
llmod_id: llmod_id.to_string(),
source: ModuleSource::Codegened(metadata_llvm_module),
kind: ModuleKind::Metadata,
};
let time_graph = if tcx.sess.opts.debugging_opts.codegen_time_graph {
Some(time_graph::TimeGraph::new())
} else {
None
};
// Skip crate items and just output metadata in -Z no-codegen mode.
if tcx.sess.opts.debugging_opts.no_codegen ||
!tcx.sess.opts.output_types.should_codegen() {
let ongoing_codegen = write::start_async_codegen(
tcx,
time_graph.clone(),
link_meta,
metadata,
rx,
1);
ongoing_codegen.submit_pre_codegened_module_to_llvm(tcx, metadata_module);
ongoing_codegen.codegen_finished(tcx);
assert_and_save_dep_graph(tcx);
ongoing_codegen.check_for_errors(tcx.sess);
return ongoing_codegen;
}
// Run the monomorphization collector and partition the collected items into
// codegen units.
let codegen_units =
tcx.collect_and_partition_mono_items(LOCAL_CRATE).1;
let codegen_units = (*codegen_units).clone();
// Force all codegen_unit queries so they are already either red or green
// when compile_codegen_unit accesses them. We are not able to re-execute
// the codegen_unit query from just the DepNode, so an unknown color would
// lead to having to re-execute compile_codegen_unit, possibly
// unnecessarily.
if tcx.dep_graph.is_fully_enabled() {
for cgu in &codegen_units {
tcx.codegen_unit(cgu.name().clone());
}
}
let ongoing_codegen = write::start_async_codegen(
tcx,
time_graph.clone(),
link_meta,
metadata,
rx,
codegen_units.len());
// Codegen an allocator shim, if necessary.
//
// If the crate doesn't have an `allocator_kind` set then there's definitely
// no shim to generate. Otherwise we also check our dependency graph for all
// our output crate types. If anything there looks like its a `Dynamic`
// linkage, then it's already got an allocator shim and we'll be using that
// one instead. If nothing exists then it's our job to generate the
// allocator!
let any_dynamic_crate = tcx.sess.dependency_formats.borrow()
.iter()
.any(|(_, list)| {
use rustc::middle::dependency_format::Linkage;
list.iter().any(|linkage| {
match linkage {
Linkage::Dynamic => true,
_ => false,
}
})
});
let allocator_module = if any_dynamic_crate {
None
} else if let Some(kind) = *tcx.sess.allocator_kind.get() {
unsafe {
let llmod_id = "allocator";
let modules = ModuleLlvm::new(tcx.sess, llmod_id);
time(tcx.sess, "write allocator module", || {
allocator::codegen(tcx, &modules, kind)
});
Some(ModuleCodegen {
name: link::ALLOCATOR_MODULE_NAME.to_string(),
llmod_id: llmod_id.to_string(),
source: ModuleSource::Codegened(modules),
kind: ModuleKind::Allocator,
})
}
} else {
None
};
if let Some(allocator_module) = allocator_module {
ongoing_codegen.submit_pre_codegened_module_to_llvm(tcx, allocator_module);
}
ongoing_codegen.submit_pre_codegened_module_to_llvm(tcx, metadata_module);
// We sort the codegen units by size. This way we can schedule work for LLVM
// a bit more efficiently.
let codegen_units = {
let mut codegen_units = codegen_units;
codegen_units.sort_by_cached_key(|cgu| cmp::Reverse(cgu.size_estimate()));
codegen_units
};
let mut total_codegen_time = Duration::new(0, 0);
let mut all_stats = Stats::default();
for cgu in codegen_units.into_iter() {
ongoing_codegen.wait_for_signal_to_codegen_item();
ongoing_codegen.check_for_errors(tcx.sess);
// First, if incremental compilation is enabled, we try to re-use the
// codegen unit from the cache.
if tcx.dep_graph.is_fully_enabled() {
let cgu_id = cgu.work_product_id();
// Check whether there is a previous work-product we can
// re-use. Not only must the file exist, and the inputs not
// be dirty, but the hash of the symbols we will generate must
// be the same.
if let Some(buf) = tcx.dep_graph.previous_work_product(&cgu_id) {
let dep_node = &DepNode::new(tcx,
DepConstructor::CompileCodegenUnit(cgu.name().clone()));
// We try to mark the DepNode::CompileCodegenUnit green. If we
// succeed it means that none of the dependencies has changed
// and we can safely re-use.
if let Some(dep_node_index) = tcx.dep_graph.try_mark_green(tcx, dep_node) {
// Append ".rs" to LLVM module identifier.
//
// LLVM code generator emits a ".file filename" directive
// for ELF backends. Value of the "filename" is set as the
// LLVM module identifier. Due to a LLVM MC bug[1], LLVM
// crashes if the module identifier is same as other symbols
// such as a function name in the module.
// 1. http://llvm.org/bugs/show_bug.cgi?id=11479
let llmod_id = format!("{}.rs", cgu.name());
let module = ModuleCodegen {
name: cgu.name().to_string(),
source: ModuleSource::Preexisting(buf),
kind: ModuleKind::Regular,
llmod_id,
};
tcx.dep_graph.mark_loaded_from_cache(dep_node_index, true);
write::submit_codegened_module_to_llvm(tcx, module, 0);
// Continue to next cgu, this one is done.
continue
}
} else {
// This can happen if files were deleted from the cache
// directory for some reason. We just re-compile then.
}
}
let _timing_guard = time_graph.as_ref().map(|time_graph| {
time_graph.start(write::CODEGEN_WORKER_TIMELINE,
write::CODEGEN_WORK_PACKAGE_KIND,
&format!("codegen {}", cgu.name()))
});
let start_time = Instant::now();
all_stats.extend(tcx.compile_codegen_unit(*cgu.name()));
total_codegen_time += start_time.elapsed();
ongoing_codegen.check_for_errors(tcx.sess);
}
ongoing_codegen.codegen_finished(tcx);
// Since the main thread is sometimes blocked during codegen, we keep track
// -Ztime-passes output manually.
print_time_passes_entry(tcx.sess.time_passes(),
"codegen to LLVM IR",
total_codegen_time);
if tcx.sess.opts.incremental.is_some() {
::rustc_incremental::assert_module_sources::assert_module_sources(tcx);
}
symbol_names_test::report_symbol_names(tcx);
if tcx.sess.codegen_stats() {
println!("--- codegen stats ---");
println!("n_glues_created: {}", all_stats.n_glues_created);
println!("n_null_glues: {}", all_stats.n_null_glues);
println!("n_real_glues: {}", all_stats.n_real_glues);
println!("n_fns: {}", all_stats.n_fns);
println!("n_inlines: {}", all_stats.n_inlines);
println!("n_closures: {}", all_stats.n_closures);
println!("fn stats:");
all_stats.fn_stats.sort_by_key(|&(_, insns)| insns);
for &(ref name, insns) in all_stats.fn_stats.iter() {
println!("{} insns, {}", insns, *name);
}
}
if tcx.sess.count_llvm_insns() {
for (k, v) in all_stats.llvm_insns.iter() {
println!("{:7} {}", *v, *k);
}
}
ongoing_codegen.check_for_errors(tcx.sess);
assert_and_save_dep_graph(tcx);
ongoing_codegen
}
fn assert_and_save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
time(tcx.sess,
"assert dep graph",
|| rustc_incremental::assert_dep_graph(tcx));
time(tcx.sess,
"serialize dep graph",
|| rustc_incremental::save_dep_graph(tcx));
}
fn collect_and_partition_mono_items<'a, 'tcx>(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
cnum: CrateNum,
) -> (Arc<DefIdSet>, Arc<Vec<Arc<CodegenUnit<'tcx>>>>)
{
assert_eq!(cnum, LOCAL_CRATE);
let collection_mode = match tcx.sess.opts.debugging_opts.print_mono_items {
Some(ref s) => {
let mode_string = s.to_lowercase();
let mode_string = mode_string.trim();
if mode_string == "eager" {
MonoItemCollectionMode::Eager
} else {
if mode_string != "lazy" {
let message = format!("Unknown codegen-item collection mode '{}'. \
Falling back to 'lazy' mode.",
mode_string);
tcx.sess.warn(&message);
}
MonoItemCollectionMode::Lazy
}
}
None => {
if tcx.sess.opts.cg.link_dead_code {
MonoItemCollectionMode::Eager
} else {
MonoItemCollectionMode::Lazy
}
}
};
let (items, inlining_map) =
time(tcx.sess, "monomorphization collection", || {
collector::collect_crate_mono_items(tcx, collection_mode)
});
tcx.sess.abort_if_errors();
::rustc_mir::monomorphize::assert_symbols_are_distinct(tcx, items.iter());
let strategy = if tcx.sess.opts.incremental.is_some() {
PartitioningStrategy::PerModule
} else {
PartitioningStrategy::FixedUnitCount(tcx.sess.codegen_units())
};
let codegen_units = time(tcx.sess, "codegen unit partitioning", || {
partitioning::partition(tcx,
items.iter().cloned(),
strategy,
&inlining_map)
.into_iter()
.map(Arc::new)
.collect::<Vec<_>>()
});
let mono_items: DefIdSet = items.iter().filter_map(|mono_item| {
match *mono_item {
MonoItem::Fn(ref instance) => Some(instance.def_id()),
MonoItem::Static(def_id) => Some(def_id),
_ => None,
}
}).collect();
if tcx.sess.opts.debugging_opts.print_mono_items.is_some() {
let mut item_to_cgus = FxHashMap();
for cgu in &codegen_units {
for (&mono_item, &linkage) in cgu.items() {
item_to_cgus.entry(mono_item)
.or_insert(Vec::new())
.push((cgu.name().clone(), linkage));
}
}
let mut item_keys: Vec<_> = items
.iter()
.map(|i| {
let mut output = i.to_string(tcx);
output.push_str(" @@");
let mut empty = Vec::new();
let cgus = item_to_cgus.get_mut(i).unwrap_or(&mut empty);
cgus.as_mut_slice().sort_by_key(|&(ref name, _)| name.clone());
cgus.dedup();
for &(ref cgu_name, (linkage, _)) in cgus.iter() {
output.push_str(" ");
output.push_str(&cgu_name.as_str());
let linkage_abbrev = match linkage {
Linkage::External => "External",
Linkage::AvailableExternally => "Available",
Linkage::LinkOnceAny => "OnceAny",
Linkage::LinkOnceODR => "OnceODR",
Linkage::WeakAny => "WeakAny",
Linkage::WeakODR => "WeakODR",
Linkage::Appending => "Appending",
Linkage::Internal => "Internal",
Linkage::Private => "Private",
Linkage::ExternalWeak => "ExternalWeak",
Linkage::Common => "Common",
};
output.push_str("[");
output.push_str(linkage_abbrev);
output.push_str("]");
}
output
})
.collect();
item_keys.sort();
for item in item_keys {
println!("MONO_ITEM {}", item);
}
}
(Arc::new(mono_items), Arc::new(codegen_units))
}
impl CrateInfo {
pub fn new(tcx: TyCtxt) -> CrateInfo {
let mut info = CrateInfo {
panic_runtime: None,
compiler_builtins: None,
profiler_runtime: None,
sanitizer_runtime: None,
is_no_builtins: FxHashSet(),
native_libraries: FxHashMap(),
used_libraries: tcx.native_libraries(LOCAL_CRATE),
link_args: tcx.link_args(LOCAL_CRATE),
crate_name: FxHashMap(),
used_crates_dynamic: cstore::used_crates(tcx, LinkagePreference::RequireDynamic),
used_crates_static: cstore::used_crates(tcx, LinkagePreference::RequireStatic),
used_crate_source: FxHashMap(),
wasm_imports: FxHashMap(),
lang_item_to_crate: FxHashMap(),
missing_lang_items: FxHashMap(),
};
let lang_items = tcx.lang_items();
let load_wasm_items = tcx.sess.crate_types.borrow()
.iter()
.any(|c| *c != config::CrateType::Rlib) &&
tcx.sess.opts.target_triple.triple() == "wasm32-unknown-unknown";
if load_wasm_items {
info.load_wasm_imports(tcx, LOCAL_CRATE);
}
for &cnum in tcx.crates().iter() {
info.native_libraries.insert(cnum, tcx.native_libraries(cnum));
info.crate_name.insert(cnum, tcx.crate_name(cnum).to_string());
info.used_crate_source.insert(cnum, tcx.used_crate_source(cnum));
if tcx.is_panic_runtime(cnum) {
info.panic_runtime = Some(cnum);
}
if tcx.is_compiler_builtins(cnum) {
info.compiler_builtins = Some(cnum);
}
if tcx.is_profiler_runtime(cnum) {
info.profiler_runtime = Some(cnum);
}
if tcx.is_sanitizer_runtime(cnum) {
info.sanitizer_runtime = Some(cnum);
}
if tcx.is_no_builtins(cnum) {
info.is_no_builtins.insert(cnum);
}
if load_wasm_items {
info.load_wasm_imports(tcx, cnum);
}
let missing = tcx.missing_lang_items(cnum);
for &item in missing.iter() {
if let Ok(id) = lang_items.require(item) {
info.lang_item_to_crate.insert(item, id.krate);
}
}
// No need to look for lang items that are whitelisted and don't
// actually need to exist.
let missing = missing.iter()
.cloned()
.filter(|&l| !weak_lang_items::whitelisted(tcx, l))
.collect();
info.missing_lang_items.insert(cnum, missing);
}
return info
}
fn load_wasm_imports(&mut self, tcx: TyCtxt, cnum: CrateNum) {
for (&id, module) in tcx.wasm_import_module_map(cnum).iter() {
let instance = Instance::mono(tcx, id);
let import_name = tcx.symbol_name(instance);
self.wasm_imports.insert(import_name.to_string(), module.clone());
}
}
}
fn is_codegened_item(tcx: TyCtxt, id: DefId) -> bool {
let (all_mono_items, _) =
tcx.collect_and_partition_mono_items(LOCAL_CRATE);
all_mono_items.contains(&id)
}
fn compile_codegen_unit<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
cgu: InternedString) -> Stats {
let cgu = tcx.codegen_unit(cgu);
let start_time = Instant::now();
let (stats, module) = module_codegen(tcx, cgu);
let time_to_codegen = start_time.elapsed();
// We assume that the cost to run LLVM on a CGU is proportional to
// the time we needed for codegenning it.
let cost = time_to_codegen.as_secs() * 1_000_000_000 +
time_to_codegen.subsec_nanos() as u64;
write::submit_codegened_module_to_llvm(tcx,
module,
cost);
return stats;
fn module_codegen<'a, 'tcx>(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
cgu: Arc<CodegenUnit<'tcx>>)
-> (Stats, ModuleCodegen)
{
let cgu_name = cgu.name().to_string();
// Append ".rs" to LLVM module identifier.
//
// LLVM code generator emits a ".file filename" directive
// for ELF backends. Value of the "filename" is set as the
// LLVM module identifier. Due to a LLVM MC bug[1], LLVM
// crashes if the module identifier is same as other symbols
// such as a function name in the module.
// 1. http://llvm.org/bugs/show_bug.cgi?id=11479
let llmod_id = format!("{}-{}.rs",
cgu.name(),
tcx.crate_disambiguator(LOCAL_CRATE)
.to_fingerprint().to_hex());
// Instantiate monomorphizations without filling out definitions yet...
let llvm_module = ModuleLlvm::new(tcx.sess, &llmod_id);
let stats = {
let cx = CodegenCx::new(tcx, cgu, &llvm_module);
let mono_items = cx.codegen_unit
.items_in_deterministic_order(cx.tcx);
for &(mono_item, (linkage, visibility)) in &mono_items {
mono_item.predefine(&cx, linkage, visibility);
}
// ... and now that we have everything pre-defined, fill out those definitions.
for &(mono_item, _) in &mono_items {
mono_item.define(&cx);
}
// If this codegen unit contains the main function, also create the
// wrapper here
maybe_create_entry_wrapper(&cx);
// Run replace-all-uses-with for statics that need it
for &(old_g, new_g) in cx.statics_to_rauw.borrow().iter() {
unsafe {
let bitcast = llvm::LLVMConstPointerCast(new_g, val_ty(old_g));
llvm::LLVMReplaceAllUsesWith(old_g, bitcast);
llvm::LLVMDeleteGlobal(old_g);
}
}
// Create the llvm.used variable
// This variable has type [N x i8*] and is stored in the llvm.metadata section
if !cx.used_statics.borrow().is_empty() {
let name = const_cstr!("llvm.used");
let section = const_cstr!("llvm.metadata");
let array = C_array(Type::i8(&cx).ptr_to(), &*cx.used_statics.borrow());
unsafe {
let g = llvm::LLVMAddGlobal(cx.llmod,
val_ty(array),
name.as_ptr());
llvm::LLVMSetInitializer(g, array);
llvm::LLVMRustSetLinkage(g, llvm::Linkage::AppendingLinkage);
llvm::LLVMSetSection(g, section.as_ptr());
}
}
// Finalize debuginfo
if cx.sess().opts.debuginfo != DebugInfo::None {
debuginfo::finalize(&cx);
}
cx.stats.into_inner()
};
(stats, ModuleCodegen {
name: cgu_name,
source: ModuleSource::Codegened(llvm_module),
kind: ModuleKind::Regular,
llmod_id,
})
}
}
pub fn provide(providers: &mut Providers) {
providers.collect_and_partition_mono_items =
collect_and_partition_mono_items;
providers.is_codegened_item = is_codegened_item;
providers.codegen_unit = |tcx, name| {
let (_, all) = tcx.collect_and_partition_mono_items(LOCAL_CRATE);
all.iter()
.find(|cgu| *cgu.name() == name)
.cloned()
.unwrap_or_else(|| panic!("failed to find cgu with name {:?}", name))
};
providers.compile_codegen_unit = compile_codegen_unit;
provide_extern(providers);
}
pub fn provide_extern(providers: &mut Providers) {
providers.dllimport_foreign_items = |tcx, krate| {
let module_map = tcx.foreign_modules(krate);
let module_map = module_map.iter()
.map(|lib| (lib.def_id, lib))
.collect::<FxHashMap<_, _>>();
let dllimports = tcx.native_libraries(krate)
.iter()
.filter(|lib| {
if lib.kind != cstore::NativeLibraryKind::NativeUnknown {
return false
}
let cfg = match lib.cfg {
Some(ref cfg) => cfg,
None => return true,
};
attr::cfg_matches(cfg, &tcx.sess.parse_sess, None)
})
.filter_map(|lib| lib.foreign_module)
.map(|id| &module_map[&id])
.flat_map(|module| module.foreign_items.iter().cloned())
.collect();
Lrc::new(dllimports)
};
providers.is_dllimport_foreign_item = |tcx, def_id| {
tcx.dllimport_foreign_items(def_id.krate).contains(&def_id)
};
}
pub fn linkage_to_llvm(linkage: Linkage) -> llvm::Linkage {
match linkage {
Linkage::External => llvm::Linkage::ExternalLinkage,
Linkage::AvailableExternally => llvm::Linkage::AvailableExternallyLinkage,
Linkage::LinkOnceAny => llvm::Linkage::LinkOnceAnyLinkage,
Linkage::LinkOnceODR => llvm::Linkage::LinkOnceODRLinkage,
Linkage::WeakAny => llvm::Linkage::WeakAnyLinkage,
Linkage::WeakODR => llvm::Linkage::WeakODRLinkage,
Linkage::Appending => llvm::Linkage::AppendingLinkage,
Linkage::Internal => llvm::Linkage::InternalLinkage,
Linkage::Private => llvm::Linkage::PrivateLinkage,
Linkage::ExternalWeak => llvm::Linkage::ExternalWeakLinkage,
Linkage::Common => llvm::Linkage::CommonLinkage,
}
}
pub fn visibility_to_llvm(linkage: Visibility) -> llvm::Visibility {
match linkage {
Visibility::Default => llvm::Visibility::Default,
Visibility::Hidden => llvm::Visibility::Hidden,
Visibility::Protected => llvm::Visibility::Protected,
}
}
// FIXME(mw): Anything that is produced via DepGraph::with_task() must implement
// the HashStable trait. Normally DepGraph::with_task() calls are
// hidden behind queries, but CGU creation is a special case in two
// ways: (1) it's not a query and (2) CGU are output nodes, so their
// Fingerprints are not actually needed. It remains to be clarified
// how exactly this case will be handled in the red/green system but
// for now we content ourselves with providing a no-op HashStable
// implementation for CGUs.
mod temp_stable_hash_impls {
use rustc_data_structures::stable_hasher::{StableHasherResult, StableHasher,
HashStable};
use ModuleCodegen;
impl<HCX> HashStable<HCX> for ModuleCodegen {
fn hash_stable<W: StableHasherResult>(&self,
_: &mut HCX,
_: &mut StableHasher<W>) {
// do nothing
}
}
}
|
use super::FormatBranch;
use crate::infrastructure::git::git_branch::GitBranch;
use crate::infrastructure::git::GitRepository;
pub fn analysis(url: &str, local_git: bool) -> Vec<FormatBranch> {
let repo = GitRepository::open(url, local_git);
let mut branches = vec![];
for br in GitBranch::list(repo) {
branches.push(FormatBranch::from(br));
}
return branches;
}
#[cfg(test)]
mod test {
use super::*;
#[ignore]
#[test]
fn local_project_test() {
let branches = analysis(".", false);
assert!(branches.len() >= 2);
}
}
|
use bigneon_db::dev::TestProject;
use bigneon_db::models::{
FeeSchedule, NewFeeScheduleRange, Organization, OrganizationEditableAttributes,
OrganizationUser, Roles, User,
};
use uuid::Uuid;
#[test]
fn create() {
let project = TestProject::new();
let connection = project.get_connection();
let user = project.create_user().finish();
let fee_schedule = FeeSchedule::create(
format!("Zero fees",).into(),
vec![NewFeeScheduleRange {
min_price: 0,
fee_in_cents: 0,
}],
).commit(connection)
.unwrap();
let organization = Organization::create(user.id, "Organization", fee_schedule.id)
.commit(connection)
.unwrap();
assert_eq!(organization.owner_user_id, user.id);
assert_eq!(organization.id.to_string().is_empty(), false);
let user2 = User::find(user.id, connection).unwrap();
assert!(
organization
.get_roles_for_user(&user2, connection)
.unwrap()
.contains(&"OrgOwner".into())
);
}
#[test]
fn update() {
let project = TestProject::new();
let user = project.create_user().finish();
//Edit Organization
let mut edited_organization = project.create_organization().with_owner(&user).finish();
edited_organization.name = "Test Org".to_string();
edited_organization.address = Some("Test Address".to_string());
edited_organization.city = Some("Test Address".to_string());
edited_organization.state = Some("Test state".to_string());
edited_organization.country = Some("Test country".to_string());
edited_organization.postal_code = Some("0124".to_string());
edited_organization.phone = Some("+27123456789".to_string());
let mut changed_attrs: OrganizationEditableAttributes = Default::default();
changed_attrs.name = Some("Test Org".to_string());
changed_attrs.address = Some("Test Address".to_string());
changed_attrs.city = Some("Test Address".to_string());
changed_attrs.state = Some("Test state".to_string());
changed_attrs.country = Some("Test country".to_string());
changed_attrs.postal_code = Some("0124".to_string());
changed_attrs.phone = Some("+27123456789".to_string());
let updated_organization = Organization::update(
&edited_organization,
changed_attrs,
project.get_connection(),
).unwrap();
assert_eq!(edited_organization, updated_organization);
}
#[test]
fn update_owner() {
let project = TestProject::new();
let user = project.create_user().finish();
//Edit Organization
let organization = project.create_organization().with_owner(&user).finish();
let user2 = project.create_user().finish();
let updated_org = organization
.set_owner(user2.id, project.get_connection())
.unwrap();
let db_org = Organization::find(organization.id, project.get_connection()).unwrap();
assert_eq!(updated_org.owner_user_id, user2.id);
assert_eq!(db_org.owner_user_id, user2.id);
}
#[test]
fn find() {
let project = TestProject::new();
let user = project.create_user().finish();
//Edit Organization
let organization = project
.create_organization()
.with_owner(&user)
.with_address()
.finish();
let found_organization = Organization::find(organization.id, project.get_connection()).unwrap();
assert_eq!(organization, found_organization);
}
#[test]
fn users() {
let project = TestProject::new();
let user = project.create_user().finish();
let user2 = project.create_user().finish();
let user3 = project.create_user().finish();
let organization = project.create_organization().with_owner(&user).finish();
let organization2 = project.create_organization().with_owner(&user3).finish();
OrganizationUser::create(organization2.id, user2.id)
.commit(project.get_connection())
.unwrap();
// Owner is included in the user results for organization2 but not organization2
let user_results = organization.users(project.get_connection()).unwrap();
assert_eq!(user_results.len(), 1);
assert_eq!(user.id, user_results[0].id);
let user_results = organization2.users(project.get_connection()).unwrap();
assert_eq!(
vec![user3.id, user2.id],
user_results.iter().map(|u| u.id).collect::<Vec<Uuid>>()
);
// Explicitly make the organization user an org user
OrganizationUser::create(organization.id, user.id)
.commit(project.get_connection())
.unwrap();
let user_results = organization.users(project.get_connection()).unwrap();
assert_eq!(user_results.len(), 1);
assert_eq!(user.id, user_results[0].id);
let user_results2 = organization2.users(project.get_connection()).unwrap();
assert_eq!(user_results2.len(), 2);
assert_eq!(user3.id, user_results2[0].id);
assert_eq!(user2.id, user_results2[1].id);
// Add a new user to the organization
OrganizationUser::create(organization.id, user2.id)
.commit(project.get_connection())
.unwrap();
let user_results = organization.users(project.get_connection()).unwrap();
assert!(user_results.len() == 2);
assert_eq!(user.id, user_results[0].id);
assert_eq!(user2.id, user_results[1].id);
let user_results2 = organization2.users(project.get_connection()).unwrap();
assert!(user_results2.len() == 2);
assert_eq!(user3.id, user_results2[0].id);
assert_eq!(user2.id, user_results2[1].id);
}
#[test]
fn is_member() {
let project = TestProject::new();
let connection = project.get_connection();
let user = project.create_user().finish();
let user2 = project.create_user().finish();
let user3 = project.create_user().finish();
let organization = project
.create_organization()
.with_owner(&user)
.with_user(&user2)
.finish();
// Reload for owner role
let user = User::find(user.id.clone(), connection).unwrap();
assert!(organization.is_member(&user, connection).unwrap());
assert!(organization.is_member(&user2, connection).unwrap());
assert!(!organization.is_member(&user3, connection).unwrap());
}
#[test]
fn all_linked_to_user() {
let project = TestProject::new();
let user = project.create_user().finish();
let user2 = project.create_user().finish();
let org1 = project.create_organization().with_owner(&user).finish();
let org2 = project
.create_organization()
.with_owner(&user2)
.with_user(&user)
.finish();
let _org3 = project.create_organization().with_owner(&user2).finish();
let orgs = Organization::all_linked_to_user(user.id, project.get_connection()).unwrap();
let mut test_vec = vec![org1, org2];
test_vec.sort_by_key(|org| org.name.clone());
assert_eq!(orgs, test_vec);
}
#[test]
fn all_org_names_linked_to_user() {
let project = TestProject::new();
let user1 = project.create_user().finish(); //Member and owner link
let user2 = project.create_user().finish(); //Only owner link
let user3 = project.create_user().finish(); //Only membership link
let user4 = project.create_user().finish(); //No links
let org1 = project
.create_organization()
.with_name(String::from("Test Org1"))
.with_owner(&user1)
.with_user(&user3)
.finish();
let org2 = project
.create_organization()
.with_name(String::from("Test Org2"))
.with_owner(&user2)
.with_user(&user1)
.finish();
let user1_links =
Organization::all_org_names_linked_to_user(user1.id, project.get_connection()).unwrap();
let user2_links =
Organization::all_org_names_linked_to_user(user2.id, project.get_connection()).unwrap();
let user3_links =
Organization::all_org_names_linked_to_user(user3.id, project.get_connection()).unwrap();
let user4_links =
Organization::all_org_names_linked_to_user(user4.id, project.get_connection()).unwrap();
let role_owner_string = String::from("owner");
let role_member_string = String::from("member");
//User1 has 2 links, owner of Org1 and member of Org2
assert_eq!(user1_links.len(), 2);
assert_eq!(
(user1_links[0].id == org1.id) && (user1_links[1].id == org2.id),
true
);
assert_eq!(
(user1_links[0].role == role_owner_string) && (user1_links[1].role == role_member_string),
true
);
//User2 has only 1 owner link with Org2
assert_eq!(user2_links.len(), 1);
assert_eq!(user2_links[0].id, org2.id);
assert_eq!(user2_links[0].role, role_owner_string);
//User3 has only 1 member link with Org1
assert_eq!(user3_links.len(), 1);
assert_eq!(user3_links[0].id, org1.id);
assert_eq!(user3_links[0].role, role_member_string);
//User4 has no links
assert_eq!(user4_links.len(), 0);
}
#[test]
fn all() {
let project = TestProject::new();
let user = project.create_user().finish();
let user2 = project.create_user().finish();
let org1 = project.create_organization().with_owner(&user).finish();
let org2 = project
.create_organization()
.with_owner(&user2)
.with_user(&user)
.finish();
let org3 = project.create_organization().with_owner(&user2).finish();
let orgs = Organization::all(project.get_connection()).unwrap();
let mut test_vec = vec![org1, org2, org3];
test_vec.sort_by_key(|org| org.name.clone());
assert_eq!(orgs, test_vec);
}
#[test]
fn remove_users() {
let project = TestProject::new();
let user = project.create_user().finish();
let user2 = project.create_user().finish();
let user3 = project.create_user().finish();
let organization = project.create_organization().with_owner(&user).finish();
OrganizationUser::create(organization.id, user2.id)
.commit(project.get_connection())
.unwrap();
OrganizationUser::create(organization.id, user3.id)
.commit(project.get_connection())
.unwrap();
let user2_id = user2.id;
let user_results = organization
.users(project.get_connection())
.unwrap()
.sort_by_key(|k| k.id);
let users_before_delete = vec![user.clone(), user2, user3.clone()].sort_by_key(|k| k.id);
assert_eq!(user_results, users_before_delete);
//remove user
let result = organization
.remove_user(user2_id, project.get_connection())
.unwrap();
assert_eq!(result, 1);
let user_results2 = organization.users(project.get_connection()).unwrap();
let users_post_delete = vec![user, user3];
assert_eq!(user_results2, users_post_delete);
}
#[test]
pub fn get_roles_for_user() {
let project = TestProject::new();
let connection = project.get_connection();
let user = project.create_user().finish();
let user2 = project.create_user().finish();
let mut user3 = project.create_user().finish();
let organization = project
.create_organization()
.with_owner(&user)
.with_user(&user2)
.finish();
user3 = user3.add_role(Roles::Admin, connection).unwrap();
assert_eq!(
organization.get_roles_for_user(&user, connection).unwrap(),
vec!["OrgOwner", "OrgMember"]
);
assert_eq!(
organization.get_roles_for_user(&user2, connection).unwrap(),
vec!["OrgMember"]
);
assert!(
organization
.get_roles_for_user(&user3, connection)
.unwrap()
.is_empty()
);
}
#[test]
pub fn get_scopes_for_user() {
let project = TestProject::new();
let connection = project.get_connection();
let user = project.create_user().finish();
let user2 = project.create_user().finish();
let mut user3 = project.create_user().finish();
let organization = project
.create_organization()
.with_owner(&user)
.with_user(&user2)
.finish();
user3 = user3.add_role(Roles::Admin, connection).unwrap();
assert_eq!(
organization.get_scopes_for_user(&user, connection).unwrap(),
vec![
"artist:write",
"event:interest",
"event:view-guests",
"event:write",
"hold:write",
"order:read",
"org:read",
"org:write",
"ticket:admin",
"ticket:transfer",
"user:read",
"venue:write"
]
);
assert_eq!(
organization
.get_scopes_for_user(&user2, connection)
.unwrap(),
vec![
"artist:write",
"event:interest",
"event:view-guests",
"event:write",
"hold:write",
"order:read",
"org:read",
"ticket:admin",
"ticket:transfer",
"venue:write",
]
);
assert!(
organization
.get_scopes_for_user(&user3, connection)
.unwrap()
.is_empty()
);
}
#[test]
fn change_owner() {
let project = TestProject::new();
let connection = project.get_connection();
let user = project.create_user().finish();
let fee_schedule = FeeSchedule::create(
format!("Zero fees",).into(),
vec![NewFeeScheduleRange {
min_price: 0,
fee_in_cents: 0,
}],
).commit(connection)
.unwrap();
let mut organization = Organization::create(user.id, "Organization", fee_schedule.id)
.commit(connection)
.unwrap();
let user2 = project.create_user().finish();
organization = organization.set_owner(user2.id, connection).unwrap();
assert!(
!organization
.get_roles_for_user(&user, connection)
.unwrap()
.contains(&"OrgOwner".into())
);
assert!(
organization
.get_roles_for_user(&user2, connection)
.unwrap()
.contains(&"OrgOwner".into())
);
}
#[test]
fn add_user() {
let project = TestProject::new();
let connection = project.get_connection();
let user = project.create_user().finish();
let user2 = project.create_user().finish();
let organization = project.create_organization().with_owner(&user).finish();
let organization_user = organization.add_user(user2.id, connection).unwrap();
assert_eq!(organization_user.user_id, user2.id);
assert_eq!(organization_user.organization_id, organization.id);
assert_eq!(organization_user.id.to_string().is_empty(), false);
let user2 = User::find(user2.id, connection).unwrap();
assert!(
organization
.get_roles_for_user(&user2, connection)
.unwrap()
.contains(&"OrgMember".into())
);
}
#[test]
fn add_fee_schedule() {
let project = TestProject::new();
let organization = project.create_organization().finish();
let fee_structure = project.create_fee_schedule().finish();
organization
.add_fee_schedule(&fee_structure, project.get_connection())
.unwrap();
let organization = Organization::find(organization.id, project.get_connection()).unwrap();
assert_eq!(organization.fee_schedule_id, fee_structure.id);
}
#[test]
fn owner() {
let project = TestProject::new();
let owner = project.create_user().finish();
let organization = project.create_organization().with_owner(&owner).finish();
let organization_owner = organization.owner(&project.get_connection()).unwrap();
assert_eq!(owner.id, organization_owner.id);
}
|
#![allow(unused_variables, non_upper_case_globals, non_snake_case, unused_unsafe, non_camel_case_types, dead_code, clippy::all)]
pub const DWRITE_ALPHA_MAX: u32 = 255u32;
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_AUTOMATIC_FONT_AXES(pub u32);
pub const DWRITE_AUTOMATIC_FONT_AXES_NONE: DWRITE_AUTOMATIC_FONT_AXES = DWRITE_AUTOMATIC_FONT_AXES(0u32);
pub const DWRITE_AUTOMATIC_FONT_AXES_OPTICAL_SIZE: DWRITE_AUTOMATIC_FONT_AXES = DWRITE_AUTOMATIC_FONT_AXES(1u32);
impl ::core::convert::From<u32> for DWRITE_AUTOMATIC_FONT_AXES {
fn from(value: u32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_AUTOMATIC_FONT_AXES {
type Abi = Self;
}
impl ::core::ops::BitOr for DWRITE_AUTOMATIC_FONT_AXES {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl ::core::ops::BitAnd for DWRITE_AUTOMATIC_FONT_AXES {
type Output = Self;
fn bitand(self, rhs: Self) -> Self {
Self(self.0 & rhs.0)
}
}
impl ::core::ops::BitOrAssign for DWRITE_AUTOMATIC_FONT_AXES {
fn bitor_assign(&mut self, rhs: Self) {
self.0.bitor_assign(rhs.0)
}
}
impl ::core::ops::BitAndAssign for DWRITE_AUTOMATIC_FONT_AXES {
fn bitand_assign(&mut self, rhs: Self) {
self.0.bitand_assign(rhs.0)
}
}
impl ::core::ops::Not for DWRITE_AUTOMATIC_FONT_AXES {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_BASELINE(pub i32);
pub const DWRITE_BASELINE_DEFAULT: DWRITE_BASELINE = DWRITE_BASELINE(0i32);
pub const DWRITE_BASELINE_ROMAN: DWRITE_BASELINE = DWRITE_BASELINE(1i32);
pub const DWRITE_BASELINE_CENTRAL: DWRITE_BASELINE = DWRITE_BASELINE(2i32);
pub const DWRITE_BASELINE_MATH: DWRITE_BASELINE = DWRITE_BASELINE(3i32);
pub const DWRITE_BASELINE_HANGING: DWRITE_BASELINE = DWRITE_BASELINE(4i32);
pub const DWRITE_BASELINE_IDEOGRAPHIC_BOTTOM: DWRITE_BASELINE = DWRITE_BASELINE(5i32);
pub const DWRITE_BASELINE_IDEOGRAPHIC_TOP: DWRITE_BASELINE = DWRITE_BASELINE(6i32);
pub const DWRITE_BASELINE_MINIMUM: DWRITE_BASELINE = DWRITE_BASELINE(7i32);
pub const DWRITE_BASELINE_MAXIMUM: DWRITE_BASELINE = DWRITE_BASELINE(8i32);
impl ::core::convert::From<i32> for DWRITE_BASELINE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_BASELINE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_BREAK_CONDITION(pub i32);
pub const DWRITE_BREAK_CONDITION_NEUTRAL: DWRITE_BREAK_CONDITION = DWRITE_BREAK_CONDITION(0i32);
pub const DWRITE_BREAK_CONDITION_CAN_BREAK: DWRITE_BREAK_CONDITION = DWRITE_BREAK_CONDITION(1i32);
pub const DWRITE_BREAK_CONDITION_MAY_NOT_BREAK: DWRITE_BREAK_CONDITION = DWRITE_BREAK_CONDITION(2i32);
pub const DWRITE_BREAK_CONDITION_MUST_BREAK: DWRITE_BREAK_CONDITION = DWRITE_BREAK_CONDITION(3i32);
impl ::core::convert::From<i32> for DWRITE_BREAK_CONDITION {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_BREAK_CONDITION {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_CARET_METRICS {
pub slopeRise: i16,
pub slopeRun: i16,
pub offset: i16,
}
impl DWRITE_CARET_METRICS {}
impl ::core::default::Default for DWRITE_CARET_METRICS {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_CARET_METRICS {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_CARET_METRICS").field("slopeRise", &self.slopeRise).field("slopeRun", &self.slopeRun).field("offset", &self.offset).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_CARET_METRICS {
fn eq(&self, other: &Self) -> bool {
self.slopeRise == other.slopeRise && self.slopeRun == other.slopeRun && self.offset == other.offset
}
}
impl ::core::cmp::Eq for DWRITE_CARET_METRICS {}
unsafe impl ::windows::core::Abi for DWRITE_CARET_METRICS {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_CLUSTER_METRICS {
pub width: f32,
pub length: u16,
pub _bitfield: u16,
}
impl DWRITE_CLUSTER_METRICS {}
impl ::core::default::Default for DWRITE_CLUSTER_METRICS {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_CLUSTER_METRICS {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_CLUSTER_METRICS").field("width", &self.width).field("length", &self.length).field("_bitfield", &self._bitfield).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_CLUSTER_METRICS {
fn eq(&self, other: &Self) -> bool {
self.width == other.width && self.length == other.length && self._bitfield == other._bitfield
}
}
impl ::core::cmp::Eq for DWRITE_CLUSTER_METRICS {}
unsafe impl ::windows::core::Abi for DWRITE_CLUSTER_METRICS {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_COLOR_F {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}
impl DWRITE_COLOR_F {}
impl ::core::default::Default for DWRITE_COLOR_F {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_COLOR_F {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_COLOR_F").field("r", &self.r).field("g", &self.g).field("b", &self.b).field("a", &self.a).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_COLOR_F {
fn eq(&self, other: &Self) -> bool {
self.r == other.r && self.g == other.g && self.b == other.b && self.a == other.a
}
}
impl ::core::cmp::Eq for DWRITE_COLOR_F {}
unsafe impl ::windows::core::Abi for DWRITE_COLOR_F {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_COLOR_GLYPH_RUN {
pub glyphRun: DWRITE_GLYPH_RUN,
pub glyphRunDescription: *mut DWRITE_GLYPH_RUN_DESCRIPTION,
pub baselineOriginX: f32,
pub baselineOriginY: f32,
pub runColor: DWRITE_COLOR_F,
pub paletteIndex: u16,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_COLOR_GLYPH_RUN {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_COLOR_GLYPH_RUN {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_COLOR_GLYPH_RUN {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_COLOR_GLYPH_RUN")
.field("glyphRun", &self.glyphRun)
.field("glyphRunDescription", &self.glyphRunDescription)
.field("baselineOriginX", &self.baselineOriginX)
.field("baselineOriginY", &self.baselineOriginY)
.field("runColor", &self.runColor)
.field("paletteIndex", &self.paletteIndex)
.finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_COLOR_GLYPH_RUN {
fn eq(&self, other: &Self) -> bool {
self.glyphRun == other.glyphRun && self.glyphRunDescription == other.glyphRunDescription && self.baselineOriginX == other.baselineOriginX && self.baselineOriginY == other.baselineOriginY && self.runColor == other.runColor && self.paletteIndex == other.paletteIndex
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_COLOR_GLYPH_RUN {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_COLOR_GLYPH_RUN {
type Abi = ::core::mem::ManuallyDrop<Self>;
}
#[derive(:: core :: clone :: Clone)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_COLOR_GLYPH_RUN1 {
pub Base: DWRITE_COLOR_GLYPH_RUN,
pub glyphImageFormat: DWRITE_GLYPH_IMAGE_FORMATS,
pub measuringMode: DWRITE_MEASURING_MODE,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_COLOR_GLYPH_RUN1 {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_COLOR_GLYPH_RUN1 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_COLOR_GLYPH_RUN1 {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_COLOR_GLYPH_RUN1").field("Base", &self.Base).field("glyphImageFormat", &self.glyphImageFormat).field("measuringMode", &self.measuringMode).finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_COLOR_GLYPH_RUN1 {
fn eq(&self, other: &Self) -> bool {
self.Base == other.Base && self.glyphImageFormat == other.glyphImageFormat && self.measuringMode == other.measuringMode
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_COLOR_GLYPH_RUN1 {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_COLOR_GLYPH_RUN1 {
type Abi = ::core::mem::ManuallyDrop<Self>;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_CONTAINER_TYPE(pub i32);
pub const DWRITE_CONTAINER_TYPE_UNKNOWN: DWRITE_CONTAINER_TYPE = DWRITE_CONTAINER_TYPE(0i32);
pub const DWRITE_CONTAINER_TYPE_WOFF: DWRITE_CONTAINER_TYPE = DWRITE_CONTAINER_TYPE(1i32);
pub const DWRITE_CONTAINER_TYPE_WOFF2: DWRITE_CONTAINER_TYPE = DWRITE_CONTAINER_TYPE(2i32);
impl ::core::convert::From<i32> for DWRITE_CONTAINER_TYPE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_CONTAINER_TYPE {
type Abi = Self;
}
pub const DWRITE_ERR_BASE: u32 = 20480u32;
pub const DWRITE_E_DOWNLOADCANCELLED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2003283954i32 as _);
pub const DWRITE_E_DOWNLOADFAILED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2003283953i32 as _);
pub const DWRITE_E_REMOTEFONT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2003283955i32 as _);
pub const DWRITE_E_TOOMANYDOWNLOADS: ::windows::core::HRESULT = ::windows::core::HRESULT(-2003283952i32 as _);
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FACTORY_TYPE(pub i32);
pub const DWRITE_FACTORY_TYPE_SHARED: DWRITE_FACTORY_TYPE = DWRITE_FACTORY_TYPE(0i32);
pub const DWRITE_FACTORY_TYPE_ISOLATED: DWRITE_FACTORY_TYPE = DWRITE_FACTORY_TYPE(1i32);
impl ::core::convert::From<i32> for DWRITE_FACTORY_TYPE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FACTORY_TYPE {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_FILE_FRAGMENT {
pub fileOffset: u64,
pub fragmentSize: u64,
}
impl DWRITE_FILE_FRAGMENT {}
impl ::core::default::Default for DWRITE_FILE_FRAGMENT {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_FILE_FRAGMENT {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_FILE_FRAGMENT").field("fileOffset", &self.fileOffset).field("fragmentSize", &self.fragmentSize).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_FILE_FRAGMENT {
fn eq(&self, other: &Self) -> bool {
self.fileOffset == other.fileOffset && self.fragmentSize == other.fragmentSize
}
}
impl ::core::cmp::Eq for DWRITE_FILE_FRAGMENT {}
unsafe impl ::windows::core::Abi for DWRITE_FILE_FRAGMENT {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FLOW_DIRECTION(pub i32);
pub const DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM: DWRITE_FLOW_DIRECTION = DWRITE_FLOW_DIRECTION(0i32);
pub const DWRITE_FLOW_DIRECTION_BOTTOM_TO_TOP: DWRITE_FLOW_DIRECTION = DWRITE_FLOW_DIRECTION(1i32);
pub const DWRITE_FLOW_DIRECTION_LEFT_TO_RIGHT: DWRITE_FLOW_DIRECTION = DWRITE_FLOW_DIRECTION(2i32);
pub const DWRITE_FLOW_DIRECTION_RIGHT_TO_LEFT: DWRITE_FLOW_DIRECTION = DWRITE_FLOW_DIRECTION(3i32);
impl ::core::convert::From<i32> for DWRITE_FLOW_DIRECTION {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FLOW_DIRECTION {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_AXIS_ATTRIBUTES(pub u32);
pub const DWRITE_FONT_AXIS_ATTRIBUTES_NONE: DWRITE_FONT_AXIS_ATTRIBUTES = DWRITE_FONT_AXIS_ATTRIBUTES(0u32);
pub const DWRITE_FONT_AXIS_ATTRIBUTES_VARIABLE: DWRITE_FONT_AXIS_ATTRIBUTES = DWRITE_FONT_AXIS_ATTRIBUTES(1u32);
pub const DWRITE_FONT_AXIS_ATTRIBUTES_HIDDEN: DWRITE_FONT_AXIS_ATTRIBUTES = DWRITE_FONT_AXIS_ATTRIBUTES(2u32);
impl ::core::convert::From<u32> for DWRITE_FONT_AXIS_ATTRIBUTES {
fn from(value: u32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_AXIS_ATTRIBUTES {
type Abi = Self;
}
impl ::core::ops::BitOr for DWRITE_FONT_AXIS_ATTRIBUTES {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl ::core::ops::BitAnd for DWRITE_FONT_AXIS_ATTRIBUTES {
type Output = Self;
fn bitand(self, rhs: Self) -> Self {
Self(self.0 & rhs.0)
}
}
impl ::core::ops::BitOrAssign for DWRITE_FONT_AXIS_ATTRIBUTES {
fn bitor_assign(&mut self, rhs: Self) {
self.0.bitor_assign(rhs.0)
}
}
impl ::core::ops::BitAndAssign for DWRITE_FONT_AXIS_ATTRIBUTES {
fn bitand_assign(&mut self, rhs: Self) {
self.0.bitand_assign(rhs.0)
}
}
impl ::core::ops::Not for DWRITE_FONT_AXIS_ATTRIBUTES {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_FONT_AXIS_RANGE {
pub axisTag: DWRITE_FONT_AXIS_TAG,
pub minValue: f32,
pub maxValue: f32,
}
impl DWRITE_FONT_AXIS_RANGE {}
impl ::core::default::Default for DWRITE_FONT_AXIS_RANGE {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_FONT_AXIS_RANGE {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_FONT_AXIS_RANGE").field("axisTag", &self.axisTag).field("minValue", &self.minValue).field("maxValue", &self.maxValue).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_FONT_AXIS_RANGE {
fn eq(&self, other: &Self) -> bool {
self.axisTag == other.axisTag && self.minValue == other.minValue && self.maxValue == other.maxValue
}
}
impl ::core::cmp::Eq for DWRITE_FONT_AXIS_RANGE {}
unsafe impl ::windows::core::Abi for DWRITE_FONT_AXIS_RANGE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_AXIS_TAG(pub u32);
pub const DWRITE_FONT_AXIS_TAG_WEIGHT: DWRITE_FONT_AXIS_TAG = DWRITE_FONT_AXIS_TAG(1952999287u32);
pub const DWRITE_FONT_AXIS_TAG_WIDTH: DWRITE_FONT_AXIS_TAG = DWRITE_FONT_AXIS_TAG(1752458359u32);
pub const DWRITE_FONT_AXIS_TAG_SLANT: DWRITE_FONT_AXIS_TAG = DWRITE_FONT_AXIS_TAG(1953393779u32);
pub const DWRITE_FONT_AXIS_TAG_OPTICAL_SIZE: DWRITE_FONT_AXIS_TAG = DWRITE_FONT_AXIS_TAG(2054385775u32);
pub const DWRITE_FONT_AXIS_TAG_ITALIC: DWRITE_FONT_AXIS_TAG = DWRITE_FONT_AXIS_TAG(1818326121u32);
impl ::core::convert::From<u32> for DWRITE_FONT_AXIS_TAG {
fn from(value: u32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_AXIS_TAG {
type Abi = Self;
}
impl ::core::ops::BitOr for DWRITE_FONT_AXIS_TAG {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl ::core::ops::BitAnd for DWRITE_FONT_AXIS_TAG {
type Output = Self;
fn bitand(self, rhs: Self) -> Self {
Self(self.0 & rhs.0)
}
}
impl ::core::ops::BitOrAssign for DWRITE_FONT_AXIS_TAG {
fn bitor_assign(&mut self, rhs: Self) {
self.0.bitor_assign(rhs.0)
}
}
impl ::core::ops::BitAndAssign for DWRITE_FONT_AXIS_TAG {
fn bitand_assign(&mut self, rhs: Self) {
self.0.bitand_assign(rhs.0)
}
}
impl ::core::ops::Not for DWRITE_FONT_AXIS_TAG {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_FONT_AXIS_VALUE {
pub axisTag: DWRITE_FONT_AXIS_TAG,
pub value: f32,
}
impl DWRITE_FONT_AXIS_VALUE {}
impl ::core::default::Default for DWRITE_FONT_AXIS_VALUE {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_FONT_AXIS_VALUE {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_FONT_AXIS_VALUE").field("axisTag", &self.axisTag).field("value", &self.value).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_FONT_AXIS_VALUE {
fn eq(&self, other: &Self) -> bool {
self.axisTag == other.axisTag && self.value == other.value
}
}
impl ::core::cmp::Eq for DWRITE_FONT_AXIS_VALUE {}
unsafe impl ::windows::core::Abi for DWRITE_FONT_AXIS_VALUE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_FACE_TYPE(pub i32);
pub const DWRITE_FONT_FACE_TYPE_CFF: DWRITE_FONT_FACE_TYPE = DWRITE_FONT_FACE_TYPE(0i32);
pub const DWRITE_FONT_FACE_TYPE_TRUETYPE: DWRITE_FONT_FACE_TYPE = DWRITE_FONT_FACE_TYPE(1i32);
pub const DWRITE_FONT_FACE_TYPE_OPENTYPE_COLLECTION: DWRITE_FONT_FACE_TYPE = DWRITE_FONT_FACE_TYPE(2i32);
pub const DWRITE_FONT_FACE_TYPE_TYPE1: DWRITE_FONT_FACE_TYPE = DWRITE_FONT_FACE_TYPE(3i32);
pub const DWRITE_FONT_FACE_TYPE_VECTOR: DWRITE_FONT_FACE_TYPE = DWRITE_FONT_FACE_TYPE(4i32);
pub const DWRITE_FONT_FACE_TYPE_BITMAP: DWRITE_FONT_FACE_TYPE = DWRITE_FONT_FACE_TYPE(5i32);
pub const DWRITE_FONT_FACE_TYPE_UNKNOWN: DWRITE_FONT_FACE_TYPE = DWRITE_FONT_FACE_TYPE(6i32);
pub const DWRITE_FONT_FACE_TYPE_RAW_CFF: DWRITE_FONT_FACE_TYPE = DWRITE_FONT_FACE_TYPE(7i32);
pub const DWRITE_FONT_FACE_TYPE_TRUETYPE_COLLECTION: DWRITE_FONT_FACE_TYPE = DWRITE_FONT_FACE_TYPE(2i32);
impl ::core::convert::From<i32> for DWRITE_FONT_FACE_TYPE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_FACE_TYPE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_FAMILY_MODEL(pub i32);
pub const DWRITE_FONT_FAMILY_MODEL_TYPOGRAPHIC: DWRITE_FONT_FAMILY_MODEL = DWRITE_FONT_FAMILY_MODEL(0i32);
pub const DWRITE_FONT_FAMILY_MODEL_WEIGHT_STRETCH_STYLE: DWRITE_FONT_FAMILY_MODEL = DWRITE_FONT_FAMILY_MODEL(1i32);
impl ::core::convert::From<i32> for DWRITE_FONT_FAMILY_MODEL {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_FAMILY_MODEL {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_FONT_FEATURE {
pub nameTag: DWRITE_FONT_FEATURE_TAG,
pub parameter: u32,
}
impl DWRITE_FONT_FEATURE {}
impl ::core::default::Default for DWRITE_FONT_FEATURE {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_FONT_FEATURE {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_FONT_FEATURE").field("nameTag", &self.nameTag).field("parameter", &self.parameter).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_FONT_FEATURE {
fn eq(&self, other: &Self) -> bool {
self.nameTag == other.nameTag && self.parameter == other.parameter
}
}
impl ::core::cmp::Eq for DWRITE_FONT_FEATURE {}
unsafe impl ::windows::core::Abi for DWRITE_FONT_FEATURE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_FEATURE_TAG(pub u32);
pub const DWRITE_FONT_FEATURE_TAG_ALTERNATIVE_FRACTIONS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1668441697u32);
pub const DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS_FROM_CAPITALS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1668297315u32);
pub const DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS_FROM_CAPITALS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1668493923u32);
pub const DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_ALTERNATES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1953259875u32);
pub const DWRITE_FONT_FEATURE_TAG_CASE_SENSITIVE_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1702060387u32);
pub const DWRITE_FONT_FEATURE_TAG_GLYPH_COMPOSITION_DECOMPOSITION: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1886217059u32);
pub const DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_LIGATURES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1734962275u32);
pub const DWRITE_FONT_FEATURE_TAG_CAPITAL_SPACING: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1886613603u32);
pub const DWRITE_FONT_FEATURE_TAG_CONTEXTUAL_SWASH: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1752658787u32);
pub const DWRITE_FONT_FEATURE_TAG_CURSIVE_POSITIONING: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1936880995u32);
pub const DWRITE_FONT_FEATURE_TAG_DEFAULT: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1953261156u32);
pub const DWRITE_FONT_FEATURE_TAG_DISCRETIONARY_LIGATURES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1734962276u32);
pub const DWRITE_FONT_FEATURE_TAG_EXPERT_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1953527909u32);
pub const DWRITE_FONT_FEATURE_TAG_FRACTIONS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1667330662u32);
pub const DWRITE_FONT_FEATURE_TAG_FULL_WIDTH: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1684633446u32);
pub const DWRITE_FONT_FEATURE_TAG_HALF_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1718378856u32);
pub const DWRITE_FONT_FEATURE_TAG_HALANT_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1852596584u32);
pub const DWRITE_FONT_FEATURE_TAG_ALTERNATE_HALF_WIDTH: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1953259880u32);
pub const DWRITE_FONT_FEATURE_TAG_HISTORICAL_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1953720680u32);
pub const DWRITE_FONT_FEATURE_TAG_HORIZONTAL_KANA_ALTERNATES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1634626408u32);
pub const DWRITE_FONT_FEATURE_TAG_HISTORICAL_LIGATURES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1734962280u32);
pub const DWRITE_FONT_FEATURE_TAG_HALF_WIDTH: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1684633448u32);
pub const DWRITE_FONT_FEATURE_TAG_HOJO_KANJI_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1869246312u32);
pub const DWRITE_FONT_FEATURE_TAG_JIS04_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(875589738u32);
pub const DWRITE_FONT_FEATURE_TAG_JIS78_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(943157354u32);
pub const DWRITE_FONT_FEATURE_TAG_JIS83_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(859336810u32);
pub const DWRITE_FONT_FEATURE_TAG_JIS90_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(809070698u32);
pub const DWRITE_FONT_FEATURE_TAG_KERNING: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1852990827u32);
pub const DWRITE_FONT_FEATURE_TAG_STANDARD_LIGATURES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1634167148u32);
pub const DWRITE_FONT_FEATURE_TAG_LINING_FIGURES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1836412524u32);
pub const DWRITE_FONT_FEATURE_TAG_LOCALIZED_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1818455916u32);
pub const DWRITE_FONT_FEATURE_TAG_MARK_POSITIONING: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1802658157u32);
pub const DWRITE_FONT_FEATURE_TAG_MATHEMATICAL_GREEK: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1802659693u32);
pub const DWRITE_FONT_FEATURE_TAG_MARK_TO_MARK_POSITIONING: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1802333037u32);
pub const DWRITE_FONT_FEATURE_TAG_ALTERNATE_ANNOTATION_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1953259886u32);
pub const DWRITE_FONT_FEATURE_TAG_NLC_KANJI_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1801677934u32);
pub const DWRITE_FONT_FEATURE_TAG_OLD_STYLE_FIGURES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1836412527u32);
pub const DWRITE_FONT_FEATURE_TAG_ORDINALS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1852076655u32);
pub const DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_ALTERNATE_WIDTH: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1953259888u32);
pub const DWRITE_FONT_FEATURE_TAG_PETITE_CAPITALS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1885430640u32);
pub const DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_FIGURES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1836412528u32);
pub const DWRITE_FONT_FEATURE_TAG_PROPORTIONAL_WIDTHS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1684633456u32);
pub const DWRITE_FONT_FEATURE_TAG_QUARTER_WIDTHS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1684633457u32);
pub const DWRITE_FONT_FEATURE_TAG_REQUIRED_LIGATURES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1734962290u32);
pub const DWRITE_FONT_FEATURE_TAG_RUBY_NOTATION_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(2036495730u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_ALTERNATES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1953259891u32);
pub const DWRITE_FONT_FEATURE_TAG_SCIENTIFIC_INFERIORS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1718511987u32);
pub const DWRITE_FONT_FEATURE_TAG_SMALL_CAPITALS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1885564275u32);
pub const DWRITE_FONT_FEATURE_TAG_SIMPLIFIED_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1819307379u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_1: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(825258867u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_2: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(842036083u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_3: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(858813299u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_4: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(875590515u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_5: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(892367731u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_6: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(909144947u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_7: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(925922163u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_8: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(942699379u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_9: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(959476595u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_10: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(808547187u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_11: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(825324403u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_12: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(842101619u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_13: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(858878835u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_14: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(875656051u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_15: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(892433267u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_16: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(909210483u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_17: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(925987699u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_18: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(942764915u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_19: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(959542131u32);
pub const DWRITE_FONT_FEATURE_TAG_STYLISTIC_SET_20: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(808612723u32);
pub const DWRITE_FONT_FEATURE_TAG_SUBSCRIPT: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1935832435u32);
pub const DWRITE_FONT_FEATURE_TAG_SUPERSCRIPT: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1936749939u32);
pub const DWRITE_FONT_FEATURE_TAG_SWASH: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1752397683u32);
pub const DWRITE_FONT_FEATURE_TAG_TITLING: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1819568500u32);
pub const DWRITE_FONT_FEATURE_TAG_TRADITIONAL_NAME_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1835101812u32);
pub const DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1836412532u32);
pub const DWRITE_FONT_FEATURE_TAG_TRADITIONAL_FORMS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1684107892u32);
pub const DWRITE_FONT_FEATURE_TAG_THIRD_WIDTHS: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1684633460u32);
pub const DWRITE_FONT_FEATURE_TAG_UNICASE: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1667853941u32);
pub const DWRITE_FONT_FEATURE_TAG_VERTICAL_WRITING: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1953654134u32);
pub const DWRITE_FONT_FEATURE_TAG_VERTICAL_ALTERNATES_AND_ROTATION: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(846492278u32);
pub const DWRITE_FONT_FEATURE_TAG_SLASHED_ZERO: DWRITE_FONT_FEATURE_TAG = DWRITE_FONT_FEATURE_TAG(1869768058u32);
impl ::core::convert::From<u32> for DWRITE_FONT_FEATURE_TAG {
fn from(value: u32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_FEATURE_TAG {
type Abi = Self;
}
impl ::core::ops::BitOr for DWRITE_FONT_FEATURE_TAG {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl ::core::ops::BitAnd for DWRITE_FONT_FEATURE_TAG {
type Output = Self;
fn bitand(self, rhs: Self) -> Self {
Self(self.0 & rhs.0)
}
}
impl ::core::ops::BitOrAssign for DWRITE_FONT_FEATURE_TAG {
fn bitor_assign(&mut self, rhs: Self) {
self.0.bitor_assign(rhs.0)
}
}
impl ::core::ops::BitAndAssign for DWRITE_FONT_FEATURE_TAG {
fn bitand_assign(&mut self, rhs: Self) {
self.0.bitand_assign(rhs.0)
}
}
impl ::core::ops::Not for DWRITE_FONT_FEATURE_TAG {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_FILE_TYPE(pub i32);
pub const DWRITE_FONT_FILE_TYPE_UNKNOWN: DWRITE_FONT_FILE_TYPE = DWRITE_FONT_FILE_TYPE(0i32);
pub const DWRITE_FONT_FILE_TYPE_CFF: DWRITE_FONT_FILE_TYPE = DWRITE_FONT_FILE_TYPE(1i32);
pub const DWRITE_FONT_FILE_TYPE_TRUETYPE: DWRITE_FONT_FILE_TYPE = DWRITE_FONT_FILE_TYPE(2i32);
pub const DWRITE_FONT_FILE_TYPE_OPENTYPE_COLLECTION: DWRITE_FONT_FILE_TYPE = DWRITE_FONT_FILE_TYPE(3i32);
pub const DWRITE_FONT_FILE_TYPE_TYPE1_PFM: DWRITE_FONT_FILE_TYPE = DWRITE_FONT_FILE_TYPE(4i32);
pub const DWRITE_FONT_FILE_TYPE_TYPE1_PFB: DWRITE_FONT_FILE_TYPE = DWRITE_FONT_FILE_TYPE(5i32);
pub const DWRITE_FONT_FILE_TYPE_VECTOR: DWRITE_FONT_FILE_TYPE = DWRITE_FONT_FILE_TYPE(6i32);
pub const DWRITE_FONT_FILE_TYPE_BITMAP: DWRITE_FONT_FILE_TYPE = DWRITE_FONT_FILE_TYPE(7i32);
pub const DWRITE_FONT_FILE_TYPE_TRUETYPE_COLLECTION: DWRITE_FONT_FILE_TYPE = DWRITE_FONT_FILE_TYPE(3i32);
impl ::core::convert::From<i32> for DWRITE_FONT_FILE_TYPE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_FILE_TYPE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_LINE_GAP_USAGE(pub i32);
pub const DWRITE_FONT_LINE_GAP_USAGE_DEFAULT: DWRITE_FONT_LINE_GAP_USAGE = DWRITE_FONT_LINE_GAP_USAGE(0i32);
pub const DWRITE_FONT_LINE_GAP_USAGE_DISABLED: DWRITE_FONT_LINE_GAP_USAGE = DWRITE_FONT_LINE_GAP_USAGE(1i32);
pub const DWRITE_FONT_LINE_GAP_USAGE_ENABLED: DWRITE_FONT_LINE_GAP_USAGE = DWRITE_FONT_LINE_GAP_USAGE(2i32);
impl ::core::convert::From<i32> for DWRITE_FONT_LINE_GAP_USAGE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_LINE_GAP_USAGE {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_FONT_METRICS {
pub designUnitsPerEm: u16,
pub ascent: u16,
pub descent: u16,
pub lineGap: i16,
pub capHeight: u16,
pub xHeight: u16,
pub underlinePosition: i16,
pub underlineThickness: u16,
pub strikethroughPosition: i16,
pub strikethroughThickness: u16,
}
impl DWRITE_FONT_METRICS {}
impl ::core::default::Default for DWRITE_FONT_METRICS {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_FONT_METRICS {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_FONT_METRICS")
.field("designUnitsPerEm", &self.designUnitsPerEm)
.field("ascent", &self.ascent)
.field("descent", &self.descent)
.field("lineGap", &self.lineGap)
.field("capHeight", &self.capHeight)
.field("xHeight", &self.xHeight)
.field("underlinePosition", &self.underlinePosition)
.field("underlineThickness", &self.underlineThickness)
.field("strikethroughPosition", &self.strikethroughPosition)
.field("strikethroughThickness", &self.strikethroughThickness)
.finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_FONT_METRICS {
fn eq(&self, other: &Self) -> bool {
self.designUnitsPerEm == other.designUnitsPerEm && self.ascent == other.ascent && self.descent == other.descent && self.lineGap == other.lineGap && self.capHeight == other.capHeight && self.xHeight == other.xHeight && self.underlinePosition == other.underlinePosition && self.underlineThickness == other.underlineThickness && self.strikethroughPosition == other.strikethroughPosition && self.strikethroughThickness == other.strikethroughThickness
}
}
impl ::core::cmp::Eq for DWRITE_FONT_METRICS {}
unsafe impl ::windows::core::Abi for DWRITE_FONT_METRICS {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_FONT_METRICS1 {
pub __AnonymousBase_DWrite_1_L627_C38: DWRITE_FONT_METRICS,
pub glyphBoxLeft: i16,
pub glyphBoxTop: i16,
pub glyphBoxRight: i16,
pub glyphBoxBottom: i16,
pub subscriptPositionX: i16,
pub subscriptPositionY: i16,
pub subscriptSizeX: i16,
pub subscriptSizeY: i16,
pub superscriptPositionX: i16,
pub superscriptPositionY: i16,
pub superscriptSizeX: i16,
pub superscriptSizeY: i16,
pub hasTypographicMetrics: super::super::Foundation::BOOL,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_FONT_METRICS1 {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_FONT_METRICS1 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_FONT_METRICS1 {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_FONT_METRICS1")
.field("__AnonymousBase_DWrite_1_L627_C38", &self.__AnonymousBase_DWrite_1_L627_C38)
.field("glyphBoxLeft", &self.glyphBoxLeft)
.field("glyphBoxTop", &self.glyphBoxTop)
.field("glyphBoxRight", &self.glyphBoxRight)
.field("glyphBoxBottom", &self.glyphBoxBottom)
.field("subscriptPositionX", &self.subscriptPositionX)
.field("subscriptPositionY", &self.subscriptPositionY)
.field("subscriptSizeX", &self.subscriptSizeX)
.field("subscriptSizeY", &self.subscriptSizeY)
.field("superscriptPositionX", &self.superscriptPositionX)
.field("superscriptPositionY", &self.superscriptPositionY)
.field("superscriptSizeX", &self.superscriptSizeX)
.field("superscriptSizeY", &self.superscriptSizeY)
.field("hasTypographicMetrics", &self.hasTypographicMetrics)
.finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_FONT_METRICS1 {
fn eq(&self, other: &Self) -> bool {
self.__AnonymousBase_DWrite_1_L627_C38 == other.__AnonymousBase_DWrite_1_L627_C38
&& self.glyphBoxLeft == other.glyphBoxLeft
&& self.glyphBoxTop == other.glyphBoxTop
&& self.glyphBoxRight == other.glyphBoxRight
&& self.glyphBoxBottom == other.glyphBoxBottom
&& self.subscriptPositionX == other.subscriptPositionX
&& self.subscriptPositionY == other.subscriptPositionY
&& self.subscriptSizeX == other.subscriptSizeX
&& self.subscriptSizeY == other.subscriptSizeY
&& self.superscriptPositionX == other.superscriptPositionX
&& self.superscriptPositionY == other.superscriptPositionY
&& self.superscriptSizeX == other.superscriptSizeX
&& self.superscriptSizeY == other.superscriptSizeY
&& self.hasTypographicMetrics == other.hasTypographicMetrics
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_FONT_METRICS1 {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_FONT_METRICS1 {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_FONT_PROPERTY {
pub propertyId: DWRITE_FONT_PROPERTY_ID,
pub propertyValue: super::super::Foundation::PWSTR,
pub localeName: super::super::Foundation::PWSTR,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_FONT_PROPERTY {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_FONT_PROPERTY {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_FONT_PROPERTY {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_FONT_PROPERTY").field("propertyId", &self.propertyId).field("propertyValue", &self.propertyValue).field("localeName", &self.localeName).finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_FONT_PROPERTY {
fn eq(&self, other: &Self) -> bool {
self.propertyId == other.propertyId && self.propertyValue == other.propertyValue && self.localeName == other.localeName
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_FONT_PROPERTY {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_FONT_PROPERTY {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_PROPERTY_ID(pub i32);
pub const DWRITE_FONT_PROPERTY_ID_NONE: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(0i32);
pub const DWRITE_FONT_PROPERTY_ID_WEIGHT_STRETCH_STYLE_FAMILY_NAME: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(1i32);
pub const DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FAMILY_NAME: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(2i32);
pub const DWRITE_FONT_PROPERTY_ID_WEIGHT_STRETCH_STYLE_FACE_NAME: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(3i32);
pub const DWRITE_FONT_PROPERTY_ID_FULL_NAME: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(4i32);
pub const DWRITE_FONT_PROPERTY_ID_WIN32_FAMILY_NAME: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(5i32);
pub const DWRITE_FONT_PROPERTY_ID_POSTSCRIPT_NAME: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(6i32);
pub const DWRITE_FONT_PROPERTY_ID_DESIGN_SCRIPT_LANGUAGE_TAG: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(7i32);
pub const DWRITE_FONT_PROPERTY_ID_SUPPORTED_SCRIPT_LANGUAGE_TAG: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(8i32);
pub const DWRITE_FONT_PROPERTY_ID_SEMANTIC_TAG: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(9i32);
pub const DWRITE_FONT_PROPERTY_ID_WEIGHT: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(10i32);
pub const DWRITE_FONT_PROPERTY_ID_STRETCH: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(11i32);
pub const DWRITE_FONT_PROPERTY_ID_STYLE: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(12i32);
pub const DWRITE_FONT_PROPERTY_ID_TYPOGRAPHIC_FACE_NAME: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(13i32);
pub const DWRITE_FONT_PROPERTY_ID_TOTAL: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(13i32);
pub const DWRITE_FONT_PROPERTY_ID_TOTAL_RS3: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(14i32);
pub const DWRITE_FONT_PROPERTY_ID_PREFERRED_FAMILY_NAME: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(2i32);
pub const DWRITE_FONT_PROPERTY_ID_FAMILY_NAME: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(1i32);
pub const DWRITE_FONT_PROPERTY_ID_FACE_NAME: DWRITE_FONT_PROPERTY_ID = DWRITE_FONT_PROPERTY_ID(3i32);
impl ::core::convert::From<i32> for DWRITE_FONT_PROPERTY_ID {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_PROPERTY_ID {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_SIMULATIONS(pub u32);
pub const DWRITE_FONT_SIMULATIONS_NONE: DWRITE_FONT_SIMULATIONS = DWRITE_FONT_SIMULATIONS(0u32);
pub const DWRITE_FONT_SIMULATIONS_BOLD: DWRITE_FONT_SIMULATIONS = DWRITE_FONT_SIMULATIONS(1u32);
pub const DWRITE_FONT_SIMULATIONS_OBLIQUE: DWRITE_FONT_SIMULATIONS = DWRITE_FONT_SIMULATIONS(2u32);
impl ::core::convert::From<u32> for DWRITE_FONT_SIMULATIONS {
fn from(value: u32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_SIMULATIONS {
type Abi = Self;
}
impl ::core::ops::BitOr for DWRITE_FONT_SIMULATIONS {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl ::core::ops::BitAnd for DWRITE_FONT_SIMULATIONS {
type Output = Self;
fn bitand(self, rhs: Self) -> Self {
Self(self.0 & rhs.0)
}
}
impl ::core::ops::BitOrAssign for DWRITE_FONT_SIMULATIONS {
fn bitor_assign(&mut self, rhs: Self) {
self.0.bitor_assign(rhs.0)
}
}
impl ::core::ops::BitAndAssign for DWRITE_FONT_SIMULATIONS {
fn bitand_assign(&mut self, rhs: Self) {
self.0.bitand_assign(rhs.0)
}
}
impl ::core::ops::Not for DWRITE_FONT_SIMULATIONS {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_SOURCE_TYPE(pub i32);
pub const DWRITE_FONT_SOURCE_TYPE_UNKNOWN: DWRITE_FONT_SOURCE_TYPE = DWRITE_FONT_SOURCE_TYPE(0i32);
pub const DWRITE_FONT_SOURCE_TYPE_PER_MACHINE: DWRITE_FONT_SOURCE_TYPE = DWRITE_FONT_SOURCE_TYPE(1i32);
pub const DWRITE_FONT_SOURCE_TYPE_PER_USER: DWRITE_FONT_SOURCE_TYPE = DWRITE_FONT_SOURCE_TYPE(2i32);
pub const DWRITE_FONT_SOURCE_TYPE_APPX_PACKAGE: DWRITE_FONT_SOURCE_TYPE = DWRITE_FONT_SOURCE_TYPE(3i32);
pub const DWRITE_FONT_SOURCE_TYPE_REMOTE_FONT_PROVIDER: DWRITE_FONT_SOURCE_TYPE = DWRITE_FONT_SOURCE_TYPE(4i32);
impl ::core::convert::From<i32> for DWRITE_FONT_SOURCE_TYPE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_SOURCE_TYPE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_STRETCH(pub i32);
pub const DWRITE_FONT_STRETCH_UNDEFINED: DWRITE_FONT_STRETCH = DWRITE_FONT_STRETCH(0i32);
pub const DWRITE_FONT_STRETCH_ULTRA_CONDENSED: DWRITE_FONT_STRETCH = DWRITE_FONT_STRETCH(1i32);
pub const DWRITE_FONT_STRETCH_EXTRA_CONDENSED: DWRITE_FONT_STRETCH = DWRITE_FONT_STRETCH(2i32);
pub const DWRITE_FONT_STRETCH_CONDENSED: DWRITE_FONT_STRETCH = DWRITE_FONT_STRETCH(3i32);
pub const DWRITE_FONT_STRETCH_SEMI_CONDENSED: DWRITE_FONT_STRETCH = DWRITE_FONT_STRETCH(4i32);
pub const DWRITE_FONT_STRETCH_NORMAL: DWRITE_FONT_STRETCH = DWRITE_FONT_STRETCH(5i32);
pub const DWRITE_FONT_STRETCH_MEDIUM: DWRITE_FONT_STRETCH = DWRITE_FONT_STRETCH(5i32);
pub const DWRITE_FONT_STRETCH_SEMI_EXPANDED: DWRITE_FONT_STRETCH = DWRITE_FONT_STRETCH(6i32);
pub const DWRITE_FONT_STRETCH_EXPANDED: DWRITE_FONT_STRETCH = DWRITE_FONT_STRETCH(7i32);
pub const DWRITE_FONT_STRETCH_EXTRA_EXPANDED: DWRITE_FONT_STRETCH = DWRITE_FONT_STRETCH(8i32);
pub const DWRITE_FONT_STRETCH_ULTRA_EXPANDED: DWRITE_FONT_STRETCH = DWRITE_FONT_STRETCH(9i32);
impl ::core::convert::From<i32> for DWRITE_FONT_STRETCH {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_STRETCH {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_STYLE(pub i32);
pub const DWRITE_FONT_STYLE_NORMAL: DWRITE_FONT_STYLE = DWRITE_FONT_STYLE(0i32);
pub const DWRITE_FONT_STYLE_OBLIQUE: DWRITE_FONT_STYLE = DWRITE_FONT_STYLE(1i32);
pub const DWRITE_FONT_STYLE_ITALIC: DWRITE_FONT_STYLE = DWRITE_FONT_STYLE(2i32);
impl ::core::convert::From<i32> for DWRITE_FONT_STYLE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_STYLE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_FONT_WEIGHT(pub i32);
pub const DWRITE_FONT_WEIGHT_THIN: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(100i32);
pub const DWRITE_FONT_WEIGHT_EXTRA_LIGHT: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(200i32);
pub const DWRITE_FONT_WEIGHT_ULTRA_LIGHT: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(200i32);
pub const DWRITE_FONT_WEIGHT_LIGHT: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(300i32);
pub const DWRITE_FONT_WEIGHT_SEMI_LIGHT: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(350i32);
pub const DWRITE_FONT_WEIGHT_NORMAL: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(400i32);
pub const DWRITE_FONT_WEIGHT_REGULAR: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(400i32);
pub const DWRITE_FONT_WEIGHT_MEDIUM: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(500i32);
pub const DWRITE_FONT_WEIGHT_DEMI_BOLD: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(600i32);
pub const DWRITE_FONT_WEIGHT_SEMI_BOLD: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(600i32);
pub const DWRITE_FONT_WEIGHT_BOLD: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(700i32);
pub const DWRITE_FONT_WEIGHT_EXTRA_BOLD: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(800i32);
pub const DWRITE_FONT_WEIGHT_ULTRA_BOLD: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(800i32);
pub const DWRITE_FONT_WEIGHT_BLACK: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(900i32);
pub const DWRITE_FONT_WEIGHT_HEAVY: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(900i32);
pub const DWRITE_FONT_WEIGHT_EXTRA_BLACK: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(950i32);
pub const DWRITE_FONT_WEIGHT_ULTRA_BLACK: DWRITE_FONT_WEIGHT = DWRITE_FONT_WEIGHT(950i32);
impl ::core::convert::From<i32> for DWRITE_FONT_WEIGHT {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_FONT_WEIGHT {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub struct DWRITE_GLYPH_IMAGE_DATA {
pub imageData: *mut ::core::ffi::c_void,
pub imageDataSize: u32,
pub uniqueDataId: u32,
pub pixelsPerEm: u32,
pub pixelSize: super::Direct2D::Common::D2D_SIZE_U,
pub horizontalLeftOrigin: super::super::Foundation::POINT,
pub horizontalRightOrigin: super::super::Foundation::POINT,
pub verticalTopOrigin: super::super::Foundation::POINT,
pub verticalBottomOrigin: super::super::Foundation::POINT,
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
impl DWRITE_GLYPH_IMAGE_DATA {}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
impl ::core::default::Default for DWRITE_GLYPH_IMAGE_DATA {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
impl ::core::fmt::Debug for DWRITE_GLYPH_IMAGE_DATA {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_GLYPH_IMAGE_DATA")
.field("imageData", &self.imageData)
.field("imageDataSize", &self.imageDataSize)
.field("uniqueDataId", &self.uniqueDataId)
.field("pixelsPerEm", &self.pixelsPerEm)
.field("pixelSize", &self.pixelSize)
.field("horizontalLeftOrigin", &self.horizontalLeftOrigin)
.field("horizontalRightOrigin", &self.horizontalRightOrigin)
.field("verticalTopOrigin", &self.verticalTopOrigin)
.field("verticalBottomOrigin", &self.verticalBottomOrigin)
.finish()
}
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
impl ::core::cmp::PartialEq for DWRITE_GLYPH_IMAGE_DATA {
fn eq(&self, other: &Self) -> bool {
self.imageData == other.imageData && self.imageDataSize == other.imageDataSize && self.uniqueDataId == other.uniqueDataId && self.pixelsPerEm == other.pixelsPerEm && self.pixelSize == other.pixelSize && self.horizontalLeftOrigin == other.horizontalLeftOrigin && self.horizontalRightOrigin == other.horizontalRightOrigin && self.verticalTopOrigin == other.verticalTopOrigin && self.verticalBottomOrigin == other.verticalBottomOrigin
}
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
impl ::core::cmp::Eq for DWRITE_GLYPH_IMAGE_DATA {}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
unsafe impl ::windows::core::Abi for DWRITE_GLYPH_IMAGE_DATA {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_GLYPH_IMAGE_FORMATS(pub u32);
pub const DWRITE_GLYPH_IMAGE_FORMATS_NONE: DWRITE_GLYPH_IMAGE_FORMATS = DWRITE_GLYPH_IMAGE_FORMATS(0u32);
pub const DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE: DWRITE_GLYPH_IMAGE_FORMATS = DWRITE_GLYPH_IMAGE_FORMATS(1u32);
pub const DWRITE_GLYPH_IMAGE_FORMATS_CFF: DWRITE_GLYPH_IMAGE_FORMATS = DWRITE_GLYPH_IMAGE_FORMATS(2u32);
pub const DWRITE_GLYPH_IMAGE_FORMATS_COLR: DWRITE_GLYPH_IMAGE_FORMATS = DWRITE_GLYPH_IMAGE_FORMATS(4u32);
pub const DWRITE_GLYPH_IMAGE_FORMATS_SVG: DWRITE_GLYPH_IMAGE_FORMATS = DWRITE_GLYPH_IMAGE_FORMATS(8u32);
pub const DWRITE_GLYPH_IMAGE_FORMATS_PNG: DWRITE_GLYPH_IMAGE_FORMATS = DWRITE_GLYPH_IMAGE_FORMATS(16u32);
pub const DWRITE_GLYPH_IMAGE_FORMATS_JPEG: DWRITE_GLYPH_IMAGE_FORMATS = DWRITE_GLYPH_IMAGE_FORMATS(32u32);
pub const DWRITE_GLYPH_IMAGE_FORMATS_TIFF: DWRITE_GLYPH_IMAGE_FORMATS = DWRITE_GLYPH_IMAGE_FORMATS(64u32);
pub const DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8: DWRITE_GLYPH_IMAGE_FORMATS = DWRITE_GLYPH_IMAGE_FORMATS(128u32);
impl ::core::convert::From<u32> for DWRITE_GLYPH_IMAGE_FORMATS {
fn from(value: u32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_GLYPH_IMAGE_FORMATS {
type Abi = Self;
}
impl ::core::ops::BitOr for DWRITE_GLYPH_IMAGE_FORMATS {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl ::core::ops::BitAnd for DWRITE_GLYPH_IMAGE_FORMATS {
type Output = Self;
fn bitand(self, rhs: Self) -> Self {
Self(self.0 & rhs.0)
}
}
impl ::core::ops::BitOrAssign for DWRITE_GLYPH_IMAGE_FORMATS {
fn bitor_assign(&mut self, rhs: Self) {
self.0.bitor_assign(rhs.0)
}
}
impl ::core::ops::BitAndAssign for DWRITE_GLYPH_IMAGE_FORMATS {
fn bitand_assign(&mut self, rhs: Self) {
self.0.bitand_assign(rhs.0)
}
}
impl ::core::ops::Not for DWRITE_GLYPH_IMAGE_FORMATS {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_GLYPH_METRICS {
pub leftSideBearing: i32,
pub advanceWidth: u32,
pub rightSideBearing: i32,
pub topSideBearing: i32,
pub advanceHeight: u32,
pub bottomSideBearing: i32,
pub verticalOriginY: i32,
}
impl DWRITE_GLYPH_METRICS {}
impl ::core::default::Default for DWRITE_GLYPH_METRICS {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_GLYPH_METRICS {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_GLYPH_METRICS")
.field("leftSideBearing", &self.leftSideBearing)
.field("advanceWidth", &self.advanceWidth)
.field("rightSideBearing", &self.rightSideBearing)
.field("topSideBearing", &self.topSideBearing)
.field("advanceHeight", &self.advanceHeight)
.field("bottomSideBearing", &self.bottomSideBearing)
.field("verticalOriginY", &self.verticalOriginY)
.finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_GLYPH_METRICS {
fn eq(&self, other: &Self) -> bool {
self.leftSideBearing == other.leftSideBearing && self.advanceWidth == other.advanceWidth && self.rightSideBearing == other.rightSideBearing && self.topSideBearing == other.topSideBearing && self.advanceHeight == other.advanceHeight && self.bottomSideBearing == other.bottomSideBearing && self.verticalOriginY == other.verticalOriginY
}
}
impl ::core::cmp::Eq for DWRITE_GLYPH_METRICS {}
unsafe impl ::windows::core::Abi for DWRITE_GLYPH_METRICS {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_GLYPH_OFFSET {
pub advanceOffset: f32,
pub ascenderOffset: f32,
}
impl DWRITE_GLYPH_OFFSET {}
impl ::core::default::Default for DWRITE_GLYPH_OFFSET {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_GLYPH_OFFSET {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_GLYPH_OFFSET").field("advanceOffset", &self.advanceOffset).field("ascenderOffset", &self.ascenderOffset).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_GLYPH_OFFSET {
fn eq(&self, other: &Self) -> bool {
self.advanceOffset == other.advanceOffset && self.ascenderOffset == other.ascenderOffset
}
}
impl ::core::cmp::Eq for DWRITE_GLYPH_OFFSET {}
unsafe impl ::windows::core::Abi for DWRITE_GLYPH_OFFSET {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_GLYPH_ORIENTATION_ANGLE(pub i32);
pub const DWRITE_GLYPH_ORIENTATION_ANGLE_0_DEGREES: DWRITE_GLYPH_ORIENTATION_ANGLE = DWRITE_GLYPH_ORIENTATION_ANGLE(0i32);
pub const DWRITE_GLYPH_ORIENTATION_ANGLE_90_DEGREES: DWRITE_GLYPH_ORIENTATION_ANGLE = DWRITE_GLYPH_ORIENTATION_ANGLE(1i32);
pub const DWRITE_GLYPH_ORIENTATION_ANGLE_180_DEGREES: DWRITE_GLYPH_ORIENTATION_ANGLE = DWRITE_GLYPH_ORIENTATION_ANGLE(2i32);
pub const DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES: DWRITE_GLYPH_ORIENTATION_ANGLE = DWRITE_GLYPH_ORIENTATION_ANGLE(3i32);
impl ::core::convert::From<i32> for DWRITE_GLYPH_ORIENTATION_ANGLE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_GLYPH_ORIENTATION_ANGLE {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_GLYPH_RUN {
pub fontFace: ::core::option::Option<IDWriteFontFace>,
pub fontEmSize: f32,
pub glyphCount: u32,
pub glyphIndices: *mut u16,
pub glyphAdvances: *mut f32,
pub glyphOffsets: *mut DWRITE_GLYPH_OFFSET,
pub isSideways: super::super::Foundation::BOOL,
pub bidiLevel: u32,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_GLYPH_RUN {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_GLYPH_RUN {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_GLYPH_RUN {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_GLYPH_RUN")
.field("fontFace", &self.fontFace)
.field("fontEmSize", &self.fontEmSize)
.field("glyphCount", &self.glyphCount)
.field("glyphIndices", &self.glyphIndices)
.field("glyphAdvances", &self.glyphAdvances)
.field("glyphOffsets", &self.glyphOffsets)
.field("isSideways", &self.isSideways)
.field("bidiLevel", &self.bidiLevel)
.finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_GLYPH_RUN {
fn eq(&self, other: &Self) -> bool {
self.fontFace == other.fontFace && self.fontEmSize == other.fontEmSize && self.glyphCount == other.glyphCount && self.glyphIndices == other.glyphIndices && self.glyphAdvances == other.glyphAdvances && self.glyphOffsets == other.glyphOffsets && self.isSideways == other.isSideways && self.bidiLevel == other.bidiLevel
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_GLYPH_RUN {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_GLYPH_RUN {
type Abi = ::core::mem::ManuallyDrop<Self>;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_GLYPH_RUN_DESCRIPTION {
pub localeName: super::super::Foundation::PWSTR,
pub string: super::super::Foundation::PWSTR,
pub stringLength: u32,
pub clusterMap: *mut u16,
pub textPosition: u32,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_GLYPH_RUN_DESCRIPTION {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_GLYPH_RUN_DESCRIPTION {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_GLYPH_RUN_DESCRIPTION {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_GLYPH_RUN_DESCRIPTION").field("localeName", &self.localeName).field("string", &self.string).field("stringLength", &self.stringLength).field("clusterMap", &self.clusterMap).field("textPosition", &self.textPosition).finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_GLYPH_RUN_DESCRIPTION {
fn eq(&self, other: &Self) -> bool {
self.localeName == other.localeName && self.string == other.string && self.stringLength == other.stringLength && self.clusterMap == other.clusterMap && self.textPosition == other.textPosition
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_GLYPH_RUN_DESCRIPTION {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_GLYPH_RUN_DESCRIPTION {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_GRID_FIT_MODE(pub i32);
pub const DWRITE_GRID_FIT_MODE_DEFAULT: DWRITE_GRID_FIT_MODE = DWRITE_GRID_FIT_MODE(0i32);
pub const DWRITE_GRID_FIT_MODE_DISABLED: DWRITE_GRID_FIT_MODE = DWRITE_GRID_FIT_MODE(1i32);
pub const DWRITE_GRID_FIT_MODE_ENABLED: DWRITE_GRID_FIT_MODE = DWRITE_GRID_FIT_MODE(2i32);
impl ::core::convert::From<i32> for DWRITE_GRID_FIT_MODE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_GRID_FIT_MODE {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_HIT_TEST_METRICS {
pub textPosition: u32,
pub length: u32,
pub left: f32,
pub top: f32,
pub width: f32,
pub height: f32,
pub bidiLevel: u32,
pub isText: super::super::Foundation::BOOL,
pub isTrimmed: super::super::Foundation::BOOL,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_HIT_TEST_METRICS {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_HIT_TEST_METRICS {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_HIT_TEST_METRICS {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_HIT_TEST_METRICS")
.field("textPosition", &self.textPosition)
.field("length", &self.length)
.field("left", &self.left)
.field("top", &self.top)
.field("width", &self.width)
.field("height", &self.height)
.field("bidiLevel", &self.bidiLevel)
.field("isText", &self.isText)
.field("isTrimmed", &self.isTrimmed)
.finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_HIT_TEST_METRICS {
fn eq(&self, other: &Self) -> bool {
self.textPosition == other.textPosition && self.length == other.length && self.left == other.left && self.top == other.top && self.width == other.width && self.height == other.height && self.bidiLevel == other.bidiLevel && self.isText == other.isText && self.isTrimmed == other.isTrimmed
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_HIT_TEST_METRICS {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_HIT_TEST_METRICS {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_INFORMATIONAL_STRING_ID(pub i32);
pub const DWRITE_INFORMATIONAL_STRING_NONE: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(0i32);
pub const DWRITE_INFORMATIONAL_STRING_COPYRIGHT_NOTICE: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(1i32);
pub const DWRITE_INFORMATIONAL_STRING_VERSION_STRINGS: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(2i32);
pub const DWRITE_INFORMATIONAL_STRING_TRADEMARK: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(3i32);
pub const DWRITE_INFORMATIONAL_STRING_MANUFACTURER: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(4i32);
pub const DWRITE_INFORMATIONAL_STRING_DESIGNER: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(5i32);
pub const DWRITE_INFORMATIONAL_STRING_DESIGNER_URL: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(6i32);
pub const DWRITE_INFORMATIONAL_STRING_DESCRIPTION: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(7i32);
pub const DWRITE_INFORMATIONAL_STRING_FONT_VENDOR_URL: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(8i32);
pub const DWRITE_INFORMATIONAL_STRING_LICENSE_DESCRIPTION: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(9i32);
pub const DWRITE_INFORMATIONAL_STRING_LICENSE_INFO_URL: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(10i32);
pub const DWRITE_INFORMATIONAL_STRING_WIN32_FAMILY_NAMES: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(11i32);
pub const DWRITE_INFORMATIONAL_STRING_WIN32_SUBFAMILY_NAMES: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(12i32);
pub const DWRITE_INFORMATIONAL_STRING_TYPOGRAPHIC_FAMILY_NAMES: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(13i32);
pub const DWRITE_INFORMATIONAL_STRING_TYPOGRAPHIC_SUBFAMILY_NAMES: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(14i32);
pub const DWRITE_INFORMATIONAL_STRING_SAMPLE_TEXT: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(15i32);
pub const DWRITE_INFORMATIONAL_STRING_FULL_NAME: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(16i32);
pub const DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_NAME: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(17i32);
pub const DWRITE_INFORMATIONAL_STRING_POSTSCRIPT_CID_NAME: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(18i32);
pub const DWRITE_INFORMATIONAL_STRING_WEIGHT_STRETCH_STYLE_FAMILY_NAME: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(19i32);
pub const DWRITE_INFORMATIONAL_STRING_DESIGN_SCRIPT_LANGUAGE_TAG: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(20i32);
pub const DWRITE_INFORMATIONAL_STRING_SUPPORTED_SCRIPT_LANGUAGE_TAG: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(21i32);
pub const DWRITE_INFORMATIONAL_STRING_PREFERRED_FAMILY_NAMES: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(13i32);
pub const DWRITE_INFORMATIONAL_STRING_PREFERRED_SUBFAMILY_NAMES: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(14i32);
pub const DWRITE_INFORMATIONAL_STRING_WWS_FAMILY_NAME: DWRITE_INFORMATIONAL_STRING_ID = DWRITE_INFORMATIONAL_STRING_ID(19i32);
impl ::core::convert::From<i32> for DWRITE_INFORMATIONAL_STRING_ID {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_INFORMATIONAL_STRING_ID {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_INLINE_OBJECT_METRICS {
pub width: f32,
pub height: f32,
pub baseline: f32,
pub supportsSideways: super::super::Foundation::BOOL,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_INLINE_OBJECT_METRICS {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_INLINE_OBJECT_METRICS {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_INLINE_OBJECT_METRICS {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_INLINE_OBJECT_METRICS").field("width", &self.width).field("height", &self.height).field("baseline", &self.baseline).field("supportsSideways", &self.supportsSideways).finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_INLINE_OBJECT_METRICS {
fn eq(&self, other: &Self) -> bool {
self.width == other.width && self.height == other.height && self.baseline == other.baseline && self.supportsSideways == other.supportsSideways
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_INLINE_OBJECT_METRICS {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_INLINE_OBJECT_METRICS {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_JUSTIFICATION_OPPORTUNITY {
pub expansionMinimum: f32,
pub expansionMaximum: f32,
pub compressionMaximum: f32,
pub _bitfield: u32,
}
impl DWRITE_JUSTIFICATION_OPPORTUNITY {}
impl ::core::default::Default for DWRITE_JUSTIFICATION_OPPORTUNITY {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_JUSTIFICATION_OPPORTUNITY {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_JUSTIFICATION_OPPORTUNITY").field("expansionMinimum", &self.expansionMinimum).field("expansionMaximum", &self.expansionMaximum).field("compressionMaximum", &self.compressionMaximum).field("_bitfield", &self._bitfield).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_JUSTIFICATION_OPPORTUNITY {
fn eq(&self, other: &Self) -> bool {
self.expansionMinimum == other.expansionMinimum && self.expansionMaximum == other.expansionMaximum && self.compressionMaximum == other.compressionMaximum && self._bitfield == other._bitfield
}
}
impl ::core::cmp::Eq for DWRITE_JUSTIFICATION_OPPORTUNITY {}
unsafe impl ::windows::core::Abi for DWRITE_JUSTIFICATION_OPPORTUNITY {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_LINE_BREAKPOINT {
pub _bitfield: u8,
}
impl DWRITE_LINE_BREAKPOINT {}
impl ::core::default::Default for DWRITE_LINE_BREAKPOINT {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_LINE_BREAKPOINT {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_LINE_BREAKPOINT").field("_bitfield", &self._bitfield).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_LINE_BREAKPOINT {
fn eq(&self, other: &Self) -> bool {
self._bitfield == other._bitfield
}
}
impl ::core::cmp::Eq for DWRITE_LINE_BREAKPOINT {}
unsafe impl ::windows::core::Abi for DWRITE_LINE_BREAKPOINT {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_LINE_METRICS {
pub length: u32,
pub trailingWhitespaceLength: u32,
pub newlineLength: u32,
pub height: f32,
pub baseline: f32,
pub isTrimmed: super::super::Foundation::BOOL,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_LINE_METRICS {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_LINE_METRICS {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_LINE_METRICS {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_LINE_METRICS").field("length", &self.length).field("trailingWhitespaceLength", &self.trailingWhitespaceLength).field("newlineLength", &self.newlineLength).field("height", &self.height).field("baseline", &self.baseline).field("isTrimmed", &self.isTrimmed).finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_LINE_METRICS {
fn eq(&self, other: &Self) -> bool {
self.length == other.length && self.trailingWhitespaceLength == other.trailingWhitespaceLength && self.newlineLength == other.newlineLength && self.height == other.height && self.baseline == other.baseline && self.isTrimmed == other.isTrimmed
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_LINE_METRICS {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_LINE_METRICS {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_LINE_METRICS1 {
pub Base: DWRITE_LINE_METRICS,
pub leadingBefore: f32,
pub leadingAfter: f32,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_LINE_METRICS1 {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_LINE_METRICS1 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_LINE_METRICS1 {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_LINE_METRICS1").field("Base", &self.Base).field("leadingBefore", &self.leadingBefore).field("leadingAfter", &self.leadingAfter).finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_LINE_METRICS1 {
fn eq(&self, other: &Self) -> bool {
self.Base == other.Base && self.leadingBefore == other.leadingBefore && self.leadingAfter == other.leadingAfter
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_LINE_METRICS1 {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_LINE_METRICS1 {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_LINE_SPACING {
pub method: DWRITE_LINE_SPACING_METHOD,
pub height: f32,
pub baseline: f32,
pub leadingBefore: f32,
pub fontLineGapUsage: DWRITE_FONT_LINE_GAP_USAGE,
}
impl DWRITE_LINE_SPACING {}
impl ::core::default::Default for DWRITE_LINE_SPACING {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_LINE_SPACING {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_LINE_SPACING").field("method", &self.method).field("height", &self.height).field("baseline", &self.baseline).field("leadingBefore", &self.leadingBefore).field("fontLineGapUsage", &self.fontLineGapUsage).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_LINE_SPACING {
fn eq(&self, other: &Self) -> bool {
self.method == other.method && self.height == other.height && self.baseline == other.baseline && self.leadingBefore == other.leadingBefore && self.fontLineGapUsage == other.fontLineGapUsage
}
}
impl ::core::cmp::Eq for DWRITE_LINE_SPACING {}
unsafe impl ::windows::core::Abi for DWRITE_LINE_SPACING {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_LINE_SPACING_METHOD(pub i32);
pub const DWRITE_LINE_SPACING_METHOD_DEFAULT: DWRITE_LINE_SPACING_METHOD = DWRITE_LINE_SPACING_METHOD(0i32);
pub const DWRITE_LINE_SPACING_METHOD_UNIFORM: DWRITE_LINE_SPACING_METHOD = DWRITE_LINE_SPACING_METHOD(1i32);
pub const DWRITE_LINE_SPACING_METHOD_PROPORTIONAL: DWRITE_LINE_SPACING_METHOD = DWRITE_LINE_SPACING_METHOD(2i32);
impl ::core::convert::From<i32> for DWRITE_LINE_SPACING_METHOD {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_LINE_SPACING_METHOD {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_LOCALITY(pub i32);
pub const DWRITE_LOCALITY_REMOTE: DWRITE_LOCALITY = DWRITE_LOCALITY(0i32);
pub const DWRITE_LOCALITY_PARTIAL: DWRITE_LOCALITY = DWRITE_LOCALITY(1i32);
pub const DWRITE_LOCALITY_LOCAL: DWRITE_LOCALITY = DWRITE_LOCALITY(2i32);
impl ::core::convert::From<i32> for DWRITE_LOCALITY {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_LOCALITY {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_MATRIX {
pub m11: f32,
pub m12: f32,
pub m21: f32,
pub m22: f32,
pub dx: f32,
pub dy: f32,
}
impl DWRITE_MATRIX {}
impl ::core::default::Default for DWRITE_MATRIX {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_MATRIX {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_MATRIX").field("m11", &self.m11).field("m12", &self.m12).field("m21", &self.m21).field("m22", &self.m22).field("dx", &self.dx).field("dy", &self.dy).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_MATRIX {
fn eq(&self, other: &Self) -> bool {
self.m11 == other.m11 && self.m12 == other.m12 && self.m21 == other.m21 && self.m22 == other.m22 && self.dx == other.dx && self.dy == other.dy
}
}
impl ::core::cmp::Eq for DWRITE_MATRIX {}
unsafe impl ::windows::core::Abi for DWRITE_MATRIX {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_MEASURING_MODE(pub i32);
pub const DWRITE_MEASURING_MODE_NATURAL: DWRITE_MEASURING_MODE = DWRITE_MEASURING_MODE(0i32);
pub const DWRITE_MEASURING_MODE_GDI_CLASSIC: DWRITE_MEASURING_MODE = DWRITE_MEASURING_MODE(1i32);
pub const DWRITE_MEASURING_MODE_GDI_NATURAL: DWRITE_MEASURING_MODE = DWRITE_MEASURING_MODE(2i32);
impl ::core::convert::From<i32> for DWRITE_MEASURING_MODE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_MEASURING_MODE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_NUMBER_SUBSTITUTION_METHOD(pub i32);
pub const DWRITE_NUMBER_SUBSTITUTION_METHOD_FROM_CULTURE: DWRITE_NUMBER_SUBSTITUTION_METHOD = DWRITE_NUMBER_SUBSTITUTION_METHOD(0i32);
pub const DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL: DWRITE_NUMBER_SUBSTITUTION_METHOD = DWRITE_NUMBER_SUBSTITUTION_METHOD(1i32);
pub const DWRITE_NUMBER_SUBSTITUTION_METHOD_NONE: DWRITE_NUMBER_SUBSTITUTION_METHOD = DWRITE_NUMBER_SUBSTITUTION_METHOD(2i32);
pub const DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL: DWRITE_NUMBER_SUBSTITUTION_METHOD = DWRITE_NUMBER_SUBSTITUTION_METHOD(3i32);
pub const DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL: DWRITE_NUMBER_SUBSTITUTION_METHOD = DWRITE_NUMBER_SUBSTITUTION_METHOD(4i32);
impl ::core::convert::From<i32> for DWRITE_NUMBER_SUBSTITUTION_METHOD {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_NUMBER_SUBSTITUTION_METHOD {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_OPTICAL_ALIGNMENT(pub i32);
pub const DWRITE_OPTICAL_ALIGNMENT_NONE: DWRITE_OPTICAL_ALIGNMENT = DWRITE_OPTICAL_ALIGNMENT(0i32);
pub const DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS: DWRITE_OPTICAL_ALIGNMENT = DWRITE_OPTICAL_ALIGNMENT(1i32);
impl ::core::convert::From<i32> for DWRITE_OPTICAL_ALIGNMENT {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_OPTICAL_ALIGNMENT {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_OUTLINE_THRESHOLD(pub i32);
pub const DWRITE_OUTLINE_THRESHOLD_ANTIALIASED: DWRITE_OUTLINE_THRESHOLD = DWRITE_OUTLINE_THRESHOLD(0i32);
pub const DWRITE_OUTLINE_THRESHOLD_ALIASED: DWRITE_OUTLINE_THRESHOLD = DWRITE_OUTLINE_THRESHOLD(1i32);
impl ::core::convert::From<i32> for DWRITE_OUTLINE_THRESHOLD {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_OUTLINE_THRESHOLD {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_OVERHANG_METRICS {
pub left: f32,
pub top: f32,
pub right: f32,
pub bottom: f32,
}
impl DWRITE_OVERHANG_METRICS {}
impl ::core::default::Default for DWRITE_OVERHANG_METRICS {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_OVERHANG_METRICS {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_OVERHANG_METRICS").field("left", &self.left).field("top", &self.top).field("right", &self.right).field("bottom", &self.bottom).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_OVERHANG_METRICS {
fn eq(&self, other: &Self) -> bool {
self.left == other.left && self.top == other.top && self.right == other.right && self.bottom == other.bottom
}
}
impl ::core::cmp::Eq for DWRITE_OVERHANG_METRICS {}
unsafe impl ::windows::core::Abi for DWRITE_OVERHANG_METRICS {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub union DWRITE_PANOSE {
pub values: [u8; 10],
pub familyKind: u8,
pub text: DWRITE_PANOSE_3,
pub script: DWRITE_PANOSE_1,
pub decorative: DWRITE_PANOSE_0,
pub symbol: DWRITE_PANOSE_2,
}
impl DWRITE_PANOSE {}
impl ::core::default::Default for DWRITE_PANOSE {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::cmp::PartialEq for DWRITE_PANOSE {
fn eq(&self, _other: &Self) -> bool {
unimplemented!()
}
}
impl ::core::cmp::Eq for DWRITE_PANOSE {}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_PANOSE_0 {
pub familyKind: u8,
pub decorativeClass: u8,
pub weight: u8,
pub aspect: u8,
pub contrast: u8,
pub serifVariant: u8,
pub fill: u8,
pub lining: u8,
pub decorativeTopology: u8,
pub characterRange: u8,
}
impl DWRITE_PANOSE_0 {}
impl ::core::default::Default for DWRITE_PANOSE_0 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_PANOSE_0 {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("_decorative_e__Struct")
.field("familyKind", &self.familyKind)
.field("decorativeClass", &self.decorativeClass)
.field("weight", &self.weight)
.field("aspect", &self.aspect)
.field("contrast", &self.contrast)
.field("serifVariant", &self.serifVariant)
.field("fill", &self.fill)
.field("lining", &self.lining)
.field("decorativeTopology", &self.decorativeTopology)
.field("characterRange", &self.characterRange)
.finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_PANOSE_0 {
fn eq(&self, other: &Self) -> bool {
self.familyKind == other.familyKind && self.decorativeClass == other.decorativeClass && self.weight == other.weight && self.aspect == other.aspect && self.contrast == other.contrast && self.serifVariant == other.serifVariant && self.fill == other.fill && self.lining == other.lining && self.decorativeTopology == other.decorativeTopology && self.characterRange == other.characterRange
}
}
impl ::core::cmp::Eq for DWRITE_PANOSE_0 {}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_0 {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_PANOSE_1 {
pub familyKind: u8,
pub toolKind: u8,
pub weight: u8,
pub spacing: u8,
pub aspectRatio: u8,
pub contrast: u8,
pub scriptTopology: u8,
pub scriptForm: u8,
pub finials: u8,
pub xAscent: u8,
}
impl DWRITE_PANOSE_1 {}
impl ::core::default::Default for DWRITE_PANOSE_1 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_PANOSE_1 {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("_script_e__Struct")
.field("familyKind", &self.familyKind)
.field("toolKind", &self.toolKind)
.field("weight", &self.weight)
.field("spacing", &self.spacing)
.field("aspectRatio", &self.aspectRatio)
.field("contrast", &self.contrast)
.field("scriptTopology", &self.scriptTopology)
.field("scriptForm", &self.scriptForm)
.field("finials", &self.finials)
.field("xAscent", &self.xAscent)
.finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_PANOSE_1 {
fn eq(&self, other: &Self) -> bool {
self.familyKind == other.familyKind && self.toolKind == other.toolKind && self.weight == other.weight && self.spacing == other.spacing && self.aspectRatio == other.aspectRatio && self.contrast == other.contrast && self.scriptTopology == other.scriptTopology && self.scriptForm == other.scriptForm && self.finials == other.finials && self.xAscent == other.xAscent
}
}
impl ::core::cmp::Eq for DWRITE_PANOSE_1 {}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_1 {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_PANOSE_2 {
pub familyKind: u8,
pub symbolKind: u8,
pub weight: u8,
pub spacing: u8,
pub aspectRatioAndContrast: u8,
pub aspectRatio94: u8,
pub aspectRatio119: u8,
pub aspectRatio157: u8,
pub aspectRatio163: u8,
pub aspectRatio211: u8,
}
impl DWRITE_PANOSE_2 {}
impl ::core::default::Default for DWRITE_PANOSE_2 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_PANOSE_2 {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("_symbol_e__Struct")
.field("familyKind", &self.familyKind)
.field("symbolKind", &self.symbolKind)
.field("weight", &self.weight)
.field("spacing", &self.spacing)
.field("aspectRatioAndContrast", &self.aspectRatioAndContrast)
.field("aspectRatio94", &self.aspectRatio94)
.field("aspectRatio119", &self.aspectRatio119)
.field("aspectRatio157", &self.aspectRatio157)
.field("aspectRatio163", &self.aspectRatio163)
.field("aspectRatio211", &self.aspectRatio211)
.finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_PANOSE_2 {
fn eq(&self, other: &Self) -> bool {
self.familyKind == other.familyKind && self.symbolKind == other.symbolKind && self.weight == other.weight && self.spacing == other.spacing && self.aspectRatioAndContrast == other.aspectRatioAndContrast && self.aspectRatio94 == other.aspectRatio94 && self.aspectRatio119 == other.aspectRatio119 && self.aspectRatio157 == other.aspectRatio157 && self.aspectRatio163 == other.aspectRatio163 && self.aspectRatio211 == other.aspectRatio211
}
}
impl ::core::cmp::Eq for DWRITE_PANOSE_2 {}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_2 {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_PANOSE_3 {
pub familyKind: u8,
pub serifStyle: u8,
pub weight: u8,
pub proportion: u8,
pub contrast: u8,
pub strokeVariation: u8,
pub armStyle: u8,
pub letterform: u8,
pub midline: u8,
pub xHeight: u8,
}
impl DWRITE_PANOSE_3 {}
impl ::core::default::Default for DWRITE_PANOSE_3 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_PANOSE_3 {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("_text_e__Struct")
.field("familyKind", &self.familyKind)
.field("serifStyle", &self.serifStyle)
.field("weight", &self.weight)
.field("proportion", &self.proportion)
.field("contrast", &self.contrast)
.field("strokeVariation", &self.strokeVariation)
.field("armStyle", &self.armStyle)
.field("letterform", &self.letterform)
.field("midline", &self.midline)
.field("xHeight", &self.xHeight)
.finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_PANOSE_3 {
fn eq(&self, other: &Self) -> bool {
self.familyKind == other.familyKind && self.serifStyle == other.serifStyle && self.weight == other.weight && self.proportion == other.proportion && self.contrast == other.contrast && self.strokeVariation == other.strokeVariation && self.armStyle == other.armStyle && self.letterform == other.letterform && self.midline == other.midline && self.xHeight == other.xHeight
}
}
impl ::core::cmp::Eq for DWRITE_PANOSE_3 {}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_3 {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_ARM_STYLE(pub i32);
pub const DWRITE_PANOSE_ARM_STYLE_ANY: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(0i32);
pub const DWRITE_PANOSE_ARM_STYLE_NO_FIT: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(1i32);
pub const DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_HORIZONTAL: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(2i32);
pub const DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_WEDGE: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(3i32);
pub const DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_VERTICAL: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(4i32);
pub const DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_SINGLE_SERIF: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(5i32);
pub const DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_DOUBLE_SERIF: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(6i32);
pub const DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_HORIZONTAL: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(7i32);
pub const DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_WEDGE: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(8i32);
pub const DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_VERTICAL: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(9i32);
pub const DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_SINGLE_SERIF: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(10i32);
pub const DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_DOUBLE_SERIF: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(11i32);
pub const DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_HORZ: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(2i32);
pub const DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_VERT: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(4i32);
pub const DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_HORZ: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(7i32);
pub const DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_WEDGE: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(8i32);
pub const DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_VERT: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(9i32);
pub const DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_SINGLE_SERIF: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(10i32);
pub const DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_DOUBLE_SERIF: DWRITE_PANOSE_ARM_STYLE = DWRITE_PANOSE_ARM_STYLE(11i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_ARM_STYLE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_ARM_STYLE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_ASPECT(pub i32);
pub const DWRITE_PANOSE_ASPECT_ANY: DWRITE_PANOSE_ASPECT = DWRITE_PANOSE_ASPECT(0i32);
pub const DWRITE_PANOSE_ASPECT_NO_FIT: DWRITE_PANOSE_ASPECT = DWRITE_PANOSE_ASPECT(1i32);
pub const DWRITE_PANOSE_ASPECT_SUPER_CONDENSED: DWRITE_PANOSE_ASPECT = DWRITE_PANOSE_ASPECT(2i32);
pub const DWRITE_PANOSE_ASPECT_VERY_CONDENSED: DWRITE_PANOSE_ASPECT = DWRITE_PANOSE_ASPECT(3i32);
pub const DWRITE_PANOSE_ASPECT_CONDENSED: DWRITE_PANOSE_ASPECT = DWRITE_PANOSE_ASPECT(4i32);
pub const DWRITE_PANOSE_ASPECT_NORMAL: DWRITE_PANOSE_ASPECT = DWRITE_PANOSE_ASPECT(5i32);
pub const DWRITE_PANOSE_ASPECT_EXTENDED: DWRITE_PANOSE_ASPECT = DWRITE_PANOSE_ASPECT(6i32);
pub const DWRITE_PANOSE_ASPECT_VERY_EXTENDED: DWRITE_PANOSE_ASPECT = DWRITE_PANOSE_ASPECT(7i32);
pub const DWRITE_PANOSE_ASPECT_SUPER_EXTENDED: DWRITE_PANOSE_ASPECT = DWRITE_PANOSE_ASPECT(8i32);
pub const DWRITE_PANOSE_ASPECT_MONOSPACED: DWRITE_PANOSE_ASPECT = DWRITE_PANOSE_ASPECT(9i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_ASPECT {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_ASPECT {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_ASPECT_RATIO(pub i32);
pub const DWRITE_PANOSE_ASPECT_RATIO_ANY: DWRITE_PANOSE_ASPECT_RATIO = DWRITE_PANOSE_ASPECT_RATIO(0i32);
pub const DWRITE_PANOSE_ASPECT_RATIO_NO_FIT: DWRITE_PANOSE_ASPECT_RATIO = DWRITE_PANOSE_ASPECT_RATIO(1i32);
pub const DWRITE_PANOSE_ASPECT_RATIO_VERY_CONDENSED: DWRITE_PANOSE_ASPECT_RATIO = DWRITE_PANOSE_ASPECT_RATIO(2i32);
pub const DWRITE_PANOSE_ASPECT_RATIO_CONDENSED: DWRITE_PANOSE_ASPECT_RATIO = DWRITE_PANOSE_ASPECT_RATIO(3i32);
pub const DWRITE_PANOSE_ASPECT_RATIO_NORMAL: DWRITE_PANOSE_ASPECT_RATIO = DWRITE_PANOSE_ASPECT_RATIO(4i32);
pub const DWRITE_PANOSE_ASPECT_RATIO_EXPANDED: DWRITE_PANOSE_ASPECT_RATIO = DWRITE_PANOSE_ASPECT_RATIO(5i32);
pub const DWRITE_PANOSE_ASPECT_RATIO_VERY_EXPANDED: DWRITE_PANOSE_ASPECT_RATIO = DWRITE_PANOSE_ASPECT_RATIO(6i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_ASPECT_RATIO {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_ASPECT_RATIO {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_CHARACTER_RANGES(pub i32);
pub const DWRITE_PANOSE_CHARACTER_RANGES_ANY: DWRITE_PANOSE_CHARACTER_RANGES = DWRITE_PANOSE_CHARACTER_RANGES(0i32);
pub const DWRITE_PANOSE_CHARACTER_RANGES_NO_FIT: DWRITE_PANOSE_CHARACTER_RANGES = DWRITE_PANOSE_CHARACTER_RANGES(1i32);
pub const DWRITE_PANOSE_CHARACTER_RANGES_EXTENDED_COLLECTION: DWRITE_PANOSE_CHARACTER_RANGES = DWRITE_PANOSE_CHARACTER_RANGES(2i32);
pub const DWRITE_PANOSE_CHARACTER_RANGES_LITERALS: DWRITE_PANOSE_CHARACTER_RANGES = DWRITE_PANOSE_CHARACTER_RANGES(3i32);
pub const DWRITE_PANOSE_CHARACTER_RANGES_NO_LOWER_CASE: DWRITE_PANOSE_CHARACTER_RANGES = DWRITE_PANOSE_CHARACTER_RANGES(4i32);
pub const DWRITE_PANOSE_CHARACTER_RANGES_SMALL_CAPS: DWRITE_PANOSE_CHARACTER_RANGES = DWRITE_PANOSE_CHARACTER_RANGES(5i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_CHARACTER_RANGES {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_CHARACTER_RANGES {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_CONTRAST(pub i32);
pub const DWRITE_PANOSE_CONTRAST_ANY: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(0i32);
pub const DWRITE_PANOSE_CONTRAST_NO_FIT: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(1i32);
pub const DWRITE_PANOSE_CONTRAST_NONE: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(2i32);
pub const DWRITE_PANOSE_CONTRAST_VERY_LOW: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(3i32);
pub const DWRITE_PANOSE_CONTRAST_LOW: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(4i32);
pub const DWRITE_PANOSE_CONTRAST_MEDIUM_LOW: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(5i32);
pub const DWRITE_PANOSE_CONTRAST_MEDIUM: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(6i32);
pub const DWRITE_PANOSE_CONTRAST_MEDIUM_HIGH: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(7i32);
pub const DWRITE_PANOSE_CONTRAST_HIGH: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(8i32);
pub const DWRITE_PANOSE_CONTRAST_VERY_HIGH: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(9i32);
pub const DWRITE_PANOSE_CONTRAST_HORIZONTAL_LOW: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(10i32);
pub const DWRITE_PANOSE_CONTRAST_HORIZONTAL_MEDIUM: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(11i32);
pub const DWRITE_PANOSE_CONTRAST_HORIZONTAL_HIGH: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(12i32);
pub const DWRITE_PANOSE_CONTRAST_BROKEN: DWRITE_PANOSE_CONTRAST = DWRITE_PANOSE_CONTRAST(13i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_CONTRAST {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_CONTRAST {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_DECORATIVE_CLASS(pub i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_ANY: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(0i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_NO_FIT: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(1i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_DERIVATIVE: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(2i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_TOPOLOGY: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(3i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_ELEMENTS: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(4i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_ASPECT: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(5i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_INITIALS: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(6i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_CARTOON: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(7i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_PICTURE_STEMS: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(8i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_ORNAMENTED: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(9i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_TEXT_AND_BACKGROUND: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(10i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_COLLAGE: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(11i32);
pub const DWRITE_PANOSE_DECORATIVE_CLASS_MONTAGE: DWRITE_PANOSE_DECORATIVE_CLASS = DWRITE_PANOSE_DECORATIVE_CLASS(12i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_DECORATIVE_CLASS {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_DECORATIVE_CLASS {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_DECORATIVE_TOPOLOGY(pub i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_ANY: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(0i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_NO_FIT: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(1i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_STANDARD: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(2i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_SQUARE: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(3i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_MULTIPLE_SEGMENT: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(4i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_ART_DECO: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(5i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_UNEVEN_WEIGHTING: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(6i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_DIVERSE_ARMS: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(7i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_DIVERSE_FORMS: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(8i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_LOMBARDIC_FORMS: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(9i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_UPPER_CASE_IN_LOWER_CASE: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(10i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_IMPLIED_TOPOLOGY: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(11i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_HORSESHOE_E_AND_A: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(12i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_CURSIVE: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(13i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_BLACKLETTER: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(14i32);
pub const DWRITE_PANOSE_DECORATIVE_TOPOLOGY_SWASH_VARIANCE: DWRITE_PANOSE_DECORATIVE_TOPOLOGY = DWRITE_PANOSE_DECORATIVE_TOPOLOGY(15i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_DECORATIVE_TOPOLOGY {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_DECORATIVE_TOPOLOGY {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_FAMILY(pub i32);
pub const DWRITE_PANOSE_FAMILY_ANY: DWRITE_PANOSE_FAMILY = DWRITE_PANOSE_FAMILY(0i32);
pub const DWRITE_PANOSE_FAMILY_NO_FIT: DWRITE_PANOSE_FAMILY = DWRITE_PANOSE_FAMILY(1i32);
pub const DWRITE_PANOSE_FAMILY_TEXT_DISPLAY: DWRITE_PANOSE_FAMILY = DWRITE_PANOSE_FAMILY(2i32);
pub const DWRITE_PANOSE_FAMILY_SCRIPT: DWRITE_PANOSE_FAMILY = DWRITE_PANOSE_FAMILY(3i32);
pub const DWRITE_PANOSE_FAMILY_DECORATIVE: DWRITE_PANOSE_FAMILY = DWRITE_PANOSE_FAMILY(4i32);
pub const DWRITE_PANOSE_FAMILY_SYMBOL: DWRITE_PANOSE_FAMILY = DWRITE_PANOSE_FAMILY(5i32);
pub const DWRITE_PANOSE_FAMILY_PICTORIAL: DWRITE_PANOSE_FAMILY = DWRITE_PANOSE_FAMILY(5i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_FAMILY {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_FAMILY {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_FILL(pub i32);
pub const DWRITE_PANOSE_FILL_ANY: DWRITE_PANOSE_FILL = DWRITE_PANOSE_FILL(0i32);
pub const DWRITE_PANOSE_FILL_NO_FIT: DWRITE_PANOSE_FILL = DWRITE_PANOSE_FILL(1i32);
pub const DWRITE_PANOSE_FILL_STANDARD_SOLID_FILL: DWRITE_PANOSE_FILL = DWRITE_PANOSE_FILL(2i32);
pub const DWRITE_PANOSE_FILL_NO_FILL: DWRITE_PANOSE_FILL = DWRITE_PANOSE_FILL(3i32);
pub const DWRITE_PANOSE_FILL_PATTERNED_FILL: DWRITE_PANOSE_FILL = DWRITE_PANOSE_FILL(4i32);
pub const DWRITE_PANOSE_FILL_COMPLEX_FILL: DWRITE_PANOSE_FILL = DWRITE_PANOSE_FILL(5i32);
pub const DWRITE_PANOSE_FILL_SHAPED_FILL: DWRITE_PANOSE_FILL = DWRITE_PANOSE_FILL(6i32);
pub const DWRITE_PANOSE_FILL_DRAWN_DISTRESSED: DWRITE_PANOSE_FILL = DWRITE_PANOSE_FILL(7i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_FILL {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_FILL {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_FINIALS(pub i32);
pub const DWRITE_PANOSE_FINIALS_ANY: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(0i32);
pub const DWRITE_PANOSE_FINIALS_NO_FIT: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(1i32);
pub const DWRITE_PANOSE_FINIALS_NONE_NO_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(2i32);
pub const DWRITE_PANOSE_FINIALS_NONE_CLOSED_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(3i32);
pub const DWRITE_PANOSE_FINIALS_NONE_OPEN_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(4i32);
pub const DWRITE_PANOSE_FINIALS_SHARP_NO_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(5i32);
pub const DWRITE_PANOSE_FINIALS_SHARP_CLOSED_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(6i32);
pub const DWRITE_PANOSE_FINIALS_SHARP_OPEN_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(7i32);
pub const DWRITE_PANOSE_FINIALS_TAPERED_NO_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(8i32);
pub const DWRITE_PANOSE_FINIALS_TAPERED_CLOSED_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(9i32);
pub const DWRITE_PANOSE_FINIALS_TAPERED_OPEN_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(10i32);
pub const DWRITE_PANOSE_FINIALS_ROUND_NO_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(11i32);
pub const DWRITE_PANOSE_FINIALS_ROUND_CLOSED_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(12i32);
pub const DWRITE_PANOSE_FINIALS_ROUND_OPEN_LOOPS: DWRITE_PANOSE_FINIALS = DWRITE_PANOSE_FINIALS(13i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_FINIALS {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_FINIALS {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_LETTERFORM(pub i32);
pub const DWRITE_PANOSE_LETTERFORM_ANY: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(0i32);
pub const DWRITE_PANOSE_LETTERFORM_NO_FIT: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(1i32);
pub const DWRITE_PANOSE_LETTERFORM_NORMAL_CONTACT: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(2i32);
pub const DWRITE_PANOSE_LETTERFORM_NORMAL_WEIGHTED: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(3i32);
pub const DWRITE_PANOSE_LETTERFORM_NORMAL_BOXED: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(4i32);
pub const DWRITE_PANOSE_LETTERFORM_NORMAL_FLATTENED: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(5i32);
pub const DWRITE_PANOSE_LETTERFORM_NORMAL_ROUNDED: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(6i32);
pub const DWRITE_PANOSE_LETTERFORM_NORMAL_OFF_CENTER: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(7i32);
pub const DWRITE_PANOSE_LETTERFORM_NORMAL_SQUARE: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(8i32);
pub const DWRITE_PANOSE_LETTERFORM_OBLIQUE_CONTACT: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(9i32);
pub const DWRITE_PANOSE_LETTERFORM_OBLIQUE_WEIGHTED: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(10i32);
pub const DWRITE_PANOSE_LETTERFORM_OBLIQUE_BOXED: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(11i32);
pub const DWRITE_PANOSE_LETTERFORM_OBLIQUE_FLATTENED: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(12i32);
pub const DWRITE_PANOSE_LETTERFORM_OBLIQUE_ROUNDED: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(13i32);
pub const DWRITE_PANOSE_LETTERFORM_OBLIQUE_OFF_CENTER: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(14i32);
pub const DWRITE_PANOSE_LETTERFORM_OBLIQUE_SQUARE: DWRITE_PANOSE_LETTERFORM = DWRITE_PANOSE_LETTERFORM(15i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_LETTERFORM {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_LETTERFORM {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_LINING(pub i32);
pub const DWRITE_PANOSE_LINING_ANY: DWRITE_PANOSE_LINING = DWRITE_PANOSE_LINING(0i32);
pub const DWRITE_PANOSE_LINING_NO_FIT: DWRITE_PANOSE_LINING = DWRITE_PANOSE_LINING(1i32);
pub const DWRITE_PANOSE_LINING_NONE: DWRITE_PANOSE_LINING = DWRITE_PANOSE_LINING(2i32);
pub const DWRITE_PANOSE_LINING_INLINE: DWRITE_PANOSE_LINING = DWRITE_PANOSE_LINING(3i32);
pub const DWRITE_PANOSE_LINING_OUTLINE: DWRITE_PANOSE_LINING = DWRITE_PANOSE_LINING(4i32);
pub const DWRITE_PANOSE_LINING_ENGRAVED: DWRITE_PANOSE_LINING = DWRITE_PANOSE_LINING(5i32);
pub const DWRITE_PANOSE_LINING_SHADOW: DWRITE_PANOSE_LINING = DWRITE_PANOSE_LINING(6i32);
pub const DWRITE_PANOSE_LINING_RELIEF: DWRITE_PANOSE_LINING = DWRITE_PANOSE_LINING(7i32);
pub const DWRITE_PANOSE_LINING_BACKDROP: DWRITE_PANOSE_LINING = DWRITE_PANOSE_LINING(8i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_LINING {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_LINING {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_MIDLINE(pub i32);
pub const DWRITE_PANOSE_MIDLINE_ANY: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(0i32);
pub const DWRITE_PANOSE_MIDLINE_NO_FIT: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(1i32);
pub const DWRITE_PANOSE_MIDLINE_STANDARD_TRIMMED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(2i32);
pub const DWRITE_PANOSE_MIDLINE_STANDARD_POINTED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(3i32);
pub const DWRITE_PANOSE_MIDLINE_STANDARD_SERIFED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(4i32);
pub const DWRITE_PANOSE_MIDLINE_HIGH_TRIMMED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(5i32);
pub const DWRITE_PANOSE_MIDLINE_HIGH_POINTED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(6i32);
pub const DWRITE_PANOSE_MIDLINE_HIGH_SERIFED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(7i32);
pub const DWRITE_PANOSE_MIDLINE_CONSTANT_TRIMMED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(8i32);
pub const DWRITE_PANOSE_MIDLINE_CONSTANT_POINTED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(9i32);
pub const DWRITE_PANOSE_MIDLINE_CONSTANT_SERIFED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(10i32);
pub const DWRITE_PANOSE_MIDLINE_LOW_TRIMMED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(11i32);
pub const DWRITE_PANOSE_MIDLINE_LOW_POINTED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(12i32);
pub const DWRITE_PANOSE_MIDLINE_LOW_SERIFED: DWRITE_PANOSE_MIDLINE = DWRITE_PANOSE_MIDLINE(13i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_MIDLINE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_MIDLINE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_PROPORTION(pub i32);
pub const DWRITE_PANOSE_PROPORTION_ANY: DWRITE_PANOSE_PROPORTION = DWRITE_PANOSE_PROPORTION(0i32);
pub const DWRITE_PANOSE_PROPORTION_NO_FIT: DWRITE_PANOSE_PROPORTION = DWRITE_PANOSE_PROPORTION(1i32);
pub const DWRITE_PANOSE_PROPORTION_OLD_STYLE: DWRITE_PANOSE_PROPORTION = DWRITE_PANOSE_PROPORTION(2i32);
pub const DWRITE_PANOSE_PROPORTION_MODERN: DWRITE_PANOSE_PROPORTION = DWRITE_PANOSE_PROPORTION(3i32);
pub const DWRITE_PANOSE_PROPORTION_EVEN_WIDTH: DWRITE_PANOSE_PROPORTION = DWRITE_PANOSE_PROPORTION(4i32);
pub const DWRITE_PANOSE_PROPORTION_EXPANDED: DWRITE_PANOSE_PROPORTION = DWRITE_PANOSE_PROPORTION(5i32);
pub const DWRITE_PANOSE_PROPORTION_CONDENSED: DWRITE_PANOSE_PROPORTION = DWRITE_PANOSE_PROPORTION(6i32);
pub const DWRITE_PANOSE_PROPORTION_VERY_EXPANDED: DWRITE_PANOSE_PROPORTION = DWRITE_PANOSE_PROPORTION(7i32);
pub const DWRITE_PANOSE_PROPORTION_VERY_CONDENSED: DWRITE_PANOSE_PROPORTION = DWRITE_PANOSE_PROPORTION(8i32);
pub const DWRITE_PANOSE_PROPORTION_MONOSPACED: DWRITE_PANOSE_PROPORTION = DWRITE_PANOSE_PROPORTION(9i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_PROPORTION {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_PROPORTION {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_SCRIPT_FORM(pub i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_ANY: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(0i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_NO_FIT: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(1i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_NO_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(2i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_SOME_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(3i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_MORE_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(4i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_EXTREME_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(5i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_NO_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(6i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_SOME_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(7i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_MORE_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(8i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_EXTREME_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(9i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_NO_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(10i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_SOME_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(11i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_MORE_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(12i32);
pub const DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_EXTREME_WRAPPING: DWRITE_PANOSE_SCRIPT_FORM = DWRITE_PANOSE_SCRIPT_FORM(13i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_SCRIPT_FORM {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_SCRIPT_FORM {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_SCRIPT_TOPOLOGY(pub i32);
pub const DWRITE_PANOSE_SCRIPT_TOPOLOGY_ANY: DWRITE_PANOSE_SCRIPT_TOPOLOGY = DWRITE_PANOSE_SCRIPT_TOPOLOGY(0i32);
pub const DWRITE_PANOSE_SCRIPT_TOPOLOGY_NO_FIT: DWRITE_PANOSE_SCRIPT_TOPOLOGY = DWRITE_PANOSE_SCRIPT_TOPOLOGY(1i32);
pub const DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_DISCONNECTED: DWRITE_PANOSE_SCRIPT_TOPOLOGY = DWRITE_PANOSE_SCRIPT_TOPOLOGY(2i32);
pub const DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_TRAILING: DWRITE_PANOSE_SCRIPT_TOPOLOGY = DWRITE_PANOSE_SCRIPT_TOPOLOGY(3i32);
pub const DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_CONNECTED: DWRITE_PANOSE_SCRIPT_TOPOLOGY = DWRITE_PANOSE_SCRIPT_TOPOLOGY(4i32);
pub const DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_DISCONNECTED: DWRITE_PANOSE_SCRIPT_TOPOLOGY = DWRITE_PANOSE_SCRIPT_TOPOLOGY(5i32);
pub const DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_TRAILING: DWRITE_PANOSE_SCRIPT_TOPOLOGY = DWRITE_PANOSE_SCRIPT_TOPOLOGY(6i32);
pub const DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_CONNECTED: DWRITE_PANOSE_SCRIPT_TOPOLOGY = DWRITE_PANOSE_SCRIPT_TOPOLOGY(7i32);
pub const DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_DISCONNECTED: DWRITE_PANOSE_SCRIPT_TOPOLOGY = DWRITE_PANOSE_SCRIPT_TOPOLOGY(8i32);
pub const DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_TRAILING: DWRITE_PANOSE_SCRIPT_TOPOLOGY = DWRITE_PANOSE_SCRIPT_TOPOLOGY(9i32);
pub const DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_CONNECTED: DWRITE_PANOSE_SCRIPT_TOPOLOGY = DWRITE_PANOSE_SCRIPT_TOPOLOGY(10i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_SCRIPT_TOPOLOGY {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_SCRIPT_TOPOLOGY {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_SERIF_STYLE(pub i32);
pub const DWRITE_PANOSE_SERIF_STYLE_ANY: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(0i32);
pub const DWRITE_PANOSE_SERIF_STYLE_NO_FIT: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(1i32);
pub const DWRITE_PANOSE_SERIF_STYLE_COVE: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(2i32);
pub const DWRITE_PANOSE_SERIF_STYLE_OBTUSE_COVE: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(3i32);
pub const DWRITE_PANOSE_SERIF_STYLE_SQUARE_COVE: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(4i32);
pub const DWRITE_PANOSE_SERIF_STYLE_OBTUSE_SQUARE_COVE: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(5i32);
pub const DWRITE_PANOSE_SERIF_STYLE_SQUARE: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(6i32);
pub const DWRITE_PANOSE_SERIF_STYLE_THIN: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(7i32);
pub const DWRITE_PANOSE_SERIF_STYLE_OVAL: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(8i32);
pub const DWRITE_PANOSE_SERIF_STYLE_EXAGGERATED: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(9i32);
pub const DWRITE_PANOSE_SERIF_STYLE_TRIANGLE: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(10i32);
pub const DWRITE_PANOSE_SERIF_STYLE_NORMAL_SANS: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(11i32);
pub const DWRITE_PANOSE_SERIF_STYLE_OBTUSE_SANS: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(12i32);
pub const DWRITE_PANOSE_SERIF_STYLE_PERPENDICULAR_SANS: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(13i32);
pub const DWRITE_PANOSE_SERIF_STYLE_FLARED: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(14i32);
pub const DWRITE_PANOSE_SERIF_STYLE_ROUNDED: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(15i32);
pub const DWRITE_PANOSE_SERIF_STYLE_SCRIPT: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(16i32);
pub const DWRITE_PANOSE_SERIF_STYLE_PERP_SANS: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(13i32);
pub const DWRITE_PANOSE_SERIF_STYLE_BONE: DWRITE_PANOSE_SERIF_STYLE = DWRITE_PANOSE_SERIF_STYLE(8i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_SERIF_STYLE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_SERIF_STYLE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_SPACING(pub i32);
pub const DWRITE_PANOSE_SPACING_ANY: DWRITE_PANOSE_SPACING = DWRITE_PANOSE_SPACING(0i32);
pub const DWRITE_PANOSE_SPACING_NO_FIT: DWRITE_PANOSE_SPACING = DWRITE_PANOSE_SPACING(1i32);
pub const DWRITE_PANOSE_SPACING_PROPORTIONAL_SPACED: DWRITE_PANOSE_SPACING = DWRITE_PANOSE_SPACING(2i32);
pub const DWRITE_PANOSE_SPACING_MONOSPACED: DWRITE_PANOSE_SPACING = DWRITE_PANOSE_SPACING(3i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_SPACING {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_SPACING {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_STROKE_VARIATION(pub i32);
pub const DWRITE_PANOSE_STROKE_VARIATION_ANY: DWRITE_PANOSE_STROKE_VARIATION = DWRITE_PANOSE_STROKE_VARIATION(0i32);
pub const DWRITE_PANOSE_STROKE_VARIATION_NO_FIT: DWRITE_PANOSE_STROKE_VARIATION = DWRITE_PANOSE_STROKE_VARIATION(1i32);
pub const DWRITE_PANOSE_STROKE_VARIATION_NO_VARIATION: DWRITE_PANOSE_STROKE_VARIATION = DWRITE_PANOSE_STROKE_VARIATION(2i32);
pub const DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_DIAGONAL: DWRITE_PANOSE_STROKE_VARIATION = DWRITE_PANOSE_STROKE_VARIATION(3i32);
pub const DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_TRANSITIONAL: DWRITE_PANOSE_STROKE_VARIATION = DWRITE_PANOSE_STROKE_VARIATION(4i32);
pub const DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_VERTICAL: DWRITE_PANOSE_STROKE_VARIATION = DWRITE_PANOSE_STROKE_VARIATION(5i32);
pub const DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_HORIZONTAL: DWRITE_PANOSE_STROKE_VARIATION = DWRITE_PANOSE_STROKE_VARIATION(6i32);
pub const DWRITE_PANOSE_STROKE_VARIATION_RAPID_VERTICAL: DWRITE_PANOSE_STROKE_VARIATION = DWRITE_PANOSE_STROKE_VARIATION(7i32);
pub const DWRITE_PANOSE_STROKE_VARIATION_RAPID_HORIZONTAL: DWRITE_PANOSE_STROKE_VARIATION = DWRITE_PANOSE_STROKE_VARIATION(8i32);
pub const DWRITE_PANOSE_STROKE_VARIATION_INSTANT_VERTICAL: DWRITE_PANOSE_STROKE_VARIATION = DWRITE_PANOSE_STROKE_VARIATION(9i32);
pub const DWRITE_PANOSE_STROKE_VARIATION_INSTANT_HORIZONTAL: DWRITE_PANOSE_STROKE_VARIATION = DWRITE_PANOSE_STROKE_VARIATION(10i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_STROKE_VARIATION {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_STROKE_VARIATION {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_SYMBOL_ASPECT_RATIO(pub i32);
pub const DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_ANY: DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = DWRITE_PANOSE_SYMBOL_ASPECT_RATIO(0i32);
pub const DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NO_FIT: DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = DWRITE_PANOSE_SYMBOL_ASPECT_RATIO(1i32);
pub const DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NO_WIDTH: DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = DWRITE_PANOSE_SYMBOL_ASPECT_RATIO(2i32);
pub const DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_EXCEPTIONALLY_WIDE: DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = DWRITE_PANOSE_SYMBOL_ASPECT_RATIO(3i32);
pub const DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_SUPER_WIDE: DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = DWRITE_PANOSE_SYMBOL_ASPECT_RATIO(4i32);
pub const DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_VERY_WIDE: DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = DWRITE_PANOSE_SYMBOL_ASPECT_RATIO(5i32);
pub const DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_WIDE: DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = DWRITE_PANOSE_SYMBOL_ASPECT_RATIO(6i32);
pub const DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NORMAL: DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = DWRITE_PANOSE_SYMBOL_ASPECT_RATIO(7i32);
pub const DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NARROW: DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = DWRITE_PANOSE_SYMBOL_ASPECT_RATIO(8i32);
pub const DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_VERY_NARROW: DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = DWRITE_PANOSE_SYMBOL_ASPECT_RATIO(9i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_SYMBOL_ASPECT_RATIO {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_SYMBOL_ASPECT_RATIO {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_SYMBOL_KIND(pub i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_ANY: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(0i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_NO_FIT: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(1i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_MONTAGES: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(2i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_PICTURES: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(3i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_SHAPES: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(4i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_SCIENTIFIC: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(5i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_MUSIC: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(6i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_EXPERT: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(7i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_PATTERNS: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(8i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_BOARDERS: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(9i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_ICONS: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(10i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_LOGOS: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(11i32);
pub const DWRITE_PANOSE_SYMBOL_KIND_INDUSTRY_SPECIFIC: DWRITE_PANOSE_SYMBOL_KIND = DWRITE_PANOSE_SYMBOL_KIND(12i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_SYMBOL_KIND {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_SYMBOL_KIND {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_TOOL_KIND(pub i32);
pub const DWRITE_PANOSE_TOOL_KIND_ANY: DWRITE_PANOSE_TOOL_KIND = DWRITE_PANOSE_TOOL_KIND(0i32);
pub const DWRITE_PANOSE_TOOL_KIND_NO_FIT: DWRITE_PANOSE_TOOL_KIND = DWRITE_PANOSE_TOOL_KIND(1i32);
pub const DWRITE_PANOSE_TOOL_KIND_FLAT_NIB: DWRITE_PANOSE_TOOL_KIND = DWRITE_PANOSE_TOOL_KIND(2i32);
pub const DWRITE_PANOSE_TOOL_KIND_PRESSURE_POINT: DWRITE_PANOSE_TOOL_KIND = DWRITE_PANOSE_TOOL_KIND(3i32);
pub const DWRITE_PANOSE_TOOL_KIND_ENGRAVED: DWRITE_PANOSE_TOOL_KIND = DWRITE_PANOSE_TOOL_KIND(4i32);
pub const DWRITE_PANOSE_TOOL_KIND_BALL: DWRITE_PANOSE_TOOL_KIND = DWRITE_PANOSE_TOOL_KIND(5i32);
pub const DWRITE_PANOSE_TOOL_KIND_BRUSH: DWRITE_PANOSE_TOOL_KIND = DWRITE_PANOSE_TOOL_KIND(6i32);
pub const DWRITE_PANOSE_TOOL_KIND_ROUGH: DWRITE_PANOSE_TOOL_KIND = DWRITE_PANOSE_TOOL_KIND(7i32);
pub const DWRITE_PANOSE_TOOL_KIND_FELT_PEN_BRUSH_TIP: DWRITE_PANOSE_TOOL_KIND = DWRITE_PANOSE_TOOL_KIND(8i32);
pub const DWRITE_PANOSE_TOOL_KIND_WILD_BRUSH: DWRITE_PANOSE_TOOL_KIND = DWRITE_PANOSE_TOOL_KIND(9i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_TOOL_KIND {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_TOOL_KIND {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_WEIGHT(pub i32);
pub const DWRITE_PANOSE_WEIGHT_ANY: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(0i32);
pub const DWRITE_PANOSE_WEIGHT_NO_FIT: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(1i32);
pub const DWRITE_PANOSE_WEIGHT_VERY_LIGHT: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(2i32);
pub const DWRITE_PANOSE_WEIGHT_LIGHT: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(3i32);
pub const DWRITE_PANOSE_WEIGHT_THIN: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(4i32);
pub const DWRITE_PANOSE_WEIGHT_BOOK: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(5i32);
pub const DWRITE_PANOSE_WEIGHT_MEDIUM: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(6i32);
pub const DWRITE_PANOSE_WEIGHT_DEMI: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(7i32);
pub const DWRITE_PANOSE_WEIGHT_BOLD: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(8i32);
pub const DWRITE_PANOSE_WEIGHT_HEAVY: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(9i32);
pub const DWRITE_PANOSE_WEIGHT_BLACK: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(10i32);
pub const DWRITE_PANOSE_WEIGHT_EXTRA_BLACK: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(11i32);
pub const DWRITE_PANOSE_WEIGHT_NORD: DWRITE_PANOSE_WEIGHT = DWRITE_PANOSE_WEIGHT(11i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_WEIGHT {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_WEIGHT {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_XASCENT(pub i32);
pub const DWRITE_PANOSE_XASCENT_ANY: DWRITE_PANOSE_XASCENT = DWRITE_PANOSE_XASCENT(0i32);
pub const DWRITE_PANOSE_XASCENT_NO_FIT: DWRITE_PANOSE_XASCENT = DWRITE_PANOSE_XASCENT(1i32);
pub const DWRITE_PANOSE_XASCENT_VERY_LOW: DWRITE_PANOSE_XASCENT = DWRITE_PANOSE_XASCENT(2i32);
pub const DWRITE_PANOSE_XASCENT_LOW: DWRITE_PANOSE_XASCENT = DWRITE_PANOSE_XASCENT(3i32);
pub const DWRITE_PANOSE_XASCENT_MEDIUM: DWRITE_PANOSE_XASCENT = DWRITE_PANOSE_XASCENT(4i32);
pub const DWRITE_PANOSE_XASCENT_HIGH: DWRITE_PANOSE_XASCENT = DWRITE_PANOSE_XASCENT(5i32);
pub const DWRITE_PANOSE_XASCENT_VERY_HIGH: DWRITE_PANOSE_XASCENT = DWRITE_PANOSE_XASCENT(6i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_XASCENT {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_XASCENT {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PANOSE_XHEIGHT(pub i32);
pub const DWRITE_PANOSE_XHEIGHT_ANY: DWRITE_PANOSE_XHEIGHT = DWRITE_PANOSE_XHEIGHT(0i32);
pub const DWRITE_PANOSE_XHEIGHT_NO_FIT: DWRITE_PANOSE_XHEIGHT = DWRITE_PANOSE_XHEIGHT(1i32);
pub const DWRITE_PANOSE_XHEIGHT_CONSTANT_SMALL: DWRITE_PANOSE_XHEIGHT = DWRITE_PANOSE_XHEIGHT(2i32);
pub const DWRITE_PANOSE_XHEIGHT_CONSTANT_STANDARD: DWRITE_PANOSE_XHEIGHT = DWRITE_PANOSE_XHEIGHT(3i32);
pub const DWRITE_PANOSE_XHEIGHT_CONSTANT_LARGE: DWRITE_PANOSE_XHEIGHT = DWRITE_PANOSE_XHEIGHT(4i32);
pub const DWRITE_PANOSE_XHEIGHT_DUCKING_SMALL: DWRITE_PANOSE_XHEIGHT = DWRITE_PANOSE_XHEIGHT(5i32);
pub const DWRITE_PANOSE_XHEIGHT_DUCKING_STANDARD: DWRITE_PANOSE_XHEIGHT = DWRITE_PANOSE_XHEIGHT(6i32);
pub const DWRITE_PANOSE_XHEIGHT_DUCKING_LARGE: DWRITE_PANOSE_XHEIGHT = DWRITE_PANOSE_XHEIGHT(7i32);
pub const DWRITE_PANOSE_XHEIGHT_CONSTANT_STD: DWRITE_PANOSE_XHEIGHT = DWRITE_PANOSE_XHEIGHT(3i32);
pub const DWRITE_PANOSE_XHEIGHT_DUCKING_STD: DWRITE_PANOSE_XHEIGHT = DWRITE_PANOSE_XHEIGHT(6i32);
impl ::core::convert::From<i32> for DWRITE_PANOSE_XHEIGHT {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PANOSE_XHEIGHT {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PARAGRAPH_ALIGNMENT(pub i32);
pub const DWRITE_PARAGRAPH_ALIGNMENT_NEAR: DWRITE_PARAGRAPH_ALIGNMENT = DWRITE_PARAGRAPH_ALIGNMENT(0i32);
pub const DWRITE_PARAGRAPH_ALIGNMENT_FAR: DWRITE_PARAGRAPH_ALIGNMENT = DWRITE_PARAGRAPH_ALIGNMENT(1i32);
pub const DWRITE_PARAGRAPH_ALIGNMENT_CENTER: DWRITE_PARAGRAPH_ALIGNMENT = DWRITE_PARAGRAPH_ALIGNMENT(2i32);
impl ::core::convert::From<i32> for DWRITE_PARAGRAPH_ALIGNMENT {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PARAGRAPH_ALIGNMENT {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_PIXEL_GEOMETRY(pub i32);
pub const DWRITE_PIXEL_GEOMETRY_FLAT: DWRITE_PIXEL_GEOMETRY = DWRITE_PIXEL_GEOMETRY(0i32);
pub const DWRITE_PIXEL_GEOMETRY_RGB: DWRITE_PIXEL_GEOMETRY = DWRITE_PIXEL_GEOMETRY(1i32);
pub const DWRITE_PIXEL_GEOMETRY_BGR: DWRITE_PIXEL_GEOMETRY = DWRITE_PIXEL_GEOMETRY(2i32);
impl ::core::convert::From<i32> for DWRITE_PIXEL_GEOMETRY {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_PIXEL_GEOMETRY {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_READING_DIRECTION(pub i32);
pub const DWRITE_READING_DIRECTION_LEFT_TO_RIGHT: DWRITE_READING_DIRECTION = DWRITE_READING_DIRECTION(0i32);
pub const DWRITE_READING_DIRECTION_RIGHT_TO_LEFT: DWRITE_READING_DIRECTION = DWRITE_READING_DIRECTION(1i32);
pub const DWRITE_READING_DIRECTION_TOP_TO_BOTTOM: DWRITE_READING_DIRECTION = DWRITE_READING_DIRECTION(2i32);
pub const DWRITE_READING_DIRECTION_BOTTOM_TO_TOP: DWRITE_READING_DIRECTION = DWRITE_READING_DIRECTION(3i32);
impl ::core::convert::From<i32> for DWRITE_READING_DIRECTION {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_READING_DIRECTION {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_RENDERING_MODE(pub i32);
pub const DWRITE_RENDERING_MODE_DEFAULT: DWRITE_RENDERING_MODE = DWRITE_RENDERING_MODE(0i32);
pub const DWRITE_RENDERING_MODE_ALIASED: DWRITE_RENDERING_MODE = DWRITE_RENDERING_MODE(1i32);
pub const DWRITE_RENDERING_MODE_GDI_CLASSIC: DWRITE_RENDERING_MODE = DWRITE_RENDERING_MODE(2i32);
pub const DWRITE_RENDERING_MODE_GDI_NATURAL: DWRITE_RENDERING_MODE = DWRITE_RENDERING_MODE(3i32);
pub const DWRITE_RENDERING_MODE_NATURAL: DWRITE_RENDERING_MODE = DWRITE_RENDERING_MODE(4i32);
pub const DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC: DWRITE_RENDERING_MODE = DWRITE_RENDERING_MODE(5i32);
pub const DWRITE_RENDERING_MODE_OUTLINE: DWRITE_RENDERING_MODE = DWRITE_RENDERING_MODE(6i32);
pub const DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC: DWRITE_RENDERING_MODE = DWRITE_RENDERING_MODE(2i32);
pub const DWRITE_RENDERING_MODE_CLEARTYPE_GDI_NATURAL: DWRITE_RENDERING_MODE = DWRITE_RENDERING_MODE(3i32);
pub const DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL: DWRITE_RENDERING_MODE = DWRITE_RENDERING_MODE(4i32);
pub const DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC: DWRITE_RENDERING_MODE = DWRITE_RENDERING_MODE(5i32);
impl ::core::convert::From<i32> for DWRITE_RENDERING_MODE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_RENDERING_MODE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_RENDERING_MODE1(pub i32);
pub const DWRITE_RENDERING_MODE1_DEFAULT: DWRITE_RENDERING_MODE1 = DWRITE_RENDERING_MODE1(0i32);
pub const DWRITE_RENDERING_MODE1_ALIASED: DWRITE_RENDERING_MODE1 = DWRITE_RENDERING_MODE1(1i32);
pub const DWRITE_RENDERING_MODE1_GDI_CLASSIC: DWRITE_RENDERING_MODE1 = DWRITE_RENDERING_MODE1(2i32);
pub const DWRITE_RENDERING_MODE1_GDI_NATURAL: DWRITE_RENDERING_MODE1 = DWRITE_RENDERING_MODE1(3i32);
pub const DWRITE_RENDERING_MODE1_NATURAL: DWRITE_RENDERING_MODE1 = DWRITE_RENDERING_MODE1(4i32);
pub const DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC: DWRITE_RENDERING_MODE1 = DWRITE_RENDERING_MODE1(5i32);
pub const DWRITE_RENDERING_MODE1_OUTLINE: DWRITE_RENDERING_MODE1 = DWRITE_RENDERING_MODE1(6i32);
pub const DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED: DWRITE_RENDERING_MODE1 = DWRITE_RENDERING_MODE1(7i32);
impl ::core::convert::From<i32> for DWRITE_RENDERING_MODE1 {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_RENDERING_MODE1 {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_SCRIPT_ANALYSIS {
pub script: u16,
pub shapes: DWRITE_SCRIPT_SHAPES,
}
impl DWRITE_SCRIPT_ANALYSIS {}
impl ::core::default::Default for DWRITE_SCRIPT_ANALYSIS {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_SCRIPT_ANALYSIS {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_SCRIPT_ANALYSIS").field("script", &self.script).field("shapes", &self.shapes).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_SCRIPT_ANALYSIS {
fn eq(&self, other: &Self) -> bool {
self.script == other.script && self.shapes == other.shapes
}
}
impl ::core::cmp::Eq for DWRITE_SCRIPT_ANALYSIS {}
unsafe impl ::windows::core::Abi for DWRITE_SCRIPT_ANALYSIS {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_SCRIPT_PROPERTIES {
pub isoScriptCode: u32,
pub isoScriptNumber: u32,
pub clusterLookahead: u32,
pub justificationCharacter: u32,
pub _bitfield: u32,
}
impl DWRITE_SCRIPT_PROPERTIES {}
impl ::core::default::Default for DWRITE_SCRIPT_PROPERTIES {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_SCRIPT_PROPERTIES {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_SCRIPT_PROPERTIES").field("isoScriptCode", &self.isoScriptCode).field("isoScriptNumber", &self.isoScriptNumber).field("clusterLookahead", &self.clusterLookahead).field("justificationCharacter", &self.justificationCharacter).field("_bitfield", &self._bitfield).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_SCRIPT_PROPERTIES {
fn eq(&self, other: &Self) -> bool {
self.isoScriptCode == other.isoScriptCode && self.isoScriptNumber == other.isoScriptNumber && self.clusterLookahead == other.clusterLookahead && self.justificationCharacter == other.justificationCharacter && self._bitfield == other._bitfield
}
}
impl ::core::cmp::Eq for DWRITE_SCRIPT_PROPERTIES {}
unsafe impl ::windows::core::Abi for DWRITE_SCRIPT_PROPERTIES {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_SCRIPT_SHAPES(pub u32);
pub const DWRITE_SCRIPT_SHAPES_DEFAULT: DWRITE_SCRIPT_SHAPES = DWRITE_SCRIPT_SHAPES(0u32);
pub const DWRITE_SCRIPT_SHAPES_NO_VISUAL: DWRITE_SCRIPT_SHAPES = DWRITE_SCRIPT_SHAPES(1u32);
impl ::core::convert::From<u32> for DWRITE_SCRIPT_SHAPES {
fn from(value: u32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_SCRIPT_SHAPES {
type Abi = Self;
}
impl ::core::ops::BitOr for DWRITE_SCRIPT_SHAPES {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl ::core::ops::BitAnd for DWRITE_SCRIPT_SHAPES {
type Output = Self;
fn bitand(self, rhs: Self) -> Self {
Self(self.0 & rhs.0)
}
}
impl ::core::ops::BitOrAssign for DWRITE_SCRIPT_SHAPES {
fn bitor_assign(&mut self, rhs: Self) {
self.0.bitor_assign(rhs.0)
}
}
impl ::core::ops::BitAndAssign for DWRITE_SCRIPT_SHAPES {
fn bitand_assign(&mut self, rhs: Self) {
self.0.bitand_assign(rhs.0)
}
}
impl ::core::ops::Not for DWRITE_SCRIPT_SHAPES {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_SHAPING_GLYPH_PROPERTIES {
pub _bitfield: u16,
}
impl DWRITE_SHAPING_GLYPH_PROPERTIES {}
impl ::core::default::Default for DWRITE_SHAPING_GLYPH_PROPERTIES {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_SHAPING_GLYPH_PROPERTIES {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_SHAPING_GLYPH_PROPERTIES").field("_bitfield", &self._bitfield).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_SHAPING_GLYPH_PROPERTIES {
fn eq(&self, other: &Self) -> bool {
self._bitfield == other._bitfield
}
}
impl ::core::cmp::Eq for DWRITE_SHAPING_GLYPH_PROPERTIES {}
unsafe impl ::windows::core::Abi for DWRITE_SHAPING_GLYPH_PROPERTIES {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_SHAPING_TEXT_PROPERTIES {
pub _bitfield: u16,
}
impl DWRITE_SHAPING_TEXT_PROPERTIES {}
impl ::core::default::Default for DWRITE_SHAPING_TEXT_PROPERTIES {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_SHAPING_TEXT_PROPERTIES {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_SHAPING_TEXT_PROPERTIES").field("_bitfield", &self._bitfield).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_SHAPING_TEXT_PROPERTIES {
fn eq(&self, other: &Self) -> bool {
self._bitfield == other._bitfield
}
}
impl ::core::cmp::Eq for DWRITE_SHAPING_TEXT_PROPERTIES {}
unsafe impl ::windows::core::Abi for DWRITE_SHAPING_TEXT_PROPERTIES {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_STRIKETHROUGH {
pub width: f32,
pub thickness: f32,
pub offset: f32,
pub readingDirection: DWRITE_READING_DIRECTION,
pub flowDirection: DWRITE_FLOW_DIRECTION,
pub localeName: super::super::Foundation::PWSTR,
pub measuringMode: DWRITE_MEASURING_MODE,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_STRIKETHROUGH {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_STRIKETHROUGH {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_STRIKETHROUGH {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_STRIKETHROUGH")
.field("width", &self.width)
.field("thickness", &self.thickness)
.field("offset", &self.offset)
.field("readingDirection", &self.readingDirection)
.field("flowDirection", &self.flowDirection)
.field("localeName", &self.localeName)
.field("measuringMode", &self.measuringMode)
.finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_STRIKETHROUGH {
fn eq(&self, other: &Self) -> bool {
self.width == other.width && self.thickness == other.thickness && self.offset == other.offset && self.readingDirection == other.readingDirection && self.flowDirection == other.flowDirection && self.localeName == other.localeName && self.measuringMode == other.measuringMode
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_STRIKETHROUGH {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_STRIKETHROUGH {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_TEXTURE_TYPE(pub i32);
pub const DWRITE_TEXTURE_ALIASED_1x1: DWRITE_TEXTURE_TYPE = DWRITE_TEXTURE_TYPE(0i32);
pub const DWRITE_TEXTURE_CLEARTYPE_3x1: DWRITE_TEXTURE_TYPE = DWRITE_TEXTURE_TYPE(1i32);
impl ::core::convert::From<i32> for DWRITE_TEXTURE_TYPE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_TEXTURE_TYPE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_TEXT_ALIGNMENT(pub i32);
pub const DWRITE_TEXT_ALIGNMENT_LEADING: DWRITE_TEXT_ALIGNMENT = DWRITE_TEXT_ALIGNMENT(0i32);
pub const DWRITE_TEXT_ALIGNMENT_TRAILING: DWRITE_TEXT_ALIGNMENT = DWRITE_TEXT_ALIGNMENT(1i32);
pub const DWRITE_TEXT_ALIGNMENT_CENTER: DWRITE_TEXT_ALIGNMENT = DWRITE_TEXT_ALIGNMENT(2i32);
pub const DWRITE_TEXT_ALIGNMENT_JUSTIFIED: DWRITE_TEXT_ALIGNMENT = DWRITE_TEXT_ALIGNMENT(3i32);
impl ::core::convert::From<i32> for DWRITE_TEXT_ALIGNMENT {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_TEXT_ALIGNMENT {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_TEXT_ANTIALIAS_MODE(pub i32);
pub const DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE: DWRITE_TEXT_ANTIALIAS_MODE = DWRITE_TEXT_ANTIALIAS_MODE(0i32);
pub const DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE: DWRITE_TEXT_ANTIALIAS_MODE = DWRITE_TEXT_ANTIALIAS_MODE(1i32);
impl ::core::convert::From<i32> for DWRITE_TEXT_ANTIALIAS_MODE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_TEXT_ANTIALIAS_MODE {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_TEXT_METRICS {
pub left: f32,
pub top: f32,
pub width: f32,
pub widthIncludingTrailingWhitespace: f32,
pub height: f32,
pub layoutWidth: f32,
pub layoutHeight: f32,
pub maxBidiReorderingDepth: u32,
pub lineCount: u32,
}
impl DWRITE_TEXT_METRICS {}
impl ::core::default::Default for DWRITE_TEXT_METRICS {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_TEXT_METRICS {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_TEXT_METRICS")
.field("left", &self.left)
.field("top", &self.top)
.field("width", &self.width)
.field("widthIncludingTrailingWhitespace", &self.widthIncludingTrailingWhitespace)
.field("height", &self.height)
.field("layoutWidth", &self.layoutWidth)
.field("layoutHeight", &self.layoutHeight)
.field("maxBidiReorderingDepth", &self.maxBidiReorderingDepth)
.field("lineCount", &self.lineCount)
.finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_TEXT_METRICS {
fn eq(&self, other: &Self) -> bool {
self.left == other.left && self.top == other.top && self.width == other.width && self.widthIncludingTrailingWhitespace == other.widthIncludingTrailingWhitespace && self.height == other.height && self.layoutWidth == other.layoutWidth && self.layoutHeight == other.layoutHeight && self.maxBidiReorderingDepth == other.maxBidiReorderingDepth && self.lineCount == other.lineCount
}
}
impl ::core::cmp::Eq for DWRITE_TEXT_METRICS {}
unsafe impl ::windows::core::Abi for DWRITE_TEXT_METRICS {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_TEXT_METRICS1 {
pub Base: DWRITE_TEXT_METRICS,
pub heightIncludingTrailingWhitespace: f32,
}
impl DWRITE_TEXT_METRICS1 {}
impl ::core::default::Default for DWRITE_TEXT_METRICS1 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_TEXT_METRICS1 {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_TEXT_METRICS1").field("Base", &self.Base).field("heightIncludingTrailingWhitespace", &self.heightIncludingTrailingWhitespace).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_TEXT_METRICS1 {
fn eq(&self, other: &Self) -> bool {
self.Base == other.Base && self.heightIncludingTrailingWhitespace == other.heightIncludingTrailingWhitespace
}
}
impl ::core::cmp::Eq for DWRITE_TEXT_METRICS1 {}
unsafe impl ::windows::core::Abi for DWRITE_TEXT_METRICS1 {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_TEXT_RANGE {
pub startPosition: u32,
pub length: u32,
}
impl DWRITE_TEXT_RANGE {}
impl ::core::default::Default for DWRITE_TEXT_RANGE {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_TEXT_RANGE {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_TEXT_RANGE").field("startPosition", &self.startPosition).field("length", &self.length).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_TEXT_RANGE {
fn eq(&self, other: &Self) -> bool {
self.startPosition == other.startPosition && self.length == other.length
}
}
impl ::core::cmp::Eq for DWRITE_TEXT_RANGE {}
unsafe impl ::windows::core::Abi for DWRITE_TEXT_RANGE {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_TRIMMING {
pub granularity: DWRITE_TRIMMING_GRANULARITY,
pub delimiter: u32,
pub delimiterCount: u32,
}
impl DWRITE_TRIMMING {}
impl ::core::default::Default for DWRITE_TRIMMING {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_TRIMMING {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_TRIMMING").field("granularity", &self.granularity).field("delimiter", &self.delimiter).field("delimiterCount", &self.delimiterCount).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_TRIMMING {
fn eq(&self, other: &Self) -> bool {
self.granularity == other.granularity && self.delimiter == other.delimiter && self.delimiterCount == other.delimiterCount
}
}
impl ::core::cmp::Eq for DWRITE_TRIMMING {}
unsafe impl ::windows::core::Abi for DWRITE_TRIMMING {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_TRIMMING_GRANULARITY(pub i32);
pub const DWRITE_TRIMMING_GRANULARITY_NONE: DWRITE_TRIMMING_GRANULARITY = DWRITE_TRIMMING_GRANULARITY(0i32);
pub const DWRITE_TRIMMING_GRANULARITY_CHARACTER: DWRITE_TRIMMING_GRANULARITY = DWRITE_TRIMMING_GRANULARITY(1i32);
pub const DWRITE_TRIMMING_GRANULARITY_WORD: DWRITE_TRIMMING_GRANULARITY = DWRITE_TRIMMING_GRANULARITY(2i32);
impl ::core::convert::From<i32> for DWRITE_TRIMMING_GRANULARITY {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_TRIMMING_GRANULARITY {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_TYPOGRAPHIC_FEATURES {
pub features: *mut DWRITE_FONT_FEATURE,
pub featureCount: u32,
}
impl DWRITE_TYPOGRAPHIC_FEATURES {}
impl ::core::default::Default for DWRITE_TYPOGRAPHIC_FEATURES {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_TYPOGRAPHIC_FEATURES {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_TYPOGRAPHIC_FEATURES").field("features", &self.features).field("featureCount", &self.featureCount).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_TYPOGRAPHIC_FEATURES {
fn eq(&self, other: &Self) -> bool {
self.features == other.features && self.featureCount == other.featureCount
}
}
impl ::core::cmp::Eq for DWRITE_TYPOGRAPHIC_FEATURES {}
unsafe impl ::windows::core::Abi for DWRITE_TYPOGRAPHIC_FEATURES {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DWRITE_UNDERLINE {
pub width: f32,
pub thickness: f32,
pub offset: f32,
pub runHeight: f32,
pub readingDirection: DWRITE_READING_DIRECTION,
pub flowDirection: DWRITE_FLOW_DIRECTION,
pub localeName: super::super::Foundation::PWSTR,
pub measuringMode: DWRITE_MEASURING_MODE,
}
#[cfg(feature = "Win32_Foundation")]
impl DWRITE_UNDERLINE {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DWRITE_UNDERLINE {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DWRITE_UNDERLINE {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_UNDERLINE")
.field("width", &self.width)
.field("thickness", &self.thickness)
.field("offset", &self.offset)
.field("runHeight", &self.runHeight)
.field("readingDirection", &self.readingDirection)
.field("flowDirection", &self.flowDirection)
.field("localeName", &self.localeName)
.field("measuringMode", &self.measuringMode)
.finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DWRITE_UNDERLINE {
fn eq(&self, other: &Self) -> bool {
self.width == other.width && self.thickness == other.thickness && self.offset == other.offset && self.runHeight == other.runHeight && self.readingDirection == other.readingDirection && self.flowDirection == other.flowDirection && self.localeName == other.localeName && self.measuringMode == other.measuringMode
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DWRITE_UNDERLINE {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DWRITE_UNDERLINE {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct DWRITE_UNICODE_RANGE {
pub first: u32,
pub last: u32,
}
impl DWRITE_UNICODE_RANGE {}
impl ::core::default::Default for DWRITE_UNICODE_RANGE {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for DWRITE_UNICODE_RANGE {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DWRITE_UNICODE_RANGE").field("first", &self.first).field("last", &self.last).finish()
}
}
impl ::core::cmp::PartialEq for DWRITE_UNICODE_RANGE {
fn eq(&self, other: &Self) -> bool {
self.first == other.first && self.last == other.last
}
}
impl ::core::cmp::Eq for DWRITE_UNICODE_RANGE {}
unsafe impl ::windows::core::Abi for DWRITE_UNICODE_RANGE {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_VERTICAL_GLYPH_ORIENTATION(pub i32);
pub const DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT: DWRITE_VERTICAL_GLYPH_ORIENTATION = DWRITE_VERTICAL_GLYPH_ORIENTATION(0i32);
pub const DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED: DWRITE_VERTICAL_GLYPH_ORIENTATION = DWRITE_VERTICAL_GLYPH_ORIENTATION(1i32);
impl ::core::convert::From<i32> for DWRITE_VERTICAL_GLYPH_ORIENTATION {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_VERTICAL_GLYPH_ORIENTATION {
type Abi = Self;
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DWRITE_WORD_WRAPPING(pub i32);
pub const DWRITE_WORD_WRAPPING_WRAP: DWRITE_WORD_WRAPPING = DWRITE_WORD_WRAPPING(0i32);
pub const DWRITE_WORD_WRAPPING_NO_WRAP: DWRITE_WORD_WRAPPING = DWRITE_WORD_WRAPPING(1i32);
pub const DWRITE_WORD_WRAPPING_EMERGENCY_BREAK: DWRITE_WORD_WRAPPING = DWRITE_WORD_WRAPPING(2i32);
pub const DWRITE_WORD_WRAPPING_WHOLE_WORD: DWRITE_WORD_WRAPPING = DWRITE_WORD_WRAPPING(3i32);
pub const DWRITE_WORD_WRAPPING_CHARACTER: DWRITE_WORD_WRAPPING = DWRITE_WORD_WRAPPING(4i32);
impl ::core::convert::From<i32> for DWRITE_WORD_WRAPPING {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DWRITE_WORD_WRAPPING {
type Abi = Self;
}
#[inline]
pub unsafe fn DWriteCreateFactory(factorytype: DWRITE_FACTORY_TYPE, iid: *const ::windows::core::GUID) -> ::windows::core::Result<::windows::core::IUnknown> {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn DWriteCreateFactory(factorytype: DWRITE_FACTORY_TYPE, iid: *const ::windows::core::GUID, factory: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT;
}
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
DWriteCreateFactory(::core::mem::transmute(factorytype), ::core::mem::transmute(iid), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
pub const FACILITY_DWRITE: u32 = 2200u32;
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteAsyncResult(pub ::windows::core::IUnknown);
impl IDWriteAsyncResult {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetWaitHandle(&self) -> super::super::Foundation::HANDLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetResult(&self) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteAsyncResult {
type Vtable = IDWriteAsyncResult_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xce25f8fd_863b_4d13_9651_c1f88dc73fe2);
}
impl ::core::convert::From<IDWriteAsyncResult> for ::windows::core::IUnknown {
fn from(value: IDWriteAsyncResult) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteAsyncResult> for ::windows::core::IUnknown {
fn from(value: &IDWriteAsyncResult) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteAsyncResult {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteAsyncResult {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteAsyncResult_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::HANDLE,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteBitmapRenderTarget(pub ::windows::core::IUnknown);
impl IDWriteBitmapRenderTarget {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawGlyphRun<'a, Param4: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(&self, baselineoriginx: f32, baselineoriginy: f32, measuringmode: DWRITE_MEASURING_MODE, glyphrun: *const DWRITE_GLYPH_RUN, renderingparams: Param4, textcolor: u32) -> ::windows::core::Result<super::super::Foundation::RECT> {
let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(baselineoriginx), ::core::mem::transmute(baselineoriginy), ::core::mem::transmute(measuringmode), ::core::mem::transmute(glyphrun), renderingparams.into_param().abi(), ::core::mem::transmute(textcolor), &mut result__).from_abi::<super::super::Foundation::RECT>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn GetMemoryDC(&self) -> super::Gdi::HDC {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPixelsPerDip(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetPixelsPerDip(&self, pixelsperdip: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(pixelsperdip)).ok()
}
pub unsafe fn GetCurrentTransform(&self) -> ::windows::core::Result<DWRITE_MATRIX> {
let mut result__: <DWRITE_MATRIX as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_MATRIX>(result__)
}
pub unsafe fn SetCurrentTransform(&self, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(transform)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSize(&self) -> ::windows::core::Result<super::super::Foundation::SIZE> {
let mut result__: <super::super::Foundation::SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::SIZE>(result__)
}
pub unsafe fn Resize(&self, width: u32, height: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(width), ::core::mem::transmute(height)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteBitmapRenderTarget {
type Vtable = IDWriteBitmapRenderTarget_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x5e5a32a3_8dff_4773_9ff6_0696eab77267);
}
impl ::core::convert::From<IDWriteBitmapRenderTarget> for ::windows::core::IUnknown {
fn from(value: IDWriteBitmapRenderTarget) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteBitmapRenderTarget> for ::windows::core::IUnknown {
fn from(value: &IDWriteBitmapRenderTarget) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteBitmapRenderTarget {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteBitmapRenderTarget {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteBitmapRenderTarget_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineoriginx: f32, baselineoriginy: f32, measuringmode: DWRITE_MEASURING_MODE, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, renderingparams: ::windows::core::RawPtr, textcolor: u32, blackboxrect: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::Gdi::HDC,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pixelsperdip: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut DWRITE_MATRIX) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *const DWRITE_MATRIX) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, size: *mut super::super::Foundation::SIZE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, width: u32, height: u32) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteBitmapRenderTarget1(pub ::windows::core::IUnknown);
impl IDWriteBitmapRenderTarget1 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawGlyphRun<'a, Param4: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(&self, baselineoriginx: f32, baselineoriginy: f32, measuringmode: DWRITE_MEASURING_MODE, glyphrun: *const DWRITE_GLYPH_RUN, renderingparams: Param4, textcolor: u32) -> ::windows::core::Result<super::super::Foundation::RECT> {
let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(baselineoriginx), ::core::mem::transmute(baselineoriginy), ::core::mem::transmute(measuringmode), ::core::mem::transmute(glyphrun), renderingparams.into_param().abi(), ::core::mem::transmute(textcolor), &mut result__).from_abi::<super::super::Foundation::RECT>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn GetMemoryDC(&self) -> super::Gdi::HDC {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPixelsPerDip(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetPixelsPerDip(&self, pixelsperdip: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(pixelsperdip)).ok()
}
pub unsafe fn GetCurrentTransform(&self) -> ::windows::core::Result<DWRITE_MATRIX> {
let mut result__: <DWRITE_MATRIX as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_MATRIX>(result__)
}
pub unsafe fn SetCurrentTransform(&self, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(transform)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSize(&self) -> ::windows::core::Result<super::super::Foundation::SIZE> {
let mut result__: <super::super::Foundation::SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::SIZE>(result__)
}
pub unsafe fn Resize(&self, width: u32, height: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(width), ::core::mem::transmute(height)).ok()
}
pub unsafe fn GetTextAntialiasMode(&self) -> DWRITE_TEXT_ANTIALIAS_MODE {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetTextAntialiasMode(&self, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(antialiasmode)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteBitmapRenderTarget1 {
type Vtable = IDWriteBitmapRenderTarget1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x791e8298_3ef3_4230_9880_c9bdecc42064);
}
impl ::core::convert::From<IDWriteBitmapRenderTarget1> for ::windows::core::IUnknown {
fn from(value: IDWriteBitmapRenderTarget1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteBitmapRenderTarget1> for ::windows::core::IUnknown {
fn from(value: &IDWriteBitmapRenderTarget1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteBitmapRenderTarget1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteBitmapRenderTarget1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteBitmapRenderTarget1> for IDWriteBitmapRenderTarget {
fn from(value: IDWriteBitmapRenderTarget1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteBitmapRenderTarget1> for IDWriteBitmapRenderTarget {
fn from(value: &IDWriteBitmapRenderTarget1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteBitmapRenderTarget> for IDWriteBitmapRenderTarget1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteBitmapRenderTarget> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteBitmapRenderTarget> for &IDWriteBitmapRenderTarget1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteBitmapRenderTarget> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteBitmapRenderTarget1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineoriginx: f32, baselineoriginy: f32, measuringmode: DWRITE_MEASURING_MODE, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, renderingparams: ::windows::core::RawPtr, textcolor: u32, blackboxrect: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::Gdi::HDC,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pixelsperdip: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut DWRITE_MATRIX) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *const DWRITE_MATRIX) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, size: *mut super::super::Foundation::SIZE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, width: u32, height: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_TEXT_ANTIALIAS_MODE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteColorGlyphRunEnumerator(pub ::windows::core::IUnknown);
impl IDWriteColorGlyphRunEnumerator {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn MoveNext(&self) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetCurrentRun(&self) -> ::windows::core::Result<*mut DWRITE_COLOR_GLYPH_RUN> {
let mut result__: <*mut DWRITE_COLOR_GLYPH_RUN as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<*mut DWRITE_COLOR_GLYPH_RUN>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteColorGlyphRunEnumerator {
type Vtable = IDWriteColorGlyphRunEnumerator_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd31fbe17_f157_41a2_8d24_cb779e0560e8);
}
impl ::core::convert::From<IDWriteColorGlyphRunEnumerator> for ::windows::core::IUnknown {
fn from(value: IDWriteColorGlyphRunEnumerator) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteColorGlyphRunEnumerator> for ::windows::core::IUnknown {
fn from(value: &IDWriteColorGlyphRunEnumerator) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteColorGlyphRunEnumerator {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteColorGlyphRunEnumerator {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteColorGlyphRunEnumerator_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasrun: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorglyphrun: *mut *mut DWRITE_COLOR_GLYPH_RUN) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteColorGlyphRunEnumerator1(pub ::windows::core::IUnknown);
impl IDWriteColorGlyphRunEnumerator1 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn MoveNext(&self) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetCurrentRun(&self) -> ::windows::core::Result<*mut DWRITE_COLOR_GLYPH_RUN> {
let mut result__: <*mut DWRITE_COLOR_GLYPH_RUN as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<*mut DWRITE_COLOR_GLYPH_RUN>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetCurrentRun2(&self) -> ::windows::core::Result<*mut DWRITE_COLOR_GLYPH_RUN1> {
let mut result__: <*mut DWRITE_COLOR_GLYPH_RUN1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<*mut DWRITE_COLOR_GLYPH_RUN1>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteColorGlyphRunEnumerator1 {
type Vtable = IDWriteColorGlyphRunEnumerator1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7c5f86da_c7a1_4f05_b8e1_55a179fe5a35);
}
impl ::core::convert::From<IDWriteColorGlyphRunEnumerator1> for ::windows::core::IUnknown {
fn from(value: IDWriteColorGlyphRunEnumerator1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteColorGlyphRunEnumerator1> for ::windows::core::IUnknown {
fn from(value: &IDWriteColorGlyphRunEnumerator1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteColorGlyphRunEnumerator1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteColorGlyphRunEnumerator1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteColorGlyphRunEnumerator1> for IDWriteColorGlyphRunEnumerator {
fn from(value: IDWriteColorGlyphRunEnumerator1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteColorGlyphRunEnumerator1> for IDWriteColorGlyphRunEnumerator {
fn from(value: &IDWriteColorGlyphRunEnumerator1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteColorGlyphRunEnumerator> for IDWriteColorGlyphRunEnumerator1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteColorGlyphRunEnumerator> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteColorGlyphRunEnumerator> for &IDWriteColorGlyphRunEnumerator1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteColorGlyphRunEnumerator> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteColorGlyphRunEnumerator1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasrun: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorglyphrun: *mut *mut DWRITE_COLOR_GLYPH_RUN) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorglyphrun: *mut *mut DWRITE_COLOR_GLYPH_RUN1) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFactory(pub ::windows::core::IUnknown);
impl IDWriteFactory {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, collectionloader: Param0, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), collectionloader.into_param().abi(), ::core::mem::transmute(collectionkey), ::core::mem::transmute(collectionkeysize), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn RegisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFileReference<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateCustomFontFileReference<'a, Param2: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: Param2) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), fontfileloader.into_param().abi(), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateFontFace(&self, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::core::option::Option<IDWriteFontFile>, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacetype), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontfacesimulationflags), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
pub unsafe fn CreateRenderingParams(&self) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateMonitorRenderingParams<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HMONITOR>>(&self, monitor: Param0) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), monitor.into_param().abi(), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn CreateCustomRenderingParams(&self, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn RegisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextFormat<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontfamilyname: Param0, fontcollection: Param1, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: Param6) -> ::windows::core::Result<IDWriteTextFormat> {
let mut result__: <IDWriteTextFormat as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), fontcollection.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstyle), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontsize), localename.into_param().abi(), &mut result__).from_abi::<IDWriteTextFormat>(result__)
}
pub unsafe fn CreateTypography(&self) -> ::windows::core::Result<IDWriteTypography> {
let mut result__: <IDWriteTypography as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTypography>(result__)
}
pub unsafe fn GetGdiInterop(&self) -> ::windows::core::Result<IDWriteGdiInterop> {
let mut result__: <IDWriteGdiInterop as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteGdiInterop>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, string: Param0, stringlength: u32, textformat: Param2, maxwidth: f32, maxheight: f32) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), string.into_param().abi(), ::core::mem::transmute(stringlength), textformat.into_param().abi(), ::core::mem::transmute(maxwidth), ::core::mem::transmute(maxheight), &mut result__).from_abi::<IDWriteTextLayout>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGdiCompatibleTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, string: Param0, stringlength: u32, textformat: Param2, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param7) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(
::core::mem::transmute_copy(self),
string.into_param().abi(),
::core::mem::transmute(stringlength),
textformat.into_param().abi(),
::core::mem::transmute(layoutwidth),
::core::mem::transmute(layoutheight),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
&mut result__,
)
.from_abi::<IDWriteTextLayout>(result__)
}
pub unsafe fn CreateEllipsisTrimmingSign<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, textformat: Param0) -> ::windows::core::Result<IDWriteInlineObject> {
let mut result__: <IDWriteInlineObject as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), textformat.into_param().abi(), &mut result__).from_abi::<IDWriteInlineObject>(result__)
}
pub unsafe fn CreateTextAnalyzer(&self) -> ::windows::core::Result<IDWriteTextAnalyzer> {
let mut result__: <IDWriteTextAnalyzer as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTextAnalyzer>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateNumberSubstitution<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: Param1, ignoreuseroverride: Param2) -> ::windows::core::Result<IDWriteNumberSubstitution> {
let mut result__: <IDWriteNumberSubstitution as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(substitutionmethod), localename.into_param().abi(), ignoreuseroverride.into_param().abi(), &mut result__).from_abi::<IDWriteNumberSubstitution>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis(&self, glyphrun: *const DWRITE_GLYPH_RUN, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFactory {
type Vtable = IDWriteFactory_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb859ee5a_d838_4b5b_a2e8_1adc7d93db48);
}
impl ::core::convert::From<IDWriteFactory> for ::windows::core::IUnknown {
fn from(value: IDWriteFactory) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFactory> for ::windows::core::IUnknown {
fn from(value: &IDWriteFactory) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFactory {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFactory {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFactory_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, collectionloader: ::windows::core::RawPtr, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::windows::core::RawPtr, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, monitor: super::Gdi::HMONITOR, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, fontcollection: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: super::super::Foundation::PWSTR, textformat: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gdiinterop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, maxwidth: f32, maxheight: f32, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textformat: ::windows::core::RawPtr, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textanalyzer: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: super::super::Foundation::PWSTR, ignoreuseroverride: super::super::Foundation::BOOL, numbersubstitution: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFactory1(pub ::windows::core::IUnknown);
impl IDWriteFactory1 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, collectionloader: Param0, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), collectionloader.into_param().abi(), ::core::mem::transmute(collectionkey), ::core::mem::transmute(collectionkeysize), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn RegisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFileReference<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateCustomFontFileReference<'a, Param2: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: Param2) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), fontfileloader.into_param().abi(), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateFontFace(&self, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::core::option::Option<IDWriteFontFile>, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacetype), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontfacesimulationflags), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
pub unsafe fn CreateRenderingParams(&self) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateMonitorRenderingParams<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HMONITOR>>(&self, monitor: Param0) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), monitor.into_param().abi(), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn CreateCustomRenderingParams(&self, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn RegisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextFormat<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontfamilyname: Param0, fontcollection: Param1, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: Param6) -> ::windows::core::Result<IDWriteTextFormat> {
let mut result__: <IDWriteTextFormat as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), fontcollection.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstyle), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontsize), localename.into_param().abi(), &mut result__).from_abi::<IDWriteTextFormat>(result__)
}
pub unsafe fn CreateTypography(&self) -> ::windows::core::Result<IDWriteTypography> {
let mut result__: <IDWriteTypography as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTypography>(result__)
}
pub unsafe fn GetGdiInterop(&self) -> ::windows::core::Result<IDWriteGdiInterop> {
let mut result__: <IDWriteGdiInterop as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteGdiInterop>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, string: Param0, stringlength: u32, textformat: Param2, maxwidth: f32, maxheight: f32) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), string.into_param().abi(), ::core::mem::transmute(stringlength), textformat.into_param().abi(), ::core::mem::transmute(maxwidth), ::core::mem::transmute(maxheight), &mut result__).from_abi::<IDWriteTextLayout>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGdiCompatibleTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, string: Param0, stringlength: u32, textformat: Param2, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param7) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(
::core::mem::transmute_copy(self),
string.into_param().abi(),
::core::mem::transmute(stringlength),
textformat.into_param().abi(),
::core::mem::transmute(layoutwidth),
::core::mem::transmute(layoutheight),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
&mut result__,
)
.from_abi::<IDWriteTextLayout>(result__)
}
pub unsafe fn CreateEllipsisTrimmingSign<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, textformat: Param0) -> ::windows::core::Result<IDWriteInlineObject> {
let mut result__: <IDWriteInlineObject as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), textformat.into_param().abi(), &mut result__).from_abi::<IDWriteInlineObject>(result__)
}
pub unsafe fn CreateTextAnalyzer(&self) -> ::windows::core::Result<IDWriteTextAnalyzer> {
let mut result__: <IDWriteTextAnalyzer as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTextAnalyzer>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateNumberSubstitution<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: Param1, ignoreuseroverride: Param2) -> ::windows::core::Result<IDWriteNumberSubstitution> {
let mut result__: <IDWriteNumberSubstitution as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(substitutionmethod), localename.into_param().abi(), ignoreuseroverride.into_param().abi(), &mut result__).from_abi::<IDWriteNumberSubstitution>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis(&self, glyphrun: *const DWRITE_GLYPH_RUN, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetEudcFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomRenderingParams2(&self, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams1> {
let mut result__: <IDWriteRenderingParams1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(enhancedcontrastgrayscale), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams1>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFactory1 {
type Vtable = IDWriteFactory1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x30572f99_dac6_41db_a16e_0486307e606a);
}
impl ::core::convert::From<IDWriteFactory1> for ::windows::core::IUnknown {
fn from(value: IDWriteFactory1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFactory1> for ::windows::core::IUnknown {
fn from(value: &IDWriteFactory1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFactory1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFactory1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFactory1> for IDWriteFactory {
fn from(value: IDWriteFactory1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory1> for IDWriteFactory {
fn from(value: &IDWriteFactory1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for IDWriteFactory1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for &IDWriteFactory1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFactory1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, collectionloader: ::windows::core::RawPtr, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::windows::core::RawPtr, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, monitor: super::Gdi::HMONITOR, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, fontcollection: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: super::super::Foundation::PWSTR, textformat: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gdiinterop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, maxwidth: f32, maxheight: f32, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textformat: ::windows::core::RawPtr, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textanalyzer: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: super::super::Foundation::PWSTR, ignoreuseroverride: super::super::Foundation::BOOL, numbersubstitution: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFactory2(pub ::windows::core::IUnknown);
impl IDWriteFactory2 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, collectionloader: Param0, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), collectionloader.into_param().abi(), ::core::mem::transmute(collectionkey), ::core::mem::transmute(collectionkeysize), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn RegisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFileReference<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateCustomFontFileReference<'a, Param2: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: Param2) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), fontfileloader.into_param().abi(), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateFontFace(&self, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::core::option::Option<IDWriteFontFile>, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacetype), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontfacesimulationflags), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
pub unsafe fn CreateRenderingParams(&self) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateMonitorRenderingParams<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HMONITOR>>(&self, monitor: Param0) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), monitor.into_param().abi(), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn CreateCustomRenderingParams(&self, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn RegisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextFormat<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontfamilyname: Param0, fontcollection: Param1, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: Param6) -> ::windows::core::Result<IDWriteTextFormat> {
let mut result__: <IDWriteTextFormat as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), fontcollection.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstyle), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontsize), localename.into_param().abi(), &mut result__).from_abi::<IDWriteTextFormat>(result__)
}
pub unsafe fn CreateTypography(&self) -> ::windows::core::Result<IDWriteTypography> {
let mut result__: <IDWriteTypography as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTypography>(result__)
}
pub unsafe fn GetGdiInterop(&self) -> ::windows::core::Result<IDWriteGdiInterop> {
let mut result__: <IDWriteGdiInterop as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteGdiInterop>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, string: Param0, stringlength: u32, textformat: Param2, maxwidth: f32, maxheight: f32) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), string.into_param().abi(), ::core::mem::transmute(stringlength), textformat.into_param().abi(), ::core::mem::transmute(maxwidth), ::core::mem::transmute(maxheight), &mut result__).from_abi::<IDWriteTextLayout>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGdiCompatibleTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, string: Param0, stringlength: u32, textformat: Param2, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param7) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(
::core::mem::transmute_copy(self),
string.into_param().abi(),
::core::mem::transmute(stringlength),
textformat.into_param().abi(),
::core::mem::transmute(layoutwidth),
::core::mem::transmute(layoutheight),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
&mut result__,
)
.from_abi::<IDWriteTextLayout>(result__)
}
pub unsafe fn CreateEllipsisTrimmingSign<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, textformat: Param0) -> ::windows::core::Result<IDWriteInlineObject> {
let mut result__: <IDWriteInlineObject as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), textformat.into_param().abi(), &mut result__).from_abi::<IDWriteInlineObject>(result__)
}
pub unsafe fn CreateTextAnalyzer(&self) -> ::windows::core::Result<IDWriteTextAnalyzer> {
let mut result__: <IDWriteTextAnalyzer as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTextAnalyzer>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateNumberSubstitution<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: Param1, ignoreuseroverride: Param2) -> ::windows::core::Result<IDWriteNumberSubstitution> {
let mut result__: <IDWriteNumberSubstitution as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(substitutionmethod), localename.into_param().abi(), ignoreuseroverride.into_param().abi(), &mut result__).from_abi::<IDWriteNumberSubstitution>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis(&self, glyphrun: *const DWRITE_GLYPH_RUN, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetEudcFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomRenderingParams2(&self, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams1> {
let mut result__: <IDWriteRenderingParams1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(enhancedcontrastgrayscale), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams1>(result__)
}
pub unsafe fn GetSystemFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
pub unsafe fn CreateFontFallbackBuilder(&self) -> ::windows::core::Result<IDWriteFontFallbackBuilder> {
let mut result__: <IDWriteFontFallbackBuilder as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallbackBuilder>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TranslateColorGlyphRun(&self, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32) -> ::windows::core::Result<IDWriteColorGlyphRunEnumerator> {
let mut result__: <IDWriteColorGlyphRunEnumerator as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(
::core::mem::transmute_copy(self),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
::core::mem::transmute(measuringmode),
::core::mem::transmute(worldtodevicetransform),
::core::mem::transmute(colorpaletteindex),
&mut result__,
)
.from_abi::<IDWriteColorGlyphRunEnumerator>(result__)
}
pub unsafe fn CreateCustomRenderingParams3(&self, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE) -> ::windows::core::Result<IDWriteRenderingParams2> {
let mut result__: <IDWriteRenderingParams2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).29)(
::core::mem::transmute_copy(self),
::core::mem::transmute(gamma),
::core::mem::transmute(enhancedcontrast),
::core::mem::transmute(grayscaleenhancedcontrast),
::core::mem::transmute(cleartypelevel),
::core::mem::transmute(pixelgeometry),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
&mut result__,
)
.from_abi::<IDWriteRenderingParams2>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis2(&self, glyphrun: *const DWRITE_GLYPH_RUN, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(gridfitmode),
::core::mem::transmute(antialiasmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFactory2 {
type Vtable = IDWriteFactory2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0439fc60_ca44_4994_8dee_3a9af7b732ec);
}
impl ::core::convert::From<IDWriteFactory2> for ::windows::core::IUnknown {
fn from(value: IDWriteFactory2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFactory2> for ::windows::core::IUnknown {
fn from(value: &IDWriteFactory2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFactory2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFactory2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFactory2> for IDWriteFactory1 {
fn from(value: IDWriteFactory2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory2> for IDWriteFactory1 {
fn from(value: &IDWriteFactory2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for IDWriteFactory2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for &IDWriteFactory2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory2> for IDWriteFactory {
fn from(value: IDWriteFactory2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory2> for IDWriteFactory {
fn from(value: &IDWriteFactory2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for IDWriteFactory2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for &IDWriteFactory2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFactory2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, collectionloader: ::windows::core::RawPtr, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::windows::core::RawPtr, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, monitor: super::Gdi::HMONITOR, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, fontcollection: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: super::super::Foundation::PWSTR, textformat: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gdiinterop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, maxwidth: f32, maxheight: f32, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textformat: ::windows::core::RawPtr, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textanalyzer: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: super::super::Foundation::PWSTR, ignoreuseroverride: super::super::Foundation::BOOL, numbersubstitution: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallbackbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32, colorlayers: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFactory3(pub ::windows::core::IUnknown);
impl IDWriteFactory3 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, collectionloader: Param0, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), collectionloader.into_param().abi(), ::core::mem::transmute(collectionkey), ::core::mem::transmute(collectionkeysize), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn RegisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFileReference<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateCustomFontFileReference<'a, Param2: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: Param2) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), fontfileloader.into_param().abi(), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateFontFace(&self, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::core::option::Option<IDWriteFontFile>, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacetype), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontfacesimulationflags), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
pub unsafe fn CreateRenderingParams(&self) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateMonitorRenderingParams<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HMONITOR>>(&self, monitor: Param0) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), monitor.into_param().abi(), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn CreateCustomRenderingParams(&self, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn RegisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextFormat<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontfamilyname: Param0, fontcollection: Param1, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: Param6) -> ::windows::core::Result<IDWriteTextFormat> {
let mut result__: <IDWriteTextFormat as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), fontcollection.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstyle), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontsize), localename.into_param().abi(), &mut result__).from_abi::<IDWriteTextFormat>(result__)
}
pub unsafe fn CreateTypography(&self) -> ::windows::core::Result<IDWriteTypography> {
let mut result__: <IDWriteTypography as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTypography>(result__)
}
pub unsafe fn GetGdiInterop(&self) -> ::windows::core::Result<IDWriteGdiInterop> {
let mut result__: <IDWriteGdiInterop as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteGdiInterop>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, string: Param0, stringlength: u32, textformat: Param2, maxwidth: f32, maxheight: f32) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), string.into_param().abi(), ::core::mem::transmute(stringlength), textformat.into_param().abi(), ::core::mem::transmute(maxwidth), ::core::mem::transmute(maxheight), &mut result__).from_abi::<IDWriteTextLayout>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGdiCompatibleTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, string: Param0, stringlength: u32, textformat: Param2, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param7) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(
::core::mem::transmute_copy(self),
string.into_param().abi(),
::core::mem::transmute(stringlength),
textformat.into_param().abi(),
::core::mem::transmute(layoutwidth),
::core::mem::transmute(layoutheight),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
&mut result__,
)
.from_abi::<IDWriteTextLayout>(result__)
}
pub unsafe fn CreateEllipsisTrimmingSign<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, textformat: Param0) -> ::windows::core::Result<IDWriteInlineObject> {
let mut result__: <IDWriteInlineObject as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), textformat.into_param().abi(), &mut result__).from_abi::<IDWriteInlineObject>(result__)
}
pub unsafe fn CreateTextAnalyzer(&self) -> ::windows::core::Result<IDWriteTextAnalyzer> {
let mut result__: <IDWriteTextAnalyzer as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTextAnalyzer>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateNumberSubstitution<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: Param1, ignoreuseroverride: Param2) -> ::windows::core::Result<IDWriteNumberSubstitution> {
let mut result__: <IDWriteNumberSubstitution as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(substitutionmethod), localename.into_param().abi(), ignoreuseroverride.into_param().abi(), &mut result__).from_abi::<IDWriteNumberSubstitution>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis(&self, glyphrun: *const DWRITE_GLYPH_RUN, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetEudcFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomRenderingParams2(&self, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams1> {
let mut result__: <IDWriteRenderingParams1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(enhancedcontrastgrayscale), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams1>(result__)
}
pub unsafe fn GetSystemFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
pub unsafe fn CreateFontFallbackBuilder(&self) -> ::windows::core::Result<IDWriteFontFallbackBuilder> {
let mut result__: <IDWriteFontFallbackBuilder as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallbackBuilder>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TranslateColorGlyphRun(&self, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32) -> ::windows::core::Result<IDWriteColorGlyphRunEnumerator> {
let mut result__: <IDWriteColorGlyphRunEnumerator as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(
::core::mem::transmute_copy(self),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
::core::mem::transmute(measuringmode),
::core::mem::transmute(worldtodevicetransform),
::core::mem::transmute(colorpaletteindex),
&mut result__,
)
.from_abi::<IDWriteColorGlyphRunEnumerator>(result__)
}
pub unsafe fn CreateCustomRenderingParams3(&self, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE) -> ::windows::core::Result<IDWriteRenderingParams2> {
let mut result__: <IDWriteRenderingParams2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).29)(
::core::mem::transmute_copy(self),
::core::mem::transmute(gamma),
::core::mem::transmute(enhancedcontrast),
::core::mem::transmute(grayscaleenhancedcontrast),
::core::mem::transmute(cleartypelevel),
::core::mem::transmute(pixelgeometry),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
&mut result__,
)
.from_abi::<IDWriteRenderingParams2>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis2(&self, glyphrun: *const DWRITE_GLYPH_RUN, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(gridfitmode),
::core::mem::transmute(antialiasmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis3(&self, glyphrun: *const DWRITE_GLYPH_RUN, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE1, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).31)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(gridfitmode),
::core::mem::transmute(antialiasmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
pub unsafe fn CreateCustomRenderingParams4(&self, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE1, gridfitmode: DWRITE_GRID_FIT_MODE) -> ::windows::core::Result<IDWriteRenderingParams3> {
let mut result__: <IDWriteRenderingParams3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).32)(
::core::mem::transmute_copy(self),
::core::mem::transmute(gamma),
::core::mem::transmute(enhancedcontrast),
::core::mem::transmute(grayscaleenhancedcontrast),
::core::mem::transmute(cleartypelevel),
::core::mem::transmute(pixelgeometry),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
&mut result__,
)
.from_abi::<IDWriteRenderingParams3>(result__)
}
pub unsafe fn CreateFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), fontfile.into_param().abi(), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFaceReference2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
pub unsafe fn GetSystemFontSet(&self) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
pub unsafe fn CreateFontSetBuilder(&self) -> ::windows::core::Result<IDWriteFontSetBuilder> {
let mut result__: <IDWriteFontSetBuilder as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSetBuilder>(result__)
}
pub unsafe fn CreateFontCollectionFromFontSet<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontSet>>(&self, fontset: Param0) -> ::windows::core::Result<IDWriteFontCollection1> {
let mut result__: <IDWriteFontCollection1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), fontset.into_param().abi(), &mut result__).from_abi::<IDWriteFontCollection1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, includedownloadablefonts: Param0, fontcollection: *mut ::core::option::Option<IDWriteFontCollection1>, checkforupdates: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), includedownloadablefonts.into_param().abi(), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn GetFontDownloadQueue(&self) -> ::windows::core::Result<IDWriteFontDownloadQueue> {
let mut result__: <IDWriteFontDownloadQueue as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontDownloadQueue>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFactory3 {
type Vtable = IDWriteFactory3_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x9a1b41c3_d3bb_466a_87fc_fe67556a3b65);
}
impl ::core::convert::From<IDWriteFactory3> for ::windows::core::IUnknown {
fn from(value: IDWriteFactory3) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFactory3> for ::windows::core::IUnknown {
fn from(value: &IDWriteFactory3) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFactory3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFactory3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFactory3> for IDWriteFactory2 {
fn from(value: IDWriteFactory3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory3> for IDWriteFactory2 {
fn from(value: &IDWriteFactory3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory2> for IDWriteFactory3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory2> for &IDWriteFactory3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory3> for IDWriteFactory1 {
fn from(value: IDWriteFactory3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory3> for IDWriteFactory1 {
fn from(value: &IDWriteFactory3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for IDWriteFactory3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for &IDWriteFactory3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory3> for IDWriteFactory {
fn from(value: IDWriteFactory3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory3> for IDWriteFactory {
fn from(value: &IDWriteFactory3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for IDWriteFactory3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for &IDWriteFactory3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFactory3_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, collectionloader: ::windows::core::RawPtr, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::windows::core::RawPtr, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, monitor: super::Gdi::HMONITOR, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, fontcollection: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: super::super::Foundation::PWSTR, textformat: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gdiinterop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, maxwidth: f32, maxheight: f32, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textformat: ::windows::core::RawPtr, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textanalyzer: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: super::super::Foundation::PWSTR, ignoreuseroverride: super::super::Foundation::BOOL, numbersubstitution: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallbackbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32, colorlayers: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE1, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE1, gridfitmode: DWRITE_GRID_FIT_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsetbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, includedownloadablefonts: super::super::Foundation::BOOL, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontdownloadqueue: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFactory4(pub ::windows::core::IUnknown);
impl IDWriteFactory4 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, collectionloader: Param0, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), collectionloader.into_param().abi(), ::core::mem::transmute(collectionkey), ::core::mem::transmute(collectionkeysize), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn RegisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFileReference<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateCustomFontFileReference<'a, Param2: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: Param2) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), fontfileloader.into_param().abi(), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateFontFace(&self, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::core::option::Option<IDWriteFontFile>, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacetype), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontfacesimulationflags), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
pub unsafe fn CreateRenderingParams(&self) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateMonitorRenderingParams<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HMONITOR>>(&self, monitor: Param0) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), monitor.into_param().abi(), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn CreateCustomRenderingParams(&self, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn RegisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextFormat<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontfamilyname: Param0, fontcollection: Param1, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: Param6) -> ::windows::core::Result<IDWriteTextFormat> {
let mut result__: <IDWriteTextFormat as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), fontcollection.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstyle), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontsize), localename.into_param().abi(), &mut result__).from_abi::<IDWriteTextFormat>(result__)
}
pub unsafe fn CreateTypography(&self) -> ::windows::core::Result<IDWriteTypography> {
let mut result__: <IDWriteTypography as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTypography>(result__)
}
pub unsafe fn GetGdiInterop(&self) -> ::windows::core::Result<IDWriteGdiInterop> {
let mut result__: <IDWriteGdiInterop as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteGdiInterop>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, string: Param0, stringlength: u32, textformat: Param2, maxwidth: f32, maxheight: f32) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), string.into_param().abi(), ::core::mem::transmute(stringlength), textformat.into_param().abi(), ::core::mem::transmute(maxwidth), ::core::mem::transmute(maxheight), &mut result__).from_abi::<IDWriteTextLayout>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGdiCompatibleTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, string: Param0, stringlength: u32, textformat: Param2, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param7) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(
::core::mem::transmute_copy(self),
string.into_param().abi(),
::core::mem::transmute(stringlength),
textformat.into_param().abi(),
::core::mem::transmute(layoutwidth),
::core::mem::transmute(layoutheight),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
&mut result__,
)
.from_abi::<IDWriteTextLayout>(result__)
}
pub unsafe fn CreateEllipsisTrimmingSign<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, textformat: Param0) -> ::windows::core::Result<IDWriteInlineObject> {
let mut result__: <IDWriteInlineObject as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), textformat.into_param().abi(), &mut result__).from_abi::<IDWriteInlineObject>(result__)
}
pub unsafe fn CreateTextAnalyzer(&self) -> ::windows::core::Result<IDWriteTextAnalyzer> {
let mut result__: <IDWriteTextAnalyzer as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTextAnalyzer>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateNumberSubstitution<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: Param1, ignoreuseroverride: Param2) -> ::windows::core::Result<IDWriteNumberSubstitution> {
let mut result__: <IDWriteNumberSubstitution as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(substitutionmethod), localename.into_param().abi(), ignoreuseroverride.into_param().abi(), &mut result__).from_abi::<IDWriteNumberSubstitution>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis(&self, glyphrun: *const DWRITE_GLYPH_RUN, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetEudcFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomRenderingParams2(&self, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams1> {
let mut result__: <IDWriteRenderingParams1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(enhancedcontrastgrayscale), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams1>(result__)
}
pub unsafe fn GetSystemFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
pub unsafe fn CreateFontFallbackBuilder(&self) -> ::windows::core::Result<IDWriteFontFallbackBuilder> {
let mut result__: <IDWriteFontFallbackBuilder as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallbackBuilder>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TranslateColorGlyphRun(&self, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32) -> ::windows::core::Result<IDWriteColorGlyphRunEnumerator> {
let mut result__: <IDWriteColorGlyphRunEnumerator as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(
::core::mem::transmute_copy(self),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
::core::mem::transmute(measuringmode),
::core::mem::transmute(worldtodevicetransform),
::core::mem::transmute(colorpaletteindex),
&mut result__,
)
.from_abi::<IDWriteColorGlyphRunEnumerator>(result__)
}
pub unsafe fn CreateCustomRenderingParams3(&self, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE) -> ::windows::core::Result<IDWriteRenderingParams2> {
let mut result__: <IDWriteRenderingParams2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).29)(
::core::mem::transmute_copy(self),
::core::mem::transmute(gamma),
::core::mem::transmute(enhancedcontrast),
::core::mem::transmute(grayscaleenhancedcontrast),
::core::mem::transmute(cleartypelevel),
::core::mem::transmute(pixelgeometry),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
&mut result__,
)
.from_abi::<IDWriteRenderingParams2>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis2(&self, glyphrun: *const DWRITE_GLYPH_RUN, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(gridfitmode),
::core::mem::transmute(antialiasmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis3(&self, glyphrun: *const DWRITE_GLYPH_RUN, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE1, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).31)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(gridfitmode),
::core::mem::transmute(antialiasmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
pub unsafe fn CreateCustomRenderingParams4(&self, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE1, gridfitmode: DWRITE_GRID_FIT_MODE) -> ::windows::core::Result<IDWriteRenderingParams3> {
let mut result__: <IDWriteRenderingParams3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).32)(
::core::mem::transmute_copy(self),
::core::mem::transmute(gamma),
::core::mem::transmute(enhancedcontrast),
::core::mem::transmute(grayscaleenhancedcontrast),
::core::mem::transmute(cleartypelevel),
::core::mem::transmute(pixelgeometry),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
&mut result__,
)
.from_abi::<IDWriteRenderingParams3>(result__)
}
pub unsafe fn CreateFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), fontfile.into_param().abi(), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFaceReference2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
pub unsafe fn GetSystemFontSet(&self) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
pub unsafe fn CreateFontSetBuilder(&self) -> ::windows::core::Result<IDWriteFontSetBuilder> {
let mut result__: <IDWriteFontSetBuilder as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSetBuilder>(result__)
}
pub unsafe fn CreateFontCollectionFromFontSet<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontSet>>(&self, fontset: Param0) -> ::windows::core::Result<IDWriteFontCollection1> {
let mut result__: <IDWriteFontCollection1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), fontset.into_param().abi(), &mut result__).from_abi::<IDWriteFontCollection1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, includedownloadablefonts: Param0, fontcollection: *mut ::core::option::Option<IDWriteFontCollection1>, checkforupdates: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), includedownloadablefonts.into_param().abi(), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn GetFontDownloadQueue(&self) -> ::windows::core::Result<IDWriteFontDownloadQueue> {
let mut result__: <IDWriteFontDownloadQueue as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontDownloadQueue>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn TranslateColorGlyphRun2<'a, Param0: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, baselineorigin: Param0, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, desiredglyphimageformats: DWRITE_GLYPH_IMAGE_FORMATS, measuringmode: DWRITE_MEASURING_MODE, worldanddpitransform: *const DWRITE_MATRIX, colorpaletteindex: u32) -> ::windows::core::Result<IDWriteColorGlyphRunEnumerator1> {
let mut result__: <IDWriteColorGlyphRunEnumerator1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).40)(
::core::mem::transmute_copy(self),
baselineorigin.into_param().abi(),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
::core::mem::transmute(desiredglyphimageformats),
::core::mem::transmute(measuringmode),
::core::mem::transmute(worldanddpitransform),
::core::mem::transmute(colorpaletteindex),
&mut result__,
)
.from_abi::<IDWriteColorGlyphRunEnumerator1>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn ComputeGlyphOrigins<'a, Param1: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, glyphrun: *const DWRITE_GLYPH_RUN, baselineorigin: Param1) -> ::windows::core::Result<super::Direct2D::Common::D2D_POINT_2F> {
let mut result__: <super::Direct2D::Common::D2D_POINT_2F as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphrun), baselineorigin.into_param().abi(), &mut result__).from_abi::<super::Direct2D::Common::D2D_POINT_2F>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn ComputeGlyphOrigins2<'a, Param2: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, glyphrun: *const DWRITE_GLYPH_RUN, measuringmode: DWRITE_MEASURING_MODE, baselineorigin: Param2, worldanddpitransform: *const DWRITE_MATRIX) -> ::windows::core::Result<super::Direct2D::Common::D2D_POINT_2F> {
let mut result__: <super::Direct2D::Common::D2D_POINT_2F as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphrun), ::core::mem::transmute(measuringmode), baselineorigin.into_param().abi(), ::core::mem::transmute(worldanddpitransform), &mut result__).from_abi::<super::Direct2D::Common::D2D_POINT_2F>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFactory4 {
type Vtable = IDWriteFactory4_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4b0b5bd3_0797_4549_8ac5_fe915cc53856);
}
impl ::core::convert::From<IDWriteFactory4> for ::windows::core::IUnknown {
fn from(value: IDWriteFactory4) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFactory4> for ::windows::core::IUnknown {
fn from(value: &IDWriteFactory4) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFactory4 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFactory4 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFactory4> for IDWriteFactory3 {
fn from(value: IDWriteFactory4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory4> for IDWriteFactory3 {
fn from(value: &IDWriteFactory4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory3> for IDWriteFactory4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory3> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory3> for &IDWriteFactory4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory3> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory4> for IDWriteFactory2 {
fn from(value: IDWriteFactory4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory4> for IDWriteFactory2 {
fn from(value: &IDWriteFactory4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory2> for IDWriteFactory4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory2> for &IDWriteFactory4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory4> for IDWriteFactory1 {
fn from(value: IDWriteFactory4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory4> for IDWriteFactory1 {
fn from(value: &IDWriteFactory4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for IDWriteFactory4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for &IDWriteFactory4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory4> for IDWriteFactory {
fn from(value: IDWriteFactory4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory4> for IDWriteFactory {
fn from(value: &IDWriteFactory4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for IDWriteFactory4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for &IDWriteFactory4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFactory4_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, collectionloader: ::windows::core::RawPtr, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::windows::core::RawPtr, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, monitor: super::Gdi::HMONITOR, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, fontcollection: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: super::super::Foundation::PWSTR, textformat: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gdiinterop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, maxwidth: f32, maxheight: f32, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textformat: ::windows::core::RawPtr, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textanalyzer: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: super::super::Foundation::PWSTR, ignoreuseroverride: super::super::Foundation::BOOL, numbersubstitution: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallbackbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32, colorlayers: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE1, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE1, gridfitmode: DWRITE_GRID_FIT_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsetbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, includedownloadablefonts: super::super::Foundation::BOOL, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontdownloadqueue: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, desiredglyphimageformats: DWRITE_GLYPH_IMAGE_FORMATS, measuringmode: DWRITE_MEASURING_MODE, worldanddpitransform: *const DWRITE_MATRIX, colorpaletteindex: u32, colorlayers: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, glyphorigins: *mut super::Direct2D::Common::D2D_POINT_2F) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, measuringmode: DWRITE_MEASURING_MODE, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, worldanddpitransform: *const DWRITE_MATRIX, glyphorigins: *mut super::Direct2D::Common::D2D_POINT_2F) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFactory5(pub ::windows::core::IUnknown);
impl IDWriteFactory5 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, collectionloader: Param0, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), collectionloader.into_param().abi(), ::core::mem::transmute(collectionkey), ::core::mem::transmute(collectionkeysize), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn RegisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFileReference<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateCustomFontFileReference<'a, Param2: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: Param2) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), fontfileloader.into_param().abi(), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateFontFace(&self, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::core::option::Option<IDWriteFontFile>, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacetype), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontfacesimulationflags), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
pub unsafe fn CreateRenderingParams(&self) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateMonitorRenderingParams<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HMONITOR>>(&self, monitor: Param0) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), monitor.into_param().abi(), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn CreateCustomRenderingParams(&self, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn RegisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextFormat<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontfamilyname: Param0, fontcollection: Param1, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: Param6) -> ::windows::core::Result<IDWriteTextFormat> {
let mut result__: <IDWriteTextFormat as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), fontcollection.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstyle), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontsize), localename.into_param().abi(), &mut result__).from_abi::<IDWriteTextFormat>(result__)
}
pub unsafe fn CreateTypography(&self) -> ::windows::core::Result<IDWriteTypography> {
let mut result__: <IDWriteTypography as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTypography>(result__)
}
pub unsafe fn GetGdiInterop(&self) -> ::windows::core::Result<IDWriteGdiInterop> {
let mut result__: <IDWriteGdiInterop as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteGdiInterop>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, string: Param0, stringlength: u32, textformat: Param2, maxwidth: f32, maxheight: f32) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), string.into_param().abi(), ::core::mem::transmute(stringlength), textformat.into_param().abi(), ::core::mem::transmute(maxwidth), ::core::mem::transmute(maxheight), &mut result__).from_abi::<IDWriteTextLayout>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGdiCompatibleTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, string: Param0, stringlength: u32, textformat: Param2, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param7) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(
::core::mem::transmute_copy(self),
string.into_param().abi(),
::core::mem::transmute(stringlength),
textformat.into_param().abi(),
::core::mem::transmute(layoutwidth),
::core::mem::transmute(layoutheight),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
&mut result__,
)
.from_abi::<IDWriteTextLayout>(result__)
}
pub unsafe fn CreateEllipsisTrimmingSign<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, textformat: Param0) -> ::windows::core::Result<IDWriteInlineObject> {
let mut result__: <IDWriteInlineObject as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), textformat.into_param().abi(), &mut result__).from_abi::<IDWriteInlineObject>(result__)
}
pub unsafe fn CreateTextAnalyzer(&self) -> ::windows::core::Result<IDWriteTextAnalyzer> {
let mut result__: <IDWriteTextAnalyzer as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTextAnalyzer>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateNumberSubstitution<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: Param1, ignoreuseroverride: Param2) -> ::windows::core::Result<IDWriteNumberSubstitution> {
let mut result__: <IDWriteNumberSubstitution as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(substitutionmethod), localename.into_param().abi(), ignoreuseroverride.into_param().abi(), &mut result__).from_abi::<IDWriteNumberSubstitution>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis(&self, glyphrun: *const DWRITE_GLYPH_RUN, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetEudcFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomRenderingParams2(&self, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams1> {
let mut result__: <IDWriteRenderingParams1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(enhancedcontrastgrayscale), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams1>(result__)
}
pub unsafe fn GetSystemFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
pub unsafe fn CreateFontFallbackBuilder(&self) -> ::windows::core::Result<IDWriteFontFallbackBuilder> {
let mut result__: <IDWriteFontFallbackBuilder as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallbackBuilder>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TranslateColorGlyphRun(&self, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32) -> ::windows::core::Result<IDWriteColorGlyphRunEnumerator> {
let mut result__: <IDWriteColorGlyphRunEnumerator as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(
::core::mem::transmute_copy(self),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
::core::mem::transmute(measuringmode),
::core::mem::transmute(worldtodevicetransform),
::core::mem::transmute(colorpaletteindex),
&mut result__,
)
.from_abi::<IDWriteColorGlyphRunEnumerator>(result__)
}
pub unsafe fn CreateCustomRenderingParams3(&self, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE) -> ::windows::core::Result<IDWriteRenderingParams2> {
let mut result__: <IDWriteRenderingParams2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).29)(
::core::mem::transmute_copy(self),
::core::mem::transmute(gamma),
::core::mem::transmute(enhancedcontrast),
::core::mem::transmute(grayscaleenhancedcontrast),
::core::mem::transmute(cleartypelevel),
::core::mem::transmute(pixelgeometry),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
&mut result__,
)
.from_abi::<IDWriteRenderingParams2>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis2(&self, glyphrun: *const DWRITE_GLYPH_RUN, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(gridfitmode),
::core::mem::transmute(antialiasmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis3(&self, glyphrun: *const DWRITE_GLYPH_RUN, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE1, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).31)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(gridfitmode),
::core::mem::transmute(antialiasmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
pub unsafe fn CreateCustomRenderingParams4(&self, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE1, gridfitmode: DWRITE_GRID_FIT_MODE) -> ::windows::core::Result<IDWriteRenderingParams3> {
let mut result__: <IDWriteRenderingParams3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).32)(
::core::mem::transmute_copy(self),
::core::mem::transmute(gamma),
::core::mem::transmute(enhancedcontrast),
::core::mem::transmute(grayscaleenhancedcontrast),
::core::mem::transmute(cleartypelevel),
::core::mem::transmute(pixelgeometry),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
&mut result__,
)
.from_abi::<IDWriteRenderingParams3>(result__)
}
pub unsafe fn CreateFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), fontfile.into_param().abi(), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFaceReference2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
pub unsafe fn GetSystemFontSet(&self) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
pub unsafe fn CreateFontSetBuilder(&self) -> ::windows::core::Result<IDWriteFontSetBuilder> {
let mut result__: <IDWriteFontSetBuilder as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSetBuilder>(result__)
}
pub unsafe fn CreateFontCollectionFromFontSet<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontSet>>(&self, fontset: Param0) -> ::windows::core::Result<IDWriteFontCollection1> {
let mut result__: <IDWriteFontCollection1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), fontset.into_param().abi(), &mut result__).from_abi::<IDWriteFontCollection1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, includedownloadablefonts: Param0, fontcollection: *mut ::core::option::Option<IDWriteFontCollection1>, checkforupdates: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), includedownloadablefonts.into_param().abi(), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn GetFontDownloadQueue(&self) -> ::windows::core::Result<IDWriteFontDownloadQueue> {
let mut result__: <IDWriteFontDownloadQueue as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontDownloadQueue>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn TranslateColorGlyphRun2<'a, Param0: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, baselineorigin: Param0, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, desiredglyphimageformats: DWRITE_GLYPH_IMAGE_FORMATS, measuringmode: DWRITE_MEASURING_MODE, worldanddpitransform: *const DWRITE_MATRIX, colorpaletteindex: u32) -> ::windows::core::Result<IDWriteColorGlyphRunEnumerator1> {
let mut result__: <IDWriteColorGlyphRunEnumerator1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).40)(
::core::mem::transmute_copy(self),
baselineorigin.into_param().abi(),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
::core::mem::transmute(desiredglyphimageformats),
::core::mem::transmute(measuringmode),
::core::mem::transmute(worldanddpitransform),
::core::mem::transmute(colorpaletteindex),
&mut result__,
)
.from_abi::<IDWriteColorGlyphRunEnumerator1>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn ComputeGlyphOrigins<'a, Param1: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, glyphrun: *const DWRITE_GLYPH_RUN, baselineorigin: Param1) -> ::windows::core::Result<super::Direct2D::Common::D2D_POINT_2F> {
let mut result__: <super::Direct2D::Common::D2D_POINT_2F as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphrun), baselineorigin.into_param().abi(), &mut result__).from_abi::<super::Direct2D::Common::D2D_POINT_2F>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn ComputeGlyphOrigins2<'a, Param2: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, glyphrun: *const DWRITE_GLYPH_RUN, measuringmode: DWRITE_MEASURING_MODE, baselineorigin: Param2, worldanddpitransform: *const DWRITE_MATRIX) -> ::windows::core::Result<super::Direct2D::Common::D2D_POINT_2F> {
let mut result__: <super::Direct2D::Common::D2D_POINT_2F as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphrun), ::core::mem::transmute(measuringmode), baselineorigin.into_param().abi(), ::core::mem::transmute(worldanddpitransform), &mut result__).from_abi::<super::Direct2D::Common::D2D_POINT_2F>(result__)
}
pub unsafe fn CreateFontSetBuilder2(&self) -> ::windows::core::Result<IDWriteFontSetBuilder1> {
let mut result__: <IDWriteFontSetBuilder1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSetBuilder1>(result__)
}
pub unsafe fn CreateInMemoryFontFileLoader(&self) -> ::windows::core::Result<IDWriteInMemoryFontFileLoader> {
let mut result__: <IDWriteInMemoryFontFileLoader as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).44)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteInMemoryFontFileLoader>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateHttpFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, referrerurl: Param0, extraheaders: Param1) -> ::windows::core::Result<IDWriteRemoteFontFileLoader> {
let mut result__: <IDWriteRemoteFontFileLoader as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), referrerurl.into_param().abi(), extraheaders.into_param().abi(), &mut result__).from_abi::<IDWriteRemoteFontFileLoader>(result__)
}
pub unsafe fn AnalyzeContainerType(&self, filedata: *const ::core::ffi::c_void, filedatasize: u32) -> DWRITE_CONTAINER_TYPE {
::core::mem::transmute((::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(filedata), ::core::mem::transmute(filedatasize)))
}
pub unsafe fn UnpackFontFile(&self, containertype: DWRITE_CONTAINER_TYPE, filedata: *const ::core::ffi::c_void, filedatasize: u32) -> ::windows::core::Result<IDWriteFontFileStream> {
let mut result__: <IDWriteFontFileStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), ::core::mem::transmute(containertype), ::core::mem::transmute(filedata), ::core::mem::transmute(filedatasize), &mut result__).from_abi::<IDWriteFontFileStream>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFactory5 {
type Vtable = IDWriteFactory5_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x958db99a_be2a_4f09_af7d_65189803d1d3);
}
impl ::core::convert::From<IDWriteFactory5> for ::windows::core::IUnknown {
fn from(value: IDWriteFactory5) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFactory5> for ::windows::core::IUnknown {
fn from(value: &IDWriteFactory5) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFactory5> for IDWriteFactory4 {
fn from(value: IDWriteFactory5) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory5> for IDWriteFactory4 {
fn from(value: &IDWriteFactory5) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory4> for IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory4> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory4> for &IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory4> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory5> for IDWriteFactory3 {
fn from(value: IDWriteFactory5) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory5> for IDWriteFactory3 {
fn from(value: &IDWriteFactory5) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory3> for IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory3> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory3> for &IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory3> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory5> for IDWriteFactory2 {
fn from(value: IDWriteFactory5) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory5> for IDWriteFactory2 {
fn from(value: &IDWriteFactory5) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory2> for IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory2> for &IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory5> for IDWriteFactory1 {
fn from(value: IDWriteFactory5) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory5> for IDWriteFactory1 {
fn from(value: &IDWriteFactory5) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for &IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory5> for IDWriteFactory {
fn from(value: IDWriteFactory5) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory5> for IDWriteFactory {
fn from(value: &IDWriteFactory5) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for &IDWriteFactory5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFactory5_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, collectionloader: ::windows::core::RawPtr, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::windows::core::RawPtr, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, monitor: super::Gdi::HMONITOR, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, fontcollection: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: super::super::Foundation::PWSTR, textformat: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gdiinterop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, maxwidth: f32, maxheight: f32, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textformat: ::windows::core::RawPtr, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textanalyzer: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: super::super::Foundation::PWSTR, ignoreuseroverride: super::super::Foundation::BOOL, numbersubstitution: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallbackbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32, colorlayers: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE1, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE1, gridfitmode: DWRITE_GRID_FIT_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsetbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, includedownloadablefonts: super::super::Foundation::BOOL, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontdownloadqueue: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, desiredglyphimageformats: DWRITE_GLYPH_IMAGE_FORMATS, measuringmode: DWRITE_MEASURING_MODE, worldanddpitransform: *const DWRITE_MATRIX, colorpaletteindex: u32, colorlayers: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, glyphorigins: *mut super::Direct2D::Common::D2D_POINT_2F) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, measuringmode: DWRITE_MEASURING_MODE, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, worldanddpitransform: *const DWRITE_MATRIX, glyphorigins: *mut super::Direct2D::Common::D2D_POINT_2F) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsetbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, newloader: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, referrerurl: super::super::Foundation::PWSTR, extraheaders: super::super::Foundation::PWSTR, newloader: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filedata: *const ::core::ffi::c_void, filedatasize: u32) -> DWRITE_CONTAINER_TYPE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, containertype: DWRITE_CONTAINER_TYPE, filedata: *const ::core::ffi::c_void, filedatasize: u32, unpackedfontstream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFactory6(pub ::windows::core::IUnknown);
impl IDWriteFactory6 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, collectionloader: Param0, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), collectionloader.into_param().abi(), ::core::mem::transmute(collectionkey), ::core::mem::transmute(collectionkeysize), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn RegisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFileReference<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateCustomFontFileReference<'a, Param2: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: Param2) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), fontfileloader.into_param().abi(), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateFontFace(&self, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::core::option::Option<IDWriteFontFile>, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacetype), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontfacesimulationflags), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
pub unsafe fn CreateRenderingParams(&self) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateMonitorRenderingParams<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HMONITOR>>(&self, monitor: Param0) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), monitor.into_param().abi(), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn CreateCustomRenderingParams(&self, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn RegisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextFormat<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontfamilyname: Param0, fontcollection: Param1, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: Param6) -> ::windows::core::Result<IDWriteTextFormat> {
let mut result__: <IDWriteTextFormat as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), fontcollection.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstyle), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontsize), localename.into_param().abi(), &mut result__).from_abi::<IDWriteTextFormat>(result__)
}
pub unsafe fn CreateTypography(&self) -> ::windows::core::Result<IDWriteTypography> {
let mut result__: <IDWriteTypography as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTypography>(result__)
}
pub unsafe fn GetGdiInterop(&self) -> ::windows::core::Result<IDWriteGdiInterop> {
let mut result__: <IDWriteGdiInterop as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteGdiInterop>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, string: Param0, stringlength: u32, textformat: Param2, maxwidth: f32, maxheight: f32) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), string.into_param().abi(), ::core::mem::transmute(stringlength), textformat.into_param().abi(), ::core::mem::transmute(maxwidth), ::core::mem::transmute(maxheight), &mut result__).from_abi::<IDWriteTextLayout>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGdiCompatibleTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, string: Param0, stringlength: u32, textformat: Param2, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param7) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(
::core::mem::transmute_copy(self),
string.into_param().abi(),
::core::mem::transmute(stringlength),
textformat.into_param().abi(),
::core::mem::transmute(layoutwidth),
::core::mem::transmute(layoutheight),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
&mut result__,
)
.from_abi::<IDWriteTextLayout>(result__)
}
pub unsafe fn CreateEllipsisTrimmingSign<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, textformat: Param0) -> ::windows::core::Result<IDWriteInlineObject> {
let mut result__: <IDWriteInlineObject as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), textformat.into_param().abi(), &mut result__).from_abi::<IDWriteInlineObject>(result__)
}
pub unsafe fn CreateTextAnalyzer(&self) -> ::windows::core::Result<IDWriteTextAnalyzer> {
let mut result__: <IDWriteTextAnalyzer as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTextAnalyzer>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateNumberSubstitution<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: Param1, ignoreuseroverride: Param2) -> ::windows::core::Result<IDWriteNumberSubstitution> {
let mut result__: <IDWriteNumberSubstitution as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(substitutionmethod), localename.into_param().abi(), ignoreuseroverride.into_param().abi(), &mut result__).from_abi::<IDWriteNumberSubstitution>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis(&self, glyphrun: *const DWRITE_GLYPH_RUN, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetEudcFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomRenderingParams2(&self, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams1> {
let mut result__: <IDWriteRenderingParams1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(enhancedcontrastgrayscale), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams1>(result__)
}
pub unsafe fn GetSystemFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
pub unsafe fn CreateFontFallbackBuilder(&self) -> ::windows::core::Result<IDWriteFontFallbackBuilder> {
let mut result__: <IDWriteFontFallbackBuilder as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallbackBuilder>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TranslateColorGlyphRun(&self, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32) -> ::windows::core::Result<IDWriteColorGlyphRunEnumerator> {
let mut result__: <IDWriteColorGlyphRunEnumerator as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(
::core::mem::transmute_copy(self),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
::core::mem::transmute(measuringmode),
::core::mem::transmute(worldtodevicetransform),
::core::mem::transmute(colorpaletteindex),
&mut result__,
)
.from_abi::<IDWriteColorGlyphRunEnumerator>(result__)
}
pub unsafe fn CreateCustomRenderingParams3(&self, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE) -> ::windows::core::Result<IDWriteRenderingParams2> {
let mut result__: <IDWriteRenderingParams2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).29)(
::core::mem::transmute_copy(self),
::core::mem::transmute(gamma),
::core::mem::transmute(enhancedcontrast),
::core::mem::transmute(grayscaleenhancedcontrast),
::core::mem::transmute(cleartypelevel),
::core::mem::transmute(pixelgeometry),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
&mut result__,
)
.from_abi::<IDWriteRenderingParams2>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis2(&self, glyphrun: *const DWRITE_GLYPH_RUN, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(gridfitmode),
::core::mem::transmute(antialiasmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis3(&self, glyphrun: *const DWRITE_GLYPH_RUN, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE1, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).31)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(gridfitmode),
::core::mem::transmute(antialiasmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
pub unsafe fn CreateCustomRenderingParams4(&self, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE1, gridfitmode: DWRITE_GRID_FIT_MODE) -> ::windows::core::Result<IDWriteRenderingParams3> {
let mut result__: <IDWriteRenderingParams3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).32)(
::core::mem::transmute_copy(self),
::core::mem::transmute(gamma),
::core::mem::transmute(enhancedcontrast),
::core::mem::transmute(grayscaleenhancedcontrast),
::core::mem::transmute(cleartypelevel),
::core::mem::transmute(pixelgeometry),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
&mut result__,
)
.from_abi::<IDWriteRenderingParams3>(result__)
}
pub unsafe fn CreateFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), fontfile.into_param().abi(), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFaceReference2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
pub unsafe fn GetSystemFontSet(&self) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
pub unsafe fn CreateFontSetBuilder(&self) -> ::windows::core::Result<IDWriteFontSetBuilder> {
let mut result__: <IDWriteFontSetBuilder as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSetBuilder>(result__)
}
pub unsafe fn CreateFontCollectionFromFontSet<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontSet>>(&self, fontset: Param0) -> ::windows::core::Result<IDWriteFontCollection1> {
let mut result__: <IDWriteFontCollection1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), fontset.into_param().abi(), &mut result__).from_abi::<IDWriteFontCollection1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, includedownloadablefonts: Param0, fontcollection: *mut ::core::option::Option<IDWriteFontCollection1>, checkforupdates: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), includedownloadablefonts.into_param().abi(), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn GetFontDownloadQueue(&self) -> ::windows::core::Result<IDWriteFontDownloadQueue> {
let mut result__: <IDWriteFontDownloadQueue as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontDownloadQueue>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn TranslateColorGlyphRun2<'a, Param0: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, baselineorigin: Param0, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, desiredglyphimageformats: DWRITE_GLYPH_IMAGE_FORMATS, measuringmode: DWRITE_MEASURING_MODE, worldanddpitransform: *const DWRITE_MATRIX, colorpaletteindex: u32) -> ::windows::core::Result<IDWriteColorGlyphRunEnumerator1> {
let mut result__: <IDWriteColorGlyphRunEnumerator1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).40)(
::core::mem::transmute_copy(self),
baselineorigin.into_param().abi(),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
::core::mem::transmute(desiredglyphimageformats),
::core::mem::transmute(measuringmode),
::core::mem::transmute(worldanddpitransform),
::core::mem::transmute(colorpaletteindex),
&mut result__,
)
.from_abi::<IDWriteColorGlyphRunEnumerator1>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn ComputeGlyphOrigins<'a, Param1: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, glyphrun: *const DWRITE_GLYPH_RUN, baselineorigin: Param1) -> ::windows::core::Result<super::Direct2D::Common::D2D_POINT_2F> {
let mut result__: <super::Direct2D::Common::D2D_POINT_2F as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphrun), baselineorigin.into_param().abi(), &mut result__).from_abi::<super::Direct2D::Common::D2D_POINT_2F>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn ComputeGlyphOrigins2<'a, Param2: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, glyphrun: *const DWRITE_GLYPH_RUN, measuringmode: DWRITE_MEASURING_MODE, baselineorigin: Param2, worldanddpitransform: *const DWRITE_MATRIX) -> ::windows::core::Result<super::Direct2D::Common::D2D_POINT_2F> {
let mut result__: <super::Direct2D::Common::D2D_POINT_2F as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphrun), ::core::mem::transmute(measuringmode), baselineorigin.into_param().abi(), ::core::mem::transmute(worldanddpitransform), &mut result__).from_abi::<super::Direct2D::Common::D2D_POINT_2F>(result__)
}
pub unsafe fn CreateFontSetBuilder2(&self) -> ::windows::core::Result<IDWriteFontSetBuilder1> {
let mut result__: <IDWriteFontSetBuilder1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSetBuilder1>(result__)
}
pub unsafe fn CreateInMemoryFontFileLoader(&self) -> ::windows::core::Result<IDWriteInMemoryFontFileLoader> {
let mut result__: <IDWriteInMemoryFontFileLoader as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).44)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteInMemoryFontFileLoader>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateHttpFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, referrerurl: Param0, extraheaders: Param1) -> ::windows::core::Result<IDWriteRemoteFontFileLoader> {
let mut result__: <IDWriteRemoteFontFileLoader as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), referrerurl.into_param().abi(), extraheaders.into_param().abi(), &mut result__).from_abi::<IDWriteRemoteFontFileLoader>(result__)
}
pub unsafe fn AnalyzeContainerType(&self, filedata: *const ::core::ffi::c_void, filedatasize: u32) -> DWRITE_CONTAINER_TYPE {
::core::mem::transmute((::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(filedata), ::core::mem::transmute(filedatasize)))
}
pub unsafe fn UnpackFontFile(&self, containertype: DWRITE_CONTAINER_TYPE, filedata: *const ::core::ffi::c_void, filedatasize: u32) -> ::windows::core::Result<IDWriteFontFileStream> {
let mut result__: <IDWriteFontFileStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), ::core::mem::transmute(containertype), ::core::mem::transmute(filedata), ::core::mem::transmute(filedatasize), &mut result__).from_abi::<IDWriteFontFileStream>(result__)
}
pub unsafe fn CreateFontFaceReference3<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<IDWriteFontFaceReference1> {
let mut result__: <IDWriteFontFaceReference1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), fontfile.into_param().abi(), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), &mut result__).from_abi::<IDWriteFontFaceReference1>(result__)
}
pub unsafe fn CreateFontResource<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0, faceindex: u32) -> ::windows::core::Result<IDWriteFontResource> {
let mut result__: <IDWriteFontResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), fontfile.into_param().abi(), ::core::mem::transmute(faceindex), &mut result__).from_abi::<IDWriteFontResource>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontSet2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, includedownloadablefonts: Param0) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self), includedownloadablefonts.into_param().abi(), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection3<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, includedownloadablefonts: Param0, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL) -> ::windows::core::Result<IDWriteFontCollection2> {
let mut result__: <IDWriteFontCollection2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), includedownloadablefonts.into_param().abi(), ::core::mem::transmute(fontfamilymodel), &mut result__).from_abi::<IDWriteFontCollection2>(result__)
}
pub unsafe fn CreateFontCollectionFromFontSet2<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontSet>>(&self, fontset: Param0, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL) -> ::windows::core::Result<IDWriteFontCollection2> {
let mut result__: <IDWriteFontCollection2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), fontset.into_param().abi(), ::core::mem::transmute(fontfamilymodel), &mut result__).from_abi::<IDWriteFontCollection2>(result__)
}
pub unsafe fn CreateFontSetBuilder3(&self) -> ::windows::core::Result<IDWriteFontSetBuilder2> {
let mut result__: <IDWriteFontSetBuilder2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).53)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSetBuilder2>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextFormat2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontfamilyname: Param0, fontcollection: Param1, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontsize: f32, localename: Param5) -> ::windows::core::Result<IDWriteTextFormat3> {
let mut result__: <IDWriteTextFormat3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).54)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), fontcollection.into_param().abi(), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), ::core::mem::transmute(fontsize), localename.into_param().abi(), &mut result__).from_abi::<IDWriteTextFormat3>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFactory6 {
type Vtable = IDWriteFactory6_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xf3744d80_21f7_42eb_b35d_995bc72fc223);
}
impl ::core::convert::From<IDWriteFactory6> for ::windows::core::IUnknown {
fn from(value: IDWriteFactory6) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFactory6> for ::windows::core::IUnknown {
fn from(value: &IDWriteFactory6) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFactory6> for IDWriteFactory5 {
fn from(value: IDWriteFactory6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory6> for IDWriteFactory5 {
fn from(value: &IDWriteFactory6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory5> for IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory5> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory5> for &IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory5> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory6> for IDWriteFactory4 {
fn from(value: IDWriteFactory6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory6> for IDWriteFactory4 {
fn from(value: &IDWriteFactory6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory4> for IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory4> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory4> for &IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory4> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory6> for IDWriteFactory3 {
fn from(value: IDWriteFactory6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory6> for IDWriteFactory3 {
fn from(value: &IDWriteFactory6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory3> for IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory3> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory3> for &IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory3> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory6> for IDWriteFactory2 {
fn from(value: IDWriteFactory6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory6> for IDWriteFactory2 {
fn from(value: &IDWriteFactory6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory2> for IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory2> for &IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory6> for IDWriteFactory1 {
fn from(value: IDWriteFactory6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory6> for IDWriteFactory1 {
fn from(value: &IDWriteFactory6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for &IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory6> for IDWriteFactory {
fn from(value: IDWriteFactory6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory6> for IDWriteFactory {
fn from(value: &IDWriteFactory6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for &IDWriteFactory6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFactory6_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, collectionloader: ::windows::core::RawPtr, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::windows::core::RawPtr, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, monitor: super::Gdi::HMONITOR, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, fontcollection: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: super::super::Foundation::PWSTR, textformat: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gdiinterop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, maxwidth: f32, maxheight: f32, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textformat: ::windows::core::RawPtr, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textanalyzer: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: super::super::Foundation::PWSTR, ignoreuseroverride: super::super::Foundation::BOOL, numbersubstitution: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallbackbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32, colorlayers: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE1, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE1, gridfitmode: DWRITE_GRID_FIT_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsetbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, includedownloadablefonts: super::super::Foundation::BOOL, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontdownloadqueue: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, desiredglyphimageformats: DWRITE_GLYPH_IMAGE_FORMATS, measuringmode: DWRITE_MEASURING_MODE, worldanddpitransform: *const DWRITE_MATRIX, colorpaletteindex: u32, colorlayers: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, glyphorigins: *mut super::Direct2D::Common::D2D_POINT_2F) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, measuringmode: DWRITE_MEASURING_MODE, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, worldanddpitransform: *const DWRITE_MATRIX, glyphorigins: *mut super::Direct2D::Common::D2D_POINT_2F) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsetbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, newloader: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, referrerurl: super::super::Foundation::PWSTR, extraheaders: super::super::Foundation::PWSTR, newloader: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filedata: *const ::core::ffi::c_void, filedatasize: u32) -> DWRITE_CONTAINER_TYPE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, containertype: DWRITE_CONTAINER_TYPE, filedata: *const ::core::ffi::c_void, filedatasize: u32, unpackedfontstream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr, faceindex: u32, fontresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, includedownloadablefonts: super::super::Foundation::BOOL, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, includedownloadablefonts: super::super::Foundation::BOOL, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: ::windows::core::RawPtr, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsetbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, fontcollection: ::windows::core::RawPtr, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontsize: f32, localename: super::super::Foundation::PWSTR, textformat: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFactory7(pub ::windows::core::IUnknown);
impl IDWriteFactory7 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, collectionloader: Param0, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), collectionloader.into_param().abi(), ::core::mem::transmute(collectionkey), ::core::mem::transmute(collectionkeysize), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn RegisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontCollectionLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollectionLoader>>(&self, fontcollectionloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontcollectionloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFileReference<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateCustomFontFileReference<'a, Param2: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: Param2) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), fontfileloader.into_param().abi(), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn CreateFontFace(&self, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::core::option::Option<IDWriteFontFile>, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacetype), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontfacesimulationflags), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
pub unsafe fn CreateRenderingParams(&self) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateMonitorRenderingParams<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HMONITOR>>(&self, monitor: Param0) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), monitor.into_param().abi(), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn CreateCustomRenderingParams(&self, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams> {
let mut result__: <IDWriteRenderingParams as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams>(result__)
}
pub unsafe fn RegisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
pub unsafe fn UnregisterFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFileLoader>>(&self, fontfileloader: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), fontfileloader.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextFormat<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontfamilyname: Param0, fontcollection: Param1, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: Param6) -> ::windows::core::Result<IDWriteTextFormat> {
let mut result__: <IDWriteTextFormat as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), fontcollection.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstyle), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontsize), localename.into_param().abi(), &mut result__).from_abi::<IDWriteTextFormat>(result__)
}
pub unsafe fn CreateTypography(&self) -> ::windows::core::Result<IDWriteTypography> {
let mut result__: <IDWriteTypography as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTypography>(result__)
}
pub unsafe fn GetGdiInterop(&self) -> ::windows::core::Result<IDWriteGdiInterop> {
let mut result__: <IDWriteGdiInterop as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteGdiInterop>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, string: Param0, stringlength: u32, textformat: Param2, maxwidth: f32, maxheight: f32) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), string.into_param().abi(), ::core::mem::transmute(stringlength), textformat.into_param().abi(), ::core::mem::transmute(maxwidth), ::core::mem::transmute(maxheight), &mut result__).from_abi::<IDWriteTextLayout>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGdiCompatibleTextLayout<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteTextFormat>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, string: Param0, stringlength: u32, textformat: Param2, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param7) -> ::windows::core::Result<IDWriteTextLayout> {
let mut result__: <IDWriteTextLayout as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(
::core::mem::transmute_copy(self),
string.into_param().abi(),
::core::mem::transmute(stringlength),
textformat.into_param().abi(),
::core::mem::transmute(layoutwidth),
::core::mem::transmute(layoutheight),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
&mut result__,
)
.from_abi::<IDWriteTextLayout>(result__)
}
pub unsafe fn CreateEllipsisTrimmingSign<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextFormat>>(&self, textformat: Param0) -> ::windows::core::Result<IDWriteInlineObject> {
let mut result__: <IDWriteInlineObject as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), textformat.into_param().abi(), &mut result__).from_abi::<IDWriteInlineObject>(result__)
}
pub unsafe fn CreateTextAnalyzer(&self) -> ::windows::core::Result<IDWriteTextAnalyzer> {
let mut result__: <IDWriteTextAnalyzer as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteTextAnalyzer>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateNumberSubstitution<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: Param1, ignoreuseroverride: Param2) -> ::windows::core::Result<IDWriteNumberSubstitution> {
let mut result__: <IDWriteNumberSubstitution as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(substitutionmethod), localename.into_param().abi(), ignoreuseroverride.into_param().abi(), &mut result__).from_abi::<IDWriteNumberSubstitution>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis(&self, glyphrun: *const DWRITE_GLYPH_RUN, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetEudcFontCollection<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, checkforupdates: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn CreateCustomRenderingParams2(&self, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE) -> ::windows::core::Result<IDWriteRenderingParams1> {
let mut result__: <IDWriteRenderingParams1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(gamma), ::core::mem::transmute(enhancedcontrast), ::core::mem::transmute(enhancedcontrastgrayscale), ::core::mem::transmute(cleartypelevel), ::core::mem::transmute(pixelgeometry), ::core::mem::transmute(renderingmode), &mut result__).from_abi::<IDWriteRenderingParams1>(result__)
}
pub unsafe fn GetSystemFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
pub unsafe fn CreateFontFallbackBuilder(&self) -> ::windows::core::Result<IDWriteFontFallbackBuilder> {
let mut result__: <IDWriteFontFallbackBuilder as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallbackBuilder>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TranslateColorGlyphRun(&self, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32) -> ::windows::core::Result<IDWriteColorGlyphRunEnumerator> {
let mut result__: <IDWriteColorGlyphRunEnumerator as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(
::core::mem::transmute_copy(self),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
::core::mem::transmute(measuringmode),
::core::mem::transmute(worldtodevicetransform),
::core::mem::transmute(colorpaletteindex),
&mut result__,
)
.from_abi::<IDWriteColorGlyphRunEnumerator>(result__)
}
pub unsafe fn CreateCustomRenderingParams3(&self, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE) -> ::windows::core::Result<IDWriteRenderingParams2> {
let mut result__: <IDWriteRenderingParams2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).29)(
::core::mem::transmute_copy(self),
::core::mem::transmute(gamma),
::core::mem::transmute(enhancedcontrast),
::core::mem::transmute(grayscaleenhancedcontrast),
::core::mem::transmute(cleartypelevel),
::core::mem::transmute(pixelgeometry),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
&mut result__,
)
.from_abi::<IDWriteRenderingParams2>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis2(&self, glyphrun: *const DWRITE_GLYPH_RUN, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(gridfitmode),
::core::mem::transmute(antialiasmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateGlyphRunAnalysis3(&self, glyphrun: *const DWRITE_GLYPH_RUN, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE1, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32) -> ::windows::core::Result<IDWriteGlyphRunAnalysis> {
let mut result__: <IDWriteGlyphRunAnalysis as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).31)(
::core::mem::transmute_copy(self),
::core::mem::transmute(glyphrun),
::core::mem::transmute(transform),
::core::mem::transmute(renderingmode),
::core::mem::transmute(measuringmode),
::core::mem::transmute(gridfitmode),
::core::mem::transmute(antialiasmode),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
&mut result__,
)
.from_abi::<IDWriteGlyphRunAnalysis>(result__)
}
pub unsafe fn CreateCustomRenderingParams4(&self, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE1, gridfitmode: DWRITE_GRID_FIT_MODE) -> ::windows::core::Result<IDWriteRenderingParams3> {
let mut result__: <IDWriteRenderingParams3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).32)(
::core::mem::transmute_copy(self),
::core::mem::transmute(gamma),
::core::mem::transmute(enhancedcontrast),
::core::mem::transmute(grayscaleenhancedcontrast),
::core::mem::transmute(cleartypelevel),
::core::mem::transmute(pixelgeometry),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
&mut result__,
)
.from_abi::<IDWriteRenderingParams3>(result__)
}
pub unsafe fn CreateFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), fontfile.into_param().abi(), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFaceReference2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0, lastwritetime: *const super::super::Foundation::FILETIME, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), filepath.into_param().abi(), ::core::mem::transmute(lastwritetime), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
pub unsafe fn GetSystemFontSet(&self) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
pub unsafe fn CreateFontSetBuilder(&self) -> ::windows::core::Result<IDWriteFontSetBuilder> {
let mut result__: <IDWriteFontSetBuilder as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSetBuilder>(result__)
}
pub unsafe fn CreateFontCollectionFromFontSet<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontSet>>(&self, fontset: Param0) -> ::windows::core::Result<IDWriteFontCollection1> {
let mut result__: <IDWriteFontCollection1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), fontset.into_param().abi(), &mut result__).from_abi::<IDWriteFontCollection1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, includedownloadablefonts: Param0, fontcollection: *mut ::core::option::Option<IDWriteFontCollection1>, checkforupdates: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), includedownloadablefonts.into_param().abi(), ::core::mem::transmute(fontcollection), checkforupdates.into_param().abi()).ok()
}
pub unsafe fn GetFontDownloadQueue(&self) -> ::windows::core::Result<IDWriteFontDownloadQueue> {
let mut result__: <IDWriteFontDownloadQueue as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontDownloadQueue>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn TranslateColorGlyphRun2<'a, Param0: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, baselineorigin: Param0, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, desiredglyphimageformats: DWRITE_GLYPH_IMAGE_FORMATS, measuringmode: DWRITE_MEASURING_MODE, worldanddpitransform: *const DWRITE_MATRIX, colorpaletteindex: u32) -> ::windows::core::Result<IDWriteColorGlyphRunEnumerator1> {
let mut result__: <IDWriteColorGlyphRunEnumerator1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).40)(
::core::mem::transmute_copy(self),
baselineorigin.into_param().abi(),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
::core::mem::transmute(desiredglyphimageformats),
::core::mem::transmute(measuringmode),
::core::mem::transmute(worldanddpitransform),
::core::mem::transmute(colorpaletteindex),
&mut result__,
)
.from_abi::<IDWriteColorGlyphRunEnumerator1>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn ComputeGlyphOrigins<'a, Param1: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, glyphrun: *const DWRITE_GLYPH_RUN, baselineorigin: Param1) -> ::windows::core::Result<super::Direct2D::Common::D2D_POINT_2F> {
let mut result__: <super::Direct2D::Common::D2D_POINT_2F as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphrun), baselineorigin.into_param().abi(), &mut result__).from_abi::<super::Direct2D::Common::D2D_POINT_2F>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn ComputeGlyphOrigins2<'a, Param2: ::windows::core::IntoParam<'a, super::Direct2D::Common::D2D_POINT_2F>>(&self, glyphrun: *const DWRITE_GLYPH_RUN, measuringmode: DWRITE_MEASURING_MODE, baselineorigin: Param2, worldanddpitransform: *const DWRITE_MATRIX) -> ::windows::core::Result<super::Direct2D::Common::D2D_POINT_2F> {
let mut result__: <super::Direct2D::Common::D2D_POINT_2F as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphrun), ::core::mem::transmute(measuringmode), baselineorigin.into_param().abi(), ::core::mem::transmute(worldanddpitransform), &mut result__).from_abi::<super::Direct2D::Common::D2D_POINT_2F>(result__)
}
pub unsafe fn CreateFontSetBuilder2(&self) -> ::windows::core::Result<IDWriteFontSetBuilder1> {
let mut result__: <IDWriteFontSetBuilder1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSetBuilder1>(result__)
}
pub unsafe fn CreateInMemoryFontFileLoader(&self) -> ::windows::core::Result<IDWriteInMemoryFontFileLoader> {
let mut result__: <IDWriteInMemoryFontFileLoader as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).44)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteInMemoryFontFileLoader>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateHttpFontFileLoader<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, referrerurl: Param0, extraheaders: Param1) -> ::windows::core::Result<IDWriteRemoteFontFileLoader> {
let mut result__: <IDWriteRemoteFontFileLoader as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), referrerurl.into_param().abi(), extraheaders.into_param().abi(), &mut result__).from_abi::<IDWriteRemoteFontFileLoader>(result__)
}
pub unsafe fn AnalyzeContainerType(&self, filedata: *const ::core::ffi::c_void, filedatasize: u32) -> DWRITE_CONTAINER_TYPE {
::core::mem::transmute((::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(filedata), ::core::mem::transmute(filedatasize)))
}
pub unsafe fn UnpackFontFile(&self, containertype: DWRITE_CONTAINER_TYPE, filedata: *const ::core::ffi::c_void, filedatasize: u32) -> ::windows::core::Result<IDWriteFontFileStream> {
let mut result__: <IDWriteFontFileStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), ::core::mem::transmute(containertype), ::core::mem::transmute(filedata), ::core::mem::transmute(filedatasize), &mut result__).from_abi::<IDWriteFontFileStream>(result__)
}
pub unsafe fn CreateFontFaceReference3<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<IDWriteFontFaceReference1> {
let mut result__: <IDWriteFontFaceReference1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), fontfile.into_param().abi(), ::core::mem::transmute(faceindex), ::core::mem::transmute(fontsimulations), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), &mut result__).from_abi::<IDWriteFontFaceReference1>(result__)
}
pub unsafe fn CreateFontResource<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0, faceindex: u32) -> ::windows::core::Result<IDWriteFontResource> {
let mut result__: <IDWriteFontResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), fontfile.into_param().abi(), ::core::mem::transmute(faceindex), &mut result__).from_abi::<IDWriteFontResource>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontSet2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, includedownloadablefonts: Param0) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self), includedownloadablefonts.into_param().abi(), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection3<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, includedownloadablefonts: Param0, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL) -> ::windows::core::Result<IDWriteFontCollection2> {
let mut result__: <IDWriteFontCollection2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), includedownloadablefonts.into_param().abi(), ::core::mem::transmute(fontfamilymodel), &mut result__).from_abi::<IDWriteFontCollection2>(result__)
}
pub unsafe fn CreateFontCollectionFromFontSet2<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontSet>>(&self, fontset: Param0, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL) -> ::windows::core::Result<IDWriteFontCollection2> {
let mut result__: <IDWriteFontCollection2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), fontset.into_param().abi(), ::core::mem::transmute(fontfamilymodel), &mut result__).from_abi::<IDWriteFontCollection2>(result__)
}
pub unsafe fn CreateFontSetBuilder3(&self) -> ::windows::core::Result<IDWriteFontSetBuilder2> {
let mut result__: <IDWriteFontSetBuilder2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).53)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSetBuilder2>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateTextFormat2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontfamilyname: Param0, fontcollection: Param1, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontsize: f32, localename: Param5) -> ::windows::core::Result<IDWriteTextFormat3> {
let mut result__: <IDWriteTextFormat3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).54)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), fontcollection.into_param().abi(), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), ::core::mem::transmute(fontsize), localename.into_param().abi(), &mut result__).from_abi::<IDWriteTextFormat3>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontSet3<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, includedownloadablefonts: Param0) -> ::windows::core::Result<IDWriteFontSet2> {
let mut result__: <IDWriteFontSet2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).55)(::core::mem::transmute_copy(self), includedownloadablefonts.into_param().abi(), &mut result__).from_abi::<IDWriteFontSet2>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSystemFontCollection4<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, includedownloadablefonts: Param0, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL) -> ::windows::core::Result<IDWriteFontCollection3> {
let mut result__: <IDWriteFontCollection3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).56)(::core::mem::transmute_copy(self), includedownloadablefonts.into_param().abi(), ::core::mem::transmute(fontfamilymodel), &mut result__).from_abi::<IDWriteFontCollection3>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFactory7 {
type Vtable = IDWriteFactory7_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x35d0e0b3_9076_4d2e_a016_a91b568a06b4);
}
impl ::core::convert::From<IDWriteFactory7> for ::windows::core::IUnknown {
fn from(value: IDWriteFactory7) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFactory7> for ::windows::core::IUnknown {
fn from(value: &IDWriteFactory7) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFactory7> for IDWriteFactory6 {
fn from(value: IDWriteFactory7) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory7> for IDWriteFactory6 {
fn from(value: &IDWriteFactory7) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory6> for IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory6> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory6> for &IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory6> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory7> for IDWriteFactory5 {
fn from(value: IDWriteFactory7) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory7> for IDWriteFactory5 {
fn from(value: &IDWriteFactory7) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory5> for IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory5> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory5> for &IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory5> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory7> for IDWriteFactory4 {
fn from(value: IDWriteFactory7) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory7> for IDWriteFactory4 {
fn from(value: &IDWriteFactory7) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory4> for IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory4> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory4> for &IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory4> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory7> for IDWriteFactory3 {
fn from(value: IDWriteFactory7) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory7> for IDWriteFactory3 {
fn from(value: &IDWriteFactory7) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory3> for IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory3> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory3> for &IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory3> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory7> for IDWriteFactory2 {
fn from(value: IDWriteFactory7) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory7> for IDWriteFactory2 {
fn from(value: &IDWriteFactory7) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory2> for IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory2> for &IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory7> for IDWriteFactory1 {
fn from(value: IDWriteFactory7) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory7> for IDWriteFactory1 {
fn from(value: &IDWriteFactory7) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory1> for &IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFactory7> for IDWriteFactory {
fn from(value: IDWriteFactory7) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFactory7> for IDWriteFactory {
fn from(value: &IDWriteFactory7) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFactory> for &IDWriteFactory7 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFactory> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFactory7_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, collectionloader: ::windows::core::RawPtr, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollectionloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfileloader: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacetype: DWRITE_FONT_FACE_TYPE, numberoffiles: u32, fontfiles: *const ::windows::core::RawPtr, faceindex: u32, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, monitor: super::Gdi::HMONITOR, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, fontcollection: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, fontstyle: DWRITE_FONT_STYLE, fontstretch: DWRITE_FONT_STRETCH, fontsize: f32, localename: super::super::Foundation::PWSTR, textformat: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gdiinterop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, maxwidth: f32, maxheight: f32, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, string: super::super::Foundation::PWSTR, stringlength: u32, textformat: ::windows::core::RawPtr, layoutwidth: f32, layoutheight: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, textlayout: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textformat: ::windows::core::RawPtr, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textanalyzer: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, substitutionmethod: DWRITE_NUMBER_SUBSTITUTION_METHOD, localename: super::super::Foundation::PWSTR, ignoreuseroverride: super::super::Foundation::BOOL, numbersubstitution: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, pixelsperdip: f32, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, enhancedcontrastgrayscale: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallbackbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineoriginx: f32, baselineoriginy: f32, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, measuringmode: DWRITE_MEASURING_MODE, worldtodevicetransform: *const DWRITE_MATRIX, colorpaletteindex: u32, colorlayers: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, transform: *const DWRITE_MATRIX, renderingmode: DWRITE_RENDERING_MODE1, measuringmode: DWRITE_MEASURING_MODE, gridfitmode: DWRITE_GRID_FIT_MODE, antialiasmode: DWRITE_TEXT_ANTIALIAS_MODE, baselineoriginx: f32, baselineoriginy: f32, glyphrunanalysis: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gamma: f32, enhancedcontrast: f32, grayscaleenhancedcontrast: f32, cleartypelevel: f32, pixelgeometry: DWRITE_PIXEL_GEOMETRY, renderingmode: DWRITE_RENDERING_MODE1, gridfitmode: DWRITE_GRID_FIT_MODE, renderingparams: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR, lastwritetime: *const super::super::Foundation::FILETIME, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsetbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, includedownloadablefonts: super::super::Foundation::BOOL, fontcollection: *mut ::windows::core::RawPtr, checkforupdates: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontdownloadqueue: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, desiredglyphimageformats: DWRITE_GLYPH_IMAGE_FORMATS, measuringmode: DWRITE_MEASURING_MODE, worldanddpitransform: *const DWRITE_MATRIX, colorpaletteindex: u32, colorlayers: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, glyphorigins: *mut super::Direct2D::Common::D2D_POINT_2F) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, measuringmode: DWRITE_MEASURING_MODE, baselineorigin: super::Direct2D::Common::D2D_POINT_2F, worldanddpitransform: *const DWRITE_MATRIX, glyphorigins: *mut super::Direct2D::Common::D2D_POINT_2F) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsetbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, newloader: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, referrerurl: super::super::Foundation::PWSTR, extraheaders: super::super::Foundation::PWSTR, newloader: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filedata: *const ::core::ffi::c_void, filedatasize: u32) -> DWRITE_CONTAINER_TYPE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, containertype: DWRITE_CONTAINER_TYPE, filedata: *const ::core::ffi::c_void, filedatasize: u32, unpackedfontstream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr, faceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr, faceindex: u32, fontresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, includedownloadablefonts: super::super::Foundation::BOOL, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, includedownloadablefonts: super::super::Foundation::BOOL, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: ::windows::core::RawPtr, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsetbuilder: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, fontcollection: ::windows::core::RawPtr, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontsize: f32, localename: super::super::Foundation::PWSTR, textformat: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, includedownloadablefonts: super::super::Foundation::BOOL, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, includedownloadablefonts: super::super::Foundation::BOOL, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFont(pub ::windows::core::IUnknown);
impl IDWriteFont {
pub unsafe fn GetFontFamily(&self) -> ::windows::core::Result<IDWriteFontFamily> {
let mut result__: <IDWriteFontFamily as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFamily>(result__)
}
pub unsafe fn GetWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsSymbolFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFaceNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetInformationalStrings(&self, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::core::option::Option<IDWriteLocalizedStrings>, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(informationalstringid), ::core::mem::transmute(informationalstrings), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMetrics(&self, fontmetrics: *mut DWRITE_FONT_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasCharacter(&self, unicodevalue: u32) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn CreateFontFace(&self) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFont {
type Vtable = IDWriteFont_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xacd16696_8c14_4f5d_877e_fe3fc1d32737);
}
impl ::core::convert::From<IDWriteFont> for ::windows::core::IUnknown {
fn from(value: IDWriteFont) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFont> for ::windows::core::IUnknown {
fn from(value: &IDWriteFont) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFont {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFont {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFont_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::windows::core::RawPtr, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS),
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFont1(pub ::windows::core::IUnknown);
impl IDWriteFont1 {
pub unsafe fn GetFontFamily(&self) -> ::windows::core::Result<IDWriteFontFamily> {
let mut result__: <IDWriteFontFamily as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFamily>(result__)
}
pub unsafe fn GetWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsSymbolFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFaceNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetInformationalStrings(&self, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::core::option::Option<IDWriteLocalizedStrings>, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(informationalstringid), ::core::mem::transmute(informationalstrings), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMetrics(&self, fontmetrics: *mut DWRITE_FONT_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasCharacter(&self, unicodevalue: u32) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn CreateFontFace(&self) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMetrics2(&self, fontmetrics: *mut DWRITE_FONT_METRICS1) {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
pub unsafe fn GetPanose(&self, panose: *mut DWRITE_PANOSE) {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(panose)))
}
pub unsafe fn GetUnicodeRanges(&self, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxrangecount), ::core::mem::transmute(unicoderanges), ::core::mem::transmute(actualrangecount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsMonospacedFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteFont1 {
type Vtable = IDWriteFont1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xacd16696_8c14_4f5d_877e_fe3fc1d32738);
}
impl ::core::convert::From<IDWriteFont1> for ::windows::core::IUnknown {
fn from(value: IDWriteFont1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFont1> for ::windows::core::IUnknown {
fn from(value: &IDWriteFont1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFont1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFont1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFont1> for IDWriteFont {
fn from(value: IDWriteFont1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFont1> for IDWriteFont {
fn from(value: &IDWriteFont1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont> for IDWriteFont1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont> for &IDWriteFont1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFont1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::windows::core::RawPtr, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS),
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS1),
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, panose: *mut DWRITE_PANOSE),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFont2(pub ::windows::core::IUnknown);
impl IDWriteFont2 {
pub unsafe fn GetFontFamily(&self) -> ::windows::core::Result<IDWriteFontFamily> {
let mut result__: <IDWriteFontFamily as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFamily>(result__)
}
pub unsafe fn GetWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsSymbolFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFaceNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetInformationalStrings(&self, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::core::option::Option<IDWriteLocalizedStrings>, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(informationalstringid), ::core::mem::transmute(informationalstrings), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMetrics(&self, fontmetrics: *mut DWRITE_FONT_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasCharacter(&self, unicodevalue: u32) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn CreateFontFace(&self) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMetrics2(&self, fontmetrics: *mut DWRITE_FONT_METRICS1) {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
pub unsafe fn GetPanose(&self, panose: *mut DWRITE_PANOSE) {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(panose)))
}
pub unsafe fn GetUnicodeRanges(&self, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxrangecount), ::core::mem::transmute(unicoderanges), ::core::mem::transmute(actualrangecount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsMonospacedFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsColorFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteFont2 {
type Vtable = IDWriteFont2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x29748ed6_8c9c_4a6a_be0b_d912e8538944);
}
impl ::core::convert::From<IDWriteFont2> for ::windows::core::IUnknown {
fn from(value: IDWriteFont2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFont2> for ::windows::core::IUnknown {
fn from(value: &IDWriteFont2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFont2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFont2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFont2> for IDWriteFont1 {
fn from(value: IDWriteFont2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFont2> for IDWriteFont1 {
fn from(value: &IDWriteFont2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont1> for IDWriteFont2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont1> for &IDWriteFont2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFont2> for IDWriteFont {
fn from(value: IDWriteFont2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFont2> for IDWriteFont {
fn from(value: &IDWriteFont2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont> for IDWriteFont2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont> for &IDWriteFont2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFont2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::windows::core::RawPtr, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS),
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS1),
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, panose: *mut DWRITE_PANOSE),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFont3(pub ::windows::core::IUnknown);
impl IDWriteFont3 {
pub unsafe fn GetFontFamily(&self) -> ::windows::core::Result<IDWriteFontFamily> {
let mut result__: <IDWriteFontFamily as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFamily>(result__)
}
pub unsafe fn GetWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsSymbolFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFaceNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetInformationalStrings(&self, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::core::option::Option<IDWriteLocalizedStrings>, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(informationalstringid), ::core::mem::transmute(informationalstrings), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMetrics(&self, fontmetrics: *mut DWRITE_FONT_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasCharacter(&self, unicodevalue: u32) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn CreateFontFace(&self) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMetrics2(&self, fontmetrics: *mut DWRITE_FONT_METRICS1) {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
pub unsafe fn GetPanose(&self, panose: *mut DWRITE_PANOSE) {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(panose)))
}
pub unsafe fn GetUnicodeRanges(&self, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxrangecount), ::core::mem::transmute(unicoderanges), ::core::mem::transmute(actualrangecount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsMonospacedFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsColorFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self)))
}
pub unsafe fn CreateFontFace2(&self) -> ::windows::core::Result<IDWriteFontFace3> {
let mut result__: <IDWriteFontFace3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFace3>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn Equals<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFont>>(&self, font: Param0) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), font.into_param().abi()))
}
pub unsafe fn GetFontFaceReference(&self) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasCharacter2(&self, unicodevalue: u32) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue)))
}
pub unsafe fn GetLocality(&self) -> DWRITE_LOCALITY {
::core::mem::transmute((::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteFont3 {
type Vtable = IDWriteFont3_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x29748ed6_8c9c_4a6a_be0b_d912e8538944);
}
impl ::core::convert::From<IDWriteFont3> for ::windows::core::IUnknown {
fn from(value: IDWriteFont3) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFont3> for ::windows::core::IUnknown {
fn from(value: &IDWriteFont3) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFont3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFont3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFont3> for IDWriteFont2 {
fn from(value: IDWriteFont3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFont3> for IDWriteFont2 {
fn from(value: &IDWriteFont3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont2> for IDWriteFont3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont2> for &IDWriteFont3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFont3> for IDWriteFont1 {
fn from(value: IDWriteFont3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFont3> for IDWriteFont1 {
fn from(value: &IDWriteFont3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont1> for IDWriteFont3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont1> for &IDWriteFont3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFont3> for IDWriteFont {
fn from(value: IDWriteFont3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFont3> for IDWriteFont {
fn from(value: &IDWriteFont3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont> for IDWriteFont3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFont> for &IDWriteFont3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFont> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFont3_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::windows::core::RawPtr, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS),
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS1),
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, panose: *mut DWRITE_PANOSE),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, font: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_LOCALITY,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontCollection(pub ::windows::core::IUnknown);
impl IDWriteFontCollection {
pub unsafe fn GetFontFamilyCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontFamily(&self, index: u32) -> ::windows::core::Result<IDWriteFontFamily> {
let mut result__: <IDWriteFontFamily as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFontFamily>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFamilyName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, familyname: Param0, index: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), familyname.into_param().abi(), ::core::mem::transmute(index), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetFontFromFontFace<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, fontface: Param0) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontface.into_param().abi(), &mut result__).from_abi::<IDWriteFont>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontCollection {
type Vtable = IDWriteFontCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa84cee02_3eea_4eee_a827_87c1a02a0fcc);
}
impl ::core::convert::From<IDWriteFontCollection> for ::windows::core::IUnknown {
fn from(value: IDWriteFontCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontCollection> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontCollection_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, familyname: super::super::Foundation::PWSTR, index: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontCollection1(pub ::windows::core::IUnknown);
impl IDWriteFontCollection1 {
pub unsafe fn GetFontFamilyCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontFamily(&self, index: u32) -> ::windows::core::Result<IDWriteFontFamily> {
let mut result__: <IDWriteFontFamily as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFontFamily>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFamilyName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, familyname: Param0, index: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), familyname.into_param().abi(), ::core::mem::transmute(index), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetFontFromFontFace<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, fontface: Param0) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontface.into_param().abi(), &mut result__).from_abi::<IDWriteFont>(result__)
}
pub unsafe fn GetFontSet(&self) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
pub unsafe fn GetFontFamily2(&self, index: u32) -> ::windows::core::Result<IDWriteFontFamily1> {
let mut result__: <IDWriteFontFamily1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFontFamily1>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontCollection1 {
type Vtable = IDWriteFontCollection1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x53585141_d9f8_4095_8321_d73cf6bd116c);
}
impl ::core::convert::From<IDWriteFontCollection1> for ::windows::core::IUnknown {
fn from(value: IDWriteFontCollection1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontCollection1> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontCollection1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontCollection1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontCollection1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontCollection1> for IDWriteFontCollection {
fn from(value: IDWriteFontCollection1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontCollection1> for IDWriteFontCollection {
fn from(value: &IDWriteFontCollection1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection> for IDWriteFontCollection1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection> for &IDWriteFontCollection1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontCollection1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, familyname: super::super::Foundation::PWSTR, index: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontCollection2(pub ::windows::core::IUnknown);
impl IDWriteFontCollection2 {
pub unsafe fn GetFontFamilyCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontFamily(&self, index: u32) -> ::windows::core::Result<IDWriteFontFamily> {
let mut result__: <IDWriteFontFamily as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFontFamily>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFamilyName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, familyname: Param0, index: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), familyname.into_param().abi(), ::core::mem::transmute(index), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetFontFromFontFace<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, fontface: Param0) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontface.into_param().abi(), &mut result__).from_abi::<IDWriteFont>(result__)
}
pub unsafe fn GetFontSet(&self) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
pub unsafe fn GetFontFamily2(&self, index: u32) -> ::windows::core::Result<IDWriteFontFamily1> {
let mut result__: <IDWriteFontFamily1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFontFamily1>(result__)
}
pub unsafe fn GetFontFamily3(&self, index: u32) -> ::windows::core::Result<IDWriteFontFamily2> {
let mut result__: <IDWriteFontFamily2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFontFamily2>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, familyname: Param0, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<IDWriteFontList2> {
let mut result__: <IDWriteFontList2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), familyname.into_param().abi(), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), &mut result__).from_abi::<IDWriteFontList2>(result__)
}
pub unsafe fn GetFontFamilyModel(&self) -> DWRITE_FONT_FAMILY_MODEL {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSet2(&self) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontCollection2 {
type Vtable = IDWriteFontCollection2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x514039c6_4617_4064_bf8b_92ea83e506e0);
}
impl ::core::convert::From<IDWriteFontCollection2> for ::windows::core::IUnknown {
fn from(value: IDWriteFontCollection2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontCollection2> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontCollection2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontCollection2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontCollection2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontCollection2> for IDWriteFontCollection1 {
fn from(value: IDWriteFontCollection2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontCollection2> for IDWriteFontCollection1 {
fn from(value: &IDWriteFontCollection2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection1> for IDWriteFontCollection2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection1> for &IDWriteFontCollection2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontCollection2> for IDWriteFontCollection {
fn from(value: IDWriteFontCollection2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontCollection2> for IDWriteFontCollection {
fn from(value: &IDWriteFontCollection2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection> for IDWriteFontCollection2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection> for &IDWriteFontCollection2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontCollection2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, familyname: super::super::Foundation::PWSTR, index: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, familyname: super::super::Foundation::PWSTR, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontlist: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_FAMILY_MODEL,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontCollection3(pub ::windows::core::IUnknown);
impl IDWriteFontCollection3 {
pub unsafe fn GetFontFamilyCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontFamily(&self, index: u32) -> ::windows::core::Result<IDWriteFontFamily> {
let mut result__: <IDWriteFontFamily as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFontFamily>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFamilyName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, familyname: Param0, index: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), familyname.into_param().abi(), ::core::mem::transmute(index), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetFontFromFontFace<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, fontface: Param0) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontface.into_param().abi(), &mut result__).from_abi::<IDWriteFont>(result__)
}
pub unsafe fn GetFontSet(&self) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
pub unsafe fn GetFontFamily2(&self, index: u32) -> ::windows::core::Result<IDWriteFontFamily1> {
let mut result__: <IDWriteFontFamily1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFontFamily1>(result__)
}
pub unsafe fn GetFontFamily3(&self, index: u32) -> ::windows::core::Result<IDWriteFontFamily2> {
let mut result__: <IDWriteFontFamily2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFontFamily2>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, familyname: Param0, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<IDWriteFontList2> {
let mut result__: <IDWriteFontList2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), familyname.into_param().abi(), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), &mut result__).from_abi::<IDWriteFontList2>(result__)
}
pub unsafe fn GetFontFamilyModel(&self) -> DWRITE_FONT_FAMILY_MODEL {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSet2(&self) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetExpirationEvent(&self) -> super::super::Foundation::HANDLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteFontCollection3 {
type Vtable = IDWriteFontCollection3_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa4d055a6_f9e3_4e25_93b7_9e309f3af8e9);
}
impl ::core::convert::From<IDWriteFontCollection3> for ::windows::core::IUnknown {
fn from(value: IDWriteFontCollection3) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontCollection3> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontCollection3) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontCollection3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontCollection3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontCollection3> for IDWriteFontCollection2 {
fn from(value: IDWriteFontCollection3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontCollection3> for IDWriteFontCollection2 {
fn from(value: &IDWriteFontCollection3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection2> for IDWriteFontCollection3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection2> for &IDWriteFontCollection3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontCollection3> for IDWriteFontCollection1 {
fn from(value: IDWriteFontCollection3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontCollection3> for IDWriteFontCollection1 {
fn from(value: &IDWriteFontCollection3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection1> for IDWriteFontCollection3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection1> for &IDWriteFontCollection3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontCollection3> for IDWriteFontCollection {
fn from(value: IDWriteFontCollection3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontCollection3> for IDWriteFontCollection {
fn from(value: &IDWriteFontCollection3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection> for IDWriteFontCollection3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontCollection> for &IDWriteFontCollection3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontCollection> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontCollection3_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, familyname: super::super::Foundation::PWSTR, index: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, fontfamily: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, familyname: super::super::Foundation::PWSTR, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontlist: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_FAMILY_MODEL,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::HANDLE,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontCollectionLoader(pub ::windows::core::IUnknown);
impl IDWriteFontCollectionLoader {
pub unsafe fn CreateEnumeratorFromKey<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFactory>>(&self, factory: Param0, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32) -> ::windows::core::Result<IDWriteFontFileEnumerator> {
let mut result__: <IDWriteFontFileEnumerator as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), factory.into_param().abi(), ::core::mem::transmute(collectionkey), ::core::mem::transmute(collectionkeysize), &mut result__).from_abi::<IDWriteFontFileEnumerator>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontCollectionLoader {
type Vtable = IDWriteFontCollectionLoader_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xcca920e4_52f0_492b_bfa8_29c72ee0a468);
}
impl ::core::convert::From<IDWriteFontCollectionLoader> for ::windows::core::IUnknown {
fn from(value: IDWriteFontCollectionLoader) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontCollectionLoader> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontCollectionLoader) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontCollectionLoader {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontCollectionLoader {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontCollectionLoader_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, factory: ::windows::core::RawPtr, collectionkey: *const ::core::ffi::c_void, collectionkeysize: u32, fontfileenumerator: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontDownloadListener(pub ::windows::core::IUnknown);
impl IDWriteFontDownloadListener {
pub unsafe fn DownloadCompleted<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontDownloadQueue>, Param1: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, downloadqueue: Param0, context: Param1, downloadresult: ::windows::core::HRESULT) {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), downloadqueue.into_param().abi(), context.into_param().abi(), ::core::mem::transmute(downloadresult)))
}
}
unsafe impl ::windows::core::Interface for IDWriteFontDownloadListener {
type Vtable = IDWriteFontDownloadListener_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb06fe5b9_43ec_4393_881b_dbe4dc72fda7);
}
impl ::core::convert::From<IDWriteFontDownloadListener> for ::windows::core::IUnknown {
fn from(value: IDWriteFontDownloadListener) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontDownloadListener> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontDownloadListener) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontDownloadListener {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontDownloadListener {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontDownloadListener_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, downloadqueue: ::windows::core::RawPtr, context: ::windows::core::RawPtr, downloadresult: ::windows::core::HRESULT),
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontDownloadQueue(pub ::windows::core::IUnknown);
impl IDWriteFontDownloadQueue {
pub unsafe fn AddListener<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontDownloadListener>>(&self, listener: Param0) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), listener.into_param().abi(), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn RemoveListener(&self, token: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(token)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsEmpty(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn BeginDownload<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, context: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), context.into_param().abi()).ok()
}
pub unsafe fn CancelDownload(&self) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)).ok()
}
pub unsafe fn GetGenerationCount(&self) -> u64 {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteFontDownloadQueue {
type Vtable = IDWriteFontDownloadQueue_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb71e6052_5aea_4fa3_832e_f60d431f7e91);
}
impl ::core::convert::From<IDWriteFontDownloadQueue> for ::windows::core::IUnknown {
fn from(value: IDWriteFontDownloadQueue) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontDownloadQueue> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontDownloadQueue) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontDownloadQueue {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontDownloadQueue {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontDownloadQueue_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listener: ::windows::core::RawPtr, token: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, token: u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, context: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u64,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFace(pub ::windows::core::IUnknown);
impl IDWriteFontFace {
pub unsafe fn GetType(&self) -> DWRITE_FONT_FACE_TYPE {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFiles(&self, numberoffiles: *mut u32, fontfiles: *mut ::core::option::Option<IDWriteFontFile>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles)).ok()
}
pub unsafe fn GetIndex(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsSymbolFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMetrics(&self, fontfacemetrics: *mut DWRITE_FONT_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacemetrics)))
}
pub unsafe fn GetGlyphCount(&self) -> u16 {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphmetrics), issideways.into_param().abi()).ok()
}
pub unsafe fn GetGlyphIndices(&self, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(codepoints), ::core::mem::transmute(codepointcount), ::core::mem::transmute(glyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TryGetFontTable(&self, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(opentypetabletag), ::core::mem::transmute(tabledata), ::core::mem::transmute(tablesize), ::core::mem::transmute(tablecontext), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn ReleaseFontTable(&self, tablecontext: *const ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(tablecontext)))
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn GetGlyphRunOutline<'a, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::Direct2D::Common::ID2D1SimplifiedGeometrySink>>(
&self,
emsize: f32,
glyphindices: *const u16,
glyphadvances: *const f32,
glyphoffsets: *const DWRITE_GLYPH_OFFSET,
glyphcount: u32,
issideways: Param5,
isrighttoleft: Param6,
geometrysink: Param7,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
::core::mem::transmute(glyphcount),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
geometrysink.into_param().abi(),
)
.ok()
}
pub unsafe fn GetRecommendedRenderingMode<'a, Param3: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(&self, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: Param3) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(measuringmode), renderingparams.into_param().abi(), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetGdiCompatibleMetrics(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS> {
let mut result__: <DWRITE_FONT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param7) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphmetrics),
issideways.into_param().abi(),
)
.ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFace {
type Vtable = IDWriteFontFace_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x5f49804d_7024_4d43_bfa9_d25984f53849);
}
impl ::core::convert::From<IDWriteFontFace> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFace) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFace> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFace) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFace {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFace {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFace_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_FACE_TYPE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, numberoffiles: *mut u32, fontfiles: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacemetrics: *mut DWRITE_FONT_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u16,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tablecontext: *const ::core::ffi::c_void),
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, glyphindices: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphcount: u32, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, geometrysink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontfacemetrics: *mut DWRITE_FONT_METRICS) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFace1(pub ::windows::core::IUnknown);
impl IDWriteFontFace1 {
pub unsafe fn GetType(&self) -> DWRITE_FONT_FACE_TYPE {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFiles(&self, numberoffiles: *mut u32, fontfiles: *mut ::core::option::Option<IDWriteFontFile>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles)).ok()
}
pub unsafe fn GetIndex(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsSymbolFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMetrics(&self, fontfacemetrics: *mut DWRITE_FONT_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacemetrics)))
}
pub unsafe fn GetGlyphCount(&self) -> u16 {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphmetrics), issideways.into_param().abi()).ok()
}
pub unsafe fn GetGlyphIndices(&self, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(codepoints), ::core::mem::transmute(codepointcount), ::core::mem::transmute(glyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TryGetFontTable(&self, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(opentypetabletag), ::core::mem::transmute(tabledata), ::core::mem::transmute(tablesize), ::core::mem::transmute(tablecontext), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn ReleaseFontTable(&self, tablecontext: *const ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(tablecontext)))
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn GetGlyphRunOutline<'a, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::Direct2D::Common::ID2D1SimplifiedGeometrySink>>(
&self,
emsize: f32,
glyphindices: *const u16,
glyphadvances: *const f32,
glyphoffsets: *const DWRITE_GLYPH_OFFSET,
glyphcount: u32,
issideways: Param5,
isrighttoleft: Param6,
geometrysink: Param7,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
::core::mem::transmute(glyphcount),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
geometrysink.into_param().abi(),
)
.ok()
}
pub unsafe fn GetRecommendedRenderingMode<'a, Param3: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(&self, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: Param3) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(measuringmode), renderingparams.into_param().abi(), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetGdiCompatibleMetrics(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS> {
let mut result__: <DWRITE_FONT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param7) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphmetrics),
issideways.into_param().abi(),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMetrics2(&self, fontmetrics: *mut DWRITE_FONT_METRICS1) {
::core::mem::transmute((::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleMetrics2(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS1> {
let mut result__: <DWRITE_FONT_METRICS1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS1>(result__)
}
pub unsafe fn GetCaretMetrics(&self, caretmetrics: *mut DWRITE_CARET_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(caretmetrics)))
}
pub unsafe fn GetUnicodeRanges(&self, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxrangecount), ::core::mem::transmute(unicoderanges), ::core::mem::transmute(actualrangecount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsMonospacedFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvances), issideways.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, issideways: Param4, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
issideways.into_param().abi(),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
)
.ok()
}
pub unsafe fn GetKerningPairAdjustments(&self, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvanceadjustments)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasKerningPairs(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode2<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: Param4, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontemsize), ::core::mem::transmute(dpix), ::core::mem::transmute(dpiy), ::core::mem::transmute(transform), issideways.into_param().abi(), ::core::mem::transmute(outlinethreshold), ::core::mem::transmute(measuringmode), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetVerticalGlyphVariants(&self, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(nominalglyphindices), ::core::mem::transmute(verticalglyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasVerticalGlyphVariants(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFace1 {
type Vtable = IDWriteFontFace1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa71efdb4_9fdb_4838_ad90_cfc3be8c3daf);
}
impl ::core::convert::From<IDWriteFontFace1> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFace1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFace1> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFace1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFace1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFace1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontFace1> for IDWriteFontFace {
fn from(value: IDWriteFontFace1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace1> for IDWriteFontFace {
fn from(value: &IDWriteFontFace1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for IDWriteFontFace1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for &IDWriteFontFace1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFace1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_FACE_TYPE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, numberoffiles: *mut u32, fontfiles: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacemetrics: *mut DWRITE_FONT_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u16,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tablecontext: *const ::core::ffi::c_void),
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, glyphindices: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphcount: u32, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, geometrysink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontfacemetrics: *mut DWRITE_FONT_METRICS) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS1),
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontmetrics: *mut DWRITE_FONT_METRICS1) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, caretmetrics: *mut DWRITE_CARET_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, issideways: super::super::Foundation::BOOL, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFace2(pub ::windows::core::IUnknown);
impl IDWriteFontFace2 {
pub unsafe fn GetType(&self) -> DWRITE_FONT_FACE_TYPE {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFiles(&self, numberoffiles: *mut u32, fontfiles: *mut ::core::option::Option<IDWriteFontFile>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles)).ok()
}
pub unsafe fn GetIndex(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsSymbolFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMetrics(&self, fontfacemetrics: *mut DWRITE_FONT_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacemetrics)))
}
pub unsafe fn GetGlyphCount(&self) -> u16 {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphmetrics), issideways.into_param().abi()).ok()
}
pub unsafe fn GetGlyphIndices(&self, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(codepoints), ::core::mem::transmute(codepointcount), ::core::mem::transmute(glyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TryGetFontTable(&self, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(opentypetabletag), ::core::mem::transmute(tabledata), ::core::mem::transmute(tablesize), ::core::mem::transmute(tablecontext), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn ReleaseFontTable(&self, tablecontext: *const ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(tablecontext)))
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn GetGlyphRunOutline<'a, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::Direct2D::Common::ID2D1SimplifiedGeometrySink>>(
&self,
emsize: f32,
glyphindices: *const u16,
glyphadvances: *const f32,
glyphoffsets: *const DWRITE_GLYPH_OFFSET,
glyphcount: u32,
issideways: Param5,
isrighttoleft: Param6,
geometrysink: Param7,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
::core::mem::transmute(glyphcount),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
geometrysink.into_param().abi(),
)
.ok()
}
pub unsafe fn GetRecommendedRenderingMode<'a, Param3: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(&self, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: Param3) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(measuringmode), renderingparams.into_param().abi(), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetGdiCompatibleMetrics(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS> {
let mut result__: <DWRITE_FONT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param7) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphmetrics),
issideways.into_param().abi(),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMetrics2(&self, fontmetrics: *mut DWRITE_FONT_METRICS1) {
::core::mem::transmute((::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleMetrics2(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS1> {
let mut result__: <DWRITE_FONT_METRICS1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS1>(result__)
}
pub unsafe fn GetCaretMetrics(&self, caretmetrics: *mut DWRITE_CARET_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(caretmetrics)))
}
pub unsafe fn GetUnicodeRanges(&self, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxrangecount), ::core::mem::transmute(unicoderanges), ::core::mem::transmute(actualrangecount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsMonospacedFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvances), issideways.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, issideways: Param4, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
issideways.into_param().abi(),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
)
.ok()
}
pub unsafe fn GetKerningPairAdjustments(&self, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvanceadjustments)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasKerningPairs(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode2<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: Param4, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontemsize), ::core::mem::transmute(dpix), ::core::mem::transmute(dpiy), ::core::mem::transmute(transform), issideways.into_param().abi(), ::core::mem::transmute(outlinethreshold), ::core::mem::transmute(measuringmode), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetVerticalGlyphVariants(&self, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(nominalglyphindices), ::core::mem::transmute(verticalglyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasVerticalGlyphVariants(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsColorFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetColorPaletteCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPaletteEntryCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPaletteEntries(&self, colorpaletteindex: u32, firstentryindex: u32, entrycount: u32, paletteentries: *mut DWRITE_COLOR_F) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(colorpaletteindex), ::core::mem::transmute(firstentryindex), ::core::mem::transmute(entrycount), ::core::mem::transmute(paletteentries)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode3<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(
&self,
fontemsize: f32,
dpix: f32,
dpiy: f32,
transform: *const DWRITE_MATRIX,
issideways: Param4,
outlinethreshold: DWRITE_OUTLINE_THRESHOLD,
measuringmode: DWRITE_MEASURING_MODE,
renderingparams: Param7,
renderingmode: *mut DWRITE_RENDERING_MODE,
gridfitmode: *mut DWRITE_GRID_FIT_MODE,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(
::core::mem::transmute_copy(self),
::core::mem::transmute(fontemsize),
::core::mem::transmute(dpix),
::core::mem::transmute(dpiy),
::core::mem::transmute(transform),
issideways.into_param().abi(),
::core::mem::transmute(outlinethreshold),
::core::mem::transmute(measuringmode),
renderingparams.into_param().abi(),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
)
.ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFace2 {
type Vtable = IDWriteFontFace2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd8b768ff_64bc_4e66_982b_ec8e87f693f7);
}
impl ::core::convert::From<IDWriteFontFace2> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFace2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFace2> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFace2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFace2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFace2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontFace2> for IDWriteFontFace1 {
fn from(value: IDWriteFontFace2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace2> for IDWriteFontFace1 {
fn from(value: &IDWriteFontFace2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace1> for IDWriteFontFace2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace1> for &IDWriteFontFace2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace2> for IDWriteFontFace {
fn from(value: IDWriteFontFace2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace2> for IDWriteFontFace {
fn from(value: &IDWriteFontFace2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for IDWriteFontFace2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for &IDWriteFontFace2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFace2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_FACE_TYPE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, numberoffiles: *mut u32, fontfiles: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacemetrics: *mut DWRITE_FONT_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u16,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tablecontext: *const ::core::ffi::c_void),
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, glyphindices: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphcount: u32, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, geometrysink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontfacemetrics: *mut DWRITE_FONT_METRICS) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS1),
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontmetrics: *mut DWRITE_FONT_METRICS1) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, caretmetrics: *mut DWRITE_CARET_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, issideways: super::super::Foundation::BOOL, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorpaletteindex: u32, firstentryindex: u32, entrycount: u32, paletteentries: *mut DWRITE_COLOR_F) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE, gridfitmode: *mut DWRITE_GRID_FIT_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFace3(pub ::windows::core::IUnknown);
impl IDWriteFontFace3 {
pub unsafe fn GetType(&self) -> DWRITE_FONT_FACE_TYPE {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFiles(&self, numberoffiles: *mut u32, fontfiles: *mut ::core::option::Option<IDWriteFontFile>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles)).ok()
}
pub unsafe fn GetIndex(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsSymbolFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMetrics(&self, fontfacemetrics: *mut DWRITE_FONT_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacemetrics)))
}
pub unsafe fn GetGlyphCount(&self) -> u16 {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphmetrics), issideways.into_param().abi()).ok()
}
pub unsafe fn GetGlyphIndices(&self, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(codepoints), ::core::mem::transmute(codepointcount), ::core::mem::transmute(glyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TryGetFontTable(&self, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(opentypetabletag), ::core::mem::transmute(tabledata), ::core::mem::transmute(tablesize), ::core::mem::transmute(tablecontext), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn ReleaseFontTable(&self, tablecontext: *const ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(tablecontext)))
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn GetGlyphRunOutline<'a, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::Direct2D::Common::ID2D1SimplifiedGeometrySink>>(
&self,
emsize: f32,
glyphindices: *const u16,
glyphadvances: *const f32,
glyphoffsets: *const DWRITE_GLYPH_OFFSET,
glyphcount: u32,
issideways: Param5,
isrighttoleft: Param6,
geometrysink: Param7,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
::core::mem::transmute(glyphcount),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
geometrysink.into_param().abi(),
)
.ok()
}
pub unsafe fn GetRecommendedRenderingMode<'a, Param3: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(&self, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: Param3) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(measuringmode), renderingparams.into_param().abi(), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetGdiCompatibleMetrics(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS> {
let mut result__: <DWRITE_FONT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param7) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphmetrics),
issideways.into_param().abi(),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMetrics2(&self, fontmetrics: *mut DWRITE_FONT_METRICS1) {
::core::mem::transmute((::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleMetrics2(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS1> {
let mut result__: <DWRITE_FONT_METRICS1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS1>(result__)
}
pub unsafe fn GetCaretMetrics(&self, caretmetrics: *mut DWRITE_CARET_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(caretmetrics)))
}
pub unsafe fn GetUnicodeRanges(&self, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxrangecount), ::core::mem::transmute(unicoderanges), ::core::mem::transmute(actualrangecount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsMonospacedFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvances), issideways.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, issideways: Param4, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
issideways.into_param().abi(),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
)
.ok()
}
pub unsafe fn GetKerningPairAdjustments(&self, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvanceadjustments)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasKerningPairs(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode2<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: Param4, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontemsize), ::core::mem::transmute(dpix), ::core::mem::transmute(dpiy), ::core::mem::transmute(transform), issideways.into_param().abi(), ::core::mem::transmute(outlinethreshold), ::core::mem::transmute(measuringmode), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetVerticalGlyphVariants(&self, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(nominalglyphindices), ::core::mem::transmute(verticalglyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasVerticalGlyphVariants(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsColorFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetColorPaletteCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPaletteEntryCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPaletteEntries(&self, colorpaletteindex: u32, firstentryindex: u32, entrycount: u32, paletteentries: *mut DWRITE_COLOR_F) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(colorpaletteindex), ::core::mem::transmute(firstentryindex), ::core::mem::transmute(entrycount), ::core::mem::transmute(paletteentries)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode3<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(
&self,
fontemsize: f32,
dpix: f32,
dpiy: f32,
transform: *const DWRITE_MATRIX,
issideways: Param4,
outlinethreshold: DWRITE_OUTLINE_THRESHOLD,
measuringmode: DWRITE_MEASURING_MODE,
renderingparams: Param7,
renderingmode: *mut DWRITE_RENDERING_MODE,
gridfitmode: *mut DWRITE_GRID_FIT_MODE,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(
::core::mem::transmute_copy(self),
::core::mem::transmute(fontemsize),
::core::mem::transmute(dpix),
::core::mem::transmute(dpiy),
::core::mem::transmute(transform),
issideways.into_param().abi(),
::core::mem::transmute(outlinethreshold),
::core::mem::transmute(measuringmode),
renderingparams.into_param().abi(),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
)
.ok()
}
pub unsafe fn GetFontFaceReference(&self) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
pub unsafe fn GetPanose(&self, panose: *mut DWRITE_PANOSE) {
::core::mem::transmute((::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), ::core::mem::transmute(panose)))
}
pub unsafe fn GetWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFamilyNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
pub unsafe fn GetFaceNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetInformationalStrings(&self, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::core::option::Option<IDWriteLocalizedStrings>, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), ::core::mem::transmute(informationalstringid), ::core::mem::transmute(informationalstrings), ::core::mem::transmute(exists)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasCharacter(&self, unicodevalue: u32) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode4<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(
&self,
fontemsize: f32,
dpix: f32,
dpiy: f32,
transform: *const DWRITE_MATRIX,
issideways: Param4,
outlinethreshold: DWRITE_OUTLINE_THRESHOLD,
measuringmode: DWRITE_MEASURING_MODE,
renderingparams: Param7,
renderingmode: *mut DWRITE_RENDERING_MODE1,
gridfitmode: *mut DWRITE_GRID_FIT_MODE,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).44)(
::core::mem::transmute_copy(self),
::core::mem::transmute(fontemsize),
::core::mem::transmute(dpix),
::core::mem::transmute(dpiy),
::core::mem::transmute(transform),
issideways.into_param().abi(),
::core::mem::transmute(outlinethreshold),
::core::mem::transmute(measuringmode),
renderingparams.into_param().abi(),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsCharacterLocal(&self, unicodevalue: u32) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsGlyphLocal(&self, glyphid: u16) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphid)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AreCharactersLocal<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, characters: Param0, charactercount: u32, enqueueifnotlocal: Param2) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), characters.into_param().abi(), ::core::mem::transmute(charactercount), enqueueifnotlocal.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AreGlyphsLocal<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphindices: *const u16, glyphcount: u32, enqueueifnotlocal: Param2) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount), enqueueifnotlocal.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFace3 {
type Vtable = IDWriteFontFace3_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd37d7598_09be_4222_a236_2081341cc1f2);
}
impl ::core::convert::From<IDWriteFontFace3> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFace3) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFace3> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFace3) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFace3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFace3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontFace3> for IDWriteFontFace2 {
fn from(value: IDWriteFontFace3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace3> for IDWriteFontFace2 {
fn from(value: &IDWriteFontFace3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace2> for IDWriteFontFace3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace2> for &IDWriteFontFace3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace3> for IDWriteFontFace1 {
fn from(value: IDWriteFontFace3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace3> for IDWriteFontFace1 {
fn from(value: &IDWriteFontFace3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace1> for IDWriteFontFace3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace1> for &IDWriteFontFace3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace3> for IDWriteFontFace {
fn from(value: IDWriteFontFace3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace3> for IDWriteFontFace {
fn from(value: &IDWriteFontFace3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for IDWriteFontFace3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for &IDWriteFontFace3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFace3_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_FACE_TYPE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, numberoffiles: *mut u32, fontfiles: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacemetrics: *mut DWRITE_FONT_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u16,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tablecontext: *const ::core::ffi::c_void),
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, glyphindices: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphcount: u32, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, geometrysink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontfacemetrics: *mut DWRITE_FONT_METRICS) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS1),
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontmetrics: *mut DWRITE_FONT_METRICS1) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, caretmetrics: *mut DWRITE_CARET_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, issideways: super::super::Foundation::BOOL, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorpaletteindex: u32, firstentryindex: u32, entrycount: u32, paletteentries: *mut DWRITE_COLOR_F) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE, gridfitmode: *mut DWRITE_GRID_FIT_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, panose: *mut DWRITE_PANOSE),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::windows::core::RawPtr, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE1, gridfitmode: *mut DWRITE_GRID_FIT_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphid: u16) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, characters: super::super::Foundation::PWSTR, charactercount: u32, enqueueifnotlocal: super::super::Foundation::BOOL, islocal: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32, enqueueifnotlocal: super::super::Foundation::BOOL, islocal: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFace4(pub ::windows::core::IUnknown);
impl IDWriteFontFace4 {
pub unsafe fn GetType(&self) -> DWRITE_FONT_FACE_TYPE {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFiles(&self, numberoffiles: *mut u32, fontfiles: *mut ::core::option::Option<IDWriteFontFile>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles)).ok()
}
pub unsafe fn GetIndex(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsSymbolFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMetrics(&self, fontfacemetrics: *mut DWRITE_FONT_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacemetrics)))
}
pub unsafe fn GetGlyphCount(&self) -> u16 {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphmetrics), issideways.into_param().abi()).ok()
}
pub unsafe fn GetGlyphIndices(&self, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(codepoints), ::core::mem::transmute(codepointcount), ::core::mem::transmute(glyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TryGetFontTable(&self, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(opentypetabletag), ::core::mem::transmute(tabledata), ::core::mem::transmute(tablesize), ::core::mem::transmute(tablecontext), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn ReleaseFontTable(&self, tablecontext: *const ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(tablecontext)))
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn GetGlyphRunOutline<'a, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::Direct2D::Common::ID2D1SimplifiedGeometrySink>>(
&self,
emsize: f32,
glyphindices: *const u16,
glyphadvances: *const f32,
glyphoffsets: *const DWRITE_GLYPH_OFFSET,
glyphcount: u32,
issideways: Param5,
isrighttoleft: Param6,
geometrysink: Param7,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
::core::mem::transmute(glyphcount),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
geometrysink.into_param().abi(),
)
.ok()
}
pub unsafe fn GetRecommendedRenderingMode<'a, Param3: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(&self, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: Param3) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(measuringmode), renderingparams.into_param().abi(), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetGdiCompatibleMetrics(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS> {
let mut result__: <DWRITE_FONT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param7) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphmetrics),
issideways.into_param().abi(),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMetrics2(&self, fontmetrics: *mut DWRITE_FONT_METRICS1) {
::core::mem::transmute((::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleMetrics2(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS1> {
let mut result__: <DWRITE_FONT_METRICS1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS1>(result__)
}
pub unsafe fn GetCaretMetrics(&self, caretmetrics: *mut DWRITE_CARET_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(caretmetrics)))
}
pub unsafe fn GetUnicodeRanges(&self, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxrangecount), ::core::mem::transmute(unicoderanges), ::core::mem::transmute(actualrangecount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsMonospacedFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvances), issideways.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, issideways: Param4, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
issideways.into_param().abi(),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
)
.ok()
}
pub unsafe fn GetKerningPairAdjustments(&self, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvanceadjustments)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasKerningPairs(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode2<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: Param4, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontemsize), ::core::mem::transmute(dpix), ::core::mem::transmute(dpiy), ::core::mem::transmute(transform), issideways.into_param().abi(), ::core::mem::transmute(outlinethreshold), ::core::mem::transmute(measuringmode), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetVerticalGlyphVariants(&self, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(nominalglyphindices), ::core::mem::transmute(verticalglyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasVerticalGlyphVariants(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsColorFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetColorPaletteCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPaletteEntryCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPaletteEntries(&self, colorpaletteindex: u32, firstentryindex: u32, entrycount: u32, paletteentries: *mut DWRITE_COLOR_F) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(colorpaletteindex), ::core::mem::transmute(firstentryindex), ::core::mem::transmute(entrycount), ::core::mem::transmute(paletteentries)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode3<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(
&self,
fontemsize: f32,
dpix: f32,
dpiy: f32,
transform: *const DWRITE_MATRIX,
issideways: Param4,
outlinethreshold: DWRITE_OUTLINE_THRESHOLD,
measuringmode: DWRITE_MEASURING_MODE,
renderingparams: Param7,
renderingmode: *mut DWRITE_RENDERING_MODE,
gridfitmode: *mut DWRITE_GRID_FIT_MODE,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(
::core::mem::transmute_copy(self),
::core::mem::transmute(fontemsize),
::core::mem::transmute(dpix),
::core::mem::transmute(dpiy),
::core::mem::transmute(transform),
issideways.into_param().abi(),
::core::mem::transmute(outlinethreshold),
::core::mem::transmute(measuringmode),
renderingparams.into_param().abi(),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
)
.ok()
}
pub unsafe fn GetFontFaceReference(&self) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
pub unsafe fn GetPanose(&self, panose: *mut DWRITE_PANOSE) {
::core::mem::transmute((::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), ::core::mem::transmute(panose)))
}
pub unsafe fn GetWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFamilyNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
pub unsafe fn GetFaceNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetInformationalStrings(&self, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::core::option::Option<IDWriteLocalizedStrings>, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), ::core::mem::transmute(informationalstringid), ::core::mem::transmute(informationalstrings), ::core::mem::transmute(exists)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasCharacter(&self, unicodevalue: u32) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode4<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(
&self,
fontemsize: f32,
dpix: f32,
dpiy: f32,
transform: *const DWRITE_MATRIX,
issideways: Param4,
outlinethreshold: DWRITE_OUTLINE_THRESHOLD,
measuringmode: DWRITE_MEASURING_MODE,
renderingparams: Param7,
renderingmode: *mut DWRITE_RENDERING_MODE1,
gridfitmode: *mut DWRITE_GRID_FIT_MODE,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).44)(
::core::mem::transmute_copy(self),
::core::mem::transmute(fontemsize),
::core::mem::transmute(dpix),
::core::mem::transmute(dpiy),
::core::mem::transmute(transform),
issideways.into_param().abi(),
::core::mem::transmute(outlinethreshold),
::core::mem::transmute(measuringmode),
renderingparams.into_param().abi(),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsCharacterLocal(&self, unicodevalue: u32) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsGlyphLocal(&self, glyphid: u16) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphid)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AreCharactersLocal<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, characters: Param0, charactercount: u32, enqueueifnotlocal: Param2) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), characters.into_param().abi(), ::core::mem::transmute(charactercount), enqueueifnotlocal.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AreGlyphsLocal<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphindices: *const u16, glyphcount: u32, enqueueifnotlocal: Param2) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount), enqueueifnotlocal.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn GetGlyphImageFormats(&self, glyphid: u16, pixelsperemfirst: u32, pixelsperemlast: u32) -> ::windows::core::Result<DWRITE_GLYPH_IMAGE_FORMATS> {
let mut result__: <DWRITE_GLYPH_IMAGE_FORMATS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphid), ::core::mem::transmute(pixelsperemfirst), ::core::mem::transmute(pixelsperemlast), &mut result__).from_abi::<DWRITE_GLYPH_IMAGE_FORMATS>(result__)
}
pub unsafe fn GetGlyphImageFormats2(&self) -> DWRITE_GLYPH_IMAGE_FORMATS {
::core::mem::transmute((::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self)))
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn GetGlyphImageData(&self, glyphid: u16, pixelsperem: u32, glyphimageformat: DWRITE_GLYPH_IMAGE_FORMATS, glyphdata: *mut DWRITE_GLYPH_IMAGE_DATA, glyphdatacontext: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphid), ::core::mem::transmute(pixelsperem), ::core::mem::transmute(glyphimageformat), ::core::mem::transmute(glyphdata), ::core::mem::transmute(glyphdatacontext)).ok()
}
pub unsafe fn ReleaseGlyphImageData(&self, glyphdatacontext: *mut ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphdatacontext)))
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFace4 {
type Vtable = IDWriteFontFace4_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x27f2a904_4eb8_441d_9678_0563f53e3e2f);
}
impl ::core::convert::From<IDWriteFontFace4> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFace4) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFace4> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFace4) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFace4 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFace4 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontFace4> for IDWriteFontFace3 {
fn from(value: IDWriteFontFace4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace4> for IDWriteFontFace3 {
fn from(value: &IDWriteFontFace4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace3> for IDWriteFontFace4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace3> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace3> for &IDWriteFontFace4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace3> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace4> for IDWriteFontFace2 {
fn from(value: IDWriteFontFace4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace4> for IDWriteFontFace2 {
fn from(value: &IDWriteFontFace4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace2> for IDWriteFontFace4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace2> for &IDWriteFontFace4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace4> for IDWriteFontFace1 {
fn from(value: IDWriteFontFace4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace4> for IDWriteFontFace1 {
fn from(value: &IDWriteFontFace4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace1> for IDWriteFontFace4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace1> for &IDWriteFontFace4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace4> for IDWriteFontFace {
fn from(value: IDWriteFontFace4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace4> for IDWriteFontFace {
fn from(value: &IDWriteFontFace4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for IDWriteFontFace4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for &IDWriteFontFace4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFace4_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_FACE_TYPE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, numberoffiles: *mut u32, fontfiles: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacemetrics: *mut DWRITE_FONT_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u16,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tablecontext: *const ::core::ffi::c_void),
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, glyphindices: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphcount: u32, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, geometrysink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontfacemetrics: *mut DWRITE_FONT_METRICS) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS1),
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontmetrics: *mut DWRITE_FONT_METRICS1) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, caretmetrics: *mut DWRITE_CARET_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, issideways: super::super::Foundation::BOOL, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorpaletteindex: u32, firstentryindex: u32, entrycount: u32, paletteentries: *mut DWRITE_COLOR_F) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE, gridfitmode: *mut DWRITE_GRID_FIT_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, panose: *mut DWRITE_PANOSE),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::windows::core::RawPtr, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE1, gridfitmode: *mut DWRITE_GRID_FIT_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphid: u16) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, characters: super::super::Foundation::PWSTR, charactercount: u32, enqueueifnotlocal: super::super::Foundation::BOOL, islocal: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32, enqueueifnotlocal: super::super::Foundation::BOOL, islocal: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphid: u16, pixelsperemfirst: u32, pixelsperemlast: u32, glyphimageformats: *mut DWRITE_GLYPH_IMAGE_FORMATS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_GLYPH_IMAGE_FORMATS,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphid: u16, pixelsperem: u32, glyphimageformat: DWRITE_GLYPH_IMAGE_FORMATS, glyphdata: *mut DWRITE_GLYPH_IMAGE_DATA, glyphdatacontext: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphdatacontext: *mut ::core::ffi::c_void),
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFace5(pub ::windows::core::IUnknown);
impl IDWriteFontFace5 {
pub unsafe fn GetType(&self) -> DWRITE_FONT_FACE_TYPE {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFiles(&self, numberoffiles: *mut u32, fontfiles: *mut ::core::option::Option<IDWriteFontFile>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles)).ok()
}
pub unsafe fn GetIndex(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsSymbolFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMetrics(&self, fontfacemetrics: *mut DWRITE_FONT_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacemetrics)))
}
pub unsafe fn GetGlyphCount(&self) -> u16 {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphmetrics), issideways.into_param().abi()).ok()
}
pub unsafe fn GetGlyphIndices(&self, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(codepoints), ::core::mem::transmute(codepointcount), ::core::mem::transmute(glyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TryGetFontTable(&self, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(opentypetabletag), ::core::mem::transmute(tabledata), ::core::mem::transmute(tablesize), ::core::mem::transmute(tablecontext), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn ReleaseFontTable(&self, tablecontext: *const ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(tablecontext)))
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn GetGlyphRunOutline<'a, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::Direct2D::Common::ID2D1SimplifiedGeometrySink>>(
&self,
emsize: f32,
glyphindices: *const u16,
glyphadvances: *const f32,
glyphoffsets: *const DWRITE_GLYPH_OFFSET,
glyphcount: u32,
issideways: Param5,
isrighttoleft: Param6,
geometrysink: Param7,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
::core::mem::transmute(glyphcount),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
geometrysink.into_param().abi(),
)
.ok()
}
pub unsafe fn GetRecommendedRenderingMode<'a, Param3: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(&self, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: Param3) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(measuringmode), renderingparams.into_param().abi(), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetGdiCompatibleMetrics(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS> {
let mut result__: <DWRITE_FONT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param7) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphmetrics),
issideways.into_param().abi(),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMetrics2(&self, fontmetrics: *mut DWRITE_FONT_METRICS1) {
::core::mem::transmute((::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleMetrics2(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS1> {
let mut result__: <DWRITE_FONT_METRICS1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS1>(result__)
}
pub unsafe fn GetCaretMetrics(&self, caretmetrics: *mut DWRITE_CARET_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(caretmetrics)))
}
pub unsafe fn GetUnicodeRanges(&self, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxrangecount), ::core::mem::transmute(unicoderanges), ::core::mem::transmute(actualrangecount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsMonospacedFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvances), issideways.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, issideways: Param4, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
issideways.into_param().abi(),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
)
.ok()
}
pub unsafe fn GetKerningPairAdjustments(&self, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvanceadjustments)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasKerningPairs(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode2<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: Param4, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontemsize), ::core::mem::transmute(dpix), ::core::mem::transmute(dpiy), ::core::mem::transmute(transform), issideways.into_param().abi(), ::core::mem::transmute(outlinethreshold), ::core::mem::transmute(measuringmode), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetVerticalGlyphVariants(&self, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(nominalglyphindices), ::core::mem::transmute(verticalglyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasVerticalGlyphVariants(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsColorFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetColorPaletteCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPaletteEntryCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPaletteEntries(&self, colorpaletteindex: u32, firstentryindex: u32, entrycount: u32, paletteentries: *mut DWRITE_COLOR_F) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(colorpaletteindex), ::core::mem::transmute(firstentryindex), ::core::mem::transmute(entrycount), ::core::mem::transmute(paletteentries)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode3<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(
&self,
fontemsize: f32,
dpix: f32,
dpiy: f32,
transform: *const DWRITE_MATRIX,
issideways: Param4,
outlinethreshold: DWRITE_OUTLINE_THRESHOLD,
measuringmode: DWRITE_MEASURING_MODE,
renderingparams: Param7,
renderingmode: *mut DWRITE_RENDERING_MODE,
gridfitmode: *mut DWRITE_GRID_FIT_MODE,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(
::core::mem::transmute_copy(self),
::core::mem::transmute(fontemsize),
::core::mem::transmute(dpix),
::core::mem::transmute(dpiy),
::core::mem::transmute(transform),
issideways.into_param().abi(),
::core::mem::transmute(outlinethreshold),
::core::mem::transmute(measuringmode),
renderingparams.into_param().abi(),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
)
.ok()
}
pub unsafe fn GetFontFaceReference(&self) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
pub unsafe fn GetPanose(&self, panose: *mut DWRITE_PANOSE) {
::core::mem::transmute((::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), ::core::mem::transmute(panose)))
}
pub unsafe fn GetWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFamilyNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
pub unsafe fn GetFaceNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetInformationalStrings(&self, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::core::option::Option<IDWriteLocalizedStrings>, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), ::core::mem::transmute(informationalstringid), ::core::mem::transmute(informationalstrings), ::core::mem::transmute(exists)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasCharacter(&self, unicodevalue: u32) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode4<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(
&self,
fontemsize: f32,
dpix: f32,
dpiy: f32,
transform: *const DWRITE_MATRIX,
issideways: Param4,
outlinethreshold: DWRITE_OUTLINE_THRESHOLD,
measuringmode: DWRITE_MEASURING_MODE,
renderingparams: Param7,
renderingmode: *mut DWRITE_RENDERING_MODE1,
gridfitmode: *mut DWRITE_GRID_FIT_MODE,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).44)(
::core::mem::transmute_copy(self),
::core::mem::transmute(fontemsize),
::core::mem::transmute(dpix),
::core::mem::transmute(dpiy),
::core::mem::transmute(transform),
issideways.into_param().abi(),
::core::mem::transmute(outlinethreshold),
::core::mem::transmute(measuringmode),
renderingparams.into_param().abi(),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsCharacterLocal(&self, unicodevalue: u32) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsGlyphLocal(&self, glyphid: u16) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphid)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AreCharactersLocal<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, characters: Param0, charactercount: u32, enqueueifnotlocal: Param2) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), characters.into_param().abi(), ::core::mem::transmute(charactercount), enqueueifnotlocal.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AreGlyphsLocal<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphindices: *const u16, glyphcount: u32, enqueueifnotlocal: Param2) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount), enqueueifnotlocal.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn GetGlyphImageFormats(&self, glyphid: u16, pixelsperemfirst: u32, pixelsperemlast: u32) -> ::windows::core::Result<DWRITE_GLYPH_IMAGE_FORMATS> {
let mut result__: <DWRITE_GLYPH_IMAGE_FORMATS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphid), ::core::mem::transmute(pixelsperemfirst), ::core::mem::transmute(pixelsperemlast), &mut result__).from_abi::<DWRITE_GLYPH_IMAGE_FORMATS>(result__)
}
pub unsafe fn GetGlyphImageFormats2(&self) -> DWRITE_GLYPH_IMAGE_FORMATS {
::core::mem::transmute((::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self)))
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn GetGlyphImageData(&self, glyphid: u16, pixelsperem: u32, glyphimageformat: DWRITE_GLYPH_IMAGE_FORMATS, glyphdata: *mut DWRITE_GLYPH_IMAGE_DATA, glyphdatacontext: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphid), ::core::mem::transmute(pixelsperem), ::core::mem::transmute(glyphimageformat), ::core::mem::transmute(glyphdata), ::core::mem::transmute(glyphdatacontext)).ok()
}
pub unsafe fn ReleaseGlyphImageData(&self, glyphdatacontext: *mut ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphdatacontext)))
}
pub unsafe fn GetFontAxisValueCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).53)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontAxisValues(&self, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).54)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasVariations(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).55)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontResource(&self) -> ::windows::core::Result<IDWriteFontResource> {
let mut result__: <IDWriteFontResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).56)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontResource>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn Equals<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, fontface: Param0) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).57)(::core::mem::transmute_copy(self), fontface.into_param().abi()))
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFace5 {
type Vtable = IDWriteFontFace5_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x98eff3a5_b667_479a_b145_e2fa5b9fdc29);
}
impl ::core::convert::From<IDWriteFontFace5> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFace5) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFace5> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFace5) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontFace5> for IDWriteFontFace4 {
fn from(value: IDWriteFontFace5) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace5> for IDWriteFontFace4 {
fn from(value: &IDWriteFontFace5) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace4> for IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace4> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace4> for &IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace4> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace5> for IDWriteFontFace3 {
fn from(value: IDWriteFontFace5) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace5> for IDWriteFontFace3 {
fn from(value: &IDWriteFontFace5) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace3> for IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace3> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace3> for &IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace3> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace5> for IDWriteFontFace2 {
fn from(value: IDWriteFontFace5) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace5> for IDWriteFontFace2 {
fn from(value: &IDWriteFontFace5) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace2> for IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace2> for &IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace5> for IDWriteFontFace1 {
fn from(value: IDWriteFontFace5) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace5> for IDWriteFontFace1 {
fn from(value: &IDWriteFontFace5) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace1> for IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace1> for &IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace5> for IDWriteFontFace {
fn from(value: IDWriteFontFace5) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace5> for IDWriteFontFace {
fn from(value: &IDWriteFontFace5) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for &IDWriteFontFace5 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFace5_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_FACE_TYPE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, numberoffiles: *mut u32, fontfiles: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacemetrics: *mut DWRITE_FONT_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u16,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tablecontext: *const ::core::ffi::c_void),
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, glyphindices: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphcount: u32, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, geometrysink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontfacemetrics: *mut DWRITE_FONT_METRICS) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS1),
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontmetrics: *mut DWRITE_FONT_METRICS1) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, caretmetrics: *mut DWRITE_CARET_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, issideways: super::super::Foundation::BOOL, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorpaletteindex: u32, firstentryindex: u32, entrycount: u32, paletteentries: *mut DWRITE_COLOR_F) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE, gridfitmode: *mut DWRITE_GRID_FIT_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, panose: *mut DWRITE_PANOSE),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::windows::core::RawPtr, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE1, gridfitmode: *mut DWRITE_GRID_FIT_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphid: u16) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, characters: super::super::Foundation::PWSTR, charactercount: u32, enqueueifnotlocal: super::super::Foundation::BOOL, islocal: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32, enqueueifnotlocal: super::super::Foundation::BOOL, islocal: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphid: u16, pixelsperemfirst: u32, pixelsperemlast: u32, glyphimageformats: *mut DWRITE_GLYPH_IMAGE_FORMATS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_GLYPH_IMAGE_FORMATS,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphid: u16, pixelsperem: u32, glyphimageformat: DWRITE_GLYPH_IMAGE_FORMATS, glyphdata: *mut DWRITE_GLYPH_IMAGE_DATA, glyphdatacontext: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphdatacontext: *mut ::core::ffi::c_void),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFace6(pub ::windows::core::IUnknown);
impl IDWriteFontFace6 {
pub unsafe fn GetType(&self) -> DWRITE_FONT_FACE_TYPE {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFiles(&self, numberoffiles: *mut u32, fontfiles: *mut ::core::option::Option<IDWriteFontFile>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(numberoffiles), ::core::mem::transmute(fontfiles)).ok()
}
pub unsafe fn GetIndex(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsSymbolFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMetrics(&self, fontfacemetrics: *mut DWRITE_FONT_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacemetrics)))
}
pub unsafe fn GetGlyphCount(&self) -> u16 {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphmetrics), issideways.into_param().abi()).ok()
}
pub unsafe fn GetGlyphIndices(&self, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(codepoints), ::core::mem::transmute(codepointcount), ::core::mem::transmute(glyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn TryGetFontTable(&self, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(opentypetabletag), ::core::mem::transmute(tabledata), ::core::mem::transmute(tablesize), ::core::mem::transmute(tablecontext), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn ReleaseFontTable(&self, tablecontext: *const ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(tablecontext)))
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn GetGlyphRunOutline<'a, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::Direct2D::Common::ID2D1SimplifiedGeometrySink>>(
&self,
emsize: f32,
glyphindices: *const u16,
glyphadvances: *const f32,
glyphoffsets: *const DWRITE_GLYPH_OFFSET,
glyphcount: u32,
issideways: Param5,
isrighttoleft: Param6,
geometrysink: Param7,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
::core::mem::transmute(glyphcount),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
geometrysink.into_param().abi(),
)
.ok()
}
pub unsafe fn GetRecommendedRenderingMode<'a, Param3: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(&self, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: Param3) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(measuringmode), renderingparams.into_param().abi(), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetGdiCompatibleMetrics(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS> {
let mut result__: <DWRITE_FONT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphMetrics<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: Param7) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphmetrics),
issideways.into_param().abi(),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMetrics2(&self, fontmetrics: *mut DWRITE_FONT_METRICS1) {
::core::mem::transmute((::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontmetrics)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleMetrics2(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX) -> ::windows::core::Result<DWRITE_FONT_METRICS1> {
let mut result__: <DWRITE_FONT_METRICS1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(emsize), ::core::mem::transmute(pixelsperdip), ::core::mem::transmute(transform), &mut result__).from_abi::<DWRITE_FONT_METRICS1>(result__)
}
pub unsafe fn GetCaretMetrics(&self, caretmetrics: *mut DWRITE_CARET_METRICS) {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(caretmetrics)))
}
pub unsafe fn GetUnicodeRanges(&self, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxrangecount), ::core::mem::transmute(unicoderanges), ::core::mem::transmute(actualrangecount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsMonospacedFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDesignGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvances), issideways.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphAdvances<'a, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: Param3, issideways: Param4, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(
::core::mem::transmute_copy(self),
::core::mem::transmute(emsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
issideways.into_param().abi(),
::core::mem::transmute(glyphcount),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
)
.ok()
}
pub unsafe fn GetKerningPairAdjustments(&self, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphadvanceadjustments)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasKerningPairs(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode2<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: Param4, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE) -> ::windows::core::Result<DWRITE_RENDERING_MODE> {
let mut result__: <DWRITE_RENDERING_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontemsize), ::core::mem::transmute(dpix), ::core::mem::transmute(dpiy), ::core::mem::transmute(transform), issideways.into_param().abi(), ::core::mem::transmute(outlinethreshold), ::core::mem::transmute(measuringmode), &mut result__).from_abi::<DWRITE_RENDERING_MODE>(result__)
}
pub unsafe fn GetVerticalGlyphVariants(&self, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphcount), ::core::mem::transmute(nominalglyphindices), ::core::mem::transmute(verticalglyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasVerticalGlyphVariants(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsColorFont(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetColorPaletteCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPaletteEntryCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPaletteEntries(&self, colorpaletteindex: u32, firstentryindex: u32, entrycount: u32, paletteentries: *mut DWRITE_COLOR_F) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(colorpaletteindex), ::core::mem::transmute(firstentryindex), ::core::mem::transmute(entrycount), ::core::mem::transmute(paletteentries)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode3<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(
&self,
fontemsize: f32,
dpix: f32,
dpiy: f32,
transform: *const DWRITE_MATRIX,
issideways: Param4,
outlinethreshold: DWRITE_OUTLINE_THRESHOLD,
measuringmode: DWRITE_MEASURING_MODE,
renderingparams: Param7,
renderingmode: *mut DWRITE_RENDERING_MODE,
gridfitmode: *mut DWRITE_GRID_FIT_MODE,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(
::core::mem::transmute_copy(self),
::core::mem::transmute(fontemsize),
::core::mem::transmute(dpix),
::core::mem::transmute(dpiy),
::core::mem::transmute(transform),
issideways.into_param().abi(),
::core::mem::transmute(outlinethreshold),
::core::mem::transmute(measuringmode),
renderingparams.into_param().abi(),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
)
.ok()
}
pub unsafe fn GetFontFaceReference(&self) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
pub unsafe fn GetPanose(&self, panose: *mut DWRITE_PANOSE) {
::core::mem::transmute((::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), ::core::mem::transmute(panose)))
}
pub unsafe fn GetWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFamilyNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
pub unsafe fn GetFaceNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetInformationalStrings(&self, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::core::option::Option<IDWriteLocalizedStrings>, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), ::core::mem::transmute(informationalstringid), ::core::mem::transmute(informationalstrings), ::core::mem::transmute(exists)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasCharacter(&self, unicodevalue: u32) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRecommendedRenderingMode4<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(
&self,
fontemsize: f32,
dpix: f32,
dpiy: f32,
transform: *const DWRITE_MATRIX,
issideways: Param4,
outlinethreshold: DWRITE_OUTLINE_THRESHOLD,
measuringmode: DWRITE_MEASURING_MODE,
renderingparams: Param7,
renderingmode: *mut DWRITE_RENDERING_MODE1,
gridfitmode: *mut DWRITE_GRID_FIT_MODE,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).44)(
::core::mem::transmute_copy(self),
::core::mem::transmute(fontemsize),
::core::mem::transmute(dpix),
::core::mem::transmute(dpiy),
::core::mem::transmute(transform),
issideways.into_param().abi(),
::core::mem::transmute(outlinethreshold),
::core::mem::transmute(measuringmode),
renderingparams.into_param().abi(),
::core::mem::transmute(renderingmode),
::core::mem::transmute(gridfitmode),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsCharacterLocal(&self, unicodevalue: u32) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), ::core::mem::transmute(unicodevalue)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsGlyphLocal(&self, glyphid: u16) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphid)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AreCharactersLocal<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, characters: Param0, charactercount: u32, enqueueifnotlocal: Param2) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), characters.into_param().abi(), ::core::mem::transmute(charactercount), enqueueifnotlocal.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AreGlyphsLocal<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphindices: *const u16, glyphcount: u32, enqueueifnotlocal: Param2) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount), enqueueifnotlocal.into_param().abi(), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn GetGlyphImageFormats(&self, glyphid: u16, pixelsperemfirst: u32, pixelsperemlast: u32) -> ::windows::core::Result<DWRITE_GLYPH_IMAGE_FORMATS> {
let mut result__: <DWRITE_GLYPH_IMAGE_FORMATS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphid), ::core::mem::transmute(pixelsperemfirst), ::core::mem::transmute(pixelsperemlast), &mut result__).from_abi::<DWRITE_GLYPH_IMAGE_FORMATS>(result__)
}
pub unsafe fn GetGlyphImageFormats2(&self) -> DWRITE_GLYPH_IMAGE_FORMATS {
::core::mem::transmute((::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self)))
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))]
pub unsafe fn GetGlyphImageData(&self, glyphid: u16, pixelsperem: u32, glyphimageformat: DWRITE_GLYPH_IMAGE_FORMATS, glyphdata: *mut DWRITE_GLYPH_IMAGE_DATA, glyphdatacontext: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphid), ::core::mem::transmute(pixelsperem), ::core::mem::transmute(glyphimageformat), ::core::mem::transmute(glyphdata), ::core::mem::transmute(glyphdatacontext)).ok()
}
pub unsafe fn ReleaseGlyphImageData(&self, glyphdatacontext: *mut ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphdatacontext)))
}
pub unsafe fn GetFontAxisValueCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).53)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontAxisValues(&self, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).54)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasVariations(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).55)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontResource(&self) -> ::windows::core::Result<IDWriteFontResource> {
let mut result__: <IDWriteFontResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).56)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontResource>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn Equals<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, fontface: Param0) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).57)(::core::mem::transmute_copy(self), fontface.into_param().abi()))
}
pub unsafe fn GetFamilyNames2(&self, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).58)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfamilymodel), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
pub unsafe fn GetFaceNames2(&self, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).59)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfamilymodel), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFace6 {
type Vtable = IDWriteFontFace6_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc4b1fe1b_6e84_47d5_b54c_a597981b06ad);
}
impl ::core::convert::From<IDWriteFontFace6> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFace6) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFace6> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFace6) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontFace6> for IDWriteFontFace5 {
fn from(value: IDWriteFontFace6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace6> for IDWriteFontFace5 {
fn from(value: &IDWriteFontFace6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace5> for IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace5> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace5> for &IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace5> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace6> for IDWriteFontFace4 {
fn from(value: IDWriteFontFace6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace6> for IDWriteFontFace4 {
fn from(value: &IDWriteFontFace6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace4> for IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace4> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace4> for &IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace4> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace6> for IDWriteFontFace3 {
fn from(value: IDWriteFontFace6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace6> for IDWriteFontFace3 {
fn from(value: &IDWriteFontFace6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace3> for IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace3> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace3> for &IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace3> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace6> for IDWriteFontFace2 {
fn from(value: IDWriteFontFace6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace6> for IDWriteFontFace2 {
fn from(value: &IDWriteFontFace6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace2> for IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace2> for &IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace6> for IDWriteFontFace1 {
fn from(value: IDWriteFontFace6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace6> for IDWriteFontFace1 {
fn from(value: &IDWriteFontFace6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace1> for IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace1> for &IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFace6> for IDWriteFontFace {
fn from(value: IDWriteFontFace6) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFace6> for IDWriteFontFace {
fn from(value: &IDWriteFontFace6) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFace> for &IDWriteFontFace6 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFace> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFace6_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_FACE_TYPE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, numberoffiles: *mut u32, fontfiles: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacemetrics: *mut DWRITE_FONT_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u16,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, codepoints: *const u32, codepointcount: u32, glyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opentypetabletag: u32, tabledata: *mut *mut ::core::ffi::c_void, tablesize: *mut u32, tablecontext: *mut *mut ::core::ffi::c_void, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tablecontext: *const ::core::ffi::c_void),
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, glyphindices: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphcount: u32, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, geometrysink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontfacemetrics: *mut DWRITE_FONT_METRICS) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, glyphindices: *const u16, glyphcount: u32, glyphmetrics: *mut DWRITE_GLYPH_METRICS, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontmetrics: *mut DWRITE_FONT_METRICS1),
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, fontmetrics: *mut DWRITE_FONT_METRICS1) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, caretmetrics: *mut DWRITE_CARET_METRICS),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxrangecount: u32, unicoderanges: *mut DWRITE_UNICODE_RANGE, actualrangecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32, issideways: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, emsize: f32, pixelsperdip: f32, transform: *const DWRITE_MATRIX, usegdinatural: super::super::Foundation::BOOL, issideways: super::super::Foundation::BOOL, glyphcount: u32, glyphindices: *const u16, glyphadvances: *mut i32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, glyphindices: *const u16, glyphadvanceadjustments: *mut i32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingmode: *mut DWRITE_RENDERING_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphcount: u32, nominalglyphindices: *const u16, verticalglyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorpaletteindex: u32, firstentryindex: u32, entrycount: u32, paletteentries: *mut DWRITE_COLOR_F) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE, gridfitmode: *mut DWRITE_GRID_FIT_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, panose: *mut DWRITE_PANOSE),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, informationalstringid: DWRITE_INFORMATIONAL_STRING_ID, informationalstrings: *mut ::windows::core::RawPtr, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontemsize: f32, dpix: f32, dpiy: f32, transform: *const DWRITE_MATRIX, issideways: super::super::Foundation::BOOL, outlinethreshold: DWRITE_OUTLINE_THRESHOLD, measuringmode: DWRITE_MEASURING_MODE, renderingparams: ::windows::core::RawPtr, renderingmode: *mut DWRITE_RENDERING_MODE1, gridfitmode: *mut DWRITE_GRID_FIT_MODE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodevalue: u32) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphid: u16) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, characters: super::super::Foundation::PWSTR, charactercount: u32, enqueueifnotlocal: super::super::Foundation::BOOL, islocal: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32, enqueueifnotlocal: super::super::Foundation::BOOL, islocal: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphid: u16, pixelsperemfirst: u32, pixelsperemlast: u32, glyphimageformats: *mut DWRITE_GLYPH_IMAGE_FORMATS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_GLYPH_IMAGE_FORMATS,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphid: u16, pixelsperem: u32, glyphimageformat: DWRITE_GLYPH_IMAGE_FORMATS, glyphdata: *mut DWRITE_GLYPH_IMAGE_DATA, glyphdatacontext: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Direct2D_Common")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphdatacontext: *mut ::core::ffi::c_void),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilymodel: DWRITE_FONT_FAMILY_MODEL, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFaceReference(pub ::windows::core::IUnknown);
impl IDWriteFontFaceReference {
pub unsafe fn CreateFontFace(&self) -> ::windows::core::Result<IDWriteFontFace3> {
let mut result__: <IDWriteFontFace3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFace3>(result__)
}
pub unsafe fn CreateFontFaceWithSimulations(&self, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFace3> {
let mut result__: <IDWriteFontFace3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacesimulationflags), &mut result__).from_abi::<IDWriteFontFace3>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn Equals<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi()))
}
pub unsafe fn GetFontFaceIndex(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontFile(&self) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn GetLocalFileSize(&self) -> u64 {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFileSize(&self) -> u64 {
::core::mem::transmute((::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFileTime(&self) -> ::windows::core::Result<super::super::Foundation::FILETIME> {
let mut result__: <super::super::Foundation::FILETIME as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::FILETIME>(result__)
}
pub unsafe fn GetLocality(&self) -> DWRITE_LOCALITY {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn EnqueueFontDownloadRequest(&self) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn EnqueueCharacterDownloadRequest<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, characters: Param0, charactercount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), characters.into_param().abi(), ::core::mem::transmute(charactercount)).ok()
}
pub unsafe fn EnqueueGlyphDownloadRequest(&self, glyphindices: *const u16, glyphcount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount)).ok()
}
pub unsafe fn EnqueueFileFragmentDownloadRequest(&self, fileoffset: u64, fragmentsize: u64) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(fileoffset), ::core::mem::transmute(fragmentsize)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFaceReference {
type Vtable = IDWriteFontFaceReference_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x5e7fa7ca_dde3_424c_89f0_9fcd6fed58cd);
}
impl ::core::convert::From<IDWriteFontFaceReference> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFaceReference) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFaceReference> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFaceReference) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFaceReference {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFaceReference {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFaceReference_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u64,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u64,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lastwritetime: *mut super::super::Foundation::FILETIME) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_LOCALITY,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, characters: super::super::Foundation::PWSTR, charactercount: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fileoffset: u64, fragmentsize: u64) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFaceReference1(pub ::windows::core::IUnknown);
impl IDWriteFontFaceReference1 {
pub unsafe fn CreateFontFace(&self) -> ::windows::core::Result<IDWriteFontFace3> {
let mut result__: <IDWriteFontFace3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFace3>(result__)
}
pub unsafe fn CreateFontFaceWithSimulations(&self, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS) -> ::windows::core::Result<IDWriteFontFace3> {
let mut result__: <IDWriteFontFace3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfacesimulationflags), &mut result__).from_abi::<IDWriteFontFace3>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn Equals<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi()))
}
pub unsafe fn GetFontFaceIndex(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetSimulations(&self) -> DWRITE_FONT_SIMULATIONS {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontFile(&self) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn GetLocalFileSize(&self) -> u64 {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFileSize(&self) -> u64 {
::core::mem::transmute((::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFileTime(&self) -> ::windows::core::Result<super::super::Foundation::FILETIME> {
let mut result__: <super::super::Foundation::FILETIME as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::FILETIME>(result__)
}
pub unsafe fn GetLocality(&self) -> DWRITE_LOCALITY {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn EnqueueFontDownloadRequest(&self) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn EnqueueCharacterDownloadRequest<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, characters: Param0, charactercount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), characters.into_param().abi(), ::core::mem::transmute(charactercount)).ok()
}
pub unsafe fn EnqueueGlyphDownloadRequest(&self, glyphindices: *const u16, glyphcount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphindices), ::core::mem::transmute(glyphcount)).ok()
}
pub unsafe fn EnqueueFileFragmentDownloadRequest(&self, fileoffset: u64, fragmentsize: u64) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(fileoffset), ::core::mem::transmute(fragmentsize)).ok()
}
pub unsafe fn CreateFontFace2(&self) -> ::windows::core::Result<IDWriteFontFace5> {
let mut result__: <IDWriteFontFace5 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFace5>(result__)
}
pub unsafe fn GetFontAxisValueCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontAxisValues(&self, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFaceReference1 {
type Vtable = IDWriteFontFaceReference1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc081fe77_2fd1_41ac_a5a3_34983c4ba61a);
}
impl ::core::convert::From<IDWriteFontFaceReference1> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFaceReference1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFaceReference1> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFaceReference1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFaceReference1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFaceReference1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontFaceReference1> for IDWriteFontFaceReference {
fn from(value: IDWriteFontFaceReference1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFaceReference1> for IDWriteFontFaceReference {
fn from(value: &IDWriteFontFaceReference1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFaceReference> for IDWriteFontFaceReference1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFaceReference> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFaceReference> for &IDWriteFontFaceReference1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFaceReference> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFaceReference1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacesimulationflags: DWRITE_FONT_SIMULATIONS, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_SIMULATIONS,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u64,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u64,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lastwritetime: *mut super::super::Foundation::FILETIME) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_LOCALITY,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, characters: super::super::Foundation::PWSTR, charactercount: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphindices: *const u16, glyphcount: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fileoffset: u64, fragmentsize: u64) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFallback(pub ::windows::core::IUnknown);
impl IDWriteFontFallback {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn MapCharacters<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
analysissource: Param0,
textposition: u32,
textlength: u32,
basefontcollection: Param3,
basefamilyname: Param4,
baseweight: DWRITE_FONT_WEIGHT,
basestyle: DWRITE_FONT_STYLE,
basestretch: DWRITE_FONT_STRETCH,
mappedlength: *mut u32,
mappedfont: *mut ::core::option::Option<IDWriteFont>,
scale: *mut f32,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(
::core::mem::transmute_copy(self),
analysissource.into_param().abi(),
::core::mem::transmute(textposition),
::core::mem::transmute(textlength),
basefontcollection.into_param().abi(),
basefamilyname.into_param().abi(),
::core::mem::transmute(baseweight),
::core::mem::transmute(basestyle),
::core::mem::transmute(basestretch),
::core::mem::transmute(mappedlength),
::core::mem::transmute(mappedfont),
::core::mem::transmute(scale),
)
.ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFallback {
type Vtable = IDWriteFontFallback_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xefa008f9_f7a1_48bf_b05c_f224713cc0ff);
}
impl ::core::convert::From<IDWriteFontFallback> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFallback) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFallback> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFallback) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFallback {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFallback {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFallback_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, basefontcollection: ::windows::core::RawPtr, basefamilyname: super::super::Foundation::PWSTR, baseweight: DWRITE_FONT_WEIGHT, basestyle: DWRITE_FONT_STYLE, basestretch: DWRITE_FONT_STRETCH, mappedlength: *mut u32, mappedfont: *mut ::windows::core::RawPtr, scale: *mut f32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFallback1(pub ::windows::core::IUnknown);
impl IDWriteFontFallback1 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn MapCharacters<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
analysissource: Param0,
textposition: u32,
textlength: u32,
basefontcollection: Param3,
basefamilyname: Param4,
baseweight: DWRITE_FONT_WEIGHT,
basestyle: DWRITE_FONT_STYLE,
basestretch: DWRITE_FONT_STRETCH,
mappedlength: *mut u32,
mappedfont: *mut ::core::option::Option<IDWriteFont>,
scale: *mut f32,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(
::core::mem::transmute_copy(self),
analysissource.into_param().abi(),
::core::mem::transmute(textposition),
::core::mem::transmute(textlength),
basefontcollection.into_param().abi(),
basefamilyname.into_param().abi(),
::core::mem::transmute(baseweight),
::core::mem::transmute(basestyle),
::core::mem::transmute(basestretch),
::core::mem::transmute(mappedlength),
::core::mem::transmute(mappedfont),
::core::mem::transmute(scale),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn MapCharacters2<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
analysissource: Param0,
textposition: u32,
textlength: u32,
basefontcollection: Param3,
basefamilyname: Param4,
fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE,
fontaxisvaluecount: u32,
mappedlength: *mut u32,
scale: *mut f32,
mappedfontface: *mut ::core::option::Option<IDWriteFontFace5>,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(
::core::mem::transmute_copy(self),
analysissource.into_param().abi(),
::core::mem::transmute(textposition),
::core::mem::transmute(textlength),
basefontcollection.into_param().abi(),
basefamilyname.into_param().abi(),
::core::mem::transmute(fontaxisvalues),
::core::mem::transmute(fontaxisvaluecount),
::core::mem::transmute(mappedlength),
::core::mem::transmute(scale),
::core::mem::transmute(mappedfontface),
)
.ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFallback1 {
type Vtable = IDWriteFontFallback1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x2397599d_dd0d_4681_bd6a_f4f31eaade77);
}
impl ::core::convert::From<IDWriteFontFallback1> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFallback1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFallback1> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFallback1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFallback1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFallback1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontFallback1> for IDWriteFontFallback {
fn from(value: IDWriteFontFallback1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFallback1> for IDWriteFontFallback {
fn from(value: &IDWriteFontFallback1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFallback> for IDWriteFontFallback1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFallback> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFallback> for &IDWriteFontFallback1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFallback> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFallback1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, basefontcollection: ::windows::core::RawPtr, basefamilyname: super::super::Foundation::PWSTR, baseweight: DWRITE_FONT_WEIGHT, basestyle: DWRITE_FONT_STYLE, basestretch: DWRITE_FONT_STRETCH, mappedlength: *mut u32, mappedfont: *mut ::windows::core::RawPtr, scale: *mut f32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, basefontcollection: ::windows::core::RawPtr, basefamilyname: super::super::Foundation::PWSTR, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, mappedlength: *mut u32, scale: *mut f32, mappedfontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFallbackBuilder(pub ::windows::core::IUnknown);
impl IDWriteFontFallbackBuilder {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AddMapping<'a, Param4: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, ranges: *const DWRITE_UNICODE_RANGE, rangescount: u32, targetfamilynames: *const *const u16, targetfamilynamescount: u32, fontcollection: Param4, localename: Param5, basefamilyname: Param6, scale: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(
::core::mem::transmute_copy(self),
::core::mem::transmute(ranges),
::core::mem::transmute(rangescount),
::core::mem::transmute(targetfamilynames),
::core::mem::transmute(targetfamilynamescount),
fontcollection.into_param().abi(),
localename.into_param().abi(),
basefamilyname.into_param().abi(),
::core::mem::transmute(scale),
)
.ok()
}
pub unsafe fn AddMappings<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFallback>>(&self, fontfallback: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fontfallback.into_param().abi()).ok()
}
pub unsafe fn CreateFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFallbackBuilder {
type Vtable = IDWriteFontFallbackBuilder_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xfd882d06_8aba_4fb8_b849_8be8b73e14de);
}
impl ::core::convert::From<IDWriteFontFallbackBuilder> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFallbackBuilder) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFallbackBuilder> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFallbackBuilder) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFallbackBuilder {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFallbackBuilder {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFallbackBuilder_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ranges: *const DWRITE_UNICODE_RANGE, rangescount: u32, targetfamilynames: *const *const u16, targetfamilynamescount: u32, fontcollection: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, basefamilyname: super::super::Foundation::PWSTR, scale: f32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFamily(pub ::windows::core::IUnknown);
impl IDWriteFontFamily {
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFont(&self, index: u32) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFont>(result__)
}
pub unsafe fn GetFamilyNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
pub unsafe fn GetFirstMatchingFont(&self, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(weight), ::core::mem::transmute(stretch), ::core::mem::transmute(style), &mut result__).from_abi::<IDWriteFont>(result__)
}
pub unsafe fn GetMatchingFonts(&self, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE) -> ::windows::core::Result<IDWriteFontList> {
let mut result__: <IDWriteFontList as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(weight), ::core::mem::transmute(stretch), ::core::mem::transmute(style), &mut result__).from_abi::<IDWriteFontList>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFamily {
type Vtable = IDWriteFontFamily_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xda20d8ef_812a_4c43_9802_62ec4abd7add);
}
impl ::core::convert::From<IDWriteFontFamily> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFamily) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFamily> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFamily) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFamily {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFamily {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontFamily> for IDWriteFontList {
fn from(value: IDWriteFontFamily) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFamily> for IDWriteFontList {
fn from(value: &IDWriteFontFamily) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList> for IDWriteFontFamily {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList> for &IDWriteFontFamily {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFamily_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE, matchingfont: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE, matchingfonts: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFamily1(pub ::windows::core::IUnknown);
impl IDWriteFontFamily1 {
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFont(&self, index: u32) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFont>(result__)
}
pub unsafe fn GetFamilyNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
pub unsafe fn GetFirstMatchingFont(&self, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(weight), ::core::mem::transmute(stretch), ::core::mem::transmute(style), &mut result__).from_abi::<IDWriteFont>(result__)
}
pub unsafe fn GetMatchingFonts(&self, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE) -> ::windows::core::Result<IDWriteFontList> {
let mut result__: <IDWriteFontList as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(weight), ::core::mem::transmute(stretch), ::core::mem::transmute(style), &mut result__).from_abi::<IDWriteFontList>(result__)
}
pub unsafe fn GetFontLocality(&self, listindex: u32) -> DWRITE_LOCALITY {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex)))
}
pub unsafe fn GetFont2(&self, listindex: u32) -> ::windows::core::Result<IDWriteFont3> {
let mut result__: <IDWriteFont3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFont3>(result__)
}
pub unsafe fn GetFontFaceReference(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFamily1 {
type Vtable = IDWriteFontFamily1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xda20d8ef_812a_4c43_9802_62ec4abd7adf);
}
impl ::core::convert::From<IDWriteFontFamily1> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFamily1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFamily1> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFamily1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFamily1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFamily1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontFamily1> for IDWriteFontFamily {
fn from(value: IDWriteFontFamily1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFamily1> for IDWriteFontFamily {
fn from(value: &IDWriteFontFamily1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFamily> for IDWriteFontFamily1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFamily> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFamily> for &IDWriteFontFamily1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFamily> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFamily1> for IDWriteFontList {
fn from(value: IDWriteFontFamily1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFamily1> for IDWriteFontList {
fn from(value: &IDWriteFontFamily1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList> for IDWriteFontFamily1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList> for &IDWriteFontFamily1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFamily1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE, matchingfont: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE, matchingfonts: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32) -> DWRITE_LOCALITY,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFamily2(pub ::windows::core::IUnknown);
impl IDWriteFontFamily2 {
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFont(&self, index: u32) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFont>(result__)
}
pub unsafe fn GetFamilyNames(&self) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
pub unsafe fn GetFirstMatchingFont(&self, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(weight), ::core::mem::transmute(stretch), ::core::mem::transmute(style), &mut result__).from_abi::<IDWriteFont>(result__)
}
pub unsafe fn GetMatchingFonts(&self, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE) -> ::windows::core::Result<IDWriteFontList> {
let mut result__: <IDWriteFontList as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(weight), ::core::mem::transmute(stretch), ::core::mem::transmute(style), &mut result__).from_abi::<IDWriteFontList>(result__)
}
pub unsafe fn GetFontLocality(&self, listindex: u32) -> DWRITE_LOCALITY {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex)))
}
pub unsafe fn GetFont2(&self, listindex: u32) -> ::windows::core::Result<IDWriteFont3> {
let mut result__: <IDWriteFont3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFont3>(result__)
}
pub unsafe fn GetFontFaceReference(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
pub unsafe fn GetMatchingFonts2(&self, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<IDWriteFontList2> {
let mut result__: <IDWriteFontList2 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), &mut result__).from_abi::<IDWriteFontList2>(result__)
}
pub unsafe fn GetFontSet(&self) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFamily2 {
type Vtable = IDWriteFontFamily2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3ed49e77_a398_4261_b9cf_c126c2131ef3);
}
impl ::core::convert::From<IDWriteFontFamily2> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFamily2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFamily2> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFamily2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFamily2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFamily2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontFamily2> for IDWriteFontFamily1 {
fn from(value: IDWriteFontFamily2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFamily2> for IDWriteFontFamily1 {
fn from(value: &IDWriteFontFamily2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFamily1> for IDWriteFontFamily2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFamily1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFamily1> for &IDWriteFontFamily2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFamily1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFamily2> for IDWriteFontFamily {
fn from(value: IDWriteFontFamily2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFamily2> for IDWriteFontFamily {
fn from(value: &IDWriteFontFamily2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFamily> for IDWriteFontFamily2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFamily> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFamily> for &IDWriteFontFamily2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFamily> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontFamily2> for IDWriteFontList {
fn from(value: IDWriteFontFamily2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontFamily2> for IDWriteFontList {
fn from(value: &IDWriteFontFamily2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList> for IDWriteFontFamily2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList> for &IDWriteFontFamily2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFamily2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE, matchingfont: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, weight: DWRITE_FONT_WEIGHT, stretch: DWRITE_FONT_STRETCH, style: DWRITE_FONT_STYLE, matchingfonts: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32) -> DWRITE_LOCALITY,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, matchingfonts: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFile(pub ::windows::core::IUnknown);
impl IDWriteFontFile {
pub unsafe fn GetReferenceKey(&self, fontfilereferencekey: *mut *mut ::core::ffi::c_void, fontfilereferencekeysize: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize)).ok()
}
pub unsafe fn GetLoader(&self) -> ::windows::core::Result<IDWriteFontFileLoader> {
let mut result__: <IDWriteFontFileLoader as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFileLoader>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn Analyze(&self, issupportedfonttype: *mut super::super::Foundation::BOOL, fontfiletype: *mut DWRITE_FONT_FILE_TYPE, fontfacetype: *mut DWRITE_FONT_FACE_TYPE, numberoffaces: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(issupportedfonttype), ::core::mem::transmute(fontfiletype), ::core::mem::transmute(fontfacetype), ::core::mem::transmute(numberoffaces)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFile {
type Vtable = IDWriteFontFile_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x739d886a_cef5_47dc_8769_1a8b41bebbb0);
}
impl ::core::convert::From<IDWriteFontFile> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFile) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFile> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFile) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFile {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFile {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFile_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *mut *mut ::core::ffi::c_void, fontfilereferencekeysize: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfileloader: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, issupportedfonttype: *mut super::super::Foundation::BOOL, fontfiletype: *mut DWRITE_FONT_FILE_TYPE, fontfacetype: *mut DWRITE_FONT_FACE_TYPE, numberoffaces: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFileEnumerator(pub ::windows::core::IUnknown);
impl IDWriteFontFileEnumerator {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn MoveNext(&self) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn GetCurrentFontFile(&self) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFileEnumerator {
type Vtable = IDWriteFontFileEnumerator_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x72755049_5ff7_435d_8348_4be97cfa6c7c);
}
impl ::core::convert::From<IDWriteFontFileEnumerator> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFileEnumerator) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFileEnumerator> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFileEnumerator) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFileEnumerator {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFileEnumerator {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFileEnumerator_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hascurrentfile: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFileLoader(pub ::windows::core::IUnknown);
impl IDWriteFontFileLoader {
pub unsafe fn CreateStreamFromKey(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32) -> ::windows::core::Result<IDWriteFontFileStream> {
let mut result__: <IDWriteFontFileStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), &mut result__).from_abi::<IDWriteFontFileStream>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFileLoader {
type Vtable = IDWriteFontFileLoader_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x727cad4e_d6af_4c9e_8a08_d695b11caa49);
}
impl ::core::convert::From<IDWriteFontFileLoader> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFileLoader) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFileLoader> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFileLoader) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFileLoader_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfilestream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontFileStream(pub ::windows::core::IUnknown);
impl IDWriteFontFileStream {
pub unsafe fn ReadFileFragment(&self, fragmentstart: *mut *mut ::core::ffi::c_void, fileoffset: u64, fragmentsize: u64, fragmentcontext: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fragmentstart), ::core::mem::transmute(fileoffset), ::core::mem::transmute(fragmentsize), ::core::mem::transmute(fragmentcontext)).ok()
}
pub unsafe fn ReleaseFileFragment(&self, fragmentcontext: *mut ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(fragmentcontext)))
}
pub unsafe fn GetFileSize(&self) -> ::windows::core::Result<u64> {
let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u64>(result__)
}
pub unsafe fn GetLastWriteTime(&self) -> ::windows::core::Result<u64> {
let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u64>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontFileStream {
type Vtable = IDWriteFontFileStream_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6d4865fe_0ab8_4d91_8f62_5dd6be34a3e0);
}
impl ::core::convert::From<IDWriteFontFileStream> for ::windows::core::IUnknown {
fn from(value: IDWriteFontFileStream) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontFileStream> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontFileStream) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontFileStream {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontFileStream {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontFileStream_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fragmentstart: *mut *mut ::core::ffi::c_void, fileoffset: u64, fragmentsize: u64, fragmentcontext: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fragmentcontext: *mut ::core::ffi::c_void),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filesize: *mut u64) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lastwritetime: *mut u64) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontList(pub ::windows::core::IUnknown);
impl IDWriteFontList {
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFont(&self, index: u32) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFont>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontList {
type Vtable = IDWriteFontList_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x1a0d8438_1d97_4ec1_aef9_a2fb86ed6acb);
}
impl ::core::convert::From<IDWriteFontList> for ::windows::core::IUnknown {
fn from(value: IDWriteFontList) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontList> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontList) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontList {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontList {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontList_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontList1(pub ::windows::core::IUnknown);
impl IDWriteFontList1 {
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFont(&self, index: u32) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFont>(result__)
}
pub unsafe fn GetFontLocality(&self, listindex: u32) -> DWRITE_LOCALITY {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex)))
}
pub unsafe fn GetFont2(&self, listindex: u32) -> ::windows::core::Result<IDWriteFont3> {
let mut result__: <IDWriteFont3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFont3>(result__)
}
pub unsafe fn GetFontFaceReference(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontList1 {
type Vtable = IDWriteFontList1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xda20d8ef_812a_4c43_9802_62ec4abd7ade);
}
impl ::core::convert::From<IDWriteFontList1> for ::windows::core::IUnknown {
fn from(value: IDWriteFontList1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontList1> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontList1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontList1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontList1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontList1> for IDWriteFontList {
fn from(value: IDWriteFontList1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontList1> for IDWriteFontList {
fn from(value: &IDWriteFontList1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList> for IDWriteFontList1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList> for &IDWriteFontList1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontList1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32) -> DWRITE_LOCALITY,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontList2(pub ::windows::core::IUnknown);
impl IDWriteFontList2 {
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFont(&self, index: u32) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<IDWriteFont>(result__)
}
pub unsafe fn GetFontLocality(&self, listindex: u32) -> DWRITE_LOCALITY {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex)))
}
pub unsafe fn GetFont2(&self, listindex: u32) -> ::windows::core::Result<IDWriteFont3> {
let mut result__: <IDWriteFont3 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFont3>(result__)
}
pub unsafe fn GetFontFaceReference(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
pub unsafe fn GetFontSet(&self) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontList2 {
type Vtable = IDWriteFontList2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc0763a34_77af_445a_b735_08c37b0a5bf5);
}
impl ::core::convert::From<IDWriteFontList2> for ::windows::core::IUnknown {
fn from(value: IDWriteFontList2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontList2> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontList2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontList2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontList2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontList2> for IDWriteFontList1 {
fn from(value: IDWriteFontList2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontList2> for IDWriteFontList1 {
fn from(value: &IDWriteFontList2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList1> for IDWriteFontList2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList1> for &IDWriteFontList2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontList2> for IDWriteFontList {
fn from(value: IDWriteFontList2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontList2> for IDWriteFontList {
fn from(value: &IDWriteFontList2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList> for IDWriteFontList2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontList> for &IDWriteFontList2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontList> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontList2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32) -> DWRITE_LOCALITY,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontResource(pub ::windows::core::IUnknown);
impl IDWriteFontResource {
pub unsafe fn GetFontFile(&self) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn GetFontFaceIndex(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontAxisCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetDefaultFontAxisValues(&self, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount)).ok()
}
pub unsafe fn GetFontAxisRanges(&self, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(fontaxisrangecount)).ok()
}
pub unsafe fn GetFontAxisAttributes(&self, axisindex: u32) -> DWRITE_FONT_AXIS_ATTRIBUTES {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(axisindex)))
}
pub unsafe fn GetAxisNames(&self, axisindex: u32) -> ::windows::core::Result<IDWriteLocalizedStrings> {
let mut result__: <IDWriteLocalizedStrings as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(axisindex), &mut result__).from_abi::<IDWriteLocalizedStrings>(result__)
}
pub unsafe fn GetAxisValueNameCount(&self, axisindex: u32) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(axisindex)))
}
pub unsafe fn GetAxisValueNames(&self, axisindex: u32, axisvalueindex: u32, fontaxisrange: *mut DWRITE_FONT_AXIS_RANGE, names: *mut ::core::option::Option<IDWriteLocalizedStrings>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(axisindex), ::core::mem::transmute(axisvalueindex), ::core::mem::transmute(fontaxisrange), ::core::mem::transmute(names)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasVariations(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn CreateFontFace(&self, fontsimulations: DWRITE_FONT_SIMULATIONS, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<IDWriteFontFace5> {
let mut result__: <IDWriteFontFace5 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontsimulations), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), &mut result__).from_abi::<IDWriteFontFace5>(result__)
}
pub unsafe fn CreateFontFaceReference(&self, fontsimulations: DWRITE_FONT_SIMULATIONS, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<IDWriteFontFaceReference1> {
let mut result__: <IDWriteFontFaceReference1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontsimulations), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), &mut result__).from_abi::<IDWriteFontFaceReference1>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontResource {
type Vtable = IDWriteFontResource_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x1f803a76_6871_48e8_987f_b975551c50f2);
}
impl ::core::convert::From<IDWriteFontResource> for ::windows::core::IUnknown {
fn from(value: IDWriteFontResource) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontResource> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontResource) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontResource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontResource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontResource_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, axisindex: u32) -> DWRITE_FONT_AXIS_ATTRIBUTES,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, axisindex: u32, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, axisindex: u32) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, axisindex: u32, axisvalueindex: u32, fontaxisrange: *mut DWRITE_FONT_AXIS_RANGE, names: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsimulations: DWRITE_FONT_SIMULATIONS, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsimulations: DWRITE_FONT_SIMULATIONS, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontSet(pub ::windows::core::IUnknown);
impl IDWriteFontSet {
pub unsafe fn GetFontCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontFaceReference(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi(), ::core::mem::transmute(listindex), ::core::mem::transmute(exists)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFontFace<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, fontface: Param0, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontface.into_param().abi(), ::core::mem::transmute(listindex), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetPropertyValues(&self, propertyid: DWRITE_FONT_PROPERTY_ID) -> ::windows::core::Result<IDWriteStringList> {
let mut result__: <IDWriteStringList as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(propertyid), &mut result__).from_abi::<IDWriteStringList>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyValues2<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, propertyid: DWRITE_FONT_PROPERTY_ID, preferredlocalenames: Param1) -> ::windows::core::Result<IDWriteStringList> {
let mut result__: <IDWriteStringList as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(propertyid), preferredlocalenames.into_param().abi(), &mut result__).from_abi::<IDWriteStringList>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyValues3(&self, listindex: u32, propertyid: DWRITE_FONT_PROPERTY_ID, exists: *mut super::super::Foundation::BOOL, values: *mut ::core::option::Option<IDWriteLocalizedStrings>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), ::core::mem::transmute(propertyid), ::core::mem::transmute(exists), ::core::mem::transmute(values)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyOccurrenceCount(&self, property: *const DWRITE_FONT_PROPERTY) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(property), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, familyname: Param0, fontweight: DWRITE_FONT_WEIGHT, fontstretch: DWRITE_FONT_STRETCH, fontstyle: DWRITE_FONT_STYLE) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), familyname.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontstyle), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts2(&self, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontSet {
type Vtable = IDWriteFontSet_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x53585141_d9f8_4095_8321_d73cf6bd116b);
}
impl ::core::convert::From<IDWriteFontSet> for ::windows::core::IUnknown {
fn from(value: IDWriteFontSet) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontSet> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontSet) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontSet {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontSet {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontSet_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, propertyid: DWRITE_FONT_PROPERTY_ID, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, propertyid: DWRITE_FONT_PROPERTY_ID, preferredlocalenames: super::super::Foundation::PWSTR, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, propertyid: DWRITE_FONT_PROPERTY_ID, exists: *mut super::super::Foundation::BOOL, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, property: *const DWRITE_FONT_PROPERTY, propertyoccurrencecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, familyname: super::super::Foundation::PWSTR, fontweight: DWRITE_FONT_WEIGHT, fontstretch: DWRITE_FONT_STRETCH, fontstyle: DWRITE_FONT_STYLE, filteredset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, filteredset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontSet1(pub ::windows::core::IUnknown);
impl IDWriteFontSet1 {
pub unsafe fn GetFontCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontFaceReference(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi(), ::core::mem::transmute(listindex), ::core::mem::transmute(exists)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFontFace<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, fontface: Param0, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontface.into_param().abi(), ::core::mem::transmute(listindex), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetPropertyValues(&self, propertyid: DWRITE_FONT_PROPERTY_ID) -> ::windows::core::Result<IDWriteStringList> {
let mut result__: <IDWriteStringList as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(propertyid), &mut result__).from_abi::<IDWriteStringList>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyValues2<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, propertyid: DWRITE_FONT_PROPERTY_ID, preferredlocalenames: Param1) -> ::windows::core::Result<IDWriteStringList> {
let mut result__: <IDWriteStringList as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(propertyid), preferredlocalenames.into_param().abi(), &mut result__).from_abi::<IDWriteStringList>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyValues3(&self, listindex: u32, propertyid: DWRITE_FONT_PROPERTY_ID, exists: *mut super::super::Foundation::BOOL, values: *mut ::core::option::Option<IDWriteLocalizedStrings>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), ::core::mem::transmute(propertyid), ::core::mem::transmute(exists), ::core::mem::transmute(values)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyOccurrenceCount(&self, property: *const DWRITE_FONT_PROPERTY) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(property), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, familyname: Param0, fontweight: DWRITE_FONT_WEIGHT, fontstretch: DWRITE_FONT_STRETCH, fontstyle: DWRITE_FONT_STYLE) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), familyname.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontstyle), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts2(&self, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts3(&self, fontproperty: *const DWRITE_FONT_PROPERTY, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontproperty), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
pub unsafe fn GetFirstFontResources(&self) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
pub unsafe fn GetFilteredFonts(&self, indices: *const u32, indexcount: u32) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(indices), ::core::mem::transmute(indexcount), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFonts2<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: Param2) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(fontaxisrangecount), selectanyrange.into_param().abi(), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFonts3<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: Param2) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount), selectanyproperty.into_param().abi(), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFontIndices<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: Param2, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(fontaxisrangecount), selectanyrange.into_param().abi(), ::core::mem::transmute(indices), ::core::mem::transmute(maxindexcount), ::core::mem::transmute(actualindexcount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFontIndices2<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: Param2, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount), selectanyproperty.into_param().abi(), ::core::mem::transmute(indices), ::core::mem::transmute(maxindexcount), ::core::mem::transmute(actualindexcount)).ok()
}
pub unsafe fn GetFontAxisRanges(&self, listindex: u32, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(maxfontaxisrangecount), ::core::mem::transmute(actualfontaxisrangecount)).ok()
}
pub unsafe fn GetFontAxisRanges2(&self, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(maxfontaxisrangecount), ::core::mem::transmute(actualfontaxisrangecount)).ok()
}
pub unsafe fn GetFontFaceReference2(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFaceReference1> {
let mut result__: <IDWriteFontFaceReference1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFaceReference1>(result__)
}
pub unsafe fn CreateFontResource(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontResource> {
let mut result__: <IDWriteFontResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontResource>(result__)
}
pub unsafe fn CreateFontFace(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFace5> {
let mut result__: <IDWriteFontFace5 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFace5>(result__)
}
pub unsafe fn GetFontLocality(&self, listindex: u32) -> DWRITE_LOCALITY {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex)))
}
}
unsafe impl ::windows::core::Interface for IDWriteFontSet1 {
type Vtable = IDWriteFontSet1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7e9fda85_6c92_4053_bc47_7ae3530db4d3);
}
impl ::core::convert::From<IDWriteFontSet1> for ::windows::core::IUnknown {
fn from(value: IDWriteFontSet1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontSet1> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontSet1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontSet1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontSet1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontSet1> for IDWriteFontSet {
fn from(value: IDWriteFontSet1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontSet1> for IDWriteFontSet {
fn from(value: &IDWriteFontSet1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet> for IDWriteFontSet1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet> for &IDWriteFontSet1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontSet1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, propertyid: DWRITE_FONT_PROPERTY_ID, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, propertyid: DWRITE_FONT_PROPERTY_ID, preferredlocalenames: super::super::Foundation::PWSTR, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, propertyid: DWRITE_FONT_PROPERTY_ID, exists: *mut super::super::Foundation::BOOL, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, property: *const DWRITE_FONT_PROPERTY, propertyoccurrencecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, familyname: super::super::Foundation::PWSTR, fontweight: DWRITE_FONT_WEIGHT, fontstretch: DWRITE_FONT_STRETCH, fontstyle: DWRITE_FONT_STYLE, filteredset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, filteredset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontproperty: *const DWRITE_FONT_PROPERTY, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, matchingfonts: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, indices: *const u32, indexcount: u32, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: super::super::Foundation::BOOL, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: super::super::Foundation::BOOL, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: super::super::Foundation::BOOL, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: super::super::Foundation::BOOL, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32) -> DWRITE_LOCALITY,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontSet2(pub ::windows::core::IUnknown);
impl IDWriteFontSet2 {
pub unsafe fn GetFontCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontFaceReference(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi(), ::core::mem::transmute(listindex), ::core::mem::transmute(exists)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFontFace<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, fontface: Param0, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontface.into_param().abi(), ::core::mem::transmute(listindex), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetPropertyValues(&self, propertyid: DWRITE_FONT_PROPERTY_ID) -> ::windows::core::Result<IDWriteStringList> {
let mut result__: <IDWriteStringList as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(propertyid), &mut result__).from_abi::<IDWriteStringList>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyValues2<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, propertyid: DWRITE_FONT_PROPERTY_ID, preferredlocalenames: Param1) -> ::windows::core::Result<IDWriteStringList> {
let mut result__: <IDWriteStringList as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(propertyid), preferredlocalenames.into_param().abi(), &mut result__).from_abi::<IDWriteStringList>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyValues3(&self, listindex: u32, propertyid: DWRITE_FONT_PROPERTY_ID, exists: *mut super::super::Foundation::BOOL, values: *mut ::core::option::Option<IDWriteLocalizedStrings>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), ::core::mem::transmute(propertyid), ::core::mem::transmute(exists), ::core::mem::transmute(values)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyOccurrenceCount(&self, property: *const DWRITE_FONT_PROPERTY) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(property), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, familyname: Param0, fontweight: DWRITE_FONT_WEIGHT, fontstretch: DWRITE_FONT_STRETCH, fontstyle: DWRITE_FONT_STYLE) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), familyname.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontstyle), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts2(&self, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts3(&self, fontproperty: *const DWRITE_FONT_PROPERTY, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontproperty), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
pub unsafe fn GetFirstFontResources(&self) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
pub unsafe fn GetFilteredFonts(&self, indices: *const u32, indexcount: u32) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(indices), ::core::mem::transmute(indexcount), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFonts2<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: Param2) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(fontaxisrangecount), selectanyrange.into_param().abi(), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFonts3<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: Param2) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount), selectanyproperty.into_param().abi(), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFontIndices<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: Param2, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(fontaxisrangecount), selectanyrange.into_param().abi(), ::core::mem::transmute(indices), ::core::mem::transmute(maxindexcount), ::core::mem::transmute(actualindexcount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFontIndices2<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: Param2, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount), selectanyproperty.into_param().abi(), ::core::mem::transmute(indices), ::core::mem::transmute(maxindexcount), ::core::mem::transmute(actualindexcount)).ok()
}
pub unsafe fn GetFontAxisRanges(&self, listindex: u32, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(maxfontaxisrangecount), ::core::mem::transmute(actualfontaxisrangecount)).ok()
}
pub unsafe fn GetFontAxisRanges2(&self, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(maxfontaxisrangecount), ::core::mem::transmute(actualfontaxisrangecount)).ok()
}
pub unsafe fn GetFontFaceReference2(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFaceReference1> {
let mut result__: <IDWriteFontFaceReference1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFaceReference1>(result__)
}
pub unsafe fn CreateFontResource(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontResource> {
let mut result__: <IDWriteFontResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontResource>(result__)
}
pub unsafe fn CreateFontFace(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFace5> {
let mut result__: <IDWriteFontFace5 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFace5>(result__)
}
pub unsafe fn GetFontLocality(&self, listindex: u32) -> DWRITE_LOCALITY {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetExpirationEvent(&self) -> super::super::Foundation::HANDLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteFontSet2 {
type Vtable = IDWriteFontSet2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xdc7ead19_e54c_43af_b2da_4e2b79ba3f7f);
}
impl ::core::convert::From<IDWriteFontSet2> for ::windows::core::IUnknown {
fn from(value: IDWriteFontSet2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontSet2> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontSet2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontSet2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontSet2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontSet2> for IDWriteFontSet1 {
fn from(value: IDWriteFontSet2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontSet2> for IDWriteFontSet1 {
fn from(value: &IDWriteFontSet2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet1> for IDWriteFontSet2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet1> for &IDWriteFontSet2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontSet2> for IDWriteFontSet {
fn from(value: IDWriteFontSet2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontSet2> for IDWriteFontSet {
fn from(value: &IDWriteFontSet2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet> for IDWriteFontSet2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet> for &IDWriteFontSet2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontSet2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, propertyid: DWRITE_FONT_PROPERTY_ID, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, propertyid: DWRITE_FONT_PROPERTY_ID, preferredlocalenames: super::super::Foundation::PWSTR, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, propertyid: DWRITE_FONT_PROPERTY_ID, exists: *mut super::super::Foundation::BOOL, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, property: *const DWRITE_FONT_PROPERTY, propertyoccurrencecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, familyname: super::super::Foundation::PWSTR, fontweight: DWRITE_FONT_WEIGHT, fontstretch: DWRITE_FONT_STRETCH, fontstyle: DWRITE_FONT_STYLE, filteredset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, filteredset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontproperty: *const DWRITE_FONT_PROPERTY, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, matchingfonts: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, indices: *const u32, indexcount: u32, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: super::super::Foundation::BOOL, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: super::super::Foundation::BOOL, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: super::super::Foundation::BOOL, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: super::super::Foundation::BOOL, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32) -> DWRITE_LOCALITY,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::HANDLE,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontSet3(pub ::windows::core::IUnknown);
impl IDWriteFontSet3 {
pub unsafe fn GetFontCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontFaceReference(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFaceReference> {
let mut result__: <IDWriteFontFaceReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFaceReference>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi(), ::core::mem::transmute(listindex), ::core::mem::transmute(exists)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindFontFace<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, fontface: Param0, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), fontface.into_param().abi(), ::core::mem::transmute(listindex), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetPropertyValues(&self, propertyid: DWRITE_FONT_PROPERTY_ID) -> ::windows::core::Result<IDWriteStringList> {
let mut result__: <IDWriteStringList as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(propertyid), &mut result__).from_abi::<IDWriteStringList>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyValues2<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, propertyid: DWRITE_FONT_PROPERTY_ID, preferredlocalenames: Param1) -> ::windows::core::Result<IDWriteStringList> {
let mut result__: <IDWriteStringList as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(propertyid), preferredlocalenames.into_param().abi(), &mut result__).from_abi::<IDWriteStringList>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyValues3(&self, listindex: u32, propertyid: DWRITE_FONT_PROPERTY_ID, exists: *mut super::super::Foundation::BOOL, values: *mut ::core::option::Option<IDWriteLocalizedStrings>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), ::core::mem::transmute(propertyid), ::core::mem::transmute(exists), ::core::mem::transmute(values)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPropertyOccurrenceCount(&self, property: *const DWRITE_FONT_PROPERTY) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(property), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, familyname: Param0, fontweight: DWRITE_FONT_WEIGHT, fontstretch: DWRITE_FONT_STRETCH, fontstyle: DWRITE_FONT_STYLE) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), familyname.into_param().abi(), ::core::mem::transmute(fontweight), ::core::mem::transmute(fontstretch), ::core::mem::transmute(fontstyle), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts2(&self, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMatchingFonts3(&self, fontproperty: *const DWRITE_FONT_PROPERTY, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontproperty), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
pub unsafe fn GetFirstFontResources(&self) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
pub unsafe fn GetFilteredFonts(&self, indices: *const u32, indexcount: u32) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(indices), ::core::mem::transmute(indexcount), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFonts2<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: Param2) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(fontaxisrangecount), selectanyrange.into_param().abi(), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFonts3<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: Param2) -> ::windows::core::Result<IDWriteFontSet1> {
let mut result__: <IDWriteFontSet1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount), selectanyproperty.into_param().abi(), &mut result__).from_abi::<IDWriteFontSet1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFontIndices<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: Param2, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(fontaxisrangecount), selectanyrange.into_param().abi(), ::core::mem::transmute(indices), ::core::mem::transmute(maxindexcount), ::core::mem::transmute(actualindexcount)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilteredFontIndices2<'a, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: Param2, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount), selectanyproperty.into_param().abi(), ::core::mem::transmute(indices), ::core::mem::transmute(maxindexcount), ::core::mem::transmute(actualindexcount)).ok()
}
pub unsafe fn GetFontAxisRanges(&self, listindex: u32, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(maxfontaxisrangecount), ::core::mem::transmute(actualfontaxisrangecount)).ok()
}
pub unsafe fn GetFontAxisRanges2(&self, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisranges), ::core::mem::transmute(maxfontaxisrangecount), ::core::mem::transmute(actualfontaxisrangecount)).ok()
}
pub unsafe fn GetFontFaceReference2(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFaceReference1> {
let mut result__: <IDWriteFontFaceReference1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFaceReference1>(result__)
}
pub unsafe fn CreateFontResource(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontResource> {
let mut result__: <IDWriteFontResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontResource>(result__)
}
pub unsafe fn CreateFontFace(&self, listindex: u32) -> ::windows::core::Result<IDWriteFontFace5> {
let mut result__: <IDWriteFontFace5 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<IDWriteFontFace5>(result__)
}
pub unsafe fn GetFontLocality(&self, listindex: u32) -> DWRITE_LOCALITY {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetExpirationEvent(&self) -> super::super::Foundation::HANDLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSourceType(&self, fontindex: u32) -> DWRITE_FONT_SOURCE_TYPE {
::core::mem::transmute((::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontindex)))
}
pub unsafe fn GetFontSourceNameLength(&self, listindex: u32) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontSourceName(&self, listindex: u32, stringbuffer: super::super::Foundation::PWSTR, stringbuffersize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), ::core::mem::transmute(stringbuffer), ::core::mem::transmute(stringbuffersize)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteFontSet3 {
type Vtable = IDWriteFontSet3_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7c073ef2_a7f4_4045_8c32_8ab8ae640f90);
}
impl ::core::convert::From<IDWriteFontSet3> for ::windows::core::IUnknown {
fn from(value: IDWriteFontSet3) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontSet3> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontSet3) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontSet3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontSet3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontSet3> for IDWriteFontSet2 {
fn from(value: IDWriteFontSet3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontSet3> for IDWriteFontSet2 {
fn from(value: &IDWriteFontSet3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet2> for IDWriteFontSet3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet2> for &IDWriteFontSet3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontSet3> for IDWriteFontSet1 {
fn from(value: IDWriteFontSet3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontSet3> for IDWriteFontSet1 {
fn from(value: &IDWriteFontSet3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet1> for IDWriteFontSet3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet1> for &IDWriteFontSet3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontSet3> for IDWriteFontSet {
fn from(value: IDWriteFontSet3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontSet3> for IDWriteFontSet {
fn from(value: &IDWriteFontSet3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet> for IDWriteFontSet3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSet> for &IDWriteFontSet3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSet> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontSet3_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, listindex: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, propertyid: DWRITE_FONT_PROPERTY_ID, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, propertyid: DWRITE_FONT_PROPERTY_ID, preferredlocalenames: super::super::Foundation::PWSTR, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, propertyid: DWRITE_FONT_PROPERTY_ID, exists: *mut super::super::Foundation::BOOL, values: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, property: *const DWRITE_FONT_PROPERTY, propertyoccurrencecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, familyname: super::super::Foundation::PWSTR, fontweight: DWRITE_FONT_WEIGHT, fontstretch: DWRITE_FONT_STRETCH, fontstyle: DWRITE_FONT_STYLE, filteredset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, filteredset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontproperty: *const DWRITE_FONT_PROPERTY, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, matchingfonts: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, indices: *const u32, indexcount: u32, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: super::super::Foundation::BOOL, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: super::super::Foundation::BOOL, filteredfontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, selectanyrange: super::super::Foundation::BOOL, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32, selectanyproperty: super::super::Foundation::BOOL, indices: *mut u32, maxindexcount: u32, actualindexcount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisranges: *mut DWRITE_FONT_AXIS_RANGE, maxfontaxisrangecount: u32, actualfontaxisrangecount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontfacereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32) -> DWRITE_LOCALITY,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::HANDLE,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontindex: u32) -> DWRITE_FONT_SOURCE_TYPE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, stringbuffer: super::super::Foundation::PWSTR, stringbuffersize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontSetBuilder(pub ::windows::core::IUnknown);
impl IDWriteFontSetBuilder {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AddFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi(), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount)).ok()
}
pub unsafe fn AddFontFaceReference2<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi()).ok()
}
pub unsafe fn AddFontSet<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontSet>>(&self, fontset: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontset.into_param().abi()).ok()
}
pub unsafe fn CreateFontSet(&self) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteFontSetBuilder {
type Vtable = IDWriteFontSetBuilder_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x2f642afe_9c68_4f40_b8be_457401afcb3d);
}
impl ::core::convert::From<IDWriteFontSetBuilder> for ::windows::core::IUnknown {
fn from(value: IDWriteFontSetBuilder) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontSetBuilder> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontSetBuilder) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontSetBuilder {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontSetBuilder {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontSetBuilder_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontSetBuilder1(pub ::windows::core::IUnknown);
impl IDWriteFontSetBuilder1 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AddFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi(), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount)).ok()
}
pub unsafe fn AddFontFaceReference2<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi()).ok()
}
pub unsafe fn AddFontSet<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontSet>>(&self, fontset: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontset.into_param().abi()).ok()
}
pub unsafe fn CreateFontSet(&self) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
pub unsafe fn AddFontFile<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), fontfile.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteFontSetBuilder1 {
type Vtable = IDWriteFontSetBuilder1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3ff7715f_3cdc_4dc6_9b72_ec5621dccafd);
}
impl ::core::convert::From<IDWriteFontSetBuilder1> for ::windows::core::IUnknown {
fn from(value: IDWriteFontSetBuilder1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontSetBuilder1> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontSetBuilder1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontSetBuilder1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontSetBuilder1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontSetBuilder1> for IDWriteFontSetBuilder {
fn from(value: IDWriteFontSetBuilder1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontSetBuilder1> for IDWriteFontSetBuilder {
fn from(value: &IDWriteFontSetBuilder1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSetBuilder> for IDWriteFontSetBuilder1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSetBuilder> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSetBuilder> for &IDWriteFontSetBuilder1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSetBuilder> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontSetBuilder1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteFontSetBuilder2(pub ::windows::core::IUnknown);
impl IDWriteFontSetBuilder2 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AddFontFaceReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi(), ::core::mem::transmute(properties), ::core::mem::transmute(propertycount)).ok()
}
pub unsafe fn AddFontFaceReference2<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFaceReference>>(&self, fontfacereference: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), fontfacereference.into_param().abi()).ok()
}
pub unsafe fn AddFontSet<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontSet>>(&self, fontset: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), fontset.into_param().abi()).ok()
}
pub unsafe fn CreateFontSet(&self) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
pub unsafe fn AddFontFile<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), fontfile.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AddFont<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFile>>(&self, fontfile: Param0, fontfaceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(
::core::mem::transmute_copy(self),
fontfile.into_param().abi(),
::core::mem::transmute(fontfaceindex),
::core::mem::transmute(fontsimulations),
::core::mem::transmute(fontaxisvalues),
::core::mem::transmute(fontaxisvaluecount),
::core::mem::transmute(fontaxisranges),
::core::mem::transmute(fontaxisrangecount),
::core::mem::transmute(properties),
::core::mem::transmute(propertycount),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn AddFontFile2<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filepath: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), filepath.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteFontSetBuilder2 {
type Vtable = IDWriteFontSetBuilder2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xee5ba612_b131_463c_8f4f_3189b9401e45);
}
impl ::core::convert::From<IDWriteFontSetBuilder2> for ::windows::core::IUnknown {
fn from(value: IDWriteFontSetBuilder2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteFontSetBuilder2> for ::windows::core::IUnknown {
fn from(value: &IDWriteFontSetBuilder2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteFontSetBuilder2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteFontSetBuilder2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteFontSetBuilder2> for IDWriteFontSetBuilder1 {
fn from(value: IDWriteFontSetBuilder2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontSetBuilder2> for IDWriteFontSetBuilder1 {
fn from(value: &IDWriteFontSetBuilder2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSetBuilder1> for IDWriteFontSetBuilder2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSetBuilder1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSetBuilder1> for &IDWriteFontSetBuilder2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSetBuilder1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteFontSetBuilder2> for IDWriteFontSetBuilder {
fn from(value: IDWriteFontSetBuilder2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteFontSetBuilder2> for IDWriteFontSetBuilder {
fn from(value: &IDWriteFontSetBuilder2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSetBuilder> for IDWriteFontSetBuilder2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSetBuilder> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontSetBuilder> for &IDWriteFontSetBuilder2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontSetBuilder> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteFontSetBuilder2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfacereference: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfile: ::windows::core::RawPtr, fontfaceindex: u32, fontsimulations: DWRITE_FONT_SIMULATIONS, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, fontaxisranges: *const DWRITE_FONT_AXIS_RANGE, fontaxisrangecount: u32, properties: *const DWRITE_FONT_PROPERTY, propertycount: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filepath: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteGdiInterop(pub ::windows::core::IUnknown);
impl IDWriteGdiInterop {
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateFontFromLOGFONT(&self, logfont: *const super::Gdi::LOGFONTW) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(logfont), &mut result__).from_abi::<IDWriteFont>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
pub unsafe fn ConvertFontToLOGFONT<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFont>>(&self, font: Param0, logfont: *mut super::Gdi::LOGFONTW, issystemfont: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), font.into_param().abi(), ::core::mem::transmute(logfont), ::core::mem::transmute(issystemfont)).ok()
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn ConvertFontFaceToLOGFONT<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, font: Param0) -> ::windows::core::Result<super::Gdi::LOGFONTW> {
let mut result__: <super::Gdi::LOGFONTW as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), font.into_param().abi(), &mut result__).from_abi::<super::Gdi::LOGFONTW>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateFontFaceFromHdc<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HDC>>(&self, hdc: Param0) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), hdc.into_param().abi(), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateBitmapRenderTarget<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HDC>>(&self, hdc: Param0, width: u32, height: u32) -> ::windows::core::Result<IDWriteBitmapRenderTarget> {
let mut result__: <IDWriteBitmapRenderTarget as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), hdc.into_param().abi(), ::core::mem::transmute(width), ::core::mem::transmute(height), &mut result__).from_abi::<IDWriteBitmapRenderTarget>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteGdiInterop {
type Vtable = IDWriteGdiInterop_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x1edd9491_9853_4299_898f_6432983b6f3a);
}
impl ::core::convert::From<IDWriteGdiInterop> for ::windows::core::IUnknown {
fn from(value: IDWriteGdiInterop) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteGdiInterop> for ::windows::core::IUnknown {
fn from(value: &IDWriteGdiInterop) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteGdiInterop {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteGdiInterop {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteGdiInterop_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, logfont: *const super::Gdi::LOGFONTW, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, font: ::windows::core::RawPtr, logfont: *mut super::Gdi::LOGFONTW, issystemfont: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi")))] usize,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, font: ::windows::core::RawPtr, logfont: *mut super::Gdi::LOGFONTW) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hdc: super::Gdi::HDC, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hdc: super::Gdi::HDC, width: u32, height: u32, rendertarget: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteGdiInterop1(pub ::windows::core::IUnknown);
impl IDWriteGdiInterop1 {
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateFontFromLOGFONT(&self, logfont: *const super::Gdi::LOGFONTW) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(logfont), &mut result__).from_abi::<IDWriteFont>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
pub unsafe fn ConvertFontToLOGFONT<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFont>>(&self, font: Param0, logfont: *mut super::Gdi::LOGFONTW, issystemfont: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), font.into_param().abi(), ::core::mem::transmute(logfont), ::core::mem::transmute(issystemfont)).ok()
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn ConvertFontFaceToLOGFONT<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, font: Param0) -> ::windows::core::Result<super::Gdi::LOGFONTW> {
let mut result__: <super::Gdi::LOGFONTW as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), font.into_param().abi(), &mut result__).from_abi::<super::Gdi::LOGFONTW>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateFontFaceFromHdc<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HDC>>(&self, hdc: Param0) -> ::windows::core::Result<IDWriteFontFace> {
let mut result__: <IDWriteFontFace as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), hdc.into_param().abi(), &mut result__).from_abi::<IDWriteFontFace>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateBitmapRenderTarget<'a, Param0: ::windows::core::IntoParam<'a, super::Gdi::HDC>>(&self, hdc: Param0, width: u32, height: u32) -> ::windows::core::Result<IDWriteBitmapRenderTarget> {
let mut result__: <IDWriteBitmapRenderTarget as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), hdc.into_param().abi(), ::core::mem::transmute(width), ::core::mem::transmute(height), &mut result__).from_abi::<IDWriteBitmapRenderTarget>(result__)
}
#[cfg(feature = "Win32_Graphics_Gdi")]
pub unsafe fn CreateFontFromLOGFONT2<'a, Param1: ::windows::core::IntoParam<'a, IDWriteFontCollection>>(&self, logfont: *const super::Gdi::LOGFONTW, fontcollection: Param1) -> ::windows::core::Result<IDWriteFont> {
let mut result__: <IDWriteFont as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(logfont), fontcollection.into_param().abi(), &mut result__).from_abi::<IDWriteFont>(result__)
}
#[cfg(feature = "Win32_Globalization")]
pub unsafe fn GetFontSignature<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, fontface: Param0) -> ::windows::core::Result<super::super::Globalization::FONTSIGNATURE> {
let mut result__: <super::super::Globalization::FONTSIGNATURE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), fontface.into_param().abi(), &mut result__).from_abi::<super::super::Globalization::FONTSIGNATURE>(result__)
}
#[cfg(feature = "Win32_Globalization")]
pub unsafe fn GetFontSignature2<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFont>>(&self, font: Param0) -> ::windows::core::Result<super::super::Globalization::FONTSIGNATURE> {
let mut result__: <super::super::Globalization::FONTSIGNATURE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), font.into_param().abi(), &mut result__).from_abi::<super::super::Globalization::FONTSIGNATURE>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
pub unsafe fn GetMatchingFontsByLOGFONT<'a, Param1: ::windows::core::IntoParam<'a, IDWriteFontSet>>(&self, logfont: *const super::Gdi::LOGFONTA, fontset: Param1) -> ::windows::core::Result<IDWriteFontSet> {
let mut result__: <IDWriteFontSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(logfont), fontset.into_param().abi(), &mut result__).from_abi::<IDWriteFontSet>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteGdiInterop1 {
type Vtable = IDWriteGdiInterop1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4556be70_3abd_4f70_90be_421780a6f515);
}
impl ::core::convert::From<IDWriteGdiInterop1> for ::windows::core::IUnknown {
fn from(value: IDWriteGdiInterop1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteGdiInterop1> for ::windows::core::IUnknown {
fn from(value: &IDWriteGdiInterop1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteGdiInterop1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteGdiInterop1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteGdiInterop1> for IDWriteGdiInterop {
fn from(value: IDWriteGdiInterop1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteGdiInterop1> for IDWriteGdiInterop {
fn from(value: &IDWriteGdiInterop1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteGdiInterop> for IDWriteGdiInterop1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteGdiInterop> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteGdiInterop> for &IDWriteGdiInterop1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteGdiInterop> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteGdiInterop1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, logfont: *const super::Gdi::LOGFONTW, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, font: ::windows::core::RawPtr, logfont: *mut super::Gdi::LOGFONTW, issystemfont: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi")))] usize,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, font: ::windows::core::RawPtr, logfont: *mut super::Gdi::LOGFONTW) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hdc: super::Gdi::HDC, fontface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hdc: super::Gdi::HDC, width: u32, height: u32, rendertarget: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
#[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, logfont: *const super::Gdi::LOGFONTW, fontcollection: ::windows::core::RawPtr, font: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Graphics_Gdi"))] usize,
#[cfg(feature = "Win32_Globalization")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, fontsignature: *mut super::super::Globalization::FONTSIGNATURE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Globalization"))] usize,
#[cfg(feature = "Win32_Globalization")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, font: ::windows::core::RawPtr, fontsignature: *mut super::super::Globalization::FONTSIGNATURE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Globalization"))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, logfont: *const super::Gdi::LOGFONTA, fontset: ::windows::core::RawPtr, filteredset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteGlyphRunAnalysis(pub ::windows::core::IUnknown);
impl IDWriteGlyphRunAnalysis {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetAlphaTextureBounds(&self, texturetype: DWRITE_TEXTURE_TYPE) -> ::windows::core::Result<super::super::Foundation::RECT> {
let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(texturetype), &mut result__).from_abi::<super::super::Foundation::RECT>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateAlphaTexture(&self, texturetype: DWRITE_TEXTURE_TYPE, texturebounds: *const super::super::Foundation::RECT, alphavalues: *mut u8, buffersize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(texturetype), ::core::mem::transmute(texturebounds), ::core::mem::transmute(alphavalues), ::core::mem::transmute(buffersize)).ok()
}
pub unsafe fn GetAlphaBlendParams<'a, Param0: ::windows::core::IntoParam<'a, IDWriteRenderingParams>>(&self, renderingparams: Param0, blendgamma: *mut f32, blendenhancedcontrast: *mut f32, blendcleartypelevel: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), renderingparams.into_param().abi(), ::core::mem::transmute(blendgamma), ::core::mem::transmute(blendenhancedcontrast), ::core::mem::transmute(blendcleartypelevel)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteGlyphRunAnalysis {
type Vtable = IDWriteGlyphRunAnalysis_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7d97dbf7_e085_42d4_81e3_6a883bded118);
}
impl ::core::convert::From<IDWriteGlyphRunAnalysis> for ::windows::core::IUnknown {
fn from(value: IDWriteGlyphRunAnalysis) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteGlyphRunAnalysis> for ::windows::core::IUnknown {
fn from(value: &IDWriteGlyphRunAnalysis) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteGlyphRunAnalysis {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteGlyphRunAnalysis {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteGlyphRunAnalysis_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, texturetype: DWRITE_TEXTURE_TYPE, texturebounds: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, texturetype: DWRITE_TEXTURE_TYPE, texturebounds: *const super::super::Foundation::RECT, alphavalues: *mut u8, buffersize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, renderingparams: ::windows::core::RawPtr, blendgamma: *mut f32, blendenhancedcontrast: *mut f32, blendcleartypelevel: *mut f32) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteInMemoryFontFileLoader(pub ::windows::core::IUnknown);
impl IDWriteInMemoryFontFileLoader {
pub unsafe fn CreateStreamFromKey(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32) -> ::windows::core::Result<IDWriteFontFileStream> {
let mut result__: <IDWriteFontFileStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), &mut result__).from_abi::<IDWriteFontFileStream>(result__)
}
pub unsafe fn CreateInMemoryFontFileReference<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFactory>, Param3: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, factory: Param0, fontdata: *const ::core::ffi::c_void, fontdatasize: u32, ownerobject: Param3) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), factory.into_param().abi(), ::core::mem::transmute(fontdata), ::core::mem::transmute(fontdatasize), ownerobject.into_param().abi(), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
pub unsafe fn GetFileCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteInMemoryFontFileLoader {
type Vtable = IDWriteInMemoryFontFileLoader_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xdc102f47_a12d_4b1c_822d_9e117e33043f);
}
impl ::core::convert::From<IDWriteInMemoryFontFileLoader> for ::windows::core::IUnknown {
fn from(value: IDWriteInMemoryFontFileLoader) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteInMemoryFontFileLoader> for ::windows::core::IUnknown {
fn from(value: &IDWriteInMemoryFontFileLoader) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteInMemoryFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteInMemoryFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteInMemoryFontFileLoader> for IDWriteFontFileLoader {
fn from(value: IDWriteInMemoryFontFileLoader) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteInMemoryFontFileLoader> for IDWriteFontFileLoader {
fn from(value: &IDWriteInMemoryFontFileLoader) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFileLoader> for IDWriteInMemoryFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFileLoader> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFileLoader> for &IDWriteInMemoryFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFileLoader> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteInMemoryFontFileLoader_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfilestream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, factory: ::windows::core::RawPtr, fontdata: *const ::core::ffi::c_void, fontdatasize: u32, ownerobject: ::windows::core::RawPtr, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteInlineObject(pub ::windows::core::IUnknown);
impl IDWriteInlineObject {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn Draw<'a, Param1: ::windows::core::IntoParam<'a, IDWriteTextRenderer>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(
&self,
clientdrawingcontext: *const ::core::ffi::c_void,
renderer: Param1,
originx: f32,
originy: f32,
issideways: Param4,
isrighttoleft: Param5,
clientdrawingeffect: Param6,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), renderer.into_param().abi(), ::core::mem::transmute(originx), ::core::mem::transmute(originy), issideways.into_param().abi(), isrighttoleft.into_param().abi(), clientdrawingeffect.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetMetrics(&self) -> ::windows::core::Result<DWRITE_INLINE_OBJECT_METRICS> {
let mut result__: <DWRITE_INLINE_OBJECT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_INLINE_OBJECT_METRICS>(result__)
}
pub unsafe fn GetOverhangMetrics(&self) -> ::windows::core::Result<DWRITE_OVERHANG_METRICS> {
let mut result__: <DWRITE_OVERHANG_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_OVERHANG_METRICS>(result__)
}
pub unsafe fn GetBreakConditions(&self, breakconditionbefore: *mut DWRITE_BREAK_CONDITION, breakconditionafter: *mut DWRITE_BREAK_CONDITION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(breakconditionbefore), ::core::mem::transmute(breakconditionafter)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteInlineObject {
type Vtable = IDWriteInlineObject_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x8339fde3_106f_47ab_8373_1c6295eb10b3);
}
impl ::core::convert::From<IDWriteInlineObject> for ::windows::core::IUnknown {
fn from(value: IDWriteInlineObject) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteInlineObject> for ::windows::core::IUnknown {
fn from(value: &IDWriteInlineObject) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteInlineObject {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteInlineObject {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteInlineObject_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, renderer: ::windows::core::RawPtr, originx: f32, originy: f32, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, metrics: *mut DWRITE_INLINE_OBJECT_METRICS) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, overhangs: *mut DWRITE_OVERHANG_METRICS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, breakconditionbefore: *mut DWRITE_BREAK_CONDITION, breakconditionafter: *mut DWRITE_BREAK_CONDITION) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteLocalFontFileLoader(pub ::windows::core::IUnknown);
impl IDWriteLocalFontFileLoader {
pub unsafe fn CreateStreamFromKey(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32) -> ::windows::core::Result<IDWriteFontFileStream> {
let mut result__: <IDWriteFontFileStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), &mut result__).from_abi::<IDWriteFontFileStream>(result__)
}
pub unsafe fn GetFilePathLengthFromKey(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFilePathFromKey(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, filepath: super::super::Foundation::PWSTR, filepathsize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), ::core::mem::transmute(filepath), ::core::mem::transmute(filepathsize)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLastWriteTimeFromKey(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32) -> ::windows::core::Result<super::super::Foundation::FILETIME> {
let mut result__: <super::super::Foundation::FILETIME as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), &mut result__).from_abi::<super::super::Foundation::FILETIME>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteLocalFontFileLoader {
type Vtable = IDWriteLocalFontFileLoader_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb2d9f3ec_c9fe_4a11_a2ec_d86208f7c0a2);
}
impl ::core::convert::From<IDWriteLocalFontFileLoader> for ::windows::core::IUnknown {
fn from(value: IDWriteLocalFontFileLoader) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteLocalFontFileLoader> for ::windows::core::IUnknown {
fn from(value: &IDWriteLocalFontFileLoader) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteLocalFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteLocalFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteLocalFontFileLoader> for IDWriteFontFileLoader {
fn from(value: IDWriteLocalFontFileLoader) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteLocalFontFileLoader> for IDWriteFontFileLoader {
fn from(value: &IDWriteLocalFontFileLoader) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFileLoader> for IDWriteLocalFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFileLoader> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFileLoader> for &IDWriteLocalFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFileLoader> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteLocalFontFileLoader_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfilestream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, filepathlength: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, filepath: super::super::Foundation::PWSTR, filepathsize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, lastwritetime: *mut super::super::Foundation::FILETIME) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteLocalizedStrings(pub ::windows::core::IUnknown);
impl IDWriteLocalizedStrings {
pub unsafe fn GetCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn FindLocaleName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, localename: Param0, index: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), localename.into_param().abi(), ::core::mem::transmute(index), ::core::mem::transmute(exists)).ok()
}
pub unsafe fn GetLocaleNameLength(&self, index: u32) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName(&self, index: u32, localename: super::super::Foundation::PWSTR, size: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(localename), ::core::mem::transmute(size)).ok()
}
pub unsafe fn GetStringLength(&self, index: u32) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetString(&self, index: u32, stringbuffer: super::super::Foundation::PWSTR, size: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(stringbuffer), ::core::mem::transmute(size)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteLocalizedStrings {
type Vtable = IDWriteLocalizedStrings_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x08256209_099a_4b34_b86d_c22b110e7771);
}
impl ::core::convert::From<IDWriteLocalizedStrings> for ::windows::core::IUnknown {
fn from(value: IDWriteLocalizedStrings) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteLocalizedStrings> for ::windows::core::IUnknown {
fn from(value: &IDWriteLocalizedStrings) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteLocalizedStrings {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteLocalizedStrings {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteLocalizedStrings_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, index: *mut u32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, length: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, localename: super::super::Foundation::PWSTR, size: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, length: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, stringbuffer: super::super::Foundation::PWSTR, size: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteNumberSubstitution(pub ::windows::core::IUnknown);
impl IDWriteNumberSubstitution {}
unsafe impl ::windows::core::Interface for IDWriteNumberSubstitution {
type Vtable = IDWriteNumberSubstitution_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x14885cc9_bab0_4f90_b6ed_5c366a2cd03d);
}
impl ::core::convert::From<IDWriteNumberSubstitution> for ::windows::core::IUnknown {
fn from(value: IDWriteNumberSubstitution) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteNumberSubstitution> for ::windows::core::IUnknown {
fn from(value: &IDWriteNumberSubstitution) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteNumberSubstitution {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteNumberSubstitution {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteNumberSubstitution_abi(pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWritePixelSnapping(pub ::windows::core::IUnknown);
impl IDWritePixelSnapping {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsPixelSnappingDisabled(&self, clientdrawingcontext: *const ::core::ffi::c_void) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn GetCurrentTransform(&self, clientdrawingcontext: *const ::core::ffi::c_void) -> ::windows::core::Result<DWRITE_MATRIX> {
let mut result__: <DWRITE_MATRIX as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), &mut result__).from_abi::<DWRITE_MATRIX>(result__)
}
pub unsafe fn GetPixelsPerDip(&self, clientdrawingcontext: *const ::core::ffi::c_void) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), &mut result__).from_abi::<f32>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWritePixelSnapping {
type Vtable = IDWritePixelSnapping_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xeaf3a2da_ecf4_4d24_b644_b34f6842024b);
}
impl ::core::convert::From<IDWritePixelSnapping> for ::windows::core::IUnknown {
fn from(value: IDWritePixelSnapping) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWritePixelSnapping> for ::windows::core::IUnknown {
fn from(value: &IDWritePixelSnapping) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWritePixelSnapping {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWritePixelSnapping {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWritePixelSnapping_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, isdisabled: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, transform: *mut DWRITE_MATRIX) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, pixelsperdip: *mut f32) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteRemoteFontFileLoader(pub ::windows::core::IUnknown);
impl IDWriteRemoteFontFileLoader {
pub unsafe fn CreateStreamFromKey(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32) -> ::windows::core::Result<IDWriteFontFileStream> {
let mut result__: <IDWriteFontFileStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), &mut result__).from_abi::<IDWriteFontFileStream>(result__)
}
pub unsafe fn CreateRemoteStreamFromKey(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32) -> ::windows::core::Result<IDWriteRemoteFontFileStream> {
let mut result__: <IDWriteRemoteFontFileStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), &mut result__).from_abi::<IDWriteRemoteFontFileStream>(result__)
}
pub unsafe fn GetLocalityFromKey(&self, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32) -> ::windows::core::Result<DWRITE_LOCALITY> {
let mut result__: <DWRITE_LOCALITY as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfilereferencekey), ::core::mem::transmute(fontfilereferencekeysize), &mut result__).from_abi::<DWRITE_LOCALITY>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateFontFileReferenceFromUrl<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFactory>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, factory: Param0, baseurl: Param1, fontfileurl: Param2) -> ::windows::core::Result<IDWriteFontFile> {
let mut result__: <IDWriteFontFile as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), factory.into_param().abi(), baseurl.into_param().abi(), fontfileurl.into_param().abi(), &mut result__).from_abi::<IDWriteFontFile>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteRemoteFontFileLoader {
type Vtable = IDWriteRemoteFontFileLoader_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x68648c83_6ede_46c0_ab46_20083a887fde);
}
impl ::core::convert::From<IDWriteRemoteFontFileLoader> for ::windows::core::IUnknown {
fn from(value: IDWriteRemoteFontFileLoader) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteRemoteFontFileLoader> for ::windows::core::IUnknown {
fn from(value: &IDWriteRemoteFontFileLoader) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteRemoteFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteRemoteFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteRemoteFontFileLoader> for IDWriteFontFileLoader {
fn from(value: IDWriteRemoteFontFileLoader) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteRemoteFontFileLoader> for IDWriteFontFileLoader {
fn from(value: &IDWriteRemoteFontFileLoader) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFileLoader> for IDWriteRemoteFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFileLoader> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFileLoader> for &IDWriteRemoteFontFileLoader {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFileLoader> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteRemoteFontFileLoader_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfilestream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, fontfilestream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfilereferencekey: *const ::core::ffi::c_void, fontfilereferencekeysize: u32, locality: *mut DWRITE_LOCALITY) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, factory: ::windows::core::RawPtr, baseurl: super::super::Foundation::PWSTR, fontfileurl: super::super::Foundation::PWSTR, fontfile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteRemoteFontFileStream(pub ::windows::core::IUnknown);
impl IDWriteRemoteFontFileStream {
pub unsafe fn ReadFileFragment(&self, fragmentstart: *mut *mut ::core::ffi::c_void, fileoffset: u64, fragmentsize: u64, fragmentcontext: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(fragmentstart), ::core::mem::transmute(fileoffset), ::core::mem::transmute(fragmentsize), ::core::mem::transmute(fragmentcontext)).ok()
}
pub unsafe fn ReleaseFileFragment(&self, fragmentcontext: *mut ::core::ffi::c_void) {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(fragmentcontext)))
}
pub unsafe fn GetFileSize(&self) -> ::windows::core::Result<u64> {
let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u64>(result__)
}
pub unsafe fn GetLastWriteTime(&self) -> ::windows::core::Result<u64> {
let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u64>(result__)
}
pub unsafe fn GetLocalFileSize(&self) -> ::windows::core::Result<u64> {
let mut result__: <u64 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u64>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFileFragmentLocality(&self, fileoffset: u64, fragmentsize: u64, islocal: *mut super::super::Foundation::BOOL, partialsize: *mut u64) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(fileoffset), ::core::mem::transmute(fragmentsize), ::core::mem::transmute(islocal), ::core::mem::transmute(partialsize)).ok()
}
pub unsafe fn GetLocality(&self) -> DWRITE_LOCALITY {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
pub unsafe fn BeginDownload(&self, downloadoperationid: *const ::windows::core::GUID, filefragments: *const DWRITE_FILE_FRAGMENT, fragmentcount: u32) -> ::windows::core::Result<IDWriteAsyncResult> {
let mut result__: <IDWriteAsyncResult as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(downloadoperationid), ::core::mem::transmute(filefragments), ::core::mem::transmute(fragmentcount), &mut result__).from_abi::<IDWriteAsyncResult>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteRemoteFontFileStream {
type Vtable = IDWriteRemoteFontFileStream_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4db3757a_2c72_4ed9_b2b6_1ababe1aff9c);
}
impl ::core::convert::From<IDWriteRemoteFontFileStream> for ::windows::core::IUnknown {
fn from(value: IDWriteRemoteFontFileStream) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteRemoteFontFileStream> for ::windows::core::IUnknown {
fn from(value: &IDWriteRemoteFontFileStream) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteRemoteFontFileStream {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteRemoteFontFileStream {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteRemoteFontFileStream> for IDWriteFontFileStream {
fn from(value: IDWriteRemoteFontFileStream) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteRemoteFontFileStream> for IDWriteFontFileStream {
fn from(value: &IDWriteRemoteFontFileStream) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFileStream> for IDWriteRemoteFontFileStream {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFileStream> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteFontFileStream> for &IDWriteRemoteFontFileStream {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteFontFileStream> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteRemoteFontFileStream_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fragmentstart: *mut *mut ::core::ffi::c_void, fileoffset: u64, fragmentsize: u64, fragmentcontext: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fragmentcontext: *mut ::core::ffi::c_void),
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filesize: *mut u64) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lastwritetime: *mut u64) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localfilesize: *mut u64) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fileoffset: u64, fragmentsize: u64, islocal: *mut super::super::Foundation::BOOL, partialsize: *mut u64) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_LOCALITY,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, downloadoperationid: *const ::windows::core::GUID, filefragments: *const DWRITE_FILE_FRAGMENT, fragmentcount: u32, asyncresult: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteRenderingParams(pub ::windows::core::IUnknown);
impl IDWriteRenderingParams {
pub unsafe fn GetGamma(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetEnhancedContrast(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetClearTypeLevel(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPixelGeometry(&self) -> DWRITE_PIXEL_GEOMETRY {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetRenderingMode(&self) -> DWRITE_RENDERING_MODE {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteRenderingParams {
type Vtable = IDWriteRenderingParams_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x2f0da53a_2add_47cd_82ee_d9ec34688e75);
}
impl ::core::convert::From<IDWriteRenderingParams> for ::windows::core::IUnknown {
fn from(value: IDWriteRenderingParams) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteRenderingParams> for ::windows::core::IUnknown {
fn from(value: &IDWriteRenderingParams) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteRenderingParams {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteRenderingParams {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteRenderingParams_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PIXEL_GEOMETRY,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_RENDERING_MODE,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteRenderingParams1(pub ::windows::core::IUnknown);
impl IDWriteRenderingParams1 {
pub unsafe fn GetGamma(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetEnhancedContrast(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetClearTypeLevel(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPixelGeometry(&self) -> DWRITE_PIXEL_GEOMETRY {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetRenderingMode(&self) -> DWRITE_RENDERING_MODE {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetGrayscaleEnhancedContrast(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteRenderingParams1 {
type Vtable = IDWriteRenderingParams1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x94413cf4_a6fc_4248_8b50_6674348fcad3);
}
impl ::core::convert::From<IDWriteRenderingParams1> for ::windows::core::IUnknown {
fn from(value: IDWriteRenderingParams1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteRenderingParams1> for ::windows::core::IUnknown {
fn from(value: &IDWriteRenderingParams1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteRenderingParams1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteRenderingParams1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteRenderingParams1> for IDWriteRenderingParams {
fn from(value: IDWriteRenderingParams1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteRenderingParams1> for IDWriteRenderingParams {
fn from(value: &IDWriteRenderingParams1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams> for IDWriteRenderingParams1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams> for &IDWriteRenderingParams1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteRenderingParams1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PIXEL_GEOMETRY,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_RENDERING_MODE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteRenderingParams2(pub ::windows::core::IUnknown);
impl IDWriteRenderingParams2 {
pub unsafe fn GetGamma(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetEnhancedContrast(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetClearTypeLevel(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPixelGeometry(&self) -> DWRITE_PIXEL_GEOMETRY {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetRenderingMode(&self) -> DWRITE_RENDERING_MODE {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetGrayscaleEnhancedContrast(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetGridFitMode(&self) -> DWRITE_GRID_FIT_MODE {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteRenderingParams2 {
type Vtable = IDWriteRenderingParams2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xf9d711c3_9777_40ae_87e8_3e5af9bf0948);
}
impl ::core::convert::From<IDWriteRenderingParams2> for ::windows::core::IUnknown {
fn from(value: IDWriteRenderingParams2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteRenderingParams2> for ::windows::core::IUnknown {
fn from(value: &IDWriteRenderingParams2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteRenderingParams2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteRenderingParams2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteRenderingParams2> for IDWriteRenderingParams1 {
fn from(value: IDWriteRenderingParams2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteRenderingParams2> for IDWriteRenderingParams1 {
fn from(value: &IDWriteRenderingParams2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams1> for IDWriteRenderingParams2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams1> for &IDWriteRenderingParams2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteRenderingParams2> for IDWriteRenderingParams {
fn from(value: IDWriteRenderingParams2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteRenderingParams2> for IDWriteRenderingParams {
fn from(value: &IDWriteRenderingParams2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams> for IDWriteRenderingParams2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams> for &IDWriteRenderingParams2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteRenderingParams2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PIXEL_GEOMETRY,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_RENDERING_MODE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_GRID_FIT_MODE,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteRenderingParams3(pub ::windows::core::IUnknown);
impl IDWriteRenderingParams3 {
pub unsafe fn GetGamma(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetEnhancedContrast(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetClearTypeLevel(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetPixelGeometry(&self) -> DWRITE_PIXEL_GEOMETRY {
::core::mem::transmute((::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetRenderingMode(&self) -> DWRITE_RENDERING_MODE {
::core::mem::transmute((::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetGrayscaleEnhancedContrast(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetGridFitMode(&self) -> DWRITE_GRID_FIT_MODE {
::core::mem::transmute((::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetRenderingMode1(&self) -> DWRITE_RENDERING_MODE1 {
::core::mem::transmute((::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self)))
}
}
unsafe impl ::windows::core::Interface for IDWriteRenderingParams3 {
type Vtable = IDWriteRenderingParams3_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb7924baa_391b_412a_8c5c_e44cc2d867dc);
}
impl ::core::convert::From<IDWriteRenderingParams3> for ::windows::core::IUnknown {
fn from(value: IDWriteRenderingParams3) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteRenderingParams3> for ::windows::core::IUnknown {
fn from(value: &IDWriteRenderingParams3) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteRenderingParams3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteRenderingParams3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteRenderingParams3> for IDWriteRenderingParams2 {
fn from(value: IDWriteRenderingParams3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteRenderingParams3> for IDWriteRenderingParams2 {
fn from(value: &IDWriteRenderingParams3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams2> for IDWriteRenderingParams3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams2> for &IDWriteRenderingParams3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteRenderingParams3> for IDWriteRenderingParams1 {
fn from(value: IDWriteRenderingParams3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteRenderingParams3> for IDWriteRenderingParams1 {
fn from(value: &IDWriteRenderingParams3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams1> for IDWriteRenderingParams3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams1> for &IDWriteRenderingParams3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteRenderingParams3> for IDWriteRenderingParams {
fn from(value: IDWriteRenderingParams3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteRenderingParams3> for IDWriteRenderingParams {
fn from(value: &IDWriteRenderingParams3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams> for IDWriteRenderingParams3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteRenderingParams> for &IDWriteRenderingParams3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteRenderingParams> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteRenderingParams3_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PIXEL_GEOMETRY,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_RENDERING_MODE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_GRID_FIT_MODE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_RENDERING_MODE1,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteStringList(pub ::windows::core::IUnknown);
impl IDWriteStringList {
pub unsafe fn GetCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleNameLength(&self, listindex: u32) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName(&self, listindex: u32, localename: super::super::Foundation::PWSTR, size: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), ::core::mem::transmute(localename), ::core::mem::transmute(size)).ok()
}
pub unsafe fn GetStringLength(&self, listindex: u32) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetString(&self, listindex: u32, stringbuffer: super::super::Foundation::PWSTR, stringbuffersize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(listindex), ::core::mem::transmute(stringbuffer), ::core::mem::transmute(stringbuffersize)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteStringList {
type Vtable = IDWriteStringList_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xcfee3140_1157_47ca_8b85_31bfcf3f2d0e);
}
impl ::core::convert::From<IDWriteStringList> for ::windows::core::IUnknown {
fn from(value: IDWriteStringList) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteStringList> for ::windows::core::IUnknown {
fn from(value: &IDWriteStringList) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteStringList {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteStringList {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteStringList_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, length: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, localename: super::super::Foundation::PWSTR, size: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, length: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, listindex: u32, stringbuffer: super::super::Foundation::PWSTR, stringbuffersize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextAnalysisSink(pub ::windows::core::IUnknown);
impl IDWriteTextAnalysisSink {
pub unsafe fn SetScriptAnalysis(&self, textposition: u32, textlength: u32, scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(scriptanalysis)).ok()
}
pub unsafe fn SetLineBreakpoints(&self, textposition: u32, textlength: u32, linebreakpoints: *const DWRITE_LINE_BREAKPOINT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(linebreakpoints)).ok()
}
pub unsafe fn SetBidiLevel(&self, textposition: u32, textlength: u32, explicitlevel: u8, resolvedlevel: u8) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(explicitlevel), ::core::mem::transmute(resolvedlevel)).ok()
}
pub unsafe fn SetNumberSubstitution<'a, Param2: ::windows::core::IntoParam<'a, IDWriteNumberSubstitution>>(&self, textposition: u32, textlength: u32, numbersubstitution: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), numbersubstitution.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextAnalysisSink {
type Vtable = IDWriteTextAnalysisSink_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x5810cd44_0ca0_4701_b3fa_bec5182ae4f6);
}
impl ::core::convert::From<IDWriteTextAnalysisSink> for ::windows::core::IUnknown {
fn from(value: IDWriteTextAnalysisSink) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextAnalysisSink> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextAnalysisSink) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextAnalysisSink {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextAnalysisSink {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextAnalysisSink_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, linebreakpoints: *const DWRITE_LINE_BREAKPOINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, explicitlevel: u8, resolvedlevel: u8) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, numbersubstitution: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextAnalysisSink1(pub ::windows::core::IUnknown);
impl IDWriteTextAnalysisSink1 {
pub unsafe fn SetScriptAnalysis(&self, textposition: u32, textlength: u32, scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(scriptanalysis)).ok()
}
pub unsafe fn SetLineBreakpoints(&self, textposition: u32, textlength: u32, linebreakpoints: *const DWRITE_LINE_BREAKPOINT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(linebreakpoints)).ok()
}
pub unsafe fn SetBidiLevel(&self, textposition: u32, textlength: u32, explicitlevel: u8, resolvedlevel: u8) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(explicitlevel), ::core::mem::transmute(resolvedlevel)).ok()
}
pub unsafe fn SetNumberSubstitution<'a, Param2: ::windows::core::IntoParam<'a, IDWriteNumberSubstitution>>(&self, textposition: u32, textlength: u32, numbersubstitution: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), numbersubstitution.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetGlyphOrientation<'a, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, textposition: u32, textlength: u32, glyphorientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, adjustedbidilevel: u8, issideways: Param4, isrighttoleft: Param5) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(glyphorientationangle), ::core::mem::transmute(adjustedbidilevel), issideways.into_param().abi(), isrighttoleft.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextAnalysisSink1 {
type Vtable = IDWriteTextAnalysisSink1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb0d941a0_85e7_4d8b_9fd3_5ced9934482a);
}
impl ::core::convert::From<IDWriteTextAnalysisSink1> for ::windows::core::IUnknown {
fn from(value: IDWriteTextAnalysisSink1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextAnalysisSink1> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextAnalysisSink1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextAnalysisSink1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextAnalysisSink1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextAnalysisSink1> for IDWriteTextAnalysisSink {
fn from(value: IDWriteTextAnalysisSink1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextAnalysisSink1> for IDWriteTextAnalysisSink {
fn from(value: &IDWriteTextAnalysisSink1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink> for IDWriteTextAnalysisSink1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextAnalysisSink> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink> for &IDWriteTextAnalysisSink1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextAnalysisSink> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextAnalysisSink1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, linebreakpoints: *const DWRITE_LINE_BREAKPOINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, explicitlevel: u8, resolvedlevel: u8) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, numbersubstitution: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, glyphorientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, adjustedbidilevel: u8, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextAnalysisSource(pub ::windows::core::IUnknown);
impl IDWriteTextAnalysisSource {
pub unsafe fn GetTextAtPosition(&self, textposition: u32, textstring: *mut *mut u16, textlength: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textstring), ::core::mem::transmute(textlength)).ok()
}
pub unsafe fn GetTextBeforePosition(&self, textposition: u32, textstring: *mut *mut u16, textlength: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textstring), ::core::mem::transmute(textlength)).ok()
}
pub unsafe fn GetParagraphReadingDirection(&self) -> DWRITE_READING_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleName(&self, textposition: u32, textlength: *mut u32, localename: *mut *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(localename)).ok()
}
pub unsafe fn GetNumberSubstitution(&self, textposition: u32, textlength: *mut u32, numbersubstitution: *mut ::core::option::Option<IDWriteNumberSubstitution>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(numbersubstitution)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextAnalysisSource {
type Vtable = IDWriteTextAnalysisSource_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x688e1a58_5094_47c8_adc8_fbcea60ae92b);
}
impl ::core::convert::From<IDWriteTextAnalysisSource> for ::windows::core::IUnknown {
fn from(value: IDWriteTextAnalysisSource) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextAnalysisSource> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextAnalysisSource) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextAnalysisSource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextAnalysisSource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextAnalysisSource_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textstring: *mut *mut u16, textlength: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textstring: *mut *mut u16, textlength: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_READING_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: *mut u32, localename: *mut *mut u16) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: *mut u32, numbersubstitution: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextAnalysisSource1(pub ::windows::core::IUnknown);
impl IDWriteTextAnalysisSource1 {
pub unsafe fn GetTextAtPosition(&self, textposition: u32, textstring: *mut *mut u16, textlength: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textstring), ::core::mem::transmute(textlength)).ok()
}
pub unsafe fn GetTextBeforePosition(&self, textposition: u32, textstring: *mut *mut u16, textlength: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textstring), ::core::mem::transmute(textlength)).ok()
}
pub unsafe fn GetParagraphReadingDirection(&self) -> DWRITE_READING_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleName(&self, textposition: u32, textlength: *mut u32, localename: *mut *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(localename)).ok()
}
pub unsafe fn GetNumberSubstitution(&self, textposition: u32, textlength: *mut u32, numbersubstitution: *mut ::core::option::Option<IDWriteNumberSubstitution>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(numbersubstitution)).ok()
}
pub unsafe fn GetVerticalGlyphOrientation(&self, textposition: u32, textlength: *mut u32, glyphorientation: *mut DWRITE_VERTICAL_GLYPH_ORIENTATION, bidilevel: *mut u8) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), ::core::mem::transmute(glyphorientation), ::core::mem::transmute(bidilevel)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextAnalysisSource1 {
type Vtable = IDWriteTextAnalysisSource1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x639cfad8_0fb4_4b21_a58a_067920120009);
}
impl ::core::convert::From<IDWriteTextAnalysisSource1> for ::windows::core::IUnknown {
fn from(value: IDWriteTextAnalysisSource1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextAnalysisSource1> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextAnalysisSource1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextAnalysisSource1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextAnalysisSource1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextAnalysisSource1> for IDWriteTextAnalysisSource {
fn from(value: IDWriteTextAnalysisSource1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextAnalysisSource1> for IDWriteTextAnalysisSource {
fn from(value: &IDWriteTextAnalysisSource1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource> for IDWriteTextAnalysisSource1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextAnalysisSource> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource> for &IDWriteTextAnalysisSource1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextAnalysisSource> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextAnalysisSource1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textstring: *mut *mut u16, textlength: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textstring: *mut *mut u16, textlength: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_READING_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: *mut u32, localename: *mut *mut u16) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: *mut u32, numbersubstitution: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: *mut u32, glyphorientation: *mut DWRITE_VERTICAL_GLYPH_ORIENTATION, bidilevel: *mut u8) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextAnalyzer(pub ::windows::core::IUnknown);
impl IDWriteTextAnalyzer {
pub unsafe fn AnalyzeScript<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
pub unsafe fn AnalyzeBidi<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
pub unsafe fn AnalyzeNumberSubstitution<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
pub unsafe fn AnalyzeLineBreakpoints<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGlyphs<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param7: ::windows::core::IntoParam<'a, IDWriteNumberSubstitution>>(
&self,
textstring: Param0,
textlength: u32,
fontface: Param2,
issideways: Param3,
isrighttoleft: Param4,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: Param6,
numbersubstitution: Param7,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
maxglyphcount: u32,
clustermap: *mut u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
glyphindices: *mut u16,
glyphprops: *mut DWRITE_SHAPING_GLYPH_PROPERTIES,
actualglyphcount: *mut u32,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(
::core::mem::transmute_copy(self),
textstring.into_param().abi(),
::core::mem::transmute(textlength),
fontface.into_param().abi(),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
::core::mem::transmute(scriptanalysis),
localename.into_param().abi(),
numbersubstitution.into_param().abi(),
::core::mem::transmute(features),
::core::mem::transmute(featurerangelengths),
::core::mem::transmute(featureranges),
::core::mem::transmute(maxglyphcount),
::core::mem::transmute(clustermap),
::core::mem::transmute(textprops),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphprops),
::core::mem::transmute(actualglyphcount),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGlyphPlacements<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param7: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param9: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param10: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param12: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
textstring: Param0,
clustermap: *const u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: Param7,
fontemsize: f32,
issideways: Param9,
isrighttoleft: Param10,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: Param12,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(
::core::mem::transmute_copy(self),
textstring.into_param().abi(),
::core::mem::transmute(clustermap),
::core::mem::transmute(textprops),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphprops),
::core::mem::transmute(glyphcount),
fontface.into_param().abi(),
::core::mem::transmute(fontemsize),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
::core::mem::transmute(scriptanalysis),
localename.into_param().abi(),
::core::mem::transmute(features),
::core::mem::transmute(featurerangelengths),
::core::mem::transmute(featureranges),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphPlacements<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param7: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param11: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param12: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param13: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param15: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
textstring: Param0,
clustermap: *const u16,
textprops: *const DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: Param7,
fontemsize: f32,
pixelsperdip: f32,
transform: *const DWRITE_MATRIX,
usegdinatural: Param11,
issideways: Param12,
isrighttoleft: Param13,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: Param15,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(
::core::mem::transmute_copy(self),
textstring.into_param().abi(),
::core::mem::transmute(clustermap),
::core::mem::transmute(textprops),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphprops),
::core::mem::transmute(glyphcount),
fontface.into_param().abi(),
::core::mem::transmute(fontemsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
::core::mem::transmute(scriptanalysis),
localename.into_param().abi(),
::core::mem::transmute(features),
::core::mem::transmute(featurerangelengths),
::core::mem::transmute(featureranges),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
)
.ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextAnalyzer {
type Vtable = IDWriteTextAnalyzer_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb7e6163e_7f46_43b4_84b3_e4e6249c365d);
}
impl ::core::convert::From<IDWriteTextAnalyzer> for ::windows::core::IUnknown {
fn from(value: IDWriteTextAnalyzer) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextAnalyzer> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextAnalyzer) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextAnalyzer {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextAnalyzer {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextAnalyzer_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
textstring: super::super::Foundation::PWSTR,
textlength: u32,
fontface: ::windows::core::RawPtr,
issideways: super::super::Foundation::BOOL,
isrighttoleft: super::super::Foundation::BOOL,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: super::super::Foundation::PWSTR,
numbersubstitution: ::windows::core::RawPtr,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
maxglyphcount: u32,
clustermap: *mut u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
glyphindices: *mut u16,
glyphprops: *mut DWRITE_SHAPING_GLYPH_PROPERTIES,
actualglyphcount: *mut u32,
) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
textstring: super::super::Foundation::PWSTR,
clustermap: *const u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: ::windows::core::RawPtr,
fontemsize: f32,
issideways: super::super::Foundation::BOOL,
isrighttoleft: super::super::Foundation::BOOL,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: super::super::Foundation::PWSTR,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
textstring: super::super::Foundation::PWSTR,
clustermap: *const u16,
textprops: *const DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: ::windows::core::RawPtr,
fontemsize: f32,
pixelsperdip: f32,
transform: *const DWRITE_MATRIX,
usegdinatural: super::super::Foundation::BOOL,
issideways: super::super::Foundation::BOOL,
isrighttoleft: super::super::Foundation::BOOL,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: super::super::Foundation::PWSTR,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextAnalyzer1(pub ::windows::core::IUnknown);
impl IDWriteTextAnalyzer1 {
pub unsafe fn AnalyzeScript<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
pub unsafe fn AnalyzeBidi<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
pub unsafe fn AnalyzeNumberSubstitution<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
pub unsafe fn AnalyzeLineBreakpoints<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGlyphs<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param7: ::windows::core::IntoParam<'a, IDWriteNumberSubstitution>>(
&self,
textstring: Param0,
textlength: u32,
fontface: Param2,
issideways: Param3,
isrighttoleft: Param4,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: Param6,
numbersubstitution: Param7,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
maxglyphcount: u32,
clustermap: *mut u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
glyphindices: *mut u16,
glyphprops: *mut DWRITE_SHAPING_GLYPH_PROPERTIES,
actualglyphcount: *mut u32,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(
::core::mem::transmute_copy(self),
textstring.into_param().abi(),
::core::mem::transmute(textlength),
fontface.into_param().abi(),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
::core::mem::transmute(scriptanalysis),
localename.into_param().abi(),
numbersubstitution.into_param().abi(),
::core::mem::transmute(features),
::core::mem::transmute(featurerangelengths),
::core::mem::transmute(featureranges),
::core::mem::transmute(maxglyphcount),
::core::mem::transmute(clustermap),
::core::mem::transmute(textprops),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphprops),
::core::mem::transmute(actualglyphcount),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGlyphPlacements<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param7: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param9: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param10: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param12: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
textstring: Param0,
clustermap: *const u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: Param7,
fontemsize: f32,
issideways: Param9,
isrighttoleft: Param10,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: Param12,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(
::core::mem::transmute_copy(self),
textstring.into_param().abi(),
::core::mem::transmute(clustermap),
::core::mem::transmute(textprops),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphprops),
::core::mem::transmute(glyphcount),
fontface.into_param().abi(),
::core::mem::transmute(fontemsize),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
::core::mem::transmute(scriptanalysis),
localename.into_param().abi(),
::core::mem::transmute(features),
::core::mem::transmute(featurerangelengths),
::core::mem::transmute(featureranges),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphPlacements<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param7: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param11: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param12: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param13: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param15: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
textstring: Param0,
clustermap: *const u16,
textprops: *const DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: Param7,
fontemsize: f32,
pixelsperdip: f32,
transform: *const DWRITE_MATRIX,
usegdinatural: Param11,
issideways: Param12,
isrighttoleft: Param13,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: Param15,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(
::core::mem::transmute_copy(self),
textstring.into_param().abi(),
::core::mem::transmute(clustermap),
::core::mem::transmute(textprops),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphprops),
::core::mem::transmute(glyphcount),
fontface.into_param().abi(),
::core::mem::transmute(fontemsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
::core::mem::transmute(scriptanalysis),
localename.into_param().abi(),
::core::mem::transmute(features),
::core::mem::transmute(featurerangelengths),
::core::mem::transmute(featureranges),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
)
.ok()
}
pub unsafe fn ApplyCharacterSpacing(&self, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textlength: u32, glyphcount: u32, clustermap: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, modifiedglyphadvances: *mut f32, modifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(
::core::mem::transmute_copy(self),
::core::mem::transmute(leadingspacing),
::core::mem::transmute(trailingspacing),
::core::mem::transmute(minimumadvancewidth),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphcount),
::core::mem::transmute(clustermap),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
::core::mem::transmute(glyphproperties),
::core::mem::transmute(modifiedglyphadvances),
::core::mem::transmute(modifiedglyphoffsets),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetBaseline<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param4: ::windows::core::IntoParam<'a, DWRITE_SCRIPT_ANALYSIS>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
fontface: Param0,
baseline: DWRITE_BASELINE,
isvertical: Param2,
issimulationallowed: Param3,
scriptanalysis: Param4,
localename: Param5,
baselinecoordinate: *mut i32,
exists: *mut super::super::Foundation::BOOL,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(
::core::mem::transmute_copy(self),
fontface.into_param().abi(),
::core::mem::transmute(baseline),
isvertical.into_param().abi(),
issimulationallowed.into_param().abi(),
scriptanalysis.into_param().abi(),
localename.into_param().abi(),
::core::mem::transmute(baselinecoordinate),
::core::mem::transmute(exists),
)
.ok()
}
pub unsafe fn AnalyzeVerticalGlyphOrientation<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource1>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink1>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGlyphOrientationTransform<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphorientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, issideways: Param1) -> ::windows::core::Result<DWRITE_MATRIX> {
let mut result__: <DWRITE_MATRIX as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphorientationangle), issideways.into_param().abi(), &mut result__).from_abi::<DWRITE_MATRIX>(result__)
}
pub unsafe fn GetScriptProperties<'a, Param0: ::windows::core::IntoParam<'a, DWRITE_SCRIPT_ANALYSIS>>(&self, scriptanalysis: Param0) -> ::windows::core::Result<DWRITE_SCRIPT_PROPERTIES> {
let mut result__: <DWRITE_SCRIPT_PROPERTIES as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), scriptanalysis.into_param().abi(), &mut result__).from_abi::<DWRITE_SCRIPT_PROPERTIES>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTextComplexity<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, textstring: Param0, textlength: u32, fontface: Param2, istextsimple: *mut super::super::Foundation::BOOL, textlengthread: *mut u32, glyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), textstring.into_param().abi(), ::core::mem::transmute(textlength), fontface.into_param().abi(), ::core::mem::transmute(istextsimple), ::core::mem::transmute(textlengthread), ::core::mem::transmute(glyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetJustificationOpportunities<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param2: ::windows::core::IntoParam<'a, DWRITE_SCRIPT_ANALYSIS>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
fontface: Param0,
fontemsize: f32,
scriptanalysis: Param2,
textlength: u32,
glyphcount: u32,
textstring: Param5,
clustermap: *const u16,
glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
justificationopportunities: *mut DWRITE_JUSTIFICATION_OPPORTUNITY,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(
::core::mem::transmute_copy(self),
fontface.into_param().abi(),
::core::mem::transmute(fontemsize),
scriptanalysis.into_param().abi(),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphcount),
textstring.into_param().abi(),
::core::mem::transmute(clustermap),
::core::mem::transmute(glyphproperties),
::core::mem::transmute(justificationopportunities),
)
.ok()
}
pub unsafe fn JustifyGlyphAdvances(&self, linewidth: f32, glyphcount: u32, justificationopportunities: *const DWRITE_JUSTIFICATION_OPPORTUNITY, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, justifiedglyphadvances: *mut f32, justifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(
::core::mem::transmute_copy(self),
::core::mem::transmute(linewidth),
::core::mem::transmute(glyphcount),
::core::mem::transmute(justificationopportunities),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
::core::mem::transmute(justifiedglyphadvances),
::core::mem::transmute(justifiedglyphoffsets),
)
.ok()
}
pub unsafe fn GetJustifiedGlyphs<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param2: ::windows::core::IntoParam<'a, DWRITE_SCRIPT_ANALYSIS>>(
&self,
fontface: Param0,
fontemsize: f32,
scriptanalysis: Param2,
textlength: u32,
glyphcount: u32,
maxglyphcount: u32,
clustermap: *const u16,
glyphindices: *const u16,
glyphadvances: *const f32,
justifiedglyphadvances: *const f32,
justifiedglyphoffsets: *const DWRITE_GLYPH_OFFSET,
glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
actualglyphcount: *mut u32,
modifiedclustermap: *mut u16,
modifiedglyphindices: *mut u16,
modifiedglyphadvances: *mut f32,
modifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(
::core::mem::transmute_copy(self),
fontface.into_param().abi(),
::core::mem::transmute(fontemsize),
scriptanalysis.into_param().abi(),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphcount),
::core::mem::transmute(maxglyphcount),
::core::mem::transmute(clustermap),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(justifiedglyphadvances),
::core::mem::transmute(justifiedglyphoffsets),
::core::mem::transmute(glyphproperties),
::core::mem::transmute(actualglyphcount),
::core::mem::transmute(modifiedclustermap),
::core::mem::transmute(modifiedglyphindices),
::core::mem::transmute(modifiedglyphadvances),
::core::mem::transmute(modifiedglyphoffsets),
)
.ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextAnalyzer1 {
type Vtable = IDWriteTextAnalyzer1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x80dad800_e21f_4e83_96ce_bfcce500db7c);
}
impl ::core::convert::From<IDWriteTextAnalyzer1> for ::windows::core::IUnknown {
fn from(value: IDWriteTextAnalyzer1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextAnalyzer1> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextAnalyzer1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextAnalyzer1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextAnalyzer1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextAnalyzer1> for IDWriteTextAnalyzer {
fn from(value: IDWriteTextAnalyzer1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextAnalyzer1> for IDWriteTextAnalyzer {
fn from(value: &IDWriteTextAnalyzer1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextAnalyzer> for IDWriteTextAnalyzer1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextAnalyzer> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextAnalyzer> for &IDWriteTextAnalyzer1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextAnalyzer> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextAnalyzer1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
textstring: super::super::Foundation::PWSTR,
textlength: u32,
fontface: ::windows::core::RawPtr,
issideways: super::super::Foundation::BOOL,
isrighttoleft: super::super::Foundation::BOOL,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: super::super::Foundation::PWSTR,
numbersubstitution: ::windows::core::RawPtr,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
maxglyphcount: u32,
clustermap: *mut u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
glyphindices: *mut u16,
glyphprops: *mut DWRITE_SHAPING_GLYPH_PROPERTIES,
actualglyphcount: *mut u32,
) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
textstring: super::super::Foundation::PWSTR,
clustermap: *const u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: ::windows::core::RawPtr,
fontemsize: f32,
issideways: super::super::Foundation::BOOL,
isrighttoleft: super::super::Foundation::BOOL,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: super::super::Foundation::PWSTR,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
textstring: super::super::Foundation::PWSTR,
clustermap: *const u16,
textprops: *const DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: ::windows::core::RawPtr,
fontemsize: f32,
pixelsperdip: f32,
transform: *const DWRITE_MATRIX,
usegdinatural: super::super::Foundation::BOOL,
issideways: super::super::Foundation::BOOL,
isrighttoleft: super::super::Foundation::BOOL,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: super::super::Foundation::PWSTR,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textlength: u32, glyphcount: u32, clustermap: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, modifiedglyphadvances: *mut f32, modifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, baseline: DWRITE_BASELINE, isvertical: super::super::Foundation::BOOL, issimulationallowed: super::super::Foundation::BOOL, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, localename: super::super::Foundation::PWSTR, baselinecoordinate: *mut i32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphorientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, issideways: super::super::Foundation::BOOL, transform: *mut DWRITE_MATRIX) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, scriptproperties: *mut DWRITE_SCRIPT_PROPERTIES) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textstring: super::super::Foundation::PWSTR, textlength: u32, fontface: ::windows::core::RawPtr, istextsimple: *mut super::super::Foundation::BOOL, textlengthread: *mut u32, glyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, fontemsize: f32, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, textlength: u32, glyphcount: u32, textstring: super::super::Foundation::PWSTR, clustermap: *const u16, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, justificationopportunities: *mut DWRITE_JUSTIFICATION_OPPORTUNITY) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linewidth: f32, glyphcount: u32, justificationopportunities: *const DWRITE_JUSTIFICATION_OPPORTUNITY, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, justifiedglyphadvances: *mut f32, justifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
fontface: ::windows::core::RawPtr,
fontemsize: f32,
scriptanalysis: DWRITE_SCRIPT_ANALYSIS,
textlength: u32,
glyphcount: u32,
maxglyphcount: u32,
clustermap: *const u16,
glyphindices: *const u16,
glyphadvances: *const f32,
justifiedglyphadvances: *const f32,
justifiedglyphoffsets: *const DWRITE_GLYPH_OFFSET,
glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
actualglyphcount: *mut u32,
modifiedclustermap: *mut u16,
modifiedglyphindices: *mut u16,
modifiedglyphadvances: *mut f32,
modifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextAnalyzer2(pub ::windows::core::IUnknown);
impl IDWriteTextAnalyzer2 {
pub unsafe fn AnalyzeScript<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
pub unsafe fn AnalyzeBidi<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
pub unsafe fn AnalyzeNumberSubstitution<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
pub unsafe fn AnalyzeLineBreakpoints<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGlyphs<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param7: ::windows::core::IntoParam<'a, IDWriteNumberSubstitution>>(
&self,
textstring: Param0,
textlength: u32,
fontface: Param2,
issideways: Param3,
isrighttoleft: Param4,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: Param6,
numbersubstitution: Param7,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
maxglyphcount: u32,
clustermap: *mut u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
glyphindices: *mut u16,
glyphprops: *mut DWRITE_SHAPING_GLYPH_PROPERTIES,
actualglyphcount: *mut u32,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(
::core::mem::transmute_copy(self),
textstring.into_param().abi(),
::core::mem::transmute(textlength),
fontface.into_param().abi(),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
::core::mem::transmute(scriptanalysis),
localename.into_param().abi(),
numbersubstitution.into_param().abi(),
::core::mem::transmute(features),
::core::mem::transmute(featurerangelengths),
::core::mem::transmute(featureranges),
::core::mem::transmute(maxglyphcount),
::core::mem::transmute(clustermap),
::core::mem::transmute(textprops),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphprops),
::core::mem::transmute(actualglyphcount),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGlyphPlacements<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param7: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param9: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param10: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param12: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
textstring: Param0,
clustermap: *const u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: Param7,
fontemsize: f32,
issideways: Param9,
isrighttoleft: Param10,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: Param12,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(
::core::mem::transmute_copy(self),
textstring.into_param().abi(),
::core::mem::transmute(clustermap),
::core::mem::transmute(textprops),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphprops),
::core::mem::transmute(glyphcount),
fontface.into_param().abi(),
::core::mem::transmute(fontemsize),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
::core::mem::transmute(scriptanalysis),
localename.into_param().abi(),
::core::mem::transmute(features),
::core::mem::transmute(featurerangelengths),
::core::mem::transmute(featureranges),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGdiCompatibleGlyphPlacements<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param7: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param11: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param12: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param13: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param15: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
textstring: Param0,
clustermap: *const u16,
textprops: *const DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: Param7,
fontemsize: f32,
pixelsperdip: f32,
transform: *const DWRITE_MATRIX,
usegdinatural: Param11,
issideways: Param12,
isrighttoleft: Param13,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: Param15,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(
::core::mem::transmute_copy(self),
textstring.into_param().abi(),
::core::mem::transmute(clustermap),
::core::mem::transmute(textprops),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphprops),
::core::mem::transmute(glyphcount),
fontface.into_param().abi(),
::core::mem::transmute(fontemsize),
::core::mem::transmute(pixelsperdip),
::core::mem::transmute(transform),
usegdinatural.into_param().abi(),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
::core::mem::transmute(scriptanalysis),
localename.into_param().abi(),
::core::mem::transmute(features),
::core::mem::transmute(featurerangelengths),
::core::mem::transmute(featureranges),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
)
.ok()
}
pub unsafe fn ApplyCharacterSpacing(&self, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textlength: u32, glyphcount: u32, clustermap: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, modifiedglyphadvances: *mut f32, modifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(
::core::mem::transmute_copy(self),
::core::mem::transmute(leadingspacing),
::core::mem::transmute(trailingspacing),
::core::mem::transmute(minimumadvancewidth),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphcount),
::core::mem::transmute(clustermap),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
::core::mem::transmute(glyphproperties),
::core::mem::transmute(modifiedglyphadvances),
::core::mem::transmute(modifiedglyphoffsets),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetBaseline<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param4: ::windows::core::IntoParam<'a, DWRITE_SCRIPT_ANALYSIS>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
fontface: Param0,
baseline: DWRITE_BASELINE,
isvertical: Param2,
issimulationallowed: Param3,
scriptanalysis: Param4,
localename: Param5,
baselinecoordinate: *mut i32,
exists: *mut super::super::Foundation::BOOL,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(
::core::mem::transmute_copy(self),
fontface.into_param().abi(),
::core::mem::transmute(baseline),
isvertical.into_param().abi(),
issimulationallowed.into_param().abi(),
scriptanalysis.into_param().abi(),
localename.into_param().abi(),
::core::mem::transmute(baselinecoordinate),
::core::mem::transmute(exists),
)
.ok()
}
pub unsafe fn AnalyzeVerticalGlyphOrientation<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSource1>, Param3: ::windows::core::IntoParam<'a, IDWriteTextAnalysisSink1>>(&self, analysissource: Param0, textposition: u32, textlength: u32, analysissink: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), analysissource.into_param().abi(), ::core::mem::transmute(textposition), ::core::mem::transmute(textlength), analysissink.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGlyphOrientationTransform<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphorientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, issideways: Param1) -> ::windows::core::Result<DWRITE_MATRIX> {
let mut result__: <DWRITE_MATRIX as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphorientationangle), issideways.into_param().abi(), &mut result__).from_abi::<DWRITE_MATRIX>(result__)
}
pub unsafe fn GetScriptProperties<'a, Param0: ::windows::core::IntoParam<'a, DWRITE_SCRIPT_ANALYSIS>>(&self, scriptanalysis: Param0) -> ::windows::core::Result<DWRITE_SCRIPT_PROPERTIES> {
let mut result__: <DWRITE_SCRIPT_PROPERTIES as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), scriptanalysis.into_param().abi(), &mut result__).from_abi::<DWRITE_SCRIPT_PROPERTIES>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTextComplexity<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IDWriteFontFace>>(&self, textstring: Param0, textlength: u32, fontface: Param2, istextsimple: *mut super::super::Foundation::BOOL, textlengthread: *mut u32, glyphindices: *mut u16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), textstring.into_param().abi(), ::core::mem::transmute(textlength), fontface.into_param().abi(), ::core::mem::transmute(istextsimple), ::core::mem::transmute(textlengthread), ::core::mem::transmute(glyphindices)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetJustificationOpportunities<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param2: ::windows::core::IntoParam<'a, DWRITE_SCRIPT_ANALYSIS>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(
&self,
fontface: Param0,
fontemsize: f32,
scriptanalysis: Param2,
textlength: u32,
glyphcount: u32,
textstring: Param5,
clustermap: *const u16,
glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
justificationopportunities: *mut DWRITE_JUSTIFICATION_OPPORTUNITY,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(
::core::mem::transmute_copy(self),
fontface.into_param().abi(),
::core::mem::transmute(fontemsize),
scriptanalysis.into_param().abi(),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphcount),
textstring.into_param().abi(),
::core::mem::transmute(clustermap),
::core::mem::transmute(glyphproperties),
::core::mem::transmute(justificationopportunities),
)
.ok()
}
pub unsafe fn JustifyGlyphAdvances(&self, linewidth: f32, glyphcount: u32, justificationopportunities: *const DWRITE_JUSTIFICATION_OPPORTUNITY, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, justifiedglyphadvances: *mut f32, justifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(
::core::mem::transmute_copy(self),
::core::mem::transmute(linewidth),
::core::mem::transmute(glyphcount),
::core::mem::transmute(justificationopportunities),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(glyphoffsets),
::core::mem::transmute(justifiedglyphadvances),
::core::mem::transmute(justifiedglyphoffsets),
)
.ok()
}
pub unsafe fn GetJustifiedGlyphs<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param2: ::windows::core::IntoParam<'a, DWRITE_SCRIPT_ANALYSIS>>(
&self,
fontface: Param0,
fontemsize: f32,
scriptanalysis: Param2,
textlength: u32,
glyphcount: u32,
maxglyphcount: u32,
clustermap: *const u16,
glyphindices: *const u16,
glyphadvances: *const f32,
justifiedglyphadvances: *const f32,
justifiedglyphoffsets: *const DWRITE_GLYPH_OFFSET,
glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
actualglyphcount: *mut u32,
modifiedclustermap: *mut u16,
modifiedglyphindices: *mut u16,
modifiedglyphadvances: *mut f32,
modifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(
::core::mem::transmute_copy(self),
fontface.into_param().abi(),
::core::mem::transmute(fontemsize),
scriptanalysis.into_param().abi(),
::core::mem::transmute(textlength),
::core::mem::transmute(glyphcount),
::core::mem::transmute(maxglyphcount),
::core::mem::transmute(clustermap),
::core::mem::transmute(glyphindices),
::core::mem::transmute(glyphadvances),
::core::mem::transmute(justifiedglyphadvances),
::core::mem::transmute(justifiedglyphoffsets),
::core::mem::transmute(glyphproperties),
::core::mem::transmute(actualglyphcount),
::core::mem::transmute(modifiedclustermap),
::core::mem::transmute(modifiedglyphindices),
::core::mem::transmute(modifiedglyphadvances),
::core::mem::transmute(modifiedglyphoffsets),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGlyphOrientationTransform2<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, glyphorientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, issideways: Param1, originx: f32, originy: f32) -> ::windows::core::Result<DWRITE_MATRIX> {
let mut result__: <DWRITE_MATRIX as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphorientationangle), issideways.into_param().abi(), ::core::mem::transmute(originx), ::core::mem::transmute(originy), &mut result__).from_abi::<DWRITE_MATRIX>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTypographicFeatures<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param1: ::windows::core::IntoParam<'a, DWRITE_SCRIPT_ANALYSIS>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontface: Param0, scriptanalysis: Param1, localename: Param2, maxtagcount: u32, actualtagcount: *mut u32, tags: *mut DWRITE_FONT_FEATURE_TAG) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), fontface.into_param().abi(), scriptanalysis.into_param().abi(), localename.into_param().abi(), ::core::mem::transmute(maxtagcount), ::core::mem::transmute(actualtagcount), ::core::mem::transmute(tags)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CheckTypographicFeature<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFace>, Param1: ::windows::core::IntoParam<'a, DWRITE_SCRIPT_ANALYSIS>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, fontface: Param0, scriptanalysis: Param1, localename: Param2, featuretag: DWRITE_FONT_FEATURE_TAG, glyphcount: u32, glyphindices: *const u16, featureapplies: *mut u8) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), fontface.into_param().abi(), scriptanalysis.into_param().abi(), localename.into_param().abi(), ::core::mem::transmute(featuretag), ::core::mem::transmute(glyphcount), ::core::mem::transmute(glyphindices), ::core::mem::transmute(featureapplies)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextAnalyzer2 {
type Vtable = IDWriteTextAnalyzer2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x553a9ff3_5693_4df7_b52b_74806f7f2eb9);
}
impl ::core::convert::From<IDWriteTextAnalyzer2> for ::windows::core::IUnknown {
fn from(value: IDWriteTextAnalyzer2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextAnalyzer2> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextAnalyzer2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextAnalyzer2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextAnalyzer2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextAnalyzer2> for IDWriteTextAnalyzer1 {
fn from(value: IDWriteTextAnalyzer2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextAnalyzer2> for IDWriteTextAnalyzer1 {
fn from(value: &IDWriteTextAnalyzer2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextAnalyzer1> for IDWriteTextAnalyzer2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextAnalyzer1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextAnalyzer1> for &IDWriteTextAnalyzer2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextAnalyzer1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextAnalyzer2> for IDWriteTextAnalyzer {
fn from(value: IDWriteTextAnalyzer2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextAnalyzer2> for IDWriteTextAnalyzer {
fn from(value: &IDWriteTextAnalyzer2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextAnalyzer> for IDWriteTextAnalyzer2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextAnalyzer> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextAnalyzer> for &IDWriteTextAnalyzer2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextAnalyzer> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextAnalyzer2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
textstring: super::super::Foundation::PWSTR,
textlength: u32,
fontface: ::windows::core::RawPtr,
issideways: super::super::Foundation::BOOL,
isrighttoleft: super::super::Foundation::BOOL,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: super::super::Foundation::PWSTR,
numbersubstitution: ::windows::core::RawPtr,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
maxglyphcount: u32,
clustermap: *mut u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
glyphindices: *mut u16,
glyphprops: *mut DWRITE_SHAPING_GLYPH_PROPERTIES,
actualglyphcount: *mut u32,
) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
textstring: super::super::Foundation::PWSTR,
clustermap: *const u16,
textprops: *mut DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: ::windows::core::RawPtr,
fontemsize: f32,
issideways: super::super::Foundation::BOOL,
isrighttoleft: super::super::Foundation::BOOL,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: super::super::Foundation::PWSTR,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
textstring: super::super::Foundation::PWSTR,
clustermap: *const u16,
textprops: *const DWRITE_SHAPING_TEXT_PROPERTIES,
textlength: u32,
glyphindices: *const u16,
glyphprops: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
glyphcount: u32,
fontface: ::windows::core::RawPtr,
fontemsize: f32,
pixelsperdip: f32,
transform: *const DWRITE_MATRIX,
usegdinatural: super::super::Foundation::BOOL,
issideways: super::super::Foundation::BOOL,
isrighttoleft: super::super::Foundation::BOOL,
scriptanalysis: *const DWRITE_SCRIPT_ANALYSIS,
localename: super::super::Foundation::PWSTR,
features: *const *const DWRITE_TYPOGRAPHIC_FEATURES,
featurerangelengths: *const u32,
featureranges: u32,
glyphadvances: *mut f32,
glyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textlength: u32, glyphcount: u32, clustermap: *const u16, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, modifiedglyphadvances: *mut f32, modifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, baseline: DWRITE_BASELINE, isvertical: super::super::Foundation::BOOL, issimulationallowed: super::super::Foundation::BOOL, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, localename: super::super::Foundation::PWSTR, baselinecoordinate: *mut i32, exists: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, analysissource: ::windows::core::RawPtr, textposition: u32, textlength: u32, analysissink: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphorientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, issideways: super::super::Foundation::BOOL, transform: *mut DWRITE_MATRIX) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, scriptproperties: *mut DWRITE_SCRIPT_PROPERTIES) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textstring: super::super::Foundation::PWSTR, textlength: u32, fontface: ::windows::core::RawPtr, istextsimple: *mut super::super::Foundation::BOOL, textlengthread: *mut u32, glyphindices: *mut u16) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, fontemsize: f32, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, textlength: u32, glyphcount: u32, textstring: super::super::Foundation::PWSTR, clustermap: *const u16, glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES, justificationopportunities: *mut DWRITE_JUSTIFICATION_OPPORTUNITY) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linewidth: f32, glyphcount: u32, justificationopportunities: *const DWRITE_JUSTIFICATION_OPPORTUNITY, glyphadvances: *const f32, glyphoffsets: *const DWRITE_GLYPH_OFFSET, justifiedglyphadvances: *mut f32, justifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
fontface: ::windows::core::RawPtr,
fontemsize: f32,
scriptanalysis: DWRITE_SCRIPT_ANALYSIS,
textlength: u32,
glyphcount: u32,
maxglyphcount: u32,
clustermap: *const u16,
glyphindices: *const u16,
glyphadvances: *const f32,
justifiedglyphadvances: *const f32,
justifiedglyphoffsets: *const DWRITE_GLYPH_OFFSET,
glyphproperties: *const DWRITE_SHAPING_GLYPH_PROPERTIES,
actualglyphcount: *mut u32,
modifiedclustermap: *mut u16,
modifiedglyphindices: *mut u16,
modifiedglyphadvances: *mut f32,
modifiedglyphoffsets: *mut DWRITE_GLYPH_OFFSET,
) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphorientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, issideways: super::super::Foundation::BOOL, originx: f32, originy: f32, transform: *mut DWRITE_MATRIX) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, localename: super::super::Foundation::PWSTR, maxtagcount: u32, actualtagcount: *mut u32, tags: *mut DWRITE_FONT_FEATURE_TAG) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontface: ::windows::core::RawPtr, scriptanalysis: DWRITE_SCRIPT_ANALYSIS, localename: super::super::Foundation::PWSTR, featuretag: DWRITE_FONT_FEATURE_TAG, glyphcount: u32, glyphindices: *const u16, featureapplies: *mut u8) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextFormat(pub ::windows::core::IUnknown);
impl IDWriteTextFormat {
pub unsafe fn SetTextAlignment(&self, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textalignment)).ok()
}
pub unsafe fn SetParagraphAlignment(&self, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(paragraphalignment)).ok()
}
pub unsafe fn SetWordWrapping(&self, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(wordwrapping)).ok()
}
pub unsafe fn SetReadingDirection(&self, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(readingdirection)).ok()
}
pub unsafe fn SetFlowDirection(&self, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(flowdirection)).ok()
}
pub unsafe fn SetIncrementalTabStop(&self, incrementaltabstop: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(incrementaltabstop)).ok()
}
pub unsafe fn SetTrimming<'a, Param1: ::windows::core::IntoParam<'a, IDWriteInlineObject>>(&self, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), trimmingsign.into_param().abi()).ok()
}
pub unsafe fn SetLineSpacing(&self, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetTextAlignment(&self) -> DWRITE_TEXT_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetParagraphAlignment(&self) -> DWRITE_PARAGRAPH_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetWordWrapping(&self) -> DWRITE_WORD_WRAPPING {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetReadingDirection(&self) -> DWRITE_READING_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFlowDirection(&self) -> DWRITE_FLOW_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetIncrementalTabStop(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetTrimming(&self, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::core::option::Option<IDWriteInlineObject>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), ::core::mem::transmute(trimmingsign)).ok()
}
pub unsafe fn GetLineSpacing(&self, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontFamilyNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName(&self, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn GetFontWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSize(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName(&self, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(localename), ::core::mem::transmute(namesize)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextFormat {
type Vtable = IDWriteTextFormat_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x9c906818_31d7_4fd3_a151_7c5e225db55a);
}
impl ::core::convert::From<IDWriteTextFormat> for ::windows::core::IUnknown {
fn from(value: IDWriteTextFormat) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextFormat> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextFormat) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextFormat {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextFormat {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextFormat_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, incrementaltabstop: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_TEXT_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PARAGRAPH_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_WORD_WRAPPING,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_READING_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FLOW_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextFormat1(pub ::windows::core::IUnknown);
impl IDWriteTextFormat1 {
pub unsafe fn SetTextAlignment(&self, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textalignment)).ok()
}
pub unsafe fn SetParagraphAlignment(&self, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(paragraphalignment)).ok()
}
pub unsafe fn SetWordWrapping(&self, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(wordwrapping)).ok()
}
pub unsafe fn SetReadingDirection(&self, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(readingdirection)).ok()
}
pub unsafe fn SetFlowDirection(&self, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(flowdirection)).ok()
}
pub unsafe fn SetIncrementalTabStop(&self, incrementaltabstop: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(incrementaltabstop)).ok()
}
pub unsafe fn SetTrimming<'a, Param1: ::windows::core::IntoParam<'a, IDWriteInlineObject>>(&self, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), trimmingsign.into_param().abi()).ok()
}
pub unsafe fn SetLineSpacing(&self, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetTextAlignment(&self) -> DWRITE_TEXT_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetParagraphAlignment(&self) -> DWRITE_PARAGRAPH_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetWordWrapping(&self) -> DWRITE_WORD_WRAPPING {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetReadingDirection(&self) -> DWRITE_READING_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFlowDirection(&self) -> DWRITE_FLOW_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetIncrementalTabStop(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetTrimming(&self, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::core::option::Option<IDWriteInlineObject>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), ::core::mem::transmute(trimmingsign)).ok()
}
pub unsafe fn GetLineSpacing(&self, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontFamilyNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName(&self, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn GetFontWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSize(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName(&self, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(localename), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn SetVerticalGlyphOrientation(&self, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphorientation)).ok()
}
pub unsafe fn GetVerticalGlyphOrientation(&self) -> DWRITE_VERTICAL_GLYPH_ORIENTATION {
::core::mem::transmute((::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLastLineWrapping<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, islastlinewrappingenabled: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), islastlinewrappingenabled.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLastLineWrapping(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetOpticalAlignment(&self, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), ::core::mem::transmute(opticalalignment)).ok()
}
pub unsafe fn GetOpticalAlignment(&self) -> DWRITE_OPTICAL_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetFontFallback<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFallback>>(&self, fontfallback: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), fontfallback.into_param().abi()).ok()
}
pub unsafe fn GetFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteTextFormat1 {
type Vtable = IDWriteTextFormat1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x5f174b49_0d8b_4cfb_8bca_f1cce9d06c67);
}
impl ::core::convert::From<IDWriteTextFormat1> for ::windows::core::IUnknown {
fn from(value: IDWriteTextFormat1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextFormat1> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextFormat1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextFormat1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextFormat1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextFormat1> for IDWriteTextFormat {
fn from(value: IDWriteTextFormat1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextFormat1> for IDWriteTextFormat {
fn from(value: &IDWriteTextFormat1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for IDWriteTextFormat1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for &IDWriteTextFormat1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextFormat1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, incrementaltabstop: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_TEXT_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PARAGRAPH_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_WORD_WRAPPING,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_READING_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FLOW_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_VERTICAL_GLYPH_ORIENTATION,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, islastlinewrappingenabled: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_OPTICAL_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextFormat2(pub ::windows::core::IUnknown);
impl IDWriteTextFormat2 {
pub unsafe fn SetTextAlignment(&self, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textalignment)).ok()
}
pub unsafe fn SetParagraphAlignment(&self, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(paragraphalignment)).ok()
}
pub unsafe fn SetWordWrapping(&self, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(wordwrapping)).ok()
}
pub unsafe fn SetReadingDirection(&self, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(readingdirection)).ok()
}
pub unsafe fn SetFlowDirection(&self, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(flowdirection)).ok()
}
pub unsafe fn SetIncrementalTabStop(&self, incrementaltabstop: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(incrementaltabstop)).ok()
}
pub unsafe fn SetTrimming<'a, Param1: ::windows::core::IntoParam<'a, IDWriteInlineObject>>(&self, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), trimmingsign.into_param().abi()).ok()
}
pub unsafe fn SetLineSpacing(&self, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetTextAlignment(&self) -> DWRITE_TEXT_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetParagraphAlignment(&self) -> DWRITE_PARAGRAPH_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetWordWrapping(&self) -> DWRITE_WORD_WRAPPING {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetReadingDirection(&self) -> DWRITE_READING_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFlowDirection(&self) -> DWRITE_FLOW_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetIncrementalTabStop(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetTrimming(&self, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::core::option::Option<IDWriteInlineObject>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), ::core::mem::transmute(trimmingsign)).ok()
}
pub unsafe fn GetLineSpacing(&self, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontFamilyNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName(&self, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn GetFontWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSize(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName(&self, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(localename), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn SetVerticalGlyphOrientation(&self, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphorientation)).ok()
}
pub unsafe fn GetVerticalGlyphOrientation(&self) -> DWRITE_VERTICAL_GLYPH_ORIENTATION {
::core::mem::transmute((::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLastLineWrapping<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, islastlinewrappingenabled: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), islastlinewrappingenabled.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLastLineWrapping(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetOpticalAlignment(&self, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), ::core::mem::transmute(opticalalignment)).ok()
}
pub unsafe fn GetOpticalAlignment(&self) -> DWRITE_OPTICAL_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetFontFallback<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFallback>>(&self, fontfallback: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), fontfallback.into_param().abi()).ok()
}
pub unsafe fn GetFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
pub unsafe fn SetLineSpacing2(&self, linespacingoptions: *const DWRITE_LINE_SPACING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingoptions)).ok()
}
pub unsafe fn GetLineSpacing2(&self) -> ::windows::core::Result<DWRITE_LINE_SPACING> {
let mut result__: <DWRITE_LINE_SPACING as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_LINE_SPACING>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteTextFormat2 {
type Vtable = IDWriteTextFormat2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xf67e0edd_9e3d_4ecc_8c32_4183253dfe70);
}
impl ::core::convert::From<IDWriteTextFormat2> for ::windows::core::IUnknown {
fn from(value: IDWriteTextFormat2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextFormat2> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextFormat2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextFormat2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextFormat2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextFormat2> for IDWriteTextFormat1 {
fn from(value: IDWriteTextFormat2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextFormat2> for IDWriteTextFormat1 {
fn from(value: &IDWriteTextFormat2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat1> for IDWriteTextFormat2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat1> for &IDWriteTextFormat2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextFormat2> for IDWriteTextFormat {
fn from(value: IDWriteTextFormat2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextFormat2> for IDWriteTextFormat {
fn from(value: &IDWriteTextFormat2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for IDWriteTextFormat2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for &IDWriteTextFormat2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextFormat2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, incrementaltabstop: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_TEXT_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PARAGRAPH_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_WORD_WRAPPING,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_READING_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FLOW_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_VERTICAL_GLYPH_ORIENTATION,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, islastlinewrappingenabled: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_OPTICAL_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingoptions: *const DWRITE_LINE_SPACING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingoptions: *mut DWRITE_LINE_SPACING) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextFormat3(pub ::windows::core::IUnknown);
impl IDWriteTextFormat3 {
pub unsafe fn SetTextAlignment(&self, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textalignment)).ok()
}
pub unsafe fn SetParagraphAlignment(&self, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(paragraphalignment)).ok()
}
pub unsafe fn SetWordWrapping(&self, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(wordwrapping)).ok()
}
pub unsafe fn SetReadingDirection(&self, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(readingdirection)).ok()
}
pub unsafe fn SetFlowDirection(&self, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(flowdirection)).ok()
}
pub unsafe fn SetIncrementalTabStop(&self, incrementaltabstop: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(incrementaltabstop)).ok()
}
pub unsafe fn SetTrimming<'a, Param1: ::windows::core::IntoParam<'a, IDWriteInlineObject>>(&self, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), trimmingsign.into_param().abi()).ok()
}
pub unsafe fn SetLineSpacing(&self, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetTextAlignment(&self) -> DWRITE_TEXT_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetParagraphAlignment(&self) -> DWRITE_PARAGRAPH_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetWordWrapping(&self) -> DWRITE_WORD_WRAPPING {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetReadingDirection(&self) -> DWRITE_READING_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFlowDirection(&self) -> DWRITE_FLOW_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetIncrementalTabStop(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetTrimming(&self, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::core::option::Option<IDWriteInlineObject>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), ::core::mem::transmute(trimmingsign)).ok()
}
pub unsafe fn GetLineSpacing(&self, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontFamilyNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName(&self, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn GetFontWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSize(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName(&self, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(localename), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn SetVerticalGlyphOrientation(&self, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphorientation)).ok()
}
pub unsafe fn GetVerticalGlyphOrientation(&self) -> DWRITE_VERTICAL_GLYPH_ORIENTATION {
::core::mem::transmute((::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLastLineWrapping<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, islastlinewrappingenabled: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), islastlinewrappingenabled.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLastLineWrapping(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetOpticalAlignment(&self, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), ::core::mem::transmute(opticalalignment)).ok()
}
pub unsafe fn GetOpticalAlignment(&self) -> DWRITE_OPTICAL_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetFontFallback<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFallback>>(&self, fontfallback: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), fontfallback.into_param().abi()).ok()
}
pub unsafe fn GetFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
pub unsafe fn SetLineSpacing2(&self, linespacingoptions: *const DWRITE_LINE_SPACING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingoptions)).ok()
}
pub unsafe fn GetLineSpacing2(&self) -> ::windows::core::Result<DWRITE_LINE_SPACING> {
let mut result__: <DWRITE_LINE_SPACING as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_LINE_SPACING>(result__)
}
pub unsafe fn SetFontAxisValues(&self, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount)).ok()
}
pub unsafe fn GetFontAxisValueCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontAxisValues(&self, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount)).ok()
}
pub unsafe fn GetAutomaticFontAxes(&self) -> DWRITE_AUTOMATIC_FONT_AXES {
::core::mem::transmute((::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetAutomaticFontAxes(&self, automaticfontaxes: DWRITE_AUTOMATIC_FONT_AXES) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), ::core::mem::transmute(automaticfontaxes)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextFormat3 {
type Vtable = IDWriteTextFormat3_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6d3b5641_e550_430d_a85b_b7bf48a93427);
}
impl ::core::convert::From<IDWriteTextFormat3> for ::windows::core::IUnknown {
fn from(value: IDWriteTextFormat3) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextFormat3> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextFormat3) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextFormat3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextFormat3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextFormat3> for IDWriteTextFormat2 {
fn from(value: IDWriteTextFormat3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextFormat3> for IDWriteTextFormat2 {
fn from(value: &IDWriteTextFormat3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat2> for IDWriteTextFormat3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat2> for &IDWriteTextFormat3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextFormat3> for IDWriteTextFormat1 {
fn from(value: IDWriteTextFormat3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextFormat3> for IDWriteTextFormat1 {
fn from(value: &IDWriteTextFormat3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat1> for IDWriteTextFormat3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat1> for &IDWriteTextFormat3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextFormat3> for IDWriteTextFormat {
fn from(value: IDWriteTextFormat3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextFormat3> for IDWriteTextFormat {
fn from(value: &IDWriteTextFormat3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for IDWriteTextFormat3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for &IDWriteTextFormat3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextFormat3_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, incrementaltabstop: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_TEXT_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PARAGRAPH_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_WORD_WRAPPING,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_READING_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FLOW_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_VERTICAL_GLYPH_ORIENTATION,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, islastlinewrappingenabled: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_OPTICAL_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingoptions: *const DWRITE_LINE_SPACING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingoptions: *mut DWRITE_LINE_SPACING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_AUTOMATIC_FONT_AXES,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, automaticfontaxes: DWRITE_AUTOMATIC_FONT_AXES) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextLayout(pub ::windows::core::IUnknown);
impl IDWriteTextLayout {
pub unsafe fn SetTextAlignment(&self, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textalignment)).ok()
}
pub unsafe fn SetParagraphAlignment(&self, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(paragraphalignment)).ok()
}
pub unsafe fn SetWordWrapping(&self, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(wordwrapping)).ok()
}
pub unsafe fn SetReadingDirection(&self, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(readingdirection)).ok()
}
pub unsafe fn SetFlowDirection(&self, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(flowdirection)).ok()
}
pub unsafe fn SetIncrementalTabStop(&self, incrementaltabstop: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(incrementaltabstop)).ok()
}
pub unsafe fn SetTrimming<'a, Param1: ::windows::core::IntoParam<'a, IDWriteInlineObject>>(&self, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), trimmingsign.into_param().abi()).ok()
}
pub unsafe fn SetLineSpacing(&self, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetTextAlignment(&self) -> DWRITE_TEXT_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetParagraphAlignment(&self) -> DWRITE_PARAGRAPH_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetWordWrapping(&self) -> DWRITE_WORD_WRAPPING {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetReadingDirection(&self) -> DWRITE_READING_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFlowDirection(&self) -> DWRITE_FLOW_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetIncrementalTabStop(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetTrimming(&self, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::core::option::Option<IDWriteInlineObject>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), ::core::mem::transmute(trimmingsign)).ok()
}
pub unsafe fn GetLineSpacing(&self, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontFamilyNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName(&self, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn GetFontWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSize(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName(&self, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(localename), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn SetMaxWidth(&self, maxwidth: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxwidth)).ok()
}
pub unsafe fn SetMaxHeight(&self, maxheight: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxheight)).ok()
}
pub unsafe fn SetFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontcollection: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), fontcollection.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetFontFamilyName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontfamilyname: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontWeight<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontweight: DWRITE_FONT_WEIGHT, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontweight), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontStyle<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontstyle: DWRITE_FONT_STYLE, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontstyle), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontStretch<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontstretch: DWRITE_FONT_STRETCH, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontstretch), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontSize<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontsize: f32, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontsize), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetUnderline<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, hasunderline: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), hasunderline.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetStrikethrough<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, hasstrikethrough: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), hasstrikethrough.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetDrawingEffect<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, drawingeffect: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), drawingeffect.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetInlineObject<'a, Param0: ::windows::core::IntoParam<'a, IDWriteInlineObject>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, inlineobject: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), inlineobject.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetTypography<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTypography>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, typography: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), typography.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLocaleName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, localename: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), localename.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn GetMaxWidth(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMaxHeight(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontCollection2(&self, currentposition: u32, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).44)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontcollection), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontFamilyNameLength2(&self, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(namelength), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName2(&self, currentposition: u32, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontWeight2(&self, currentposition: u32, fontweight: *mut DWRITE_FONT_WEIGHT, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontweight), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontStyle2(&self, currentposition: u32, fontstyle: *mut DWRITE_FONT_STYLE, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontstyle), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontStretch2(&self, currentposition: u32, fontstretch: *mut DWRITE_FONT_STRETCH, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontstretch), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontSize2(&self, currentposition: u32, fontsize: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontsize), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetUnderline(&self, currentposition: u32, hasunderline: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(hasunderline), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetStrikethrough(&self, currentposition: u32, hasstrikethrough: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(hasstrikethrough), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetDrawingEffect(&self, currentposition: u32, drawingeffect: *mut ::core::option::Option<::windows::core::IUnknown>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).53)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(drawingeffect), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetInlineObject(&self, currentposition: u32, inlineobject: *mut ::core::option::Option<IDWriteInlineObject>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).54)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(inlineobject), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetTypography(&self, currentposition: u32, typography: *mut ::core::option::Option<IDWriteTypography>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).55)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(typography), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetLocaleNameLength2(&self, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).56)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(namelength), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName2(&self, currentposition: u32, localename: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).57)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(localename), ::core::mem::transmute(namesize), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn Draw<'a, Param1: ::windows::core::IntoParam<'a, IDWriteTextRenderer>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, renderer: Param1, originx: f32, originy: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).58)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), renderer.into_param().abi(), ::core::mem::transmute(originx), ::core::mem::transmute(originy)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLineMetrics(&self, linemetrics: *mut DWRITE_LINE_METRICS, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).59)(::core::mem::transmute_copy(self), ::core::mem::transmute(linemetrics), ::core::mem::transmute(maxlinecount), ::core::mem::transmute(actuallinecount)).ok()
}
pub unsafe fn GetMetrics(&self) -> ::windows::core::Result<DWRITE_TEXT_METRICS> {
let mut result__: <DWRITE_TEXT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).60)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_TEXT_METRICS>(result__)
}
pub unsafe fn GetOverhangMetrics(&self) -> ::windows::core::Result<DWRITE_OVERHANG_METRICS> {
let mut result__: <DWRITE_OVERHANG_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).61)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_OVERHANG_METRICS>(result__)
}
pub unsafe fn GetClusterMetrics(&self, clustermetrics: *mut DWRITE_CLUSTER_METRICS, maxclustercount: u32, actualclustercount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).62)(::core::mem::transmute_copy(self), ::core::mem::transmute(clustermetrics), ::core::mem::transmute(maxclustercount), ::core::mem::transmute(actualclustercount)).ok()
}
pub unsafe fn DetermineMinWidth(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).63)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestPoint(&self, pointx: f32, pointy: f32, istrailinghit: *mut super::super::Foundation::BOOL, isinside: *mut super::super::Foundation::BOOL, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).64)(::core::mem::transmute_copy(self), ::core::mem::transmute(pointx), ::core::mem::transmute(pointy), ::core::mem::transmute(istrailinghit), ::core::mem::transmute(isinside), ::core::mem::transmute(hittestmetrics)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestTextPosition<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, textposition: u32, istrailinghit: Param1, pointx: *mut f32, pointy: *mut f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).65)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), istrailinghit.into_param().abi(), ::core::mem::transmute(pointx), ::core::mem::transmute(pointy), ::core::mem::transmute(hittestmetrics)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestTextRange(&self, textposition: u32, textlength: u32, originx: f32, originy: f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS, maxhittestmetricscount: u32, actualhittestmetricscount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).66)(
::core::mem::transmute_copy(self),
::core::mem::transmute(textposition),
::core::mem::transmute(textlength),
::core::mem::transmute(originx),
::core::mem::transmute(originy),
::core::mem::transmute(hittestmetrics),
::core::mem::transmute(maxhittestmetricscount),
::core::mem::transmute(actualhittestmetricscount),
)
.ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextLayout {
type Vtable = IDWriteTextLayout_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x53737037_6d14_410b_9bfe_0b182bb70961);
}
impl ::core::convert::From<IDWriteTextLayout> for ::windows::core::IUnknown {
fn from(value: IDWriteTextLayout) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextLayout> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextLayout) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextLayout {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextLayout {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextLayout> for IDWriteTextFormat {
fn from(value: IDWriteTextLayout) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout> for IDWriteTextFormat {
fn from(value: &IDWriteTextLayout) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for IDWriteTextLayout {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for &IDWriteTextLayout {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextLayout_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, incrementaltabstop: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_TEXT_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PARAGRAPH_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_WORD_WRAPPING,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_READING_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FLOW_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxwidth: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxheight: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontstyle: DWRITE_FONT_STYLE, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontstretch: DWRITE_FONT_STRETCH, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsize: f32, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasunderline: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasstrikethrough: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, drawingeffect: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, inlineobject: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontcollection: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontweight: *mut DWRITE_FONT_WEIGHT, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontstyle: *mut DWRITE_FONT_STYLE, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontstretch: *mut DWRITE_FONT_STRETCH, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontsize: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, hasunderline: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, hasstrikethrough: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, drawingeffect: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, inlineobject: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, typography: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, localename: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, renderer: ::windows::core::RawPtr, originx: f32, originy: f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linemetrics: *mut DWRITE_LINE_METRICS, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textmetrics: *mut DWRITE_TEXT_METRICS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, overhangs: *mut DWRITE_OVERHANG_METRICS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clustermetrics: *mut DWRITE_CLUSTER_METRICS, maxclustercount: u32, actualclustercount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, minwidth: *mut f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pointx: f32, pointy: f32, istrailinghit: *mut super::super::Foundation::BOOL, isinside: *mut super::super::Foundation::BOOL, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, istrailinghit: super::super::Foundation::BOOL, pointx: *mut f32, pointy: *mut f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, originx: f32, originy: f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS, maxhittestmetricscount: u32, actualhittestmetricscount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextLayout1(pub ::windows::core::IUnknown);
impl IDWriteTextLayout1 {
pub unsafe fn SetTextAlignment(&self, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textalignment)).ok()
}
pub unsafe fn SetParagraphAlignment(&self, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(paragraphalignment)).ok()
}
pub unsafe fn SetWordWrapping(&self, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(wordwrapping)).ok()
}
pub unsafe fn SetReadingDirection(&self, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(readingdirection)).ok()
}
pub unsafe fn SetFlowDirection(&self, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(flowdirection)).ok()
}
pub unsafe fn SetIncrementalTabStop(&self, incrementaltabstop: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(incrementaltabstop)).ok()
}
pub unsafe fn SetTrimming<'a, Param1: ::windows::core::IntoParam<'a, IDWriteInlineObject>>(&self, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), trimmingsign.into_param().abi()).ok()
}
pub unsafe fn SetLineSpacing(&self, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetTextAlignment(&self) -> DWRITE_TEXT_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetParagraphAlignment(&self) -> DWRITE_PARAGRAPH_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetWordWrapping(&self) -> DWRITE_WORD_WRAPPING {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetReadingDirection(&self) -> DWRITE_READING_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFlowDirection(&self) -> DWRITE_FLOW_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetIncrementalTabStop(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetTrimming(&self, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::core::option::Option<IDWriteInlineObject>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), ::core::mem::transmute(trimmingsign)).ok()
}
pub unsafe fn GetLineSpacing(&self, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontFamilyNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName(&self, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn GetFontWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSize(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName(&self, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(localename), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn SetMaxWidth(&self, maxwidth: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxwidth)).ok()
}
pub unsafe fn SetMaxHeight(&self, maxheight: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxheight)).ok()
}
pub unsafe fn SetFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontcollection: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), fontcollection.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetFontFamilyName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontfamilyname: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontWeight<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontweight: DWRITE_FONT_WEIGHT, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontweight), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontStyle<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontstyle: DWRITE_FONT_STYLE, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontstyle), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontStretch<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontstretch: DWRITE_FONT_STRETCH, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontstretch), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontSize<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontsize: f32, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontsize), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetUnderline<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, hasunderline: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), hasunderline.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetStrikethrough<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, hasstrikethrough: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), hasstrikethrough.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetDrawingEffect<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, drawingeffect: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), drawingeffect.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetInlineObject<'a, Param0: ::windows::core::IntoParam<'a, IDWriteInlineObject>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, inlineobject: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), inlineobject.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetTypography<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTypography>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, typography: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), typography.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLocaleName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, localename: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), localename.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn GetMaxWidth(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMaxHeight(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontCollection2(&self, currentposition: u32, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).44)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontcollection), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontFamilyNameLength2(&self, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(namelength), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName2(&self, currentposition: u32, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontWeight2(&self, currentposition: u32, fontweight: *mut DWRITE_FONT_WEIGHT, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontweight), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontStyle2(&self, currentposition: u32, fontstyle: *mut DWRITE_FONT_STYLE, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontstyle), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontStretch2(&self, currentposition: u32, fontstretch: *mut DWRITE_FONT_STRETCH, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontstretch), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontSize2(&self, currentposition: u32, fontsize: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontsize), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetUnderline(&self, currentposition: u32, hasunderline: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(hasunderline), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetStrikethrough(&self, currentposition: u32, hasstrikethrough: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(hasstrikethrough), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetDrawingEffect(&self, currentposition: u32, drawingeffect: *mut ::core::option::Option<::windows::core::IUnknown>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).53)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(drawingeffect), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetInlineObject(&self, currentposition: u32, inlineobject: *mut ::core::option::Option<IDWriteInlineObject>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).54)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(inlineobject), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetTypography(&self, currentposition: u32, typography: *mut ::core::option::Option<IDWriteTypography>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).55)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(typography), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetLocaleNameLength2(&self, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).56)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(namelength), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName2(&self, currentposition: u32, localename: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).57)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(localename), ::core::mem::transmute(namesize), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn Draw<'a, Param1: ::windows::core::IntoParam<'a, IDWriteTextRenderer>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, renderer: Param1, originx: f32, originy: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).58)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), renderer.into_param().abi(), ::core::mem::transmute(originx), ::core::mem::transmute(originy)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLineMetrics(&self, linemetrics: *mut DWRITE_LINE_METRICS, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).59)(::core::mem::transmute_copy(self), ::core::mem::transmute(linemetrics), ::core::mem::transmute(maxlinecount), ::core::mem::transmute(actuallinecount)).ok()
}
pub unsafe fn GetMetrics(&self) -> ::windows::core::Result<DWRITE_TEXT_METRICS> {
let mut result__: <DWRITE_TEXT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).60)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_TEXT_METRICS>(result__)
}
pub unsafe fn GetOverhangMetrics(&self) -> ::windows::core::Result<DWRITE_OVERHANG_METRICS> {
let mut result__: <DWRITE_OVERHANG_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).61)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_OVERHANG_METRICS>(result__)
}
pub unsafe fn GetClusterMetrics(&self, clustermetrics: *mut DWRITE_CLUSTER_METRICS, maxclustercount: u32, actualclustercount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).62)(::core::mem::transmute_copy(self), ::core::mem::transmute(clustermetrics), ::core::mem::transmute(maxclustercount), ::core::mem::transmute(actualclustercount)).ok()
}
pub unsafe fn DetermineMinWidth(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).63)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestPoint(&self, pointx: f32, pointy: f32, istrailinghit: *mut super::super::Foundation::BOOL, isinside: *mut super::super::Foundation::BOOL, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).64)(::core::mem::transmute_copy(self), ::core::mem::transmute(pointx), ::core::mem::transmute(pointy), ::core::mem::transmute(istrailinghit), ::core::mem::transmute(isinside), ::core::mem::transmute(hittestmetrics)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestTextPosition<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, textposition: u32, istrailinghit: Param1, pointx: *mut f32, pointy: *mut f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).65)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), istrailinghit.into_param().abi(), ::core::mem::transmute(pointx), ::core::mem::transmute(pointy), ::core::mem::transmute(hittestmetrics)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestTextRange(&self, textposition: u32, textlength: u32, originx: f32, originy: f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS, maxhittestmetricscount: u32, actualhittestmetricscount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).66)(
::core::mem::transmute_copy(self),
::core::mem::transmute(textposition),
::core::mem::transmute(textlength),
::core::mem::transmute(originx),
::core::mem::transmute(originy),
::core::mem::transmute(hittestmetrics),
::core::mem::transmute(maxhittestmetricscount),
::core::mem::transmute(actualhittestmetricscount),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetPairKerning<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, ispairkerningenabled: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).67)(::core::mem::transmute_copy(self), ispairkerningenabled.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPairKerning(&self, currentposition: u32, ispairkerningenabled: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).68)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(ispairkerningenabled), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn SetCharacterSpacing<'a, Param3: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textrange: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).69)(::core::mem::transmute_copy(self), ::core::mem::transmute(leadingspacing), ::core::mem::transmute(trailingspacing), ::core::mem::transmute(minimumadvancewidth), textrange.into_param().abi()).ok()
}
pub unsafe fn GetCharacterSpacing(&self, currentposition: u32, leadingspacing: *mut f32, trailingspacing: *mut f32, minimumadvancewidth: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).70)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(leadingspacing), ::core::mem::transmute(trailingspacing), ::core::mem::transmute(minimumadvancewidth), ::core::mem::transmute(textrange)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextLayout1 {
type Vtable = IDWriteTextLayout1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x9064d822_80a7_465c_a986_df65f78b8feb);
}
impl ::core::convert::From<IDWriteTextLayout1> for ::windows::core::IUnknown {
fn from(value: IDWriteTextLayout1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextLayout1> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextLayout1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextLayout1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextLayout1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextLayout1> for IDWriteTextLayout {
fn from(value: IDWriteTextLayout1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout1> for IDWriteTextLayout {
fn from(value: &IDWriteTextLayout1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout> for IDWriteTextLayout1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout> for &IDWriteTextLayout1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextLayout1> for IDWriteTextFormat {
fn from(value: IDWriteTextLayout1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout1> for IDWriteTextFormat {
fn from(value: &IDWriteTextLayout1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for IDWriteTextLayout1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for &IDWriteTextLayout1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextLayout1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, incrementaltabstop: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_TEXT_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PARAGRAPH_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_WORD_WRAPPING,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_READING_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FLOW_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxwidth: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxheight: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontstyle: DWRITE_FONT_STYLE, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontstretch: DWRITE_FONT_STRETCH, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsize: f32, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasunderline: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasstrikethrough: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, drawingeffect: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, inlineobject: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontcollection: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontweight: *mut DWRITE_FONT_WEIGHT, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontstyle: *mut DWRITE_FONT_STYLE, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontstretch: *mut DWRITE_FONT_STRETCH, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontsize: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, hasunderline: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, hasstrikethrough: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, drawingeffect: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, inlineobject: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, typography: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, localename: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, renderer: ::windows::core::RawPtr, originx: f32, originy: f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linemetrics: *mut DWRITE_LINE_METRICS, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textmetrics: *mut DWRITE_TEXT_METRICS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, overhangs: *mut DWRITE_OVERHANG_METRICS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clustermetrics: *mut DWRITE_CLUSTER_METRICS, maxclustercount: u32, actualclustercount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, minwidth: *mut f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pointx: f32, pointy: f32, istrailinghit: *mut super::super::Foundation::BOOL, isinside: *mut super::super::Foundation::BOOL, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, istrailinghit: super::super::Foundation::BOOL, pointx: *mut f32, pointy: *mut f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, originx: f32, originy: f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS, maxhittestmetricscount: u32, actualhittestmetricscount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ispairkerningenabled: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, ispairkerningenabled: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, leadingspacing: *mut f32, trailingspacing: *mut f32, minimumadvancewidth: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextLayout2(pub ::windows::core::IUnknown);
impl IDWriteTextLayout2 {
pub unsafe fn SetTextAlignment(&self, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textalignment)).ok()
}
pub unsafe fn SetParagraphAlignment(&self, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(paragraphalignment)).ok()
}
pub unsafe fn SetWordWrapping(&self, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(wordwrapping)).ok()
}
pub unsafe fn SetReadingDirection(&self, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(readingdirection)).ok()
}
pub unsafe fn SetFlowDirection(&self, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(flowdirection)).ok()
}
pub unsafe fn SetIncrementalTabStop(&self, incrementaltabstop: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(incrementaltabstop)).ok()
}
pub unsafe fn SetTrimming<'a, Param1: ::windows::core::IntoParam<'a, IDWriteInlineObject>>(&self, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), trimmingsign.into_param().abi()).ok()
}
pub unsafe fn SetLineSpacing(&self, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetTextAlignment(&self) -> DWRITE_TEXT_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetParagraphAlignment(&self) -> DWRITE_PARAGRAPH_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetWordWrapping(&self) -> DWRITE_WORD_WRAPPING {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetReadingDirection(&self) -> DWRITE_READING_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFlowDirection(&self) -> DWRITE_FLOW_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetIncrementalTabStop(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetTrimming(&self, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::core::option::Option<IDWriteInlineObject>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), ::core::mem::transmute(trimmingsign)).ok()
}
pub unsafe fn GetLineSpacing(&self, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontFamilyNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName(&self, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn GetFontWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSize(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName(&self, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(localename), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn SetMaxWidth(&self, maxwidth: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxwidth)).ok()
}
pub unsafe fn SetMaxHeight(&self, maxheight: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxheight)).ok()
}
pub unsafe fn SetFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontcollection: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), fontcollection.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetFontFamilyName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontfamilyname: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontWeight<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontweight: DWRITE_FONT_WEIGHT, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontweight), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontStyle<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontstyle: DWRITE_FONT_STYLE, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontstyle), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontStretch<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontstretch: DWRITE_FONT_STRETCH, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontstretch), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontSize<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontsize: f32, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontsize), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetUnderline<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, hasunderline: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), hasunderline.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetStrikethrough<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, hasstrikethrough: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), hasstrikethrough.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetDrawingEffect<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, drawingeffect: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), drawingeffect.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetInlineObject<'a, Param0: ::windows::core::IntoParam<'a, IDWriteInlineObject>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, inlineobject: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), inlineobject.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetTypography<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTypography>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, typography: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), typography.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLocaleName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, localename: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), localename.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn GetMaxWidth(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMaxHeight(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontCollection2(&self, currentposition: u32, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).44)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontcollection), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontFamilyNameLength2(&self, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(namelength), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName2(&self, currentposition: u32, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontWeight2(&self, currentposition: u32, fontweight: *mut DWRITE_FONT_WEIGHT, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontweight), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontStyle2(&self, currentposition: u32, fontstyle: *mut DWRITE_FONT_STYLE, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontstyle), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontStretch2(&self, currentposition: u32, fontstretch: *mut DWRITE_FONT_STRETCH, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontstretch), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontSize2(&self, currentposition: u32, fontsize: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontsize), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetUnderline(&self, currentposition: u32, hasunderline: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(hasunderline), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetStrikethrough(&self, currentposition: u32, hasstrikethrough: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(hasstrikethrough), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetDrawingEffect(&self, currentposition: u32, drawingeffect: *mut ::core::option::Option<::windows::core::IUnknown>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).53)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(drawingeffect), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetInlineObject(&self, currentposition: u32, inlineobject: *mut ::core::option::Option<IDWriteInlineObject>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).54)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(inlineobject), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetTypography(&self, currentposition: u32, typography: *mut ::core::option::Option<IDWriteTypography>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).55)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(typography), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetLocaleNameLength2(&self, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).56)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(namelength), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName2(&self, currentposition: u32, localename: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).57)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(localename), ::core::mem::transmute(namesize), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn Draw<'a, Param1: ::windows::core::IntoParam<'a, IDWriteTextRenderer>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, renderer: Param1, originx: f32, originy: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).58)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), renderer.into_param().abi(), ::core::mem::transmute(originx), ::core::mem::transmute(originy)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLineMetrics(&self, linemetrics: *mut DWRITE_LINE_METRICS, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).59)(::core::mem::transmute_copy(self), ::core::mem::transmute(linemetrics), ::core::mem::transmute(maxlinecount), ::core::mem::transmute(actuallinecount)).ok()
}
pub unsafe fn GetMetrics(&self) -> ::windows::core::Result<DWRITE_TEXT_METRICS> {
let mut result__: <DWRITE_TEXT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).60)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_TEXT_METRICS>(result__)
}
pub unsafe fn GetOverhangMetrics(&self) -> ::windows::core::Result<DWRITE_OVERHANG_METRICS> {
let mut result__: <DWRITE_OVERHANG_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).61)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_OVERHANG_METRICS>(result__)
}
pub unsafe fn GetClusterMetrics(&self, clustermetrics: *mut DWRITE_CLUSTER_METRICS, maxclustercount: u32, actualclustercount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).62)(::core::mem::transmute_copy(self), ::core::mem::transmute(clustermetrics), ::core::mem::transmute(maxclustercount), ::core::mem::transmute(actualclustercount)).ok()
}
pub unsafe fn DetermineMinWidth(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).63)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestPoint(&self, pointx: f32, pointy: f32, istrailinghit: *mut super::super::Foundation::BOOL, isinside: *mut super::super::Foundation::BOOL, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).64)(::core::mem::transmute_copy(self), ::core::mem::transmute(pointx), ::core::mem::transmute(pointy), ::core::mem::transmute(istrailinghit), ::core::mem::transmute(isinside), ::core::mem::transmute(hittestmetrics)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestTextPosition<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, textposition: u32, istrailinghit: Param1, pointx: *mut f32, pointy: *mut f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).65)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), istrailinghit.into_param().abi(), ::core::mem::transmute(pointx), ::core::mem::transmute(pointy), ::core::mem::transmute(hittestmetrics)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestTextRange(&self, textposition: u32, textlength: u32, originx: f32, originy: f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS, maxhittestmetricscount: u32, actualhittestmetricscount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).66)(
::core::mem::transmute_copy(self),
::core::mem::transmute(textposition),
::core::mem::transmute(textlength),
::core::mem::transmute(originx),
::core::mem::transmute(originy),
::core::mem::transmute(hittestmetrics),
::core::mem::transmute(maxhittestmetricscount),
::core::mem::transmute(actualhittestmetricscount),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetPairKerning<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, ispairkerningenabled: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).67)(::core::mem::transmute_copy(self), ispairkerningenabled.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPairKerning(&self, currentposition: u32, ispairkerningenabled: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).68)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(ispairkerningenabled), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn SetCharacterSpacing<'a, Param3: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textrange: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).69)(::core::mem::transmute_copy(self), ::core::mem::transmute(leadingspacing), ::core::mem::transmute(trailingspacing), ::core::mem::transmute(minimumadvancewidth), textrange.into_param().abi()).ok()
}
pub unsafe fn GetCharacterSpacing(&self, currentposition: u32, leadingspacing: *mut f32, trailingspacing: *mut f32, minimumadvancewidth: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).70)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(leadingspacing), ::core::mem::transmute(trailingspacing), ::core::mem::transmute(minimumadvancewidth), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetMetrics2(&self) -> ::windows::core::Result<DWRITE_TEXT_METRICS1> {
let mut result__: <DWRITE_TEXT_METRICS1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).71)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_TEXT_METRICS1>(result__)
}
pub unsafe fn SetVerticalGlyphOrientation(&self, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).72)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphorientation)).ok()
}
pub unsafe fn GetVerticalGlyphOrientation(&self) -> DWRITE_VERTICAL_GLYPH_ORIENTATION {
::core::mem::transmute((::windows::core::Interface::vtable(self).73)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLastLineWrapping<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, islastlinewrappingenabled: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).74)(::core::mem::transmute_copy(self), islastlinewrappingenabled.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLastLineWrapping(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).75)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetOpticalAlignment(&self, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).76)(::core::mem::transmute_copy(self), ::core::mem::transmute(opticalalignment)).ok()
}
pub unsafe fn GetOpticalAlignment(&self) -> DWRITE_OPTICAL_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).77)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetFontFallback<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFallback>>(&self, fontfallback: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).78)(::core::mem::transmute_copy(self), fontfallback.into_param().abi()).ok()
}
pub unsafe fn GetFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).79)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteTextLayout2 {
type Vtable = IDWriteTextLayout2_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x1093c18f_8d5e_43f0_b064_0917311b525e);
}
impl ::core::convert::From<IDWriteTextLayout2> for ::windows::core::IUnknown {
fn from(value: IDWriteTextLayout2) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextLayout2> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextLayout2) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextLayout2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextLayout2 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextLayout2> for IDWriteTextLayout1 {
fn from(value: IDWriteTextLayout2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout2> for IDWriteTextLayout1 {
fn from(value: &IDWriteTextLayout2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout1> for IDWriteTextLayout2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout1> for &IDWriteTextLayout2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextLayout2> for IDWriteTextLayout {
fn from(value: IDWriteTextLayout2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout2> for IDWriteTextLayout {
fn from(value: &IDWriteTextLayout2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout> for IDWriteTextLayout2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout> for &IDWriteTextLayout2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextLayout2> for IDWriteTextFormat {
fn from(value: IDWriteTextLayout2) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout2> for IDWriteTextFormat {
fn from(value: &IDWriteTextLayout2) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for IDWriteTextLayout2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for &IDWriteTextLayout2 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextLayout2_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, incrementaltabstop: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_TEXT_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PARAGRAPH_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_WORD_WRAPPING,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_READING_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FLOW_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxwidth: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxheight: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontstyle: DWRITE_FONT_STYLE, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontstretch: DWRITE_FONT_STRETCH, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsize: f32, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasunderline: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasstrikethrough: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, drawingeffect: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, inlineobject: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontcollection: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontweight: *mut DWRITE_FONT_WEIGHT, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontstyle: *mut DWRITE_FONT_STYLE, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontstretch: *mut DWRITE_FONT_STRETCH, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontsize: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, hasunderline: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, hasstrikethrough: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, drawingeffect: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, inlineobject: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, typography: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, localename: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, renderer: ::windows::core::RawPtr, originx: f32, originy: f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linemetrics: *mut DWRITE_LINE_METRICS, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textmetrics: *mut DWRITE_TEXT_METRICS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, overhangs: *mut DWRITE_OVERHANG_METRICS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clustermetrics: *mut DWRITE_CLUSTER_METRICS, maxclustercount: u32, actualclustercount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, minwidth: *mut f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pointx: f32, pointy: f32, istrailinghit: *mut super::super::Foundation::BOOL, isinside: *mut super::super::Foundation::BOOL, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, istrailinghit: super::super::Foundation::BOOL, pointx: *mut f32, pointy: *mut f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, originx: f32, originy: f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS, maxhittestmetricscount: u32, actualhittestmetricscount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ispairkerningenabled: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, ispairkerningenabled: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, leadingspacing: *mut f32, trailingspacing: *mut f32, minimumadvancewidth: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textmetrics: *mut DWRITE_TEXT_METRICS1) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_VERTICAL_GLYPH_ORIENTATION,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, islastlinewrappingenabled: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_OPTICAL_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextLayout3(pub ::windows::core::IUnknown);
impl IDWriteTextLayout3 {
pub unsafe fn SetTextAlignment(&self, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textalignment)).ok()
}
pub unsafe fn SetParagraphAlignment(&self, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(paragraphalignment)).ok()
}
pub unsafe fn SetWordWrapping(&self, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(wordwrapping)).ok()
}
pub unsafe fn SetReadingDirection(&self, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(readingdirection)).ok()
}
pub unsafe fn SetFlowDirection(&self, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(flowdirection)).ok()
}
pub unsafe fn SetIncrementalTabStop(&self, incrementaltabstop: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(incrementaltabstop)).ok()
}
pub unsafe fn SetTrimming<'a, Param1: ::windows::core::IntoParam<'a, IDWriteInlineObject>>(&self, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), trimmingsign.into_param().abi()).ok()
}
pub unsafe fn SetLineSpacing(&self, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetTextAlignment(&self) -> DWRITE_TEXT_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetParagraphAlignment(&self) -> DWRITE_PARAGRAPH_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetWordWrapping(&self) -> DWRITE_WORD_WRAPPING {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetReadingDirection(&self) -> DWRITE_READING_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFlowDirection(&self) -> DWRITE_FLOW_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetIncrementalTabStop(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetTrimming(&self, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::core::option::Option<IDWriteInlineObject>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), ::core::mem::transmute(trimmingsign)).ok()
}
pub unsafe fn GetLineSpacing(&self, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontFamilyNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName(&self, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn GetFontWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSize(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName(&self, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(localename), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn SetMaxWidth(&self, maxwidth: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxwidth)).ok()
}
pub unsafe fn SetMaxHeight(&self, maxheight: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxheight)).ok()
}
pub unsafe fn SetFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontcollection: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), fontcollection.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetFontFamilyName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontfamilyname: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontWeight<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontweight: DWRITE_FONT_WEIGHT, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontweight), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontStyle<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontstyle: DWRITE_FONT_STYLE, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontstyle), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontStretch<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontstretch: DWRITE_FONT_STRETCH, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontstretch), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontSize<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontsize: f32, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontsize), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetUnderline<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, hasunderline: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), hasunderline.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetStrikethrough<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, hasstrikethrough: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), hasstrikethrough.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetDrawingEffect<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, drawingeffect: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), drawingeffect.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetInlineObject<'a, Param0: ::windows::core::IntoParam<'a, IDWriteInlineObject>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, inlineobject: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), inlineobject.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetTypography<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTypography>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, typography: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), typography.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLocaleName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, localename: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), localename.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn GetMaxWidth(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMaxHeight(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontCollection2(&self, currentposition: u32, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).44)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontcollection), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontFamilyNameLength2(&self, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(namelength), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName2(&self, currentposition: u32, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontWeight2(&self, currentposition: u32, fontweight: *mut DWRITE_FONT_WEIGHT, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontweight), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontStyle2(&self, currentposition: u32, fontstyle: *mut DWRITE_FONT_STYLE, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontstyle), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontStretch2(&self, currentposition: u32, fontstretch: *mut DWRITE_FONT_STRETCH, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontstretch), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontSize2(&self, currentposition: u32, fontsize: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontsize), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetUnderline(&self, currentposition: u32, hasunderline: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(hasunderline), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetStrikethrough(&self, currentposition: u32, hasstrikethrough: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(hasstrikethrough), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetDrawingEffect(&self, currentposition: u32, drawingeffect: *mut ::core::option::Option<::windows::core::IUnknown>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).53)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(drawingeffect), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetInlineObject(&self, currentposition: u32, inlineobject: *mut ::core::option::Option<IDWriteInlineObject>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).54)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(inlineobject), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetTypography(&self, currentposition: u32, typography: *mut ::core::option::Option<IDWriteTypography>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).55)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(typography), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetLocaleNameLength2(&self, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).56)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(namelength), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName2(&self, currentposition: u32, localename: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).57)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(localename), ::core::mem::transmute(namesize), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn Draw<'a, Param1: ::windows::core::IntoParam<'a, IDWriteTextRenderer>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, renderer: Param1, originx: f32, originy: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).58)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), renderer.into_param().abi(), ::core::mem::transmute(originx), ::core::mem::transmute(originy)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLineMetrics(&self, linemetrics: *mut DWRITE_LINE_METRICS, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).59)(::core::mem::transmute_copy(self), ::core::mem::transmute(linemetrics), ::core::mem::transmute(maxlinecount), ::core::mem::transmute(actuallinecount)).ok()
}
pub unsafe fn GetMetrics(&self) -> ::windows::core::Result<DWRITE_TEXT_METRICS> {
let mut result__: <DWRITE_TEXT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).60)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_TEXT_METRICS>(result__)
}
pub unsafe fn GetOverhangMetrics(&self) -> ::windows::core::Result<DWRITE_OVERHANG_METRICS> {
let mut result__: <DWRITE_OVERHANG_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).61)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_OVERHANG_METRICS>(result__)
}
pub unsafe fn GetClusterMetrics(&self, clustermetrics: *mut DWRITE_CLUSTER_METRICS, maxclustercount: u32, actualclustercount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).62)(::core::mem::transmute_copy(self), ::core::mem::transmute(clustermetrics), ::core::mem::transmute(maxclustercount), ::core::mem::transmute(actualclustercount)).ok()
}
pub unsafe fn DetermineMinWidth(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).63)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestPoint(&self, pointx: f32, pointy: f32, istrailinghit: *mut super::super::Foundation::BOOL, isinside: *mut super::super::Foundation::BOOL, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).64)(::core::mem::transmute_copy(self), ::core::mem::transmute(pointx), ::core::mem::transmute(pointy), ::core::mem::transmute(istrailinghit), ::core::mem::transmute(isinside), ::core::mem::transmute(hittestmetrics)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestTextPosition<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, textposition: u32, istrailinghit: Param1, pointx: *mut f32, pointy: *mut f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).65)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), istrailinghit.into_param().abi(), ::core::mem::transmute(pointx), ::core::mem::transmute(pointy), ::core::mem::transmute(hittestmetrics)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestTextRange(&self, textposition: u32, textlength: u32, originx: f32, originy: f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS, maxhittestmetricscount: u32, actualhittestmetricscount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).66)(
::core::mem::transmute_copy(self),
::core::mem::transmute(textposition),
::core::mem::transmute(textlength),
::core::mem::transmute(originx),
::core::mem::transmute(originy),
::core::mem::transmute(hittestmetrics),
::core::mem::transmute(maxhittestmetricscount),
::core::mem::transmute(actualhittestmetricscount),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetPairKerning<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, ispairkerningenabled: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).67)(::core::mem::transmute_copy(self), ispairkerningenabled.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPairKerning(&self, currentposition: u32, ispairkerningenabled: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).68)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(ispairkerningenabled), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn SetCharacterSpacing<'a, Param3: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textrange: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).69)(::core::mem::transmute_copy(self), ::core::mem::transmute(leadingspacing), ::core::mem::transmute(trailingspacing), ::core::mem::transmute(minimumadvancewidth), textrange.into_param().abi()).ok()
}
pub unsafe fn GetCharacterSpacing(&self, currentposition: u32, leadingspacing: *mut f32, trailingspacing: *mut f32, minimumadvancewidth: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).70)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(leadingspacing), ::core::mem::transmute(trailingspacing), ::core::mem::transmute(minimumadvancewidth), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetMetrics2(&self) -> ::windows::core::Result<DWRITE_TEXT_METRICS1> {
let mut result__: <DWRITE_TEXT_METRICS1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).71)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_TEXT_METRICS1>(result__)
}
pub unsafe fn SetVerticalGlyphOrientation(&self, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).72)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphorientation)).ok()
}
pub unsafe fn GetVerticalGlyphOrientation(&self) -> DWRITE_VERTICAL_GLYPH_ORIENTATION {
::core::mem::transmute((::windows::core::Interface::vtable(self).73)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLastLineWrapping<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, islastlinewrappingenabled: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).74)(::core::mem::transmute_copy(self), islastlinewrappingenabled.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLastLineWrapping(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).75)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetOpticalAlignment(&self, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).76)(::core::mem::transmute_copy(self), ::core::mem::transmute(opticalalignment)).ok()
}
pub unsafe fn GetOpticalAlignment(&self) -> DWRITE_OPTICAL_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).77)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetFontFallback<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFallback>>(&self, fontfallback: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).78)(::core::mem::transmute_copy(self), fontfallback.into_param().abi()).ok()
}
pub unsafe fn GetFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).79)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
pub unsafe fn InvalidateLayout(&self) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).80)(::core::mem::transmute_copy(self)).ok()
}
pub unsafe fn SetLineSpacing2(&self, linespacingoptions: *const DWRITE_LINE_SPACING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).81)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingoptions)).ok()
}
pub unsafe fn GetLineSpacing2(&self) -> ::windows::core::Result<DWRITE_LINE_SPACING> {
let mut result__: <DWRITE_LINE_SPACING as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).82)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_LINE_SPACING>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLineMetrics2(&self, linemetrics: *mut DWRITE_LINE_METRICS1, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).83)(::core::mem::transmute_copy(self), ::core::mem::transmute(linemetrics), ::core::mem::transmute(maxlinecount), ::core::mem::transmute(actuallinecount)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextLayout3 {
type Vtable = IDWriteTextLayout3_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x07ddcd52_020e_4de8_ac33_6c953d83f92d);
}
impl ::core::convert::From<IDWriteTextLayout3> for ::windows::core::IUnknown {
fn from(value: IDWriteTextLayout3) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextLayout3> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextLayout3) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextLayout3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextLayout3 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextLayout3> for IDWriteTextLayout2 {
fn from(value: IDWriteTextLayout3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout3> for IDWriteTextLayout2 {
fn from(value: &IDWriteTextLayout3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout2> for IDWriteTextLayout3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout2> for &IDWriteTextLayout3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextLayout3> for IDWriteTextLayout1 {
fn from(value: IDWriteTextLayout3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout3> for IDWriteTextLayout1 {
fn from(value: &IDWriteTextLayout3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout1> for IDWriteTextLayout3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout1> for &IDWriteTextLayout3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextLayout3> for IDWriteTextLayout {
fn from(value: IDWriteTextLayout3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout3> for IDWriteTextLayout {
fn from(value: &IDWriteTextLayout3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout> for IDWriteTextLayout3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout> for &IDWriteTextLayout3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextLayout3> for IDWriteTextFormat {
fn from(value: IDWriteTextLayout3) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout3> for IDWriteTextFormat {
fn from(value: &IDWriteTextLayout3) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for IDWriteTextLayout3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for &IDWriteTextLayout3 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextLayout3_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, incrementaltabstop: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_TEXT_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PARAGRAPH_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_WORD_WRAPPING,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_READING_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FLOW_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxwidth: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxheight: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontstyle: DWRITE_FONT_STYLE, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontstretch: DWRITE_FONT_STRETCH, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsize: f32, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasunderline: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasstrikethrough: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, drawingeffect: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, inlineobject: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontcollection: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontweight: *mut DWRITE_FONT_WEIGHT, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontstyle: *mut DWRITE_FONT_STYLE, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontstretch: *mut DWRITE_FONT_STRETCH, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontsize: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, hasunderline: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, hasstrikethrough: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, drawingeffect: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, inlineobject: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, typography: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, localename: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, renderer: ::windows::core::RawPtr, originx: f32, originy: f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linemetrics: *mut DWRITE_LINE_METRICS, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textmetrics: *mut DWRITE_TEXT_METRICS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, overhangs: *mut DWRITE_OVERHANG_METRICS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clustermetrics: *mut DWRITE_CLUSTER_METRICS, maxclustercount: u32, actualclustercount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, minwidth: *mut f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pointx: f32, pointy: f32, istrailinghit: *mut super::super::Foundation::BOOL, isinside: *mut super::super::Foundation::BOOL, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, istrailinghit: super::super::Foundation::BOOL, pointx: *mut f32, pointy: *mut f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, originx: f32, originy: f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS, maxhittestmetricscount: u32, actualhittestmetricscount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ispairkerningenabled: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, ispairkerningenabled: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, leadingspacing: *mut f32, trailingspacing: *mut f32, minimumadvancewidth: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textmetrics: *mut DWRITE_TEXT_METRICS1) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_VERTICAL_GLYPH_ORIENTATION,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, islastlinewrappingenabled: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_OPTICAL_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingoptions: *const DWRITE_LINE_SPACING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingoptions: *mut DWRITE_LINE_SPACING) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linemetrics: *mut DWRITE_LINE_METRICS1, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextLayout4(pub ::windows::core::IUnknown);
impl IDWriteTextLayout4 {
pub unsafe fn SetTextAlignment(&self, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(textalignment)).ok()
}
pub unsafe fn SetParagraphAlignment(&self, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(paragraphalignment)).ok()
}
pub unsafe fn SetWordWrapping(&self, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(wordwrapping)).ok()
}
pub unsafe fn SetReadingDirection(&self, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(readingdirection)).ok()
}
pub unsafe fn SetFlowDirection(&self, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(flowdirection)).ok()
}
pub unsafe fn SetIncrementalTabStop(&self, incrementaltabstop: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(incrementaltabstop)).ok()
}
pub unsafe fn SetTrimming<'a, Param1: ::windows::core::IntoParam<'a, IDWriteInlineObject>>(&self, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), trimmingsign.into_param().abi()).ok()
}
pub unsafe fn SetLineSpacing(&self, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetTextAlignment(&self) -> DWRITE_TEXT_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetParagraphAlignment(&self) -> DWRITE_PARAGRAPH_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetWordWrapping(&self) -> DWRITE_WORD_WRAPPING {
::core::mem::transmute((::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetReadingDirection(&self) -> DWRITE_READING_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFlowDirection(&self) -> DWRITE_FLOW_DIRECTION {
::core::mem::transmute((::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetIncrementalTabStop(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetTrimming(&self, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::core::option::Option<IDWriteInlineObject>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(trimmingoptions), ::core::mem::transmute(trimmingsign)).ok()
}
pub unsafe fn GetLineSpacing(&self, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingmethod), ::core::mem::transmute(linespacing), ::core::mem::transmute(baseline)).ok()
}
pub unsafe fn GetFontCollection(&self) -> ::windows::core::Result<IDWriteFontCollection> {
let mut result__: <IDWriteFontCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontCollection>(result__)
}
pub unsafe fn GetFontFamilyNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName(&self, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn GetFontWeight(&self) -> DWRITE_FONT_WEIGHT {
::core::mem::transmute((::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStyle(&self) -> DWRITE_FONT_STYLE {
::core::mem::transmute((::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontStretch(&self) -> DWRITE_FONT_STRETCH {
::core::mem::transmute((::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontSize(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetLocaleNameLength(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName(&self, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(localename), ::core::mem::transmute(namesize)).ok()
}
pub unsafe fn SetMaxWidth(&self, maxwidth: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxwidth)).ok()
}
pub unsafe fn SetMaxHeight(&self, maxheight: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), ::core::mem::transmute(maxheight)).ok()
}
pub unsafe fn SetFontCollection<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontCollection>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontcollection: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), fontcollection.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetFontFamilyName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontfamilyname: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), fontfamilyname.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontWeight<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontweight: DWRITE_FONT_WEIGHT, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontweight), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontStyle<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontstyle: DWRITE_FONT_STYLE, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontstyle), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontStretch<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontstretch: DWRITE_FONT_STRETCH, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontstretch), textrange.into_param().abi()).ok()
}
pub unsafe fn SetFontSize<'a, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontsize: f32, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontsize), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetUnderline<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, hasunderline: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), hasunderline.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetStrikethrough<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, hasstrikethrough: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), hasstrikethrough.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetDrawingEffect<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, drawingeffect: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), drawingeffect.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetInlineObject<'a, Param0: ::windows::core::IntoParam<'a, IDWriteInlineObject>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, inlineobject: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), inlineobject.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn SetTypography<'a, Param0: ::windows::core::IntoParam<'a, IDWriteTypography>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, typography: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), typography.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLocaleName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, localename: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), localename.into_param().abi(), textrange.into_param().abi()).ok()
}
pub unsafe fn GetMaxWidth(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetMaxHeight(&self) -> f32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontCollection2(&self, currentposition: u32, fontcollection: *mut ::core::option::Option<IDWriteFontCollection>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).44)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontcollection), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontFamilyNameLength2(&self, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(namelength), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFontFamilyName2(&self, currentposition: u32, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontfamilyname), ::core::mem::transmute(namesize), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontWeight2(&self, currentposition: u32, fontweight: *mut DWRITE_FONT_WEIGHT, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontweight), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontStyle2(&self, currentposition: u32, fontstyle: *mut DWRITE_FONT_STYLE, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontstyle), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontStretch2(&self, currentposition: u32, fontstretch: *mut DWRITE_FONT_STRETCH, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontstretch), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetFontSize2(&self, currentposition: u32, fontsize: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontsize), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetUnderline(&self, currentposition: u32, hasunderline: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(hasunderline), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetStrikethrough(&self, currentposition: u32, hasstrikethrough: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(hasstrikethrough), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetDrawingEffect(&self, currentposition: u32, drawingeffect: *mut ::core::option::Option<::windows::core::IUnknown>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).53)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(drawingeffect), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetInlineObject(&self, currentposition: u32, inlineobject: *mut ::core::option::Option<IDWriteInlineObject>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).54)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(inlineobject), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetTypography(&self, currentposition: u32, typography: *mut ::core::option::Option<IDWriteTypography>, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).55)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(typography), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetLocaleNameLength2(&self, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).56)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(namelength), ::core::mem::transmute(textrange)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLocaleName2(&self, currentposition: u32, localename: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).57)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(localename), ::core::mem::transmute(namesize), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn Draw<'a, Param1: ::windows::core::IntoParam<'a, IDWriteTextRenderer>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, renderer: Param1, originx: f32, originy: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).58)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), renderer.into_param().abi(), ::core::mem::transmute(originx), ::core::mem::transmute(originy)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLineMetrics(&self, linemetrics: *mut DWRITE_LINE_METRICS, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).59)(::core::mem::transmute_copy(self), ::core::mem::transmute(linemetrics), ::core::mem::transmute(maxlinecount), ::core::mem::transmute(actuallinecount)).ok()
}
pub unsafe fn GetMetrics(&self) -> ::windows::core::Result<DWRITE_TEXT_METRICS> {
let mut result__: <DWRITE_TEXT_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).60)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_TEXT_METRICS>(result__)
}
pub unsafe fn GetOverhangMetrics(&self) -> ::windows::core::Result<DWRITE_OVERHANG_METRICS> {
let mut result__: <DWRITE_OVERHANG_METRICS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).61)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_OVERHANG_METRICS>(result__)
}
pub unsafe fn GetClusterMetrics(&self, clustermetrics: *mut DWRITE_CLUSTER_METRICS, maxclustercount: u32, actualclustercount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).62)(::core::mem::transmute_copy(self), ::core::mem::transmute(clustermetrics), ::core::mem::transmute(maxclustercount), ::core::mem::transmute(actualclustercount)).ok()
}
pub unsafe fn DetermineMinWidth(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).63)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestPoint(&self, pointx: f32, pointy: f32, istrailinghit: *mut super::super::Foundation::BOOL, isinside: *mut super::super::Foundation::BOOL, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).64)(::core::mem::transmute_copy(self), ::core::mem::transmute(pointx), ::core::mem::transmute(pointy), ::core::mem::transmute(istrailinghit), ::core::mem::transmute(isinside), ::core::mem::transmute(hittestmetrics)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestTextPosition<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, textposition: u32, istrailinghit: Param1, pointx: *mut f32, pointy: *mut f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).65)(::core::mem::transmute_copy(self), ::core::mem::transmute(textposition), istrailinghit.into_param().abi(), ::core::mem::transmute(pointx), ::core::mem::transmute(pointy), ::core::mem::transmute(hittestmetrics)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HitTestTextRange(&self, textposition: u32, textlength: u32, originx: f32, originy: f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS, maxhittestmetricscount: u32, actualhittestmetricscount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).66)(
::core::mem::transmute_copy(self),
::core::mem::transmute(textposition),
::core::mem::transmute(textlength),
::core::mem::transmute(originx),
::core::mem::transmute(originy),
::core::mem::transmute(hittestmetrics),
::core::mem::transmute(maxhittestmetricscount),
::core::mem::transmute(actualhittestmetricscount),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetPairKerning<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param1: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, ispairkerningenabled: Param0, textrange: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).67)(::core::mem::transmute_copy(self), ispairkerningenabled.into_param().abi(), textrange.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetPairKerning(&self, currentposition: u32, ispairkerningenabled: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).68)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(ispairkerningenabled), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn SetCharacterSpacing<'a, Param3: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textrange: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).69)(::core::mem::transmute_copy(self), ::core::mem::transmute(leadingspacing), ::core::mem::transmute(trailingspacing), ::core::mem::transmute(minimumadvancewidth), textrange.into_param().abi()).ok()
}
pub unsafe fn GetCharacterSpacing(&self, currentposition: u32, leadingspacing: *mut f32, trailingspacing: *mut f32, minimumadvancewidth: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).70)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(leadingspacing), ::core::mem::transmute(trailingspacing), ::core::mem::transmute(minimumadvancewidth), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetMetrics2(&self) -> ::windows::core::Result<DWRITE_TEXT_METRICS1> {
let mut result__: <DWRITE_TEXT_METRICS1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).71)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_TEXT_METRICS1>(result__)
}
pub unsafe fn SetVerticalGlyphOrientation(&self, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).72)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphorientation)).ok()
}
pub unsafe fn GetVerticalGlyphOrientation(&self) -> DWRITE_VERTICAL_GLYPH_ORIENTATION {
::core::mem::transmute((::windows::core::Interface::vtable(self).73)(::core::mem::transmute_copy(self)))
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLastLineWrapping<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, islastlinewrappingenabled: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).74)(::core::mem::transmute_copy(self), islastlinewrappingenabled.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLastLineWrapping(&self) -> super::super::Foundation::BOOL {
::core::mem::transmute((::windows::core::Interface::vtable(self).75)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetOpticalAlignment(&self, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).76)(::core::mem::transmute_copy(self), ::core::mem::transmute(opticalalignment)).ok()
}
pub unsafe fn GetOpticalAlignment(&self) -> DWRITE_OPTICAL_ALIGNMENT {
::core::mem::transmute((::windows::core::Interface::vtable(self).77)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetFontFallback<'a, Param0: ::windows::core::IntoParam<'a, IDWriteFontFallback>>(&self, fontfallback: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).78)(::core::mem::transmute_copy(self), fontfallback.into_param().abi()).ok()
}
pub unsafe fn GetFontFallback(&self) -> ::windows::core::Result<IDWriteFontFallback> {
let mut result__: <IDWriteFontFallback as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).79)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IDWriteFontFallback>(result__)
}
pub unsafe fn InvalidateLayout(&self) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).80)(::core::mem::transmute_copy(self)).ok()
}
pub unsafe fn SetLineSpacing2(&self, linespacingoptions: *const DWRITE_LINE_SPACING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).81)(::core::mem::transmute_copy(self), ::core::mem::transmute(linespacingoptions)).ok()
}
pub unsafe fn GetLineSpacing2(&self) -> ::windows::core::Result<DWRITE_LINE_SPACING> {
let mut result__: <DWRITE_LINE_SPACING as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).82)(::core::mem::transmute_copy(self), &mut result__).from_abi::<DWRITE_LINE_SPACING>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLineMetrics2(&self, linemetrics: *mut DWRITE_LINE_METRICS1, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).83)(::core::mem::transmute_copy(self), ::core::mem::transmute(linemetrics), ::core::mem::transmute(maxlinecount), ::core::mem::transmute(actuallinecount)).ok()
}
pub unsafe fn SetFontAxisValues<'a, Param2: ::windows::core::IntoParam<'a, DWRITE_TEXT_RANGE>>(&self, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, textrange: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).84)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), textrange.into_param().abi()).ok()
}
pub unsafe fn GetFontAxisValueCount(&self, currentposition: u32) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).85)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition)))
}
pub unsafe fn GetFontAxisValues(&self, currentposition: u32, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).86)(::core::mem::transmute_copy(self), ::core::mem::transmute(currentposition), ::core::mem::transmute(fontaxisvalues), ::core::mem::transmute(fontaxisvaluecount), ::core::mem::transmute(textrange)).ok()
}
pub unsafe fn GetAutomaticFontAxes(&self) -> DWRITE_AUTOMATIC_FONT_AXES {
::core::mem::transmute((::windows::core::Interface::vtable(self).87)(::core::mem::transmute_copy(self)))
}
pub unsafe fn SetAutomaticFontAxes(&self, automaticfontaxes: DWRITE_AUTOMATIC_FONT_AXES) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).88)(::core::mem::transmute_copy(self), ::core::mem::transmute(automaticfontaxes)).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextLayout4 {
type Vtable = IDWriteTextLayout4_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x05a9bf42_223f_4441_b5fb_8263685f55e9);
}
impl ::core::convert::From<IDWriteTextLayout4> for ::windows::core::IUnknown {
fn from(value: IDWriteTextLayout4) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextLayout4> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextLayout4) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextLayout4> for IDWriteTextLayout3 {
fn from(value: IDWriteTextLayout4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout4> for IDWriteTextLayout3 {
fn from(value: &IDWriteTextLayout4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout3> for IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout3> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout3> for &IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout3> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextLayout4> for IDWriteTextLayout2 {
fn from(value: IDWriteTextLayout4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout4> for IDWriteTextLayout2 {
fn from(value: &IDWriteTextLayout4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout2> for IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout2> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout2> for &IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout2> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextLayout4> for IDWriteTextLayout1 {
fn from(value: IDWriteTextLayout4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout4> for IDWriteTextLayout1 {
fn from(value: &IDWriteTextLayout4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout1> for IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout1> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout1> for &IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout1> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextLayout4> for IDWriteTextLayout {
fn from(value: IDWriteTextLayout4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout4> for IDWriteTextLayout {
fn from(value: &IDWriteTextLayout4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout> for IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextLayout> for &IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextLayout> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextLayout4> for IDWriteTextFormat {
fn from(value: IDWriteTextLayout4) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextLayout4> for IDWriteTextFormat {
fn from(value: &IDWriteTextLayout4) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextFormat> for &IDWriteTextLayout4 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextFormat> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextLayout4_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textalignment: DWRITE_TEXT_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, paragraphalignment: DWRITE_PARAGRAPH_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, wordwrapping: DWRITE_WORD_WRAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, readingdirection: DWRITE_READING_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flowdirection: DWRITE_FLOW_DIRECTION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, incrementaltabstop: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *const DWRITE_TRIMMING, trimmingsign: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: DWRITE_LINE_SPACING_METHOD, linespacing: f32, baseline: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_TEXT_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_PARAGRAPH_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_WORD_WRAPPING,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_READING_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FLOW_DIRECTION,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, trimmingoptions: *mut DWRITE_TRIMMING, trimmingsign: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingmethod: *mut DWRITE_LINE_SPACING_METHOD, linespacing: *mut f32, baseline: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_WEIGHT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STYLE,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_FONT_STRETCH,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, namesize: u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxwidth: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, maxheight: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontcollection: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfamilyname: super::super::Foundation::PWSTR, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontweight: DWRITE_FONT_WEIGHT, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontstyle: DWRITE_FONT_STYLE, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontstretch: DWRITE_FONT_STRETCH, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontsize: f32, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasunderline: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hasstrikethrough: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, drawingeffect: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, inlineobject: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, typography: ::windows::core::RawPtr, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, localename: super::super::Foundation::PWSTR, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> f32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontcollection: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontfamilyname: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontweight: *mut DWRITE_FONT_WEIGHT, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontstyle: *mut DWRITE_FONT_STYLE, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontstretch: *mut DWRITE_FONT_STRETCH, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontsize: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, hasunderline: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, hasstrikethrough: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, drawingeffect: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, inlineobject: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, typography: *mut ::windows::core::RawPtr, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, namelength: *mut u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, localename: super::super::Foundation::PWSTR, namesize: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, renderer: ::windows::core::RawPtr, originx: f32, originy: f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linemetrics: *mut DWRITE_LINE_METRICS, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textmetrics: *mut DWRITE_TEXT_METRICS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, overhangs: *mut DWRITE_OVERHANG_METRICS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clustermetrics: *mut DWRITE_CLUSTER_METRICS, maxclustercount: u32, actualclustercount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, minwidth: *mut f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pointx: f32, pointy: f32, istrailinghit: *mut super::super::Foundation::BOOL, isinside: *mut super::super::Foundation::BOOL, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, istrailinghit: super::super::Foundation::BOOL, pointx: *mut f32, pointy: *mut f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textposition: u32, textlength: u32, originx: f32, originy: f32, hittestmetrics: *mut DWRITE_HIT_TEST_METRICS, maxhittestmetricscount: u32, actualhittestmetricscount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ispairkerningenabled: super::super::Foundation::BOOL, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, ispairkerningenabled: *mut super::super::Foundation::BOOL, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, leadingspacing: f32, trailingspacing: f32, minimumadvancewidth: f32, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, leadingspacing: *mut f32, trailingspacing: *mut f32, minimumadvancewidth: *mut f32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, textmetrics: *mut DWRITE_TEXT_METRICS1) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphorientation: DWRITE_VERTICAL_GLYPH_ORIENTATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_VERTICAL_GLYPH_ORIENTATION,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, islastlinewrappingenabled: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> super::super::Foundation::BOOL,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opticalalignment: DWRITE_OPTICAL_ALIGNMENT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_OPTICAL_ALIGNMENT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfallback: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingoptions: *const DWRITE_LINE_SPACING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linespacingoptions: *mut DWRITE_LINE_SPACING) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linemetrics: *mut DWRITE_LINE_METRICS1, maxlinecount: u32, actuallinecount: *mut u32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontaxisvalues: *const DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, textrange: DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, currentposition: u32, fontaxisvalues: *mut DWRITE_FONT_AXIS_VALUE, fontaxisvaluecount: u32, textrange: *mut DWRITE_TEXT_RANGE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> DWRITE_AUTOMATIC_FONT_AXES,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, automaticfontaxes: DWRITE_AUTOMATIC_FONT_AXES) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextRenderer(pub ::windows::core::IUnknown);
impl IDWriteTextRenderer {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsPixelSnappingDisabled(&self, clientdrawingcontext: *const ::core::ffi::c_void) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn GetCurrentTransform(&self, clientdrawingcontext: *const ::core::ffi::c_void) -> ::windows::core::Result<DWRITE_MATRIX> {
let mut result__: <DWRITE_MATRIX as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), &mut result__).from_abi::<DWRITE_MATRIX>(result__)
}
pub unsafe fn GetPixelsPerDip(&self, clientdrawingcontext: *const ::core::ffi::c_void) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), &mut result__).from_abi::<f32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawGlyphRun<'a, Param6: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, measuringmode: DWRITE_MEASURING_MODE, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, clientdrawingeffect: Param6) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(
::core::mem::transmute_copy(self),
::core::mem::transmute(clientdrawingcontext),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
::core::mem::transmute(measuringmode),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
clientdrawingeffect.into_param().abi(),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawUnderline<'a, Param4: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, underline: *const DWRITE_UNDERLINE, clientdrawingeffect: Param4) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), ::core::mem::transmute(baselineoriginx), ::core::mem::transmute(baselineoriginy), ::core::mem::transmute(underline), clientdrawingeffect.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawStrikethrough<'a, Param4: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, strikethrough: *const DWRITE_STRIKETHROUGH, clientdrawingeffect: Param4) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), ::core::mem::transmute(baselineoriginx), ::core::mem::transmute(baselineoriginy), ::core::mem::transmute(strikethrough), clientdrawingeffect.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawInlineObject<'a, Param3: ::windows::core::IntoParam<'a, IDWriteInlineObject>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(
&self,
clientdrawingcontext: *const ::core::ffi::c_void,
originx: f32,
originy: f32,
inlineobject: Param3,
issideways: Param4,
isrighttoleft: Param5,
clientdrawingeffect: Param6,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), ::core::mem::transmute(originx), ::core::mem::transmute(originy), inlineobject.into_param().abi(), issideways.into_param().abi(), isrighttoleft.into_param().abi(), clientdrawingeffect.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextRenderer {
type Vtable = IDWriteTextRenderer_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xef8a8135_5cc6_45fe_8825_c5a0724eb819);
}
impl ::core::convert::From<IDWriteTextRenderer> for ::windows::core::IUnknown {
fn from(value: IDWriteTextRenderer) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextRenderer> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextRenderer) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextRenderer {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextRenderer {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextRenderer> for IDWritePixelSnapping {
fn from(value: IDWriteTextRenderer) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextRenderer> for IDWritePixelSnapping {
fn from(value: &IDWriteTextRenderer) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWritePixelSnapping> for IDWriteTextRenderer {
fn into_param(self) -> ::windows::core::Param<'a, IDWritePixelSnapping> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWritePixelSnapping> for &IDWriteTextRenderer {
fn into_param(self) -> ::windows::core::Param<'a, IDWritePixelSnapping> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextRenderer_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, isdisabled: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, transform: *mut DWRITE_MATRIX) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, pixelsperdip: *mut f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, measuringmode: DWRITE_MEASURING_MODE, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, underline: *const DWRITE_UNDERLINE, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, strikethrough: *const DWRITE_STRIKETHROUGH, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, originx: f32, originy: f32, inlineobject: ::windows::core::RawPtr, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTextRenderer1(pub ::windows::core::IUnknown);
impl IDWriteTextRenderer1 {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsPixelSnappingDisabled(&self, clientdrawingcontext: *const ::core::ffi::c_void) -> ::windows::core::Result<super::super::Foundation::BOOL> {
let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn GetCurrentTransform(&self, clientdrawingcontext: *const ::core::ffi::c_void) -> ::windows::core::Result<DWRITE_MATRIX> {
let mut result__: <DWRITE_MATRIX as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), &mut result__).from_abi::<DWRITE_MATRIX>(result__)
}
pub unsafe fn GetPixelsPerDip(&self, clientdrawingcontext: *const ::core::ffi::c_void) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), &mut result__).from_abi::<f32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawGlyphRun<'a, Param6: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, measuringmode: DWRITE_MEASURING_MODE, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, clientdrawingeffect: Param6) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(
::core::mem::transmute_copy(self),
::core::mem::transmute(clientdrawingcontext),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
::core::mem::transmute(measuringmode),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
clientdrawingeffect.into_param().abi(),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawUnderline<'a, Param4: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, underline: *const DWRITE_UNDERLINE, clientdrawingeffect: Param4) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), ::core::mem::transmute(baselineoriginx), ::core::mem::transmute(baselineoriginy), ::core::mem::transmute(underline), clientdrawingeffect.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawStrikethrough<'a, Param4: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, strikethrough: *const DWRITE_STRIKETHROUGH, clientdrawingeffect: Param4) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), ::core::mem::transmute(baselineoriginx), ::core::mem::transmute(baselineoriginy), ::core::mem::transmute(strikethrough), clientdrawingeffect.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawInlineObject<'a, Param3: ::windows::core::IntoParam<'a, IDWriteInlineObject>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(
&self,
clientdrawingcontext: *const ::core::ffi::c_void,
originx: f32,
originy: f32,
inlineobject: Param3,
issideways: Param4,
isrighttoleft: Param5,
clientdrawingeffect: Param6,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), ::core::mem::transmute(originx), ::core::mem::transmute(originy), inlineobject.into_param().abi(), issideways.into_param().abi(), isrighttoleft.into_param().abi(), clientdrawingeffect.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawGlyphRun2<'a, Param7: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, orientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, measuringmode: DWRITE_MEASURING_MODE, glyphrun: *const DWRITE_GLYPH_RUN, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, clientdrawingeffect: Param7) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(
::core::mem::transmute_copy(self),
::core::mem::transmute(clientdrawingcontext),
::core::mem::transmute(baselineoriginx),
::core::mem::transmute(baselineoriginy),
::core::mem::transmute(orientationangle),
::core::mem::transmute(measuringmode),
::core::mem::transmute(glyphrun),
::core::mem::transmute(glyphrundescription),
clientdrawingeffect.into_param().abi(),
)
.ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawUnderline2<'a, Param5: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, orientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, underline: *const DWRITE_UNDERLINE, clientdrawingeffect: Param5) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), ::core::mem::transmute(baselineoriginx), ::core::mem::transmute(baselineoriginy), ::core::mem::transmute(orientationangle), ::core::mem::transmute(underline), clientdrawingeffect.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawStrikethrough2<'a, Param5: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, orientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, strikethrough: *const DWRITE_STRIKETHROUGH, clientdrawingeffect: Param5) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(clientdrawingcontext), ::core::mem::transmute(baselineoriginx), ::core::mem::transmute(baselineoriginy), ::core::mem::transmute(orientationangle), ::core::mem::transmute(strikethrough), clientdrawingeffect.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn DrawInlineObject2<'a, Param4: ::windows::core::IntoParam<'a, IDWriteInlineObject>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>, Param7: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(
&self,
clientdrawingcontext: *const ::core::ffi::c_void,
originx: f32,
originy: f32,
orientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE,
inlineobject: Param4,
issideways: Param5,
isrighttoleft: Param6,
clientdrawingeffect: Param7,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(
::core::mem::transmute_copy(self),
::core::mem::transmute(clientdrawingcontext),
::core::mem::transmute(originx),
::core::mem::transmute(originy),
::core::mem::transmute(orientationangle),
inlineobject.into_param().abi(),
issideways.into_param().abi(),
isrighttoleft.into_param().abi(),
clientdrawingeffect.into_param().abi(),
)
.ok()
}
}
unsafe impl ::windows::core::Interface for IDWriteTextRenderer1 {
type Vtable = IDWriteTextRenderer1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd3e0e934_22a0_427e_aae4_7d9574b59db1);
}
impl ::core::convert::From<IDWriteTextRenderer1> for ::windows::core::IUnknown {
fn from(value: IDWriteTextRenderer1) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTextRenderer1> for ::windows::core::IUnknown {
fn from(value: &IDWriteTextRenderer1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTextRenderer1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTextRenderer1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IDWriteTextRenderer1> for IDWriteTextRenderer {
fn from(value: IDWriteTextRenderer1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextRenderer1> for IDWriteTextRenderer {
fn from(value: &IDWriteTextRenderer1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextRenderer> for IDWriteTextRenderer1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextRenderer> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWriteTextRenderer> for &IDWriteTextRenderer1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWriteTextRenderer> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IDWriteTextRenderer1> for IDWritePixelSnapping {
fn from(value: IDWriteTextRenderer1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IDWriteTextRenderer1> for IDWritePixelSnapping {
fn from(value: &IDWriteTextRenderer1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWritePixelSnapping> for IDWriteTextRenderer1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWritePixelSnapping> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IDWritePixelSnapping> for &IDWriteTextRenderer1 {
fn into_param(self) -> ::windows::core::Param<'a, IDWritePixelSnapping> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTextRenderer1_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, isdisabled: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, transform: *mut DWRITE_MATRIX) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, pixelsperdip: *mut f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, measuringmode: DWRITE_MEASURING_MODE, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, underline: *const DWRITE_UNDERLINE, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, strikethrough: *const DWRITE_STRIKETHROUGH, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, originx: f32, originy: f32, inlineobject: ::windows::core::RawPtr, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, orientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, measuringmode: DWRITE_MEASURING_MODE, glyphrun: *const ::core::mem::ManuallyDrop<DWRITE_GLYPH_RUN>, glyphrundescription: *const DWRITE_GLYPH_RUN_DESCRIPTION, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, orientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, underline: *const DWRITE_UNDERLINE, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, baselineoriginx: f32, baselineoriginy: f32, orientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, strikethrough: *const DWRITE_STRIKETHROUGH, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clientdrawingcontext: *const ::core::ffi::c_void, originx: f32, originy: f32, orientationangle: DWRITE_GLYPH_ORIENTATION_ANGLE, inlineobject: ::windows::core::RawPtr, issideways: super::super::Foundation::BOOL, isrighttoleft: super::super::Foundation::BOOL, clientdrawingeffect: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IDWriteTypography(pub ::windows::core::IUnknown);
impl IDWriteTypography {
pub unsafe fn AddFontFeature<'a, Param0: ::windows::core::IntoParam<'a, DWRITE_FONT_FEATURE>>(&self, fontfeature: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), fontfeature.into_param().abi()).ok()
}
pub unsafe fn GetFontFeatureCount(&self) -> u32 {
::core::mem::transmute((::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self)))
}
pub unsafe fn GetFontFeature(&self, fontfeatureindex: u32) -> ::windows::core::Result<DWRITE_FONT_FEATURE> {
let mut result__: <DWRITE_FONT_FEATURE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfeatureindex), &mut result__).from_abi::<DWRITE_FONT_FEATURE>(result__)
}
}
unsafe impl ::windows::core::Interface for IDWriteTypography {
type Vtable = IDWriteTypography_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x55f1112b_1dc2_4b3c_9541_f46894ed85b6);
}
impl ::core::convert::From<IDWriteTypography> for ::windows::core::IUnknown {
fn from(value: IDWriteTypography) -> Self {
value.0
}
}
impl ::core::convert::From<&IDWriteTypography> for ::windows::core::IUnknown {
fn from(value: &IDWriteTypography) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IDWriteTypography {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Owned(self.0)
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for &'a IDWriteTypography {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IDWriteTypography_abi(
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfeature: DWRITE_FONT_FEATURE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfeatureindex: u32, fontfeature: *mut DWRITE_FONT_FEATURE) -> ::windows::core::HRESULT,
);
|
/// This allows dumping a CSV of all the evaluations that were performed during a run, as well as a
/// graphviz (.dot) graph recapitulating the run.
///
/// NOTE: This applies to the old log format, which is was less precise and does not contain
/// precise run details, such as actions not taken, or timings. This file is kept for historical
/// reasons so that we still have a way to parse those old log files.
use std::collections::HashMap;
use std::fs::File;
use std::io;
use std::path::PathBuf;
use telamon::explorer::{choice::ActionEx, eventlog::EventLog};
use rpds::List;
use serde::{Deserialize, Serialize};
use structopt::StructOpt;
#[derive(Serialize, Deserialize)]
pub enum DeadEndSource {
/// Dead-end encountered in the tree
Tree {
/// List of actions defining the dead-end candidate
actions: List<ActionEx>,
},
/// Dead-end encountered in the rollout phase
Rollout {
/// List of actions defining the dead-end candidate
actions: List<ActionEx>,
/// Depth in the tree. The remaining actions were selected during rollout.
depth: usize,
/// Performance model bound
bound: f64,
/// Current cut value
cut: f64,
},
}
/// The possible tree events.
/// WARNING: Changing the enums *will break* any pre-existing eventlog files. Adding new cases
/// *at the end only* is safe.
#[derive(Serialize, Deserialize)]
pub enum TreeEvent {
Evaluation {
actions: List<ActionEx>,
score: f64,
},
/// A fully-specified implementation was found and evaluated
EvaluationV2 {
/// List of actions defining the implementation
actions: List<ActionEx>,
/// Depth in the tree. The remaining actions were selected during rollout.
depth: usize,
/// Execution time
score: f64,
/// Performance model lower bound
bound: f64,
/// Cut value when the implementation was found. This is the best implementation at the
/// time the descent started from the root, as threads only synchronize the cut at the
/// root.
cut: f64,
/// Time at which the implementation was found
discovery_time: f64,
/// Time at which the evaluation finished. Note that evaluations are performed by a
/// specific thread, not the one that found the implementation.
evaluation_end_time: f64,
/// ID of the thread that found this implementation
thread: String,
},
/// A dead-end was reached
DeadEnd {
/// Source of this deadend
source: DeadEndSource,
/// Time at which the deadend was found after the start of the program
discovery_time: f64,
/// ID of the thread that found the deadend
thread: String,
},
}
struct Edge {
action: ActionEx,
node: Box<Node>,
}
struct Node {
children: HashMap<ActionEx, Edge>,
evaluations: Vec<f64>,
id: usize,
tag: Option<f64>,
}
impl Node {
fn compute_top(&mut self, k: usize) {
let mut buf = Vec::with_capacity(k);
for (_action, edge) in self.children.iter() {
for eval in &edge.node.evaluations {
let pos = buf
.binary_search_by(|&probe| utils::cmp_f64(probe, *eval))
.unwrap_or_else(|e| e);
if pos < k {
if buf.len() >= k {
buf.pop();
}
buf.insert(pos, *eval);
}
}
}
if let Some(threshold) = buf.pop() {
for (_action, edge) in self.children.iter_mut() {
edge.node.tag = Some(
edge.node
.evaluations
.iter()
.filter(|eval| **eval <= threshold)
.count() as f64
/ k as f64,
);
edge.node.compute_top(k);
}
}
}
}
struct TreeInfo<'a> {
nodes: Vec<&'a Node>,
edges: Vec<(usize, usize, &'a Edge)>,
}
type Nd<'a> = (usize, &'a Node);
type Ed<'a> = &'a (usize, usize, &'a Edge);
impl<'a> dot::GraphWalk<'a, Nd<'a>, Ed<'a>> for TreeInfo<'a> {
fn nodes(&'a self) -> dot::Nodes<'a, Nd<'a>> {
self.nodes.iter().cloned().enumerate().collect()
}
fn edges(&'a self) -> dot::Edges<'a, Ed<'a>> {
self.edges.iter().collect()
}
fn source(&'a self, edge: &Ed<'a>) -> Nd<'a> {
(edge.0, self.nodes[edge.0])
}
fn target(&'a self, edge: &Ed<'a>) -> Nd<'a> {
(edge.1, self.nodes[edge.1])
}
}
impl<'a> dot::Labeller<'a, Nd<'a>, Ed<'a>> for TreeInfo<'a> {
fn graph_id(&'a self) -> dot::Id<'a> {
dot::Id::new("telamon").unwrap()
}
fn node_id(&'a self, n: &Nd<'a>) -> dot::Id<'a> {
dot::Id::new(format!("N{}", n.0)).unwrap()
}
fn node_label(&self, n: &Nd<'a>) -> dot::LabelText<'_> {
dot::LabelText::label(format!(
"#{}: {} (best: {:7.03e}, avg: {:7.03e}, avglog: {:7.03e}{})",
n.1.id,
n.1.evaluations.len(),
n.1.evaluations
.iter()
.cloned()
.min_by(|lhs, rhs| utils::cmp_f64(*lhs, *rhs))
.unwrap_or(std::f64::INFINITY),
n.1.evaluations.iter().sum::<f64>() / n.1.evaluations.len() as f64,
n.1.evaluations.iter().map(|x| x.ln()).sum::<f64>()
/ n.1.evaluations.len() as f64,
if let Some(tag) = n.1.tag {
format!(", top10: {}%", tag * 100.)
} else {
"".into()
},
))
}
fn edge_label(&self, e: &Ed<'a>) -> dot::LabelText<'_> {
dot::LabelText::label(format!("{:?}", e.2.action))
}
}
impl Node {
fn info(&self, max_depth: Option<u32>, min_evals: Option<u32>) -> TreeInfo<'_> {
let mut worklist = vec![(self, 0)];
let mut nodes = vec![];
let mut edges = vec![];
while let Some((node, depth)) = worklist.pop() {
nodes.push((node as *const Node, node));
if max_depth.map(|max_depth| depth < max_depth).unwrap_or(true)
&& min_evals
.map(|min_evals| node.evaluations.len() as u32 > min_evals)
.unwrap_or(true)
{
for (_action, edge) in node.children.iter() {
edges.push((node as *const Node, &*edge.node as *const Node, edge));
worklist.push((&edge.node, depth + 1));
}
}
}
let mut nodeindex: HashMap<*const Node, usize> = HashMap::new();
for (index, (nid, _)) in nodes.iter().enumerate() {
nodeindex.insert(*nid, index);
}
TreeInfo {
nodes: nodes.into_iter().map(|(_nid, info)| info).collect(),
edges: edges
.into_iter()
.map(|(from, to, info)| (nodeindex[&from], nodeindex[&to], info))
.collect(),
}
}
}
/// Recursively walks the tree defined by `children` and records an evaluation value of `eval`
/// along the path.
fn record<II>(children: &mut HashMap<ActionEx, Edge>, actions: II, eval: f64, id: usize)
where
II: IntoIterator<Item = ActionEx>,
{
let mut it = actions.into_iter();
if let Some(action) = it.next() {
let edge = children.entry(action.clone()).or_insert_with(|| Edge {
action: action.clone(),
node: Box::new(Node {
children: Default::default(),
evaluations: vec![],
id,
tag: None,
}),
});
edge.node.evaluations.push(eval);
record(&mut edge.node.children, it, eval, id)
}
}
#[derive(Debug, StructOpt)]
#[structopt(name = "parse_event_log")]
struct Opt {
#[structopt(
parse(from_os_str),
short = "i",
long = "input",
default_value = "eventlog.tfrecord.gz"
)]
eventlog: PathBuf,
#[structopt(long = "topk", default_value = "10")]
topk: usize,
/// Maximum depth after which nodes should be hidden in the graph output. Nodes at a depth
/// larger than max_depth are not displayed.
#[structopt(long = "max-depth")]
max_depth: Option<u32>,
/// Minimum number of evaluations below which children should be hidden in the graph output.
/// Nodes with less than `min_evals` evaluations are displayed, but not their children.
#[structopt(long = "min-evals")]
min_evals: Option<u32>,
}
fn main() -> io::Result<()> {
let opt = Opt::from_args();
let mut root = Node {
children: Default::default(),
evaluations: vec![],
id: 0,
tag: None,
};
let mut evals = Vec::new();
for (id, record_bytes) in EventLog::open(&opt.eventlog)?.records().enumerate() {
match bincode::deserialize(&record_bytes?).unwrap() {
TreeEvent::Evaluation { actions, score }
| TreeEvent::EvaluationV2 { actions, score, .. } => {
root.evaluations.push(score);
let actions = {
let mut actions = actions.iter().cloned().collect::<Vec<_>>();
actions.reverse();
actions
};
record(&mut root.children, actions, score, id);
evals.push(score);
}
TreeEvent::DeadEnd { .. } => (),
}
}
println!("Computing top{} for all nodes...", opt.topk);
root.compute_top(opt.topk);
// Print the graph
println!(
"Writing graph to {}...",
format!("graph-top{}.dot", opt.topk)
);
{
let mut f = File::create(format!("graph-top{}.dot", opt.topk)).unwrap();
dot::render(&root.info(opt.max_depth, opt.min_evals), &mut f).unwrap();
}
// Print the csv
println!("Writing out.csv...");
{
let mut f = File::create("out.csv")?;
let mut writer = csv::Writer::from_writer(&mut f);
writer.write_record(&["Id", "Time"]).unwrap();
for (id, eval) in evals.iter().enumerate() {
writer
.write_record(&[id.to_string(), eval.to_string()])
.unwrap();
}
writer.flush()?;
}
Ok(())
}
|
//
// Sysinfo
//
// Copyright (c) 2017 Guillaume Gomez
//
use ::DiskExt;
use ::utils;
use super::system::get_all_data;
use libc::statvfs;
use std::mem;
use std::fmt::{Debug, Error, Formatter};
use std::path::{Path, PathBuf};
use std::ffi::{OsStr, OsString};
use std::os::unix::ffi::OsStrExt;
/// Enum containing the different handled disks types.
#[derive(Debug, PartialEq, Clone, Copy)]
pub enum DiskType {
/// HDD type.
HDD,
/// SSD type.
SSD,
/// Unknown type.
Unknown(isize),
}
impl From<isize> for DiskType {
fn from(t: isize) -> DiskType {
match t {
0 => DiskType::SSD,
1 => DiskType::HDD,
id => DiskType::Unknown(id),
}
}
}
fn find_type_for_name(name: &OsStr) -> DiskType {
/* turn "sda1" into "sda": */
let mut trimmed: &[u8] = name.as_bytes();
while trimmed.len() > 1 && trimmed[trimmed.len()-1] >= b'0' && trimmed[trimmed.len()-1] <= b'9' {
trimmed = &trimmed[..trimmed.len()-1]
}
let trimmed: &OsStr = OsStrExt::from_bytes(trimmed);
let path = Path::new("/sys/block/").to_owned()
.join(trimmed)
.join("queue/rotational");
let rotational_int = get_all_data(path).unwrap_or_default().trim().parse();
DiskType::from(rotational_int.unwrap_or(-1))
}
macro_rules! cast {
($x:expr) => { u64::from($x) }
}
pub fn new(name: &OsStr, mount_point: &Path, file_system: &[u8]) -> Disk {
let mount_point_cpath = utils::to_cpath(mount_point);
let type_ = find_type_for_name(name);
let mut total = 0;
let mut available = 0;
unsafe {
let mut stat: statvfs = mem::zeroed();
if statvfs(mount_point_cpath.as_ptr() as *const _, &mut stat) == 0 {
total = cast!(stat.f_bsize) * cast!(stat.f_blocks);
available = cast!(stat.f_bsize) * cast!(stat.f_bavail);
}
}
Disk {
type_,
name: name.to_owned(),
file_system: file_system.to_owned(),
mount_point: mount_point.to_owned(),
total_space: cast!(total),
available_space: cast!(available),
}
}
/// Struct containing a disk information.
pub struct Disk {
type_: DiskType,
name: OsString,
file_system: Vec<u8>,
mount_point: PathBuf,
total_space: u64,
available_space: u64,
}
impl Debug for Disk {
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error> {
write!(fmt,
"Disk({:?})[FS: {:?}][Type: {:?}] mounted on {:?}: {}/{} B",
self.get_name(), self.get_file_system(), self.get_type(), self.get_mount_point(),
self.get_available_space(), self.get_total_space())
}
}
impl DiskExt for Disk {
fn get_type(&self) -> DiskType {
self.type_
}
fn get_name(&self) -> &OsStr {
&self.name
}
fn get_file_system(&self) -> &[u8] {
&self.file_system
}
fn get_mount_point(&self) -> &Path {
&self.mount_point
}
fn get_total_space(&self) -> u64 {
self.total_space
}
fn get_available_space(&self) -> u64 {
self.available_space
}
fn update(&mut self) -> bool {
unsafe {
let mut stat: statvfs = mem::zeroed();
let mount_point_cpath = utils::to_cpath(&self.mount_point);
if statvfs(mount_point_cpath.as_ptr() as *const _, &mut stat) == 0 {
let tmp = cast!(stat.f_bsize) * cast!(stat.f_bavail);
self.available_space = cast!(tmp);
true
} else {
false
}
}
}
}
|
use sprack::PackOptions;
use std::path::Path;
pub struct RunOptions<'a> {
pub pack_options: PackOptions<'a>,
pub input_paths: Vec<&'a Path>,
pub output_path: &'a Path,
pub keep_work_dir: bool,
pub demo_run: bool,
pub recursive: bool,
}
impl<'a> Default for RunOptions<'a> {
fn default() -> RunOptions<'a> {
RunOptions {
pack_options: PackOptions { ..Default::default() },
input_paths: vec![],
output_path: Path::new("out"),
keep_work_dir: false,
demo_run: false,
recursive: false,
}
}
}
|
//! A collection of common types used by the Oasis Contract SDK.
pub mod address;
pub mod env;
pub mod event;
pub mod message;
pub mod modules;
pub mod storage;
pub mod token;
pub mod testing;
/// Unique stored code identifier.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, cbor::Decode, cbor::Encode)]
#[cbor(transparent)]
pub struct CodeId(u64);
impl CodeId {
/// Convert identifier to u64.
pub fn as_u64(&self) -> u64 {
self.0
}
/// Return the next identifier in sequence.
pub fn increment(&self) -> Self {
CodeId(self.0 + 1)
}
/// Convert identifier to storage key representation.
pub fn to_storage_key(self) -> [u8; 8] {
self.0.to_be_bytes()
}
}
impl From<u64> for CodeId {
fn from(v: u64) -> Self {
CodeId(v)
}
}
/// Unique deployed code instance identifier.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, cbor::Decode, cbor::Encode)]
#[cbor(transparent)]
pub struct InstanceId(u64);
impl InstanceId {
/// Convert identifier to u64.
pub fn as_u64(&self) -> u64 {
self.0
}
/// Return the next identifier in sequence.
pub fn increment(&self) -> Self {
InstanceId(self.0 + 1)
}
/// Convert identifier to storage key representation.
pub fn to_storage_key(self) -> [u8; 8] {
self.0.to_be_bytes()
}
}
impl From<u64> for InstanceId {
fn from(v: u64) -> Self {
InstanceId(v)
}
}
/// Execution context.
///
/// Contains information that is useful on most invocations as it is always
/// included without requiring any explicit queries.
#[derive(Debug, Default, cbor::Decode, cbor::Encode)]
pub struct ExecutionContext {
/// Contract instance identifier.
pub instance_id: InstanceId,
/// Contract instance address.
pub instance_address: address::Address,
/// Caller address.
pub caller_address: address::Address,
/// Tokens deposited by the caller.
#[cbor(optional, default, skip_serializing_if = "Vec::is_empty")]
pub deposited_tokens: Vec<token::BaseUnits>,
}
/// Contract execution result.
#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
pub enum ExecutionResult {
#[cbor(rename = "ok")]
Ok(ExecutionOk),
#[cbor(rename = "fail")]
Failed {
#[cbor(optional, default, skip_serializing_if = "String::is_empty")]
module: String,
code: u32,
#[cbor(optional, default, skip_serializing_if = "String::is_empty")]
message: String,
},
}
/// Result of a successful contract execution.
#[derive(Clone, Debug, cbor::Encode, cbor::Decode)]
pub struct ExecutionOk {
/// Raw data returned from the contract.
pub data: Vec<u8>,
/// Messages emitted from the contract.
#[cbor(optional, default, skip_serializing_if = "Vec::is_empty")]
pub messages: Vec<message::Message>,
/// Events emitted from the contract.
#[cbor(optional, default, skip_serializing_if = "Vec::is_empty")]
pub events: Vec<event::Event>,
}
|
pub(crate) use _sre::make_module;
#[pymodule]
mod _sre {
use crate::{
atomic_func,
builtins::{
PyCallableIterator, PyDictRef, PyGenericAlias, PyInt, PyList, PyStr, PyStrRef, PyTuple,
PyTupleRef, PyTypeRef,
},
common::{ascii, hash::PyHash},
convert::ToPyObject,
function::{ArgCallable, OptionalArg, PosArgs, PyComparisonValue},
protocol::{PyBuffer, PyMappingMethods},
stdlib::sys,
types::{AsMapping, Comparable, Hashable, Representable},
Py, PyObject, PyObjectRef, PyPayload, PyRef, PyResult, TryFromBorrowedObject,
TryFromObject, VirtualMachine,
};
use core::str;
use crossbeam_utils::atomic::AtomicCell;
use itertools::Itertools;
use num_traits::ToPrimitive;
use sre_engine::{
constants::SreFlag,
engine::{lower_ascii, lower_unicode, upper_unicode, Request, SearchIter, State, StrDrive},
};
#[pyattr]
pub use sre_engine::{constants::SRE_MAGIC as MAGIC, CODESIZE, MAXGROUPS, MAXREPEAT};
#[pyfunction]
fn getcodesize() -> usize {
CODESIZE
}
#[pyfunction]
fn ascii_iscased(ch: i32) -> bool {
(ch >= b'a' as i32 && ch <= b'z' as i32) || (ch >= b'A' as i32 && ch <= b'Z' as i32)
}
#[pyfunction]
fn unicode_iscased(ch: i32) -> bool {
let ch = ch as u32;
ch != lower_unicode(ch) || ch != upper_unicode(ch)
}
#[pyfunction]
fn ascii_tolower(ch: i32) -> i32 {
lower_ascii(ch as u32) as i32
}
#[pyfunction]
fn unicode_tolower(ch: i32) -> i32 {
lower_unicode(ch as u32) as i32
}
trait SreStr: StrDrive {
fn slice(&self, start: usize, end: usize, vm: &VirtualMachine) -> PyObjectRef;
fn create_request(self, pattern: &Pattern, start: usize, end: usize) -> Request<Self> {
Request::new(self, start, end, &pattern.code, false)
}
}
impl SreStr for &[u8] {
fn slice(&self, start: usize, end: usize, vm: &VirtualMachine) -> PyObjectRef {
vm.ctx
.new_bytes(self.iter().take(end).skip(start).cloned().collect())
.into()
}
}
impl SreStr for &str {
fn slice(&self, start: usize, end: usize, vm: &VirtualMachine) -> PyObjectRef {
vm.ctx
.new_str(self.chars().take(end).skip(start).collect::<String>())
.into()
}
}
#[pyfunction]
fn compile(
pattern: PyObjectRef,
flags: u16,
code: PyObjectRef,
groups: usize,
groupindex: PyDictRef,
indexgroup: PyObjectRef,
vm: &VirtualMachine,
) -> PyResult<Pattern> {
// FIXME:
// pattern could only be None if called by re.Scanner
// re.Scanner has no official API and in CPython's implement
// isbytes will be hanging (-1)
// here is just a hack to let re.Scanner works only with str not bytes
let isbytes = !vm.is_none(&pattern) && !pattern.payload_is::<PyStr>();
let code = code.try_to_value(vm)?;
Ok(Pattern {
pattern,
flags: SreFlag::from_bits_truncate(flags),
code,
groups,
groupindex,
indexgroup: indexgroup.try_to_value(vm)?,
isbytes,
})
}
#[derive(FromArgs)]
struct StringArgs {
string: PyObjectRef,
#[pyarg(any, default = "0")]
pos: usize,
#[pyarg(any, default = "sys::MAXSIZE as usize")]
endpos: usize,
}
#[derive(FromArgs)]
struct SubArgs {
// repl: Either<ArgCallable, PyStrRef>,
repl: PyObjectRef,
string: PyObjectRef,
#[pyarg(any, default = "0")]
count: usize,
}
#[derive(FromArgs)]
struct SplitArgs {
string: PyObjectRef,
#[pyarg(any, default = "0")]
maxsplit: isize,
}
#[pyattr]
#[pyclass(name = "Pattern")]
#[derive(Debug, PyPayload)]
pub(crate) struct Pattern {
pub pattern: PyObjectRef,
pub flags: SreFlag,
pub code: Vec<u32>,
pub groups: usize,
pub groupindex: PyDictRef,
pub indexgroup: Vec<Option<PyStrRef>>,
pub isbytes: bool,
}
macro_rules! with_sre_str {
($pattern:expr, $string:expr, $vm:expr, $f:expr) => {
if $pattern.isbytes {
Pattern::with_bytes($string, $vm, $f)
} else {
Pattern::with_str($string, $vm, $f)
}
};
}
#[pyclass(with(Hashable, Comparable, Representable))]
impl Pattern {
fn with_str<F, R>(string: &PyObject, vm: &VirtualMachine, f: F) -> PyResult<R>
where
F: FnOnce(&str) -> PyResult<R>,
{
let string = string
.payload::<PyStr>()
.ok_or_else(|| vm.new_type_error("expected string".to_owned()))?;
f(string.as_str())
}
fn with_bytes<F, R>(string: &PyObject, vm: &VirtualMachine, f: F) -> PyResult<R>
where
F: FnOnce(&[u8]) -> PyResult<R>,
{
PyBuffer::try_from_borrowed_object(vm, string)?.contiguous_or_collect(f)
}
#[pymethod(name = "match")]
fn pymatch(
zelf: PyRef<Pattern>,
string_args: StringArgs,
vm: &VirtualMachine,
) -> PyResult<Option<PyRef<Match>>> {
let StringArgs {
string,
pos,
endpos,
} = string_args;
with_sre_str!(zelf, &string.clone(), vm, |x| {
let req = x.create_request(&zelf, pos, endpos);
let mut state = State::default();
state.pymatch(req);
Ok(state
.has_matched
.then(|| Match::new(&state, zelf.clone(), string).into_ref(&vm.ctx)))
})
}
#[pymethod]
fn fullmatch(
zelf: PyRef<Pattern>,
string_args: StringArgs,
vm: &VirtualMachine,
) -> PyResult<Option<PyRef<Match>>> {
with_sre_str!(zelf, &string_args.string.clone(), vm, |x| {
let mut req = x.create_request(&zelf, string_args.pos, string_args.endpos);
req.match_all = true;
let mut state = State::default();
state.pymatch(req);
Ok(state.has_matched.then(|| {
Match::new(&state, zelf.clone(), string_args.string).into_ref(&vm.ctx)
}))
})
}
#[pymethod]
fn search(
zelf: PyRef<Pattern>,
string_args: StringArgs,
vm: &VirtualMachine,
) -> PyResult<Option<PyRef<Match>>> {
with_sre_str!(zelf, &string_args.string.clone(), vm, |x| {
let req = x.create_request(&zelf, string_args.pos, string_args.endpos);
let mut state = State::default();
state.search(req);
Ok(state.has_matched.then(|| {
Match::new(&state, zelf.clone(), string_args.string).into_ref(&vm.ctx)
}))
})
}
#[pymethod]
fn findall(
zelf: PyRef<Pattern>,
string_args: StringArgs,
vm: &VirtualMachine,
) -> PyResult<Vec<PyObjectRef>> {
with_sre_str!(zelf, &string_args.string, vm, |s| {
let req = s.create_request(&zelf, string_args.pos, string_args.endpos);
let state = State::default();
let mut matchlist: Vec<PyObjectRef> = Vec::new();
let mut iter = SearchIter { req, state };
while iter.next().is_some() {
let m = Match::new(&iter.state, zelf.clone(), string_args.string.clone());
let item = if zelf.groups == 0 || zelf.groups == 1 {
m.get_slice(zelf.groups, s, vm)
.unwrap_or_else(|| vm.ctx.none())
} else {
m.groups(OptionalArg::Present(vm.ctx.new_str(ascii!("")).into()), vm)?
.into()
};
matchlist.push(item);
}
Ok(matchlist)
})
}
#[pymethod]
fn finditer(
zelf: PyRef<Pattern>,
string_args: StringArgs,
vm: &VirtualMachine,
) -> PyResult<PyCallableIterator> {
let scanner = SreScanner {
pattern: zelf,
string: string_args.string,
start: AtomicCell::new(string_args.pos),
end: string_args.endpos,
must_advance: AtomicCell::new(false),
}
.into_ref(&vm.ctx);
let search = vm.get_str_method(scanner.into(), "search").unwrap()?;
let search = ArgCallable::try_from_object(vm, search)?;
let iterator = PyCallableIterator::new(search, vm.ctx.none());
Ok(iterator)
}
#[pymethod]
fn scanner(
zelf: PyRef<Pattern>,
string_args: StringArgs,
vm: &VirtualMachine,
) -> PyRef<SreScanner> {
SreScanner {
pattern: zelf,
string: string_args.string,
start: AtomicCell::new(string_args.pos),
end: string_args.endpos,
must_advance: AtomicCell::new(false),
}
.into_ref(&vm.ctx)
}
#[pymethod]
fn sub(zelf: PyRef<Pattern>, sub_args: SubArgs, vm: &VirtualMachine) -> PyResult {
Self::subx(zelf, sub_args, false, vm)
}
#[pymethod]
fn subn(zelf: PyRef<Pattern>, sub_args: SubArgs, vm: &VirtualMachine) -> PyResult {
Self::subx(zelf, sub_args, true, vm)
}
#[pymethod]
fn split(
zelf: PyRef<Pattern>,
split_args: SplitArgs,
vm: &VirtualMachine,
) -> PyResult<Vec<PyObjectRef>> {
with_sre_str!(zelf, &split_args.string, vm, |s| {
let req = s.create_request(&zelf, 0, usize::MAX);
let state = State::default();
let mut splitlist: Vec<PyObjectRef> = Vec::new();
let mut iter = SearchIter { req, state };
let mut n = 0;
let mut last = 0;
while (split_args.maxsplit == 0 || n < split_args.maxsplit) && iter.next().is_some()
{
/* get segment before this match */
splitlist.push(s.slice(last, iter.state.start, vm));
let m = Match::new(&iter.state, zelf.clone(), split_args.string.clone());
// add groups (if any)
for i in 1..=zelf.groups {
splitlist.push(m.get_slice(i, s, vm).unwrap_or_else(|| vm.ctx.none()));
}
n += 1;
last = iter.state.string_position;
}
// get segment following last match (even if empty)
splitlist.push(req.string.slice(last, s.count(), vm));
Ok(splitlist)
})
}
#[pygetset]
fn flags(&self) -> u16 {
self.flags.bits()
}
#[pygetset]
fn groupindex(&self) -> PyDictRef {
self.groupindex.clone()
}
#[pygetset]
fn groups(&self) -> usize {
self.groups
}
#[pygetset]
fn pattern(&self) -> PyObjectRef {
self.pattern.clone()
}
fn subx(
zelf: PyRef<Pattern>,
sub_args: SubArgs,
subn: bool,
vm: &VirtualMachine,
) -> PyResult {
let SubArgs {
repl,
string,
count,
} = sub_args;
let (is_callable, filter) = if repl.is_callable() {
(true, repl)
} else {
let is_template = if zelf.isbytes {
Self::with_bytes(&repl, vm, |x| Ok(x.contains(&b'\\')))
} else {
Self::with_str(&repl, vm, |x| Ok(x.contains('\\')))
}?;
if is_template {
let re = vm.import("re", None, 0)?;
let func = re.get_attr("_subx", vm)?;
let filter = func.call((zelf.clone(), repl), vm)?;
(filter.is_callable(), filter)
} else {
(false, repl)
}
};
with_sre_str!(zelf, &string, vm, |s| {
let req = s.create_request(&zelf, 0, usize::MAX);
let state = State::default();
let mut sublist: Vec<PyObjectRef> = Vec::new();
let mut iter = SearchIter { req, state };
let mut n = 0;
let mut last_pos = 0;
while (count == 0 || n < count) && iter.next().is_some() {
if last_pos < iter.state.start {
/* get segment before this match */
sublist.push(s.slice(last_pos, iter.state.start, vm));
}
if is_callable {
let m = Match::new(&iter.state, zelf.clone(), string.clone());
let ret = filter.call((m.into_ref(&vm.ctx),), vm)?;
sublist.push(ret);
} else {
sublist.push(filter.clone());
}
last_pos = iter.state.string_position;
n += 1;
}
/* get segment following last match */
sublist.push(s.slice(last_pos, iter.req.end, vm));
let list = PyList::from(sublist).into_pyobject(vm);
let join_type: PyObjectRef = if zelf.isbytes {
vm.ctx.new_bytes(vec![]).into()
} else {
vm.ctx.new_str(ascii!("")).into()
};
let ret = vm.call_method(&join_type, "join", (list,))?;
Ok(if subn { (ret, n).to_pyobject(vm) } else { ret })
})
}
#[pyclassmethod(magic)]
fn class_getitem(cls: PyTypeRef, args: PyObjectRef, vm: &VirtualMachine) -> PyGenericAlias {
PyGenericAlias::new(cls, args, vm)
}
}
impl Hashable for Pattern {
fn hash(zelf: &crate::Py<Self>, vm: &VirtualMachine) -> PyResult<PyHash> {
let hash = zelf.pattern.hash(vm)?;
let (_, code, _) = unsafe { zelf.code.align_to::<u8>() };
let hash = hash ^ vm.state.hash_secret.hash_bytes(code);
let hash = hash ^ (zelf.flags.bits() as PyHash);
let hash = hash ^ (zelf.isbytes as i64);
Ok(hash)
}
}
impl Comparable for Pattern {
fn cmp(
zelf: &crate::Py<Self>,
other: &PyObject,
op: crate::types::PyComparisonOp,
vm: &VirtualMachine,
) -> PyResult<PyComparisonValue> {
if let Some(res) = op.identical_optimization(zelf, other) {
return Ok(res.into());
}
op.eq_only(|| {
if let Some(other) = other.downcast_ref::<Pattern>() {
Ok(PyComparisonValue::Implemented(
zelf.flags == other.flags
&& zelf.isbytes == other.isbytes
&& zelf.code == other.code
&& vm.bool_eq(&zelf.pattern, &other.pattern)?,
))
} else {
Ok(PyComparisonValue::NotImplemented)
}
})
}
}
impl Representable for Pattern {
#[inline]
fn repr_str(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<String> {
let flag_names = [
("re.TEMPLATE", SreFlag::TEMPLATE),
("re.IGNORECASE", SreFlag::IGNORECASE),
("re.LOCALE", SreFlag::LOCALE),
("re.MULTILINE", SreFlag::MULTILINE),
("re.DOTALL", SreFlag::DOTALL),
("re.UNICODE", SreFlag::UNICODE),
("re.VERBOSE", SreFlag::VERBOSE),
("re.DEBUG", SreFlag::DEBUG),
("re.ASCII", SreFlag::ASCII),
];
/* Omit re.UNICODE for valid string patterns. */
let mut flags = zelf.flags;
if !zelf.isbytes
&& (flags & (SreFlag::LOCALE | SreFlag::UNICODE | SreFlag::ASCII))
== SreFlag::UNICODE
{
flags &= !SreFlag::UNICODE;
}
let flags = flag_names
.iter()
.filter(|(_, flag)| flags.contains(*flag))
.map(|(name, _)| name)
.join("|");
let pattern = zelf.pattern.repr(vm)?;
let truncated: String;
let s = if pattern.char_len() > 200 {
truncated = pattern.as_str().chars().take(200).collect();
&truncated
} else {
pattern.as_str()
};
if flags.is_empty() {
Ok(format!("re.compile({s})"))
} else {
Ok(format!("re.compile({s}, {flags})"))
}
}
}
#[pyattr]
#[pyclass(name = "Match")]
#[derive(Debug, PyPayload)]
pub(crate) struct Match {
string: PyObjectRef,
pattern: PyRef<Pattern>,
pos: usize,
endpos: usize,
lastindex: isize,
regs: Vec<(isize, isize)>,
}
#[pyclass(with(AsMapping, Representable))]
impl Match {
pub(crate) fn new<S: StrDrive>(
state: &State<S>,
pattern: PyRef<Pattern>,
string: PyObjectRef,
) -> Self {
let mut regs = vec![(state.start as isize, state.string_position as isize)];
for group in 0..pattern.groups {
let mark_index = 2 * group;
if mark_index + 1 < state.marks.len() {
let start = state.marks[mark_index];
let end = state.marks[mark_index + 1];
if start.is_some() && end.is_some() {
regs.push((start.unpack() as isize, end.unpack() as isize));
continue;
}
}
regs.push((-1, -1));
}
Self {
string,
pattern,
pos: state.start,
endpos: state.string_position,
lastindex: state.marks.last_index(),
regs,
}
}
#[pygetset]
fn pos(&self) -> usize {
self.pos
}
#[pygetset]
fn endpos(&self) -> usize {
self.endpos
}
#[pygetset]
fn lastindex(&self) -> Option<isize> {
if self.lastindex >= 0 {
Some(self.lastindex)
} else {
None
}
}
#[pygetset]
fn lastgroup(&self) -> Option<PyStrRef> {
let i = self.lastindex.to_usize()?;
self.pattern.indexgroup.get(i)?.clone()
}
#[pygetset]
fn re(&self) -> PyRef<Pattern> {
self.pattern.clone()
}
#[pygetset]
fn string(&self) -> PyObjectRef {
self.string.clone()
}
#[pygetset]
fn regs(&self, vm: &VirtualMachine) -> PyTupleRef {
PyTuple::new_ref(
self.regs.iter().map(|&x| x.to_pyobject(vm)).collect(),
&vm.ctx,
)
}
#[pymethod]
fn start(&self, group: OptionalArg<PyObjectRef>, vm: &VirtualMachine) -> PyResult<isize> {
self.span(group, vm).map(|x| x.0)
}
#[pymethod]
fn end(&self, group: OptionalArg<PyObjectRef>, vm: &VirtualMachine) -> PyResult<isize> {
self.span(group, vm).map(|x| x.1)
}
#[pymethod]
fn span(
&self,
group: OptionalArg<PyObjectRef>,
vm: &VirtualMachine,
) -> PyResult<(isize, isize)> {
let index = group.map_or(Ok(0), |group| {
self.get_index(group, vm)
.ok_or_else(|| vm.new_index_error("no such group".to_owned()))
})?;
Ok(self.regs[index])
}
#[pymethod]
fn expand(zelf: PyRef<Match>, template: PyStrRef, vm: &VirtualMachine) -> PyResult {
let re = vm.import("re", None, 0)?;
let func = re.get_attr("_expand", vm)?;
func.call((zelf.pattern.clone(), zelf, template), vm)
}
#[pymethod]
fn group(&self, args: PosArgs<PyObjectRef>, vm: &VirtualMachine) -> PyResult {
with_sre_str!(self.pattern, &self.string, vm, |str_drive| {
let args = args.into_vec();
if args.is_empty() {
return Ok(self.get_slice(0, str_drive, vm).unwrap().to_pyobject(vm));
}
let mut v: Vec<PyObjectRef> = args
.into_iter()
.map(|x| {
self.get_index(x, vm)
.ok_or_else(|| vm.new_index_error("no such group".to_owned()))
.map(|index| {
self.get_slice(index, str_drive, vm)
.map(|x| x.to_pyobject(vm))
.unwrap_or_else(|| vm.ctx.none())
})
})
.try_collect()?;
if v.len() == 1 {
Ok(v.pop().unwrap())
} else {
Ok(vm.ctx.new_tuple(v).into())
}
})
}
#[pymethod(magic)]
fn getitem(
&self,
group: PyObjectRef,
vm: &VirtualMachine,
) -> PyResult<Option<PyObjectRef>> {
with_sre_str!(self.pattern, &self.string, vm, |str_drive| {
let i = self
.get_index(group, vm)
.ok_or_else(|| vm.new_index_error("no such group".to_owned()))?;
Ok(self.get_slice(i, str_drive, vm))
})
}
#[pymethod]
fn groups(
&self,
default: OptionalArg<PyObjectRef>,
vm: &VirtualMachine,
) -> PyResult<PyTupleRef> {
let default = default.unwrap_or_else(|| vm.ctx.none());
with_sre_str!(self.pattern, &self.string, vm, |str_drive| {
let v: Vec<PyObjectRef> = (1..self.regs.len())
.map(|i| {
self.get_slice(i, str_drive, vm)
.map(|s| s.to_pyobject(vm))
.unwrap_or_else(|| default.clone())
})
.collect();
Ok(PyTuple::new_ref(v, &vm.ctx))
})
}
#[pymethod]
fn groupdict(
&self,
default: OptionalArg<PyObjectRef>,
vm: &VirtualMachine,
) -> PyResult<PyDictRef> {
let default = default.unwrap_or_else(|| vm.ctx.none());
with_sre_str!(self.pattern, &self.string, vm, |str_drive| {
let dict = vm.ctx.new_dict();
for (key, index) in self.pattern.groupindex.clone() {
let value = self
.get_index(index, vm)
.and_then(|x| self.get_slice(x, str_drive, vm))
.map(|x| x.to_pyobject(vm))
.unwrap_or_else(|| default.clone());
dict.set_item(&*key, value, vm)?;
}
Ok(dict)
})
}
fn get_index(&self, group: PyObjectRef, vm: &VirtualMachine) -> Option<usize> {
let i = if let Ok(i) = group.try_index(vm) {
i
} else {
self.pattern
.groupindex
.get_item_opt(&*group, vm)
.ok()??
.downcast::<PyInt>()
.ok()?
};
let i = i.as_bigint().to_isize()?;
if i >= 0 && i as usize <= self.pattern.groups {
Some(i as usize)
} else {
None
}
}
fn get_slice<S: SreStr>(
&self,
index: usize,
str_drive: S,
vm: &VirtualMachine,
) -> Option<PyObjectRef> {
let (start, end) = self.regs[index];
if start < 0 || end < 0 {
return None;
}
Some(str_drive.slice(start as usize, end as usize, vm))
}
#[pyclassmethod(magic)]
fn class_getitem(cls: PyTypeRef, args: PyObjectRef, vm: &VirtualMachine) -> PyGenericAlias {
PyGenericAlias::new(cls, args, vm)
}
}
impl AsMapping for Match {
fn as_mapping() -> &'static PyMappingMethods {
static AS_MAPPING: once_cell::sync::Lazy<PyMappingMethods> =
once_cell::sync::Lazy::new(|| PyMappingMethods {
subscript: atomic_func!(|mapping, needle, vm| {
Match::mapping_downcast(mapping)
.getitem(needle.to_owned(), vm)
.map(|x| x.to_pyobject(vm))
}),
..PyMappingMethods::NOT_IMPLEMENTED
});
&AS_MAPPING
}
}
impl Representable for Match {
#[inline]
fn repr_str(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<String> {
with_sre_str!(zelf.pattern, &zelf.string, vm, |str_drive| {
Ok(format!(
"<re.Match object; span=({}, {}), match={}>",
zelf.regs[0].0,
zelf.regs[0].1,
zelf.get_slice(0, str_drive, vm).unwrap().repr(vm)?
))
})
}
}
#[pyattr]
#[pyclass(name = "SRE_Scanner")]
#[derive(Debug, PyPayload)]
struct SreScanner {
pattern: PyRef<Pattern>,
string: PyObjectRef,
start: AtomicCell<usize>,
end: usize,
must_advance: AtomicCell<bool>,
}
#[pyclass]
impl SreScanner {
#[pygetset]
fn pattern(&self) -> PyRef<Pattern> {
self.pattern.clone()
}
#[pymethod(name = "match")]
fn pymatch(&self, vm: &VirtualMachine) -> PyResult<Option<PyRef<Match>>> {
with_sre_str!(self.pattern, &self.string.clone(), vm, |s| {
let mut req = s.create_request(&self.pattern, self.start.load(), self.end);
let mut state = State::default();
req.must_advance = self.must_advance.load();
state.pymatch(req);
self.must_advance
.store(state.string_position == state.start);
self.start.store(state.string_position);
Ok(state.has_matched.then(|| {
Match::new(&state, self.pattern.clone(), self.string.clone()).into_ref(&vm.ctx)
}))
})
}
#[pymethod]
fn search(&self, vm: &VirtualMachine) -> PyResult<Option<PyRef<Match>>> {
if self.start.load() > self.end {
return Ok(None);
}
with_sre_str!(self.pattern, &self.string.clone(), vm, |s| {
let mut req = s.create_request(&self.pattern, self.start.load(), self.end);
let mut state = State::default();
req.must_advance = self.must_advance.load();
state.search(req);
self.must_advance
.store(state.string_position == state.start);
self.start.store(state.string_position);
Ok(state.has_matched.then(|| {
Match::new(&state, self.pattern.clone(), self.string.clone()).into_ref(&vm.ctx)
}))
})
}
}
}
|
#[doc = r"Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r"Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::IF1MSK2 {
#[doc = r"Modifies the contents of the register"]
#[inline(always)]
pub fn modify<F>(&self, f: F)
where
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
{
let bits = self.register.get();
self.register.set(f(&R { bits }, &mut W { bits }).bits);
}
#[doc = r"Reads the contents of the register"]
#[inline(always)]
pub fn read(&self) -> R {
R {
bits: self.register.get(),
}
}
#[doc = r"Writes to the register"]
#[inline(always)]
pub fn write<F>(&self, f: F)
where
F: FnOnce(&mut W) -> &mut W,
{
self.register.set(
f(&mut W {
bits: Self::reset_value(),
})
.bits,
);
}
#[doc = r"Reset value of the register"]
#[inline(always)]
pub const fn reset_value() -> u32 {
0
}
#[doc = r"Writes the reset value to the register"]
#[inline(always)]
pub fn reset(&self) {
self.register.set(Self::reset_value())
}
}
#[doc = r"Value of the field"]
pub struct CAN_IF1MSK2_IDMSKR {
bits: u16,
}
impl CAN_IF1MSK2_IDMSKR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u16 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _CAN_IF1MSK2_IDMSKW<'a> {
w: &'a mut W,
}
impl<'a> _CAN_IF1MSK2_IDMSKW<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits &= !(8191 << 0);
self.w.bits |= ((value as u32) & 8191) << 0;
self.w
}
}
#[doc = r"Value of the field"]
pub struct CAN_IF1MSK2_MDIRR {
bits: bool,
}
impl CAN_IF1MSK2_MDIRR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _CAN_IF1MSK2_MDIRW<'a> {
w: &'a mut W,
}
impl<'a> _CAN_IF1MSK2_MDIRW<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(1 << 14);
self.w.bits |= ((value as u32) & 1) << 14;
self.w
}
}
#[doc = r"Value of the field"]
pub struct CAN_IF1MSK2_MXTDR {
bits: bool,
}
impl CAN_IF1MSK2_MXTDR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _CAN_IF1MSK2_MXTDW<'a> {
w: &'a mut W,
}
impl<'a> _CAN_IF1MSK2_MXTDW<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(1 << 15);
self.w.bits |= ((value as u32) & 1) << 15;
self.w
}
}
impl R {
#[doc = r"Value of the register as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bits 0:12 - Identifier Mask"]
#[inline(always)]
pub fn can_if1msk2_idmsk(&self) -> CAN_IF1MSK2_IDMSKR {
let bits = ((self.bits >> 0) & 8191) as u16;
CAN_IF1MSK2_IDMSKR { bits }
}
#[doc = "Bit 14 - Mask Message Direction"]
#[inline(always)]
pub fn can_if1msk2_mdir(&self) -> CAN_IF1MSK2_MDIRR {
let bits = ((self.bits >> 14) & 1) != 0;
CAN_IF1MSK2_MDIRR { bits }
}
#[doc = "Bit 15 - Mask Extended Identifier"]
#[inline(always)]
pub fn can_if1msk2_mxtd(&self) -> CAN_IF1MSK2_MXTDR {
let bits = ((self.bits >> 15) & 1) != 0;
CAN_IF1MSK2_MXTDR { bits }
}
}
impl W {
#[doc = r"Writes raw bits to the register"]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bits 0:12 - Identifier Mask"]
#[inline(always)]
pub fn can_if1msk2_idmsk(&mut self) -> _CAN_IF1MSK2_IDMSKW {
_CAN_IF1MSK2_IDMSKW { w: self }
}
#[doc = "Bit 14 - Mask Message Direction"]
#[inline(always)]
pub fn can_if1msk2_mdir(&mut self) -> _CAN_IF1MSK2_MDIRW {
_CAN_IF1MSK2_MDIRW { w: self }
}
#[doc = "Bit 15 - Mask Extended Identifier"]
#[inline(always)]
pub fn can_if1msk2_mxtd(&mut self) -> _CAN_IF1MSK2_MXTDW {
_CAN_IF1MSK2_MXTDW { w: self }
}
}
|
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct FinishExamDto {
pub pattern: String,
pub data: FinishExamData,
}
#[derive(Serialize, Deserialize, Debug)]
pub struct FinishExamData {
pub id_student: i32,
pub id_student_exam: i32,
}
|
use candy_vm::{
fiber::{Fiber, FiberId},
lir::Lir,
tracer::Tracer,
vm::Vm,
};
use extension_trait::extension_trait;
use rustc_hash::FxHashMap;
use std::{borrow::Borrow, hash::Hash, num::NonZeroUsize};
#[extension_trait]
pub impl FiberIdExtension for FiberId {
fn get<L: Borrow<Lir>, T: Tracer>(self, vm: &Vm<L, T>) -> &Fiber<T::ForFiber> {
vm.fiber(self).unwrap().fiber_ref()
}
}
// In some places (e.g., `Variable::variables_reference`), `0` is used to
// represent no value. (Not sure why they didn't use `null` like in many other
// places.) Therefore, the ID is the index in `keys` plus one.
pub struct IdMapping<T: Clone + Eq + Hash> {
keys: Vec<T>,
key_to_id: FxHashMap<T, NonZeroUsize>,
}
impl<T: Clone + Eq + Hash> IdMapping<T> {
pub fn id_to_key(&self, id: NonZeroUsize) -> &T {
&self.keys[id.get() - 1]
}
pub fn key_to_id(&mut self, key: T) -> NonZeroUsize {
*self.key_to_id.entry(key.clone()).or_insert_with(|| {
self.keys.push(key);
self.keys.len().try_into().unwrap()
})
}
}
impl<T: Clone + Eq + Hash> Default for IdMapping<T> {
fn default() -> Self {
Self {
keys: vec![],
key_to_id: Default::default(),
}
}
}
|
use std::fs;
use std::path::{Path, PathBuf};
use walkdir::WalkDir;
use guarding_core::domain::code_file::CodeFile;
use crate::identify::c_sharp_ident::CSharpIdent;
use crate::identify::code_ident::CodeIdent;
use crate::identify::java_ident::JavaIdent;
use crate::identify::js_ident::JsIdent;
use crate::identify::rust_ident::RustIdent;
pub struct ModelBuilder {}
impl ModelBuilder {
pub fn build_models_by_dir(code_dir: PathBuf) -> Vec<CodeFile> {
let mut models = vec![];
for entry in WalkDir::new(code_dir) {
let entry = entry.unwrap();
if !entry.file_type().is_file() {
continue;
}
let path = entry.path();
if let None = path.extension() {
continue;
}
ModelBuilder::build_model_by_file(&mut models, path)
}
models
}
pub fn build_model_by_file(models: &mut Vec<CodeFile>, path: &Path) {
let ext = path.extension().unwrap().to_str().unwrap();
let file_name = path.file_name().unwrap().to_str().unwrap();
match ext {
"java" => {
let mut file = JavaIdent::parse(ModelBuilder::read_content(path).as_str());
file.path = ModelBuilder::format_path(path);
file.file_name = file_name.to_string();
models.push(file);
}
"js" => {
let mut file = JsIdent::parse(ModelBuilder::read_content(path).as_str());
file.path = format!("{}", path.display());
file.file_name = file_name.to_string();
models.push(file);
}
"rs" => {
let mut file = RustIdent::parse(ModelBuilder::read_content(path).as_str());
file.path = format!("{}", path.display());
file.file_name = file_name.to_string();
models.push(file);
}
"cs" => {
let mut file = CSharpIdent::parse(ModelBuilder::read_content(path).as_str());
file.path = format!("{}", path.display());
file.file_name = file_name.to_string();
models.push(file);
}
&_ => {}
}
}
fn read_content(path: &Path) -> String {
fs::read_to_string(path).expect("not such file")
}
fn format_path(path: &Path) -> String {
format!("{}", path.display())
}
}
#[cfg(test)]
mod tests {
use std::env;
use crate::ModelBuilder;
#[test]
fn should_parse_current_dir() {
let dir = env::current_dir().unwrap();
let models = ModelBuilder::build_models_by_dir(dir);
assert!(models.len() > 0);
}
} |
#![allow(clippy::derive_partial_eq_without_eq)]
use crate::{
prefix_type::{PrefixRef, WithMetadata},
StableAbi,
};
mod cond_fields {
use super::*;
/// This type is used in prefix type examples.
#[repr(C)]
#[derive(StableAbi)]
#[sabi(kind(Prefix(prefix_ref = Module_Ref, prefix_fields = Module_Prefix)))]
pub struct Module {
#[sabi(accessible_if = true)]
pub first: usize,
#[sabi(last_prefix_field)]
pub second: usize,
#[sabi(accessible_if = true)]
pub third: usize,
pub fourth: usize,
}
impl std::ops::Deref for Module_Prefix {
type Target = DerefTo;
fn deref(&self) -> &DerefTo {
&DerefTo {
first: "5",
second: "8",
third: "13",
fourth: "21",
}
}
}
pub const MOD_VAL: &WithMetadata<Module> = &WithMetadata::new(Module {
first: 5,
second: 8,
third: 13,
fourth: 21,
});
pub const PREFIX: PrefixRef<Module_Prefix> = MOD_VAL.static_as_prefix();
}
pub struct DerefTo {
pub first: &'static str,
pub second: &'static str,
pub third: &'static str,
pub fourth: &'static str,
}
#[test]
fn prefix_field_vis() {
use cond_fields::{Module_Ref, PREFIX};
let pref = PREFIX.prefix();
let modref = Module_Ref(PREFIX);
// Exploiting the fact that the compiler does a deref coercion
// if it can't find a pub field with a given name.
assert_eq!(pref.first, "5");
assert_eq!(modref.first(), Some(5));
assert_eq!(pref.second, 8);
assert_eq!(modref.second(), 8);
assert_eq!(pref.third, "13");
assert_eq!(modref.third(), Some(13));
assert_eq!(pref.fourth, "21");
assert_eq!(modref.fourth(), Some(21));
}
////////////////////////////////////////////////////////////////////////////////
mod different_alignments {
use super::*;
/// This type is used in prefix type examples.
#[repr(C)]
#[derive(StableAbi)]
#[sabi(kind(Prefix(prefix_ref = Module_Ref, prefix_fields = Module_Prefix)))]
pub struct Module {
pub f0: u64,
#[sabi(last_prefix_field)]
pub f1: u8,
pub f2: u16,
pub f3: u32,
pub f4: u64,
pub f5: u32,
pub f6: u16,
pub f7: u8,
}
pub const MOD_VAL: &WithMetadata<Module> = &WithMetadata::new(Module {
f0: 5,
f1: 8,
f2: 13,
f3: 21,
f4: 34,
f5: 55,
f6: 89,
f7: 144,
});
pub const PREFIX: PrefixRef<Module_Prefix> = MOD_VAL.static_as_prefix();
}
/// Making sure that suffix fields with different alignments are accessed correctly.
#[test]
fn access_different_alignments() {
use different_alignments::{Module_Ref, PREFIX};
let modref = Module_Ref(PREFIX);
assert_eq!(modref.f0(), 5);
assert_eq!(modref.f1(), 8);
assert_eq!(modref.f2(), Some(13));
assert_eq!(modref.f3(), Some(21));
assert_eq!(modref.f4(), Some(34));
assert_eq!(modref.f5(), Some(55));
assert_eq!(modref.f6(), Some(89));
assert_eq!(modref.f7(), Some(144));
}
////////////////////////////////////////////////////////////////////////////////
#[repr(C, align(32))]
#[derive(StableAbi, Debug, Copy, Clone, PartialEq)]
pub struct AlignTo32<T>(pub T);
#[repr(C, align(64))]
#[derive(StableAbi, Debug, Copy, Clone, PartialEq)]
pub struct AlignTo64<T>(pub T);
mod overaligned {
use super::*;
/// This type is used in prefix type examples.
#[repr(C, align(32))]
#[derive(StableAbi)]
#[sabi(kind(Prefix))]
pub struct Module {
pub f0: u64,
pub f1: u8,
#[sabi(last_prefix_field)]
pub f2: u16,
pub f3: AlignTo32<u32>,
pub f4: AlignTo64<u32>,
pub f5: u16,
pub f6: u8,
}
pub const MOD_VAL: &WithMetadata<Module> = &WithMetadata::new(Module {
f0: 5,
f1: 8,
f2: 13,
f3: AlignTo32(21),
f4: AlignTo64(34),
f5: 55,
f6: 89,
});
pub const PREFIX: PrefixRef<Module_Prefix> = MOD_VAL.static_as_prefix();
}
/// Making sure that suffix fields with different alignments are accessed correctly.
#[test]
fn access_overaligned_fields() {
use overaligned::{Module_Ref, PREFIX};
let modref = Module_Ref(PREFIX);
assert_eq!(modref.f0(), 5);
assert_eq!(modref.f1(), 8);
assert_eq!(modref.f2(), 13);
assert_eq!(modref.f3(), Some(AlignTo32(21)));
assert_eq!(modref.f4(), Some(AlignTo64(34)));
assert_eq!(modref.f5(), Some(55));
assert_eq!(modref.f6(), Some(89));
}
|
#[macro_use]
mod common;
macro_rules! get_hash(
($str:expr) => (
$str.split(' ').collect::<Vec<&str>>()[0]
);
);
macro_rules! test_digest {
($($t:ident)*) => ($(
mod $t {
use common::util::*;
static UTIL_NAME: &'static str = "hashsum";
static DIGEST_ARG: &'static str = concat!("--", stringify!($t));
static EXPECTED_FILE: &'static str = concat!(stringify!($t), ".expected");
#[test]
fn test_single_file() {
let (at, mut ucmd) = testing(UTIL_NAME);
let result = ucmd.arg(DIGEST_ARG).arg("input.txt").run();
assert_empty_stderr!(result);
assert!(result.success);
assert_eq!(get_hash!(result.stdout), at.read(EXPECTED_FILE));
}
#[test]
fn test_stdin() {
let (at, mut ucmd) = testing(UTIL_NAME);
let input = at.read("input.txt");
let result = ucmd.arg(DIGEST_ARG).run_piped_stdin(input);
assert_empty_stderr!(result);
assert!(result.success);
assert_eq!(get_hash!(result.stdout), at.read(EXPECTED_FILE));
}
}
)*)
}
test_digest! { md5 sha1 sha224 sha256 sha384 sha512 }
|
#![ allow (unused_parens) ]
#[ macro_use ]
extern crate clap;
#[ macro_use ]
extern crate output;
extern crate btrfs;
extern crate flate2;
extern crate rustc_serialize;
extern crate serde_json;
extern crate sha2;
extern crate time;
#[ doc (hidden) ]
#[ macro_use ]
mod misc;
mod commands;
mod arguments;
mod database;
mod operations;
mod types;
use std::process;
use arguments::*;
use commands::*;
fn main () {
// process arguments
let arguments =
parse_arguments ();
let exit_code =
main_real (
& arguments);
process::exit (
exit_code);
}
fn main_real (
arguments: & Arguments,
) -> i32 {
let output =
output::open ();
// delegate to command
let command_result =
match arguments.command {
Command::Dedupe =>
dedupe_command (
& output,
arguments,
),
Command::PrintExtents =>
print_extents_command (
& output,
arguments,
)
};
match command_result {
Ok (_) =>
0,
Err (error_message) => {
output.clear_status ();
output.message_format (
format_args! (
"{}",
error_message));
1
},
}
}
// ex: noet ts=4 filetype=rust
|
//! A write buffer.
use arrow::record_batch::RecordBatch;
use data_types::{StatValues, TimestampMinMax};
use mutable_batch::{column::ColumnData, MutableBatch};
use schema::{Projection, TIME_COLUMN_NAME};
use super::{snapshot::Snapshot, BufferState, Transition};
use crate::{
buffer_tree::partition::buffer::{
mutable_buffer::Buffer,
traits::{Queryable, Writeable},
},
query::projection::OwnedProjection,
};
/// The FSM starting ingest state - a mutable buffer collecting writes.
#[derive(Debug, Default)]
pub(crate) struct Buffering {
/// The buffer for incoming writes.
///
/// This buffer MAY be empty when no writes have occured since transitioning
/// to this state.
buffer: Buffer,
}
/// Implement on-demand querying of the buffered contents without storing the
/// generated snapshot.
///
/// In the future this [`Queryable`] should NOT be implemented for
/// [`Buffering`], and instead snapshots should be incrementally generated and
/// compacted. See <https://github.com/influxdata/influxdb_iox/issues/5805> for
/// context.
///
/// # Panics
///
/// This method panics if converting the buffered data (if any) into an Arrow
/// [`RecordBatch`] fails (a non-transient error).
impl Queryable for Buffering {
fn get_query_data(&self, projection: &OwnedProjection) -> Vec<RecordBatch> {
self.buffer
.buffer()
.map(|v| vec![projection.project_mutable_batches(v)])
.unwrap_or_default()
}
fn rows(&self) -> usize {
self.buffer.buffer().map(|v| v.rows()).unwrap_or_default()
}
fn timestamp_stats(&self) -> Option<TimestampMinMax> {
self.buffer
.buffer()
.map(extract_timestamp_summary)
// Safety: unwrapping the timestamp bounds is safe, as any non-empty
// buffer must contain timestamps.
.map(|v| TimestampMinMax {
min: v.min.unwrap(),
max: v.max.unwrap(),
})
}
fn schema(&self) -> Option<schema::Schema> {
self.buffer.buffer().map(|v| {
v.schema(Projection::All)
.expect("failed to construct batch schema")
})
}
}
impl Writeable for Buffering {
fn write(&mut self, batch: MutableBatch) -> Result<(), mutable_batch::Error> {
self.buffer.buffer_write(batch)
}
}
impl BufferState<Buffering> {
/// Attempt to generate a snapshot from the data in this buffer.
///
/// This returns [`Transition::Unchanged`] if this buffer contains no data.
pub(crate) fn snapshot(self) -> Transition<Snapshot, Buffering> {
if self.state.buffer.is_empty() {
// It is a logical error to snapshot an empty buffer.
return Transition::unchanged(self);
}
// Generate a snapshot from the buffer.
let snap = self
.state
.buffer
.snapshot()
.expect("snapshot of non-empty buffer should succeed");
// And transition to the WithSnapshot state.
Transition::ok(Snapshot::new(vec![snap]), self.sequence_numbers)
}
pub(crate) fn persist_cost_estimate(&self) -> usize {
self.state.buffer.persist_cost_estimate()
}
}
/// Perform an O(1) extraction of the timestamp column statistics.
fn extract_timestamp_summary(batch: &MutableBatch) -> &StatValues<i64> {
let col = batch
.column(TIME_COLUMN_NAME)
.expect("timestamps must exist for non-empty buffer");
match col.data() {
ColumnData::I64(_data, stats) => stats,
_ => unreachable!(),
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_empty_buffer_does_not_snapshot() {
let b = BufferState::new();
match b.snapshot() {
Transition::Ok(_) => panic!("empty buffer should not transition to snapshot state"),
Transition::Unchanged(_) => {
// OK!
}
}
}
}
|
use chrono::NaiveDate;
use super::task_data::TaskData;
#[derive(Debug)]
pub struct TaskPerformanceData {
pub task: TaskData,
pub timestamps: Vec<NaiveDate>,
}
|
mod languages;
pub mod rand;
pub use languages::Language;
|
//! The main scheduler logic.
//!
//! The scheduler is implemented as a singleton in order to make it easy for code anywhere in the
//! project to make use of async functionality. The actual scheduler instance is not publicly
//! accessible, instead we use various standalone functions like `start()` and `wait_for()` to
//! safely manage access to the scheduler.
//!
//! # Scheduling Work
//!
//! Use `scheduler::start()` to run some work asynchronously, getting an `Async<T>` representing the
//! result of the work. Use `Async::await()` to suspend the current fiber until the work completes
//! and get the result. By default, dropping an `Async<T>` will suspend the current fiber until
//! the work finishes, but you can use `Async::forget()` to ignore the result without blocking.
//!
//! # Sharing Data Between Work
//!
//! Unlike with `std::thread::spawn()`, it's possible for work started with `scheduler::start()`
//! to borrow data from the caller:
//!
//! ```
//!
//! ```
use fiber::{self, Fiber, FiberId};
use cell_extras::AtomicInitCell;
use std::boxed::FnBox;
use std::collections::{HashMap, HashSet, VecDeque};
use std::fmt::{self, Debug, Formatter};
use std::marker::PhantomData;
use std::mem;
use std::sync::{Condvar, Mutex, Once, ONCE_INIT};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::mpsc::{self, Receiver};
use stopwatch;
const DEFAULT_STACK_SIZE: usize = 64 * 1024;
static CONDVAR: AtomicInitCell<Condvar> = AtomicInitCell::new();
static INSTANCE: AtomicInitCell<Mutex<Scheduler>> = AtomicInitCell::new();
static INSTANCE_INIT: Once = ONCE_INIT;
static WORK_COUNTER: AtomicUsize = AtomicUsize::new(1);
/// Represents the result of a computation that may finish at some point in the future.
///
/// Use `scheduler::start()` to run some work asynchronously, getting an `Async<T>` representing the
/// result of the work. Use `Async::await()` to suspend the current fiber until the work completes
/// and get the result. By default, dropping an `Async<T>` will suspend the current fiber until
/// the work finishes, but you can use `Async::forget()` to ignore the result without blocking.
///
/// # Sharing Data Across Work
///
/// It's possible to share
#[derive(Debug)]
pub struct Async<'a, T> {
work: WorkId,
receiver: Receiver<T>,
_phantom: PhantomData<&'a FnMut()>,
}
impl<'a, T> Async<'a, T> {
/// Suspend the current fiber until the async operation finishes.
pub fn await(self) -> T {
let result = {
let Async { work, ref receiver, .. } = self;
work.await();
receiver.try_recv().expect("Failed to receive result of async computation")
};
result
}
pub fn work_id(&self) -> WorkId {
self.work
}
}
impl<T> Async<'static, T> {
pub fn forget(self) {
mem::forget(self);
}
}
impl<'a, T> Drop for Async<'a, T> {
fn drop(&mut self) {
self.work.await();
}
}
/// A shareable reference to a work unit, counterpart to `Async<T>`.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct WorkId(usize);
impl WorkId {
/// Suspends the current fiber until this work unit has completed.
///
/// If the work unit has already finished then `await()` will return immediately.
pub fn await(self) {
if Scheduler::with(|scheduler| scheduler.add_dependency(self)) {
suspend();
}
}
}
/// Initializes a newly-spawned worker thread.
///
/// Prepares the worker thread by initializing it for Fiber usage.
// TODO: This should probably only be public within the crate. Only the engine should be using this,
// and only at startup, we probably don't want user code to be spawning threads anyway.
pub fn init_thread() {
// Make sure the scheduler is initialized before first use.
Scheduler::with(|_| {});
// Manually convert current thread into a fiber because reasons.
fiber::init();
}
// TODO: This should probably only be public within the crate. Only the engine should be using this,
// and only at startup, we probably don't want user code to be spawning threads anyway.
pub fn run_wait_fiber() {
// Make sure the scheduler is initialized before first use.
Scheduler::with(|_| {});
// Setup this thread for running fibers and create an initial fiber for it. This will become
// the wait fiber for this thread.
fiber::init();
fiber_routine();
}
pub fn start<'a, F, T>(func: F) -> Async<'a, T>
where
F: FnOnce() -> T,
F: 'a + Send,
T: 'a + Send,
{
// Normally we can't box a closure with a non 'static lifetime because it could outlive its
// borrowed data. In this case the lifetime parameter on the returned `Async` ensures that
// the closure can't outlive the borrowed data, so we use this evil magic to convince the
// compiler to allow us to box the closure.
unsafe fn erase_lifetime<'a, F>(func: F) -> Box<FnBox()>
where
F: FnOnce(),
F: 'a + Send,
{
let boxed_proc = Box::new(func);
let proc_ptr = Box::into_raw(boxed_proc) as *mut FnBox();
Box::from_raw(::std::mem::transmute(proc_ptr))
}
// Create the channel that'll be used to send the result of the operation to the `Async` object.
let (sender, receiver) = mpsc::sync_channel(1);
let work_id = WorkId(WORK_COUNTER.fetch_add(1, Ordering::Relaxed));
let work_proc = unsafe {
erase_lifetime(move || {
let result = func();
sender.try_send(result).expect("Failed to send async result");
})
};
Scheduler::with(move |scheduler| scheduler.schedule_work(Work {
func: work_proc,
id: work_id,
}));
Async {
work: work_id,
receiver: receiver,
_phantom: PhantomData,
}
}
/// Suspends the current fiber and makes the wait fiber active.
///
/// Generally you shouldn't need to call this directly, but if you have one piece of code that
/// runs synchronously for a long time you can use `suspend()` to yield time to other work.
pub fn suspend() {
let next_fiber = Scheduler::with(|scheduler| scheduler.next_fiber());
let suspended = unsafe { next_fiber.resume() };
stopwatch::switch_context(suspended.id(), fiber::current().unwrap());
Scheduler::with(move |scheduler| scheduler.handle_suspended(suspended));
}
fn fiber_routine() -> ! {
loop {
match Scheduler::with(|scheduler| scheduler.next()) {
Some(NextWork::Work(Work { func, id })) => {
Scheduler::with(|scheduler| scheduler.start_work(id));
func();
Scheduler::with(|scheduler| scheduler.finish_work(id));
},
Some(NextWork::Fiber(fiber)) => {
let suspended = unsafe { fiber.resume() };
stopwatch::switch_context(suspended.id(), fiber::current().unwrap());
Scheduler::with(move |scheduler| scheduler.handle_suspended(suspended));
},
None => {
// If there's no new work and no fibers ready to run then we want to block the
// thread until some becomes available.
let mutex = INSTANCE.borrow();
let condvar = CONDVAR.borrow();
let _ = condvar
.wait(mutex.lock().expect("Scheduler mutex was poisoned"))
.expect("Scheduler mutex was poisoned");
},
}
}
}
struct Work {
func: Box<FnBox()>,
id: WorkId,
}
impl Debug for Work {
fn fmt(&self, formatter: &mut Formatter) -> Result<(), fmt::Error> {
write!(formatter, "Work {{ id: {:?} }}", self.id)
}
}
enum NextWork {
Work(Work),
Fiber(Fiber),
}
struct Scheduler {
/// Work units that are currently pending or in progress.
current_work: HashSet<WorkId>,
work_map: HashMap<FiberId, WorkId>,
/// New units of work that haven't been started on a fiber yet.
///
/// These are ready to be made active at any time.
new_work: VecDeque<Work>,
/// Fibers that have no pending dependencies.
///
/// These are ready to be made active at any time.
ready_fibers: VecDeque<Fiber>,
/// A map specifying which pending fibers depend on which others.
///
/// Once all of a fiber's dependencies complete it should be moved to `new_work`.
dependencies: HashMap<FiberId, (Option<Fiber>, HashSet<WorkId>)>,
// TODO: Should we distinguise between "finished" and "ready" fibers? My intuition is that we'd
// want to give fibers that actively have work CPU time before we resume fibers that would be
// pulling new work, but maybe not? If we threw them all into one queue I guess the worst case
// scenario would be there's no work left, a bunch of empty fibers, and only a few fibers with
// active work. In which case we might have to cycle through a bunch of fibers before we can
// start doing actual work.
finished: VecDeque<Fiber>,
}
unsafe impl Send for Scheduler {}
impl Scheduler {
/// Provides safe access to the scheduler instance.
///
/// # Fiber Switches
///
/// Note that it is an error to call `Fiber::make_active()` within `func`. Doing so will cause
/// the `Mutex` guard on the instance to never unlock, making the scheduler instance
/// inaccessible. All standalone functions that access the scheduler and wish to switch fibers
/// should use `Scheduler::next()` to return the next fiber from `with()` and then call
/// `make_active()` *after* `with()` has returned.
fn with<F, T>(func: F) -> T
where F: FnOnce(&mut Scheduler) -> T
{
INSTANCE_INIT.call_once(|| {
let scheduler = Scheduler {
current_work: HashSet::new(),
work_map: HashMap::new(),
new_work: VecDeque::new(),
ready_fibers: VecDeque::new(),
dependencies: HashMap::new(),
finished: VecDeque::new(),
};
INSTANCE.init(Mutex::new(scheduler));
CONDVAR.init(Condvar::new());
});
let instance = INSTANCE.borrow();
let mut guard = instance.lock().expect("Scheduler mutex was poisoned");
func(&mut *guard)
}
/// Add a new unit of work to the pending queue.
fn schedule_work(&mut self, work: Work) {
assert!(self.current_work.insert(work.id), "Work's ID was already present in current work set");
self.new_work.push_back(work);
CONDVAR.borrow().notify_one();
}
/// Adds `dependency` as a dependency of the currently running fiber.
///
/// Returns `true` if work is still in progress and was added as a dependency, false otherwise.
fn add_dependency(&mut self, dependency: WorkId) -> bool {
let pending = fiber::current().unwrap();
if self.current_work.contains(&dependency) {
debug_assert!(
!self.dependencies.contains_key(&pending),
"Marking a fiber as pending but it is already pending: {:?}",
pending,
);
// Add `pending` to set of pending fibers and list `dependencies` as dependencies.
let &mut (_, ref mut dependencies_set) =
self.dependencies
.entry(pending)
.or_insert((None, HashSet::new()));
// Add `fibers` to the list of ready fibers.
dependencies_set.insert(dependency);
true
} else {
false
}
}
fn start_work(&mut self, new_work: WorkId) {
debug_assert!(self.current_work.contains(&new_work), "Work ID was not in current work set");
let current = fiber::current().unwrap();
self.work_map.insert(current, new_work);
}
/// Removes the specified unit of work from the scheduler, updating any dependent work.
fn finish_work(&mut self, finished_work: WorkId) {
// Iterate over all suspended work units, removing `finished_work` as a dependency where
// necessary. If any of the work units no longer have dependencies then
let mut ready = Vec::new();
for (&pending_fiber, &mut (_, ref mut dependencies)) in &mut self.dependencies {
dependencies.remove(&finished_work);
if dependencies.len() == 0 {
ready.push(pending_fiber);
}
}
for ready_work in ready {
let (maybe_fiber, _) = self.dependencies.remove(&ready_work).unwrap();
if let Some(ready_fiber) = maybe_fiber {
self.ready_fibers.push_back(ready_fiber);
CONDVAR.borrow().notify_one();
}
}
let fiber = fiber::current().unwrap();
assert!(self.current_work.remove(&finished_work), "{:?} wasn't in current work set when it finished", finished_work);
assert!(self.work_map.remove(&fiber).is_some(), "{:?} didn't have {:?} associated in the work map", fiber, finished_work);
}
/// Performs the necessary bookkeeping when a fiber becomes active.
fn handle_suspended(&mut self, suspended: Fiber) {
// If the suspended fiber has dependencies then update the dependencies map with the
// actual fiber, that way when its dependencies complete it can be resumed. Otherwise, the
// fiber is done and ready to take on more work. This means that we need to make sure that
// we always call `add_dependencies()` before suspending a fiber, otherwise a fiber could
// be marked as done before it's ready.
if let Some(&mut (ref mut none_fiber, _)) = self.dependencies.get_mut(&suspended.id()) {
debug_assert!(none_fiber.is_none(), "Dependencies map already had a fiber assicated with fiber ID");
mem::replace(none_fiber, Some(suspended));
} else if self.work_map.contains_key(&suspended.id()) {
self.ready_fibers.push_back(suspended);
} else {
self.finished.push_back(suspended);
}
}
/// Gets the next ready fiber, or creates a new one if necessary.
fn next_fiber(&mut self) -> Fiber {
self.ready_fibers.pop_front()
.or_else(|| self.finished.pop_front())
.unwrap_or_else(|| {
fn fiber_proc(suspended: Fiber) -> ! {
stopwatch::switch_context(suspended.id(), fiber::current().unwrap());
// The current fiber has been resumed. Let the scheduler know that the previous fiber is no
// longer active.
Scheduler::with(|scheduler| scheduler.handle_suspended(suspended));
fiber_routine();
}
Fiber::new(DEFAULT_STACK_SIZE, fiber_proc)
})
}
/// Gets the next available work for a thread, either a new unit of work or a ready fiber.
///
/// Prioritizes new work over pending fibers, and will only return ready fibers that already
/// have work. To get *any* next fiber, including ones without active work or a new one if no
/// existing fibers are available, use `next_fiber()`.
fn next(&mut self) -> Option<NextWork> {
if let Some(work) = self.new_work.pop_front() {
Some(NextWork::Work(work))
} else {
self.ready_fibers.pop_front().map(|fiber| NextWork::Fiber(fiber))
}
}
}
|
#[derive(Clone,Debug)]
pub struct Neuron {
bias: f32,
pub weights: Vec<f32>,
pub activation: f32,
}
#[derive(Clone)]
pub struct FullNet {
pub layers: Vec<Vec<Neuron>>, //fix vec![Vec<Neuron>;4] not sure how to get this to work, would be nice to but not necareccy.
}
/*
/¯¯¯m
i----m
\___m
the weights between the i am m layer are owned by the i neuron. output neurones weights will be null as they will have no "connection"
*/
use rand::{distributions::Uniform, thread_rng, Rng};
use std::f32::consts::E;
#[allow(dead_code)]
impl Neuron {
pub fn new(weights: usize) -> Neuron {
let mut random = thread_rng(); //i assume that this is expensive so i did not put it on the same line as the weight gerneration
let range = Uniform::new_inclusive(0.7,0.7);
Neuron {
bias: 0.0,
weights:(&mut random).sample_iter(range).take(weights).collect(), //wanted to avoid using map not sure if this is the idiomatic way of doing this
activation: 1.0,
}
}
pub fn activtion(&mut self,layer: Vec<Neuron>, self_pos: usize) -> Self { // the layer should be the previous layer ( sould have made this explicit) Fool
self.activation = 0.0;
for node in layer {
self.activation += node.activation * node.weights[self_pos];
}
self.activation = 1.0 / (1.0 + E.powf(-self.activation)); // this is a sigmoid function, it is cosely bound between 2 asymtotes on y=1 and y=0 meaning it is good for "squishification"-3Blue!Brown
self.to_owned()
}
}
#[allow(dead_code)]
impl FullNet {
pub fn new(inputs: usize, outputs: usize,mut hidden_layers:usize) -> Self {
let mut net = Vec::new();
//this automatically constructs a net of in, out and x hidden layers 2 neurons deep
hidden_layers = if hidden_layers ==0{1}else{hidden_layers};
net.push(FullNet::pop_vec(inputs,2));
for _ in 0..hidden_layers-1{
net.push(FullNet::pop_vec(2, 2));
}
net.push(FullNet::pop_vec(2, outputs));
net.push(FullNet::pop_vec(outputs, 1));
FullNet { layers: net }
}
pub fn run_data(&mut self,inputs:Vec<i32>)->Vec<f32>{ //returns the output as a vec of floats(the activations of the opuput layer)
for i in 0..inputs.len(){
self.layers[0][i].activation = inputs[i]as f32; //load the given inputs into the input layer of the net
}
for layer in 1..self.layers.len(){ //for every layer
for node in 0..self.layers[layer].len(){ //do the folowing for each node in that layer
let a = self.layers[layer-1].clone();
self.layers[layer][node].activtion(a, node);
}
}
self.layers.last().unwrap().iter().map(|node|node.activation).collect()
}
fn _total_cost(outputs:Vec<f32>,expected:Vec<f32>)->f32{
let mut cost = 0.0;
for i in 0..outputs.len(){
cost += (outputs[i]-expected[i]).powf(2.0)
}
cost
}
/*
input layer -- hidden later(s) -- output layer
if the input is the layer you are creating then len is the number
of inputs and the "next_layer" is the length the the presceding hidden layer
*/
#[allow(dead_code)]
fn pop_vec(len: usize, next_len: usize) -> Vec<Neuron> {
let mut sub_net = Vec::new();
for _ in 0..len {
sub_net.push(Neuron::new(next_len));
}
sub_net
}
}
//inputs:usize,outputs:usize,hiddenLayersLen:usize
|
/*-------------------------------
game_text.rs
ゲーム内で表示するテキストを一挙に取ってくる
Tomlから取得する予定
* struct Source: tomlファイルから読み込んだ内容がここに
* impl GameText:
* new()
* new_score() : スコア表示のためTextを再生成
* from_array()
-------------------------------*/
use std::io::Result;
use ggez::graphics::{ Font, Text };
use ggez::{ Context, GameResult };
use toml;
use assets::Assets;
use etc;
#[derive(Clone, Debug, Deserialize)]
pub struct Source {
title_logo: String,
title_description: String,
title_headline: String,
title_tips: Vec<String>,
game_over_title: String,
game_over_score: String,
game_over_tips: Vec<String>,
}
impl Source {
fn new(assets: &Assets) -> Result<Self> {
// ggez用にいじってるPathBufを正常な&strにする: 7れんさ
let text_tmp_path = assets
.show_map()
.get("game_text.toml")
.expect("HashMap.get()時のエラー")
.strip_prefix("/")
.expect("strip_prefix時のエラー")
.to_str()
.expect("PathBuf.to_str()時のエラー");
let text_path = etc::easy_path_set(text_tmp_path);
let tmp_vec = etc::File::read_to_vec(&text_path)?;
let src_text: Source = toml::de::from_slice(&tmp_vec).expect("toml deserialize時のエラー");
Ok(src_text)
}
}
#[derive(Clone, Debug)]
pub struct GameText {
pub title_logo: Text,
pub title_description: Text,
pub title_headline: Text,
pub title_tips: Vec<Text>,
pub game_over_title: Text,
pub game_over_score: Text,
pub game_over_score_num: Text,
pub game_over_tips: Vec<Text>,
}
impl GameText {
/// GameTextの生成
pub fn new(ctx: &mut Context,
assets: &Assets) -> GameResult<Self> {
let src = Source::new(assets)?;
let title_logo = Text::new(
ctx,
&src.title_logo,
&assets.pixel_font_big,
)?;
let title_description = Text::new(
ctx,
&src.title_description,
&assets.pixel_font_small,
)?;
let title_headline = Text::new(
ctx,
&src.title_headline,
&assets.pixel_font_small,
)?;
let title_tips = GameText::from_array(
ctx,
&src.title_tips,
&assets.pixel_font_small,
)?;
let game_over_title = Text::new(
ctx,
&src.game_over_title,
&assets.pixel_font_big
)?;
let game_over_score = Text::new(
ctx,
&src.game_over_score,
&assets.pixel_font
)?;
// 後で書き換えるものなので、適当にclone()しておく
// ほんとは空テキストを出力できる機能がggezにあるべきなのよ。
let game_over_score_num = game_over_score.clone();
let game_over_tips = GameText::from_array(
ctx,
&src.game_over_tips,
&assets.pixel_font,
)?;
Ok(GameText {
title_logo: title_logo,
title_description: title_description,
title_headline: title_headline,
title_tips: title_tips,
game_over_title: game_over_title,
game_over_score: game_over_score,
game_over_score_num: game_over_score_num,
game_over_tips: game_over_tips,
})
}
// その時のフレーム数からスコアを計算する
pub fn new_score(&mut self,
ctx: &mut Context,
font: &Font,
score: usize) -> GameResult<()> {
let tmp_t = format!("**{}**", score);
let out_t = Text::new(
ctx,
&tmp_t,
font,
)?;
self.game_over_score_num = out_t;
Ok(())
}
fn from_array(ctx: &mut Context,
in_vec: &Vec<String>,
font: &Font) -> GameResult<Vec<Text>> {
let mut out_vec = Vec::with_capacity(in_vec.len());
for li in in_vec {
let tmp_t = Text::new(
ctx,
&li,
font
)?;
out_vec.push(tmp_t);
}
Ok(out_vec)
}
}
|
//! Contains implementation of default logger.
use enso_prelude::*;
use crate::AnyLogger;
use crate::Message;
use enso_shapely::CloneRef;
use std::fmt::Debug;
#[cfg(target_arch = "wasm32")]
use web_sys::console;
#[cfg(target_arch = "wasm32")]
use wasm_bindgen::JsValue;
// ==============
// === Logger ===
// ==============
/// Default Logger implementation.
#[derive(Clone,CloneRef,Debug,Default)]
pub struct Logger {
/// Path that is used as an unique identifier of this logger.
path : ImString,
trace_copies : TraceCopies,
#[cfg(not(target_arch="wasm32"))]
indent : Rc<Cell<usize>>,
}
#[cfg(not(target_arch="wasm32"))]
impl Logger {
fn format(&self, msg:impl Message) -> String {
let indent = " ".repeat(4*self.indent.get());
msg.with(|s|iformat!("{indent}[{self.path}] {s}"))
}
fn inc_indent(&self) {
self.indent.update(|t|t.saturating_add(1));
}
fn dec_indent(&self) {
self.indent.update(|t|t.saturating_sub(1));
}
}
#[cfg(target_arch="wasm32")]
impl Logger {
fn format(&self, msg:impl Message) -> JsValue {
msg.with(|s|iformat!("[{self.path}] {s}")).into()
}
}
#[cfg(not(target_arch="wasm32"))]
impl AnyLogger for Logger {
type Owned = Self;
fn new(path:impl Into<ImString>) -> Self {
let path = path.into();
let indent = default();
let trace_copies = default();
Self {path,indent,trace_copies}
}
fn path (&self) -> &str { &self.path }
fn trace (&self, msg:impl Message) { println!("{}",self.format(msg)) }
fn debug (&self, msg:impl Message) { println!("{}",self.format(msg)) }
fn info (&self, msg:impl Message) { println!("{}",self.format(msg)) }
fn warning (&self, msg:impl Message) { println!("[WARNING] {}",self.format(msg)) }
fn error (&self, msg:impl Message) { println!("[ERROR] {}",self.format(msg)) }
fn group_begin (&self, msg:impl Message) { println!("{}",self.format(msg)); self.inc_indent() }
fn group_end (&self) { self.dec_indent() }
fn trace_copies(&self) { self.trace_copies.enable(&self.path) }
}
#[cfg(target_arch="wasm32")]
impl AnyLogger for Logger {
type Owned = Self;
fn new(path:impl Into<ImString>) -> Self {
let path = path.into();
let trace_copies = default();
Self {path,trace_copies}
}
fn path (&self) -> &str { &self.path }
fn trace (&self, msg:impl Message) { console::trace_1 (&self.format(msg)) }
fn debug (&self, msg:impl Message) { console::debug_1 (&self.format(msg)) }
fn info (&self, msg:impl Message) { console::info_1 (&self.format(msg)) }
fn warning (&self, msg:impl Message) { console::warn_1 (&self.format(msg)) }
fn error (&self, msg:impl Message) { console::error_1 (&self.format(msg)) }
fn group_begin (&self, msg:impl Message) { console::group_1 (&self.format(msg)) }
fn group_end (&self) { console::group_end() }
fn trace_copies(&self) { self.trace_copies.enable(&self.path) }
}
// ===================
// === Conversions ===
// ===================
impls!{ From + &From <crate::disabled::Logger> for Logger { |logger| Self::new(logger.path()) }}
|
use std::fs::File;
use std::io::{Read, Result};
fn main() {
println!("{:}", time_remaining());
}
fn retrieve(path: &str) -> Result<String> {
let mut f = try!(File::open("/sys/class/power_supply/BAT0/".to_string() + path));
let mut buffer = String::new();
f.read_to_string(&mut buffer).unwrap();
Ok(buffer.trim().to_string())
}
fn time_remaining() -> String {
let status = retrieve("status").unwrap_or("error".to_string());
let charge_full = retrieve("energy_full")
.unwrap_or(retrieve("charge_full").unwrap_or("error".to_string()));
let charge_now = retrieve("energy_now")
.unwrap_or(retrieve("charge_now").unwrap_or("error".to_string()));
let current_now = retrieve("power_now")
.unwrap_or(retrieve("current_now").unwrap_or("error".to_string()));
let charge_full_parsed = charge_full.parse::<f64>().unwrap();
let charge_now_parsed = charge_now.parse::<f64>().unwrap();
let current_now_parsed = current_now.parse::<f64>().unwrap();
let (append_status, hrs_to_time) = match status.as_ref() {
"Charging" => {
let hrs_to_time = (charge_full_parsed - charge_now_parsed) / current_now_parsed;
(" until charged", hrs_to_time)
}
"Discharging" => {
let hrs_to_time = charge_now_parsed / current_now_parsed;
(" remaining", hrs_to_time)
}
_ => ("", 0.0),
};
let hours = hrs_to_time.floor();
let mut minutes = (hrs_to_time - hours) * 60.0;
let seconds = ((minutes - minutes.floor()) * 60.0).floor();
minutes = minutes.floor();
let percentage = (charge_now_parsed * 100.0 / charge_full_parsed).floor();
let time_remaining =
status + ", " + &percentage.to_string() + "%, " + &hours.to_string() + ":" +
&minutes.to_string() + ":" + &seconds.to_string() + append_status;
time_remaining.to_string()
}
|
extern crate iron;
extern crate urlencoded;
use iron::prelude::*;
use iron::status;
use std::error::Error;
use std::fs::File;
use std::path::Path;
use std::io::prelude::*;
use std::collections::HashMap;
use urlencoded::UrlEncodedQuery;
// fn print_query(hashmap: &&HashMap<String,Vec<String>>){
//
// println!("Parsed GET request query string:\n {:?}", hashmap);
//
// }
fn print_query(hashmap: &&HashMap<String,Vec<String>>)-> Response{
/*
println!("Parsed GET request query string:\n {:?}", hashmap);
let mut v: Vec<String> = vec![];
let str_vec = &hashmap.get("vec").unwrap()[0];
println!{"vec: {:?}",str_vec};
let tmp = str_vec.split(",");
println!{"vec: {:?}",tmp};
*/
let try_file= match hashmap.get("file") {
// The `description` method of `io::Error` returns a string that
// describes the error
None => {
println!("wrong Question");
return Response::with((status::BadRequest, "Falsche frage"))
}
Some(name) => name //fals erfolgreich, gib die Datei zurück
};
//erzeuge einen String
let filename = String::from("html/".to_string() + &try_file[0]);
//let filename = String::from("html/cd_catalog.xml");
//öffne die angefragte Datei
let path = Path::new(&filename);
let display = path.display();
let extension = path.extension();
println!("display: {:?}", display);
let mut file = match File::open(&path) {
// The `description` method of `io::Error` returns a string that
// describes the error
Err(why) => {
println!("couldn't open {}: {}", display, Error::description(&why));
return Response::with((status::NotFound, "Seite nicht gefunden!"))
}
Ok(file) => file //fals erfolgreich, gib die Datei zurück
};
let mut s = String::new();
//erzeuen einer Response mit OK und dem Dateiinhalt im body
let mut res = match file.read_to_string(&mut s) {
Err(why) => panic!("couldn't read {}: {}", display,
Error::description(&why)),
Ok(_) => Response::with((status::Ok,s)),
};
//erzeuge String für den content-type auf basis der Dateiendung
//unwarap führt zum Absturtz falls datei ohne Endung existiert und aufgerufen wird
let ext = "text/".to_string()+extension.unwrap().to_str().unwrap();
res.headers.set_raw("content-type", vec![ext.as_bytes().to_vec()]);
return res
// Response::with((status::Ok, "Hello!"))
}
fn generate_response(path_vec: &Vec<String>) -> Response{
//wird aufgerufen, falls nur eine Datei (index.html u.a.) aufgerufen wird
//es soll nur eine Seite geladen werden -> kein GET Request
// Create a path to the desired file
let s = if path_vec[0] == ""{ //falls keien Datei angegben -> default index.html
"html/index.html".to_string()
} else {
"html/".to_string() + &path_vec[path_vec.len()-1]
};
let path = Path::new(&s);
let display = path.display();
println!("display: {:?}", display);
println!(" len: {:?}", path_vec.len());
//versuche die Datei zu öffnen
//falls unbekannt gib 404 als Respons
// Open the path in read-only mode, returns `io::Result<File>`
let mut file = match File::open(&path) {
// The `description` method of `io::Error` returns a string that
// describes the error
Err(why) => {
println!("couldn't open {}: {}", display, Error::description(&why));
return Response::with((status::NotFound, "Seite nicht gefunden!"))
}
Ok(file) => file //fals erfolgreich, gib die Datei zurück
};
// Read the file contents into a string, returns `io::Result<usize>`
let mut s = String::new();
let mut res = match file.read_to_string(&mut s) {
Err(why) => panic!("couldn't read {}: {}", display,
Error::description(&why)),
Ok(_) => Response::with((status::Ok,s)),
};
//setzen des content-type -> Annahme das immer html
res.headers.set_raw("content-type", vec![b"text/html".to_vec()]);
println!("status: {:?}",res.status);
println!("headers: {:?}",res.headers);
return res;
// `file` goes out of scope, and gets closed
//Response::with((status::Ok, "Hello!"))
}
fn log_params(req: &mut Request) -> IronResult<Response> {
println!(" ", );
println!("-----------------------------------------", );
println!("-----------------------------------------", );
//Was steht alles in req drin
println!("url: {}",req.url);
println!(" scheme: {}",req.url.scheme);
println!(" Host: {}",req.url.host);
println!(" port: {}",req.url.port);
println!(" Path: ");
for s in &req.url.path{
println!(" {}", s);
}
println!(" username: {:?}",req.url.username);
println!(" password: {:?}",req.url.password);
println!(" query: {:?}",req.url.query);
println!(" fragment: {:?}",req.url.fragment);
println!("Method: {:?}",req.method);
println!("Headers: {:?}",req.headers);
println!(" ");
let mut s = String::new();
match req.body.read_to_string(&mut s){
Err(why) => panic!("couldn't read Body: {}",Error::description(&why)),
Ok(_) => println!("Body: {:?}",s),
};
//brauch ich glaub ich nicht
//println!(" Extensions: {:?}",req.extensions);
println!(" ", );
println!("remote_addr: {}",req.remote_addr);
println!("local_addr: {}",req.local_addr);
// println!("-----------------------------------------", );
// println!(" ", );
// Extract the decoded data as hashmap, using the UrlEncodedQuery plugin.
//auswerten des Get Request String
// match req.get_ref::<UrlEncodedQuery>() {
// Ok(ref hashmap) => print_query(hashmap),//println!("Parsed GET request query string:\n {:?}", hashmap),
// Err(ref e) => println!("{:?}", e)
// };
// match req.get_ref::<UrlEncodedQuery>() {
// Ok(ref hashmap) => print_query(hashmap),//println!("Parsed GET request query string:\n {:?}", hashmap),
// Err(ref e) => println!("{:?}",e)
// };
println!(" ", );
println!("-----------------------------------------", );
println!("-----------------------------------------", );
//
// let mut resp = match generate_response(&req.url.query, &req.url.path) {
// Err(_) => Response::with((status::Ok, "Hello!")),
// Ok(r) => r
// };
//überprüfe, ob url Query
if req.url.query.is_some(){
// let resp = match req.get_ref::<UrlEncodedQuery>() {
// Ok(ref hashmap) => print_query(hashmap),//println!("Parsed GET request query string:\n {:?}", hashmap),
// Err(_) => Response::with((status::Ok, "Hello!"))
// };
//erzeugt hashmap
let hashmap = req.get_ref::<UrlEncodedQuery>().unwrap();
let resp = print_query(&hashmap); //auswerten der Query -> erzeugt Response
Ok(resp)
} else { //falls keine Query -> es soll nur seite geladen werden
Ok(generate_response(&req.url.path))
}
//Ok(generate_response(&req.url.query, &req.url.path))
}
// Test out the server with `curl -i "http://localhost:3000/?name=franklin&name=trevor" 127.0.0.1`
fn main() {
Iron::new(log_params).http("127.0.0.1:3000").unwrap();
}
|
// Copyright (c) 2018 Chef Software Inc. and/or applicable contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Windows-equivalent for determining if the current user has certain
//! abilities.
// The Linux version uses Capabilities. Until we sort out the
// equivalent implementation on Windows, we assume that the current
// process has the abilities. This was the implicit behavior prior to
// adding this abstraction, so Windows supervisor behavior will remain
// unchanged (i.e., it will still require "root"-like abilities to
// run).
pub fn can_run_services_as_svc_user() -> bool {
true
}
|
/// 各種特殊ノートを含む譜面かどうか
#[derive(Clone, Debug)]
pub struct IncludeFeatures {
undefined_ln: UndefinedLn,
mine_note: MineNote,
random: Random,
long_note: LongNote,
charge_note: ChargeNote,
hell_charge_note: HellChargeNote,
stop_sequence: StopSequence,
}
impl From<i32> for IncludeFeatures {
fn from(i: i32) -> Self {
let undefined_ln = UndefinedLn(i & 1 != 0);
let mine_note = MineNote(i & 2 != 0);
let random = Random(i & 4 != 0);
let long_note = LongNote(i & 8 != 0);
let charge_note = ChargeNote(i & 16 != 0);
let hell_charge_note = HellChargeNote(i & 32 != 0);
let stop_sequence = StopSequence(i & 64 != 0);
IncludeFeatures {
undefined_ln,
mine_note,
random,
long_note,
charge_note,
hell_charge_note,
stop_sequence,
}
}
}
impl From<IncludeFeatures> for i32 {
fn from(feature: IncludeFeatures) -> Self {
(if feature.undefined_ln.0 { 1 } else { 0 })
+ if feature.mine_note.0 { 2 } else { 0 }
+ if feature.random.0 { 4 } else { 0 }
+ if feature.long_note.0 { 8 } else { 0 }
+ if feature.charge_note.0 { 16 } else { 0 }
+ if feature.hell_charge_note.0 { 32 } else { 0 }
+ if feature.stop_sequence.0 { 64 } else { 0 }
}
}
#[derive(Clone, Debug)]
pub struct UndefinedLn(bool);
#[derive(Clone, Debug)]
pub struct MineNote(bool);
#[derive(Clone, Debug)]
pub struct Random(bool);
#[derive(Clone, Debug)]
pub struct LongNote(bool);
#[derive(Clone, Debug)]
pub struct ChargeNote(bool);
#[derive(Clone, Debug)]
pub struct HellChargeNote(bool);
#[derive(Clone, Debug)]
pub struct StopSequence(bool);
#[cfg(test)]
mod test {
use super::*;
#[test]
fn test() {
for i in 0..128 {
let i_f = IncludeFeatures::from(i);
assert_eq!(i, i32::from(i_f));
}
}
}
|
// auto generated, do not modify.
// created: Mon Feb 22 23:57:02 2016
// src-file: /QtWidgets/qgesture.h
// dst-file: /src/widgets/qgesture.rs
//
// header block begin =>
#![feature(libc)]
#![feature(core)]
#![feature(collections)]
extern crate libc;
use self::libc::*;
// <= header block end
// main block begin =>
// <= main block end
// use block begin =>
// use super::qgesture::QGesture; // 773
use std::ops::Deref;
use super::super::core::qobjectdefs::*; // 771
use super::super::core::qobject::*; // 771
use super::super::core::qpoint::*; // 771
use super::super::core::qcoreevent::*; // 771
use super::qwidget::*; // 773
// use super::qlist::*; // 775
// <= use block end
// ext block begin =>
// #[link(name = "Qt5Core")]
// #[link(name = "Qt5Gui")]
// #[link(name = "Qt5Widgets")]
// #[link(name = "QtInline")]
extern {
fn QSwipeGesture_Class_Size() -> c_int;
// proto: void QSwipeGesture::~QSwipeGesture();
fn C_ZN13QSwipeGestureD2Ev(qthis: u64 /* *mut c_void*/);
// proto: const QMetaObject * QSwipeGesture::metaObject();
fn C_ZNK13QSwipeGesture10metaObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QSwipeGesture::setSwipeAngle(qreal value);
fn C_ZN13QSwipeGesture13setSwipeAngleEd(qthis: u64 /* *mut c_void*/, arg0: c_double);
// proto: void QSwipeGesture::QSwipeGesture(QObject * parent);
fn C_ZN13QSwipeGestureC2EP7QObject(arg0: *mut c_void) -> u64;
// proto: qreal QSwipeGesture::swipeAngle();
fn C_ZNK13QSwipeGesture10swipeAngleEv(qthis: u64 /* *mut c_void*/) -> c_double;
fn QGesture_Class_Size() -> c_int;
// proto: QPointF QGesture::hotSpot();
fn C_ZNK8QGesture7hotSpotEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: bool QGesture::hasHotSpot();
fn C_ZNK8QGesture10hasHotSpotEv(qthis: u64 /* *mut c_void*/) -> c_char;
// proto: void QGesture::unsetHotSpot();
fn C_ZN8QGesture12unsetHotSpotEv(qthis: u64 /* *mut c_void*/);
// proto: const QMetaObject * QGesture::metaObject();
fn C_ZNK8QGesture10metaObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QGesture::QGesture(QObject * parent);
fn C_ZN8QGestureC2EP7QObject(arg0: *mut c_void) -> u64;
// proto: void QGesture::setHotSpot(const QPointF & value);
fn C_ZN8QGesture10setHotSpotERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void);
// proto: void QGesture::~QGesture();
fn C_ZN8QGestureD2Ev(qthis: u64 /* *mut c_void*/);
fn QGestureEvent_Class_Size() -> c_int;
// proto: bool QGestureEvent::isAccepted(QGesture * );
fn C_ZNK13QGestureEvent10isAcceptedEP8QGesture(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> c_char;
// proto: QWidget * QGestureEvent::widget();
fn C_ZNK13QGestureEvent6widgetEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QGestureEvent::ignore(QGesture * );
fn C_ZN13QGestureEvent6ignoreEP8QGesture(qthis: u64 /* *mut c_void*/, arg0: *mut c_void);
// proto: void QGestureEvent::accept(QGesture * );
fn C_ZN13QGestureEvent6acceptEP8QGesture(qthis: u64 /* *mut c_void*/, arg0: *mut c_void);
// proto: QList<QGesture *> QGestureEvent::activeGestures();
fn C_ZNK13QGestureEvent14activeGesturesEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: QList<QGesture *> QGestureEvent::gestures();
fn C_ZNK13QGestureEvent8gesturesEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QGestureEvent::setAccepted(QGesture * , bool );
fn C_ZN13QGestureEvent11setAcceptedEP8QGestureb(qthis: u64 /* *mut c_void*/, arg0: *mut c_void, arg1: c_char);
// proto: void QGestureEvent::setWidget(QWidget * widget);
fn C_ZN13QGestureEvent9setWidgetEP7QWidget(qthis: u64 /* *mut c_void*/, arg0: *mut c_void);
// proto: void QGestureEvent::~QGestureEvent();
fn C_ZN13QGestureEventD2Ev(qthis: u64 /* *mut c_void*/);
// proto: QList<QGesture *> QGestureEvent::canceledGestures();
fn C_ZNK13QGestureEvent16canceledGesturesEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: QPointF QGestureEvent::mapToGraphicsScene(const QPointF & gesturePoint);
fn C_ZNK13QGestureEvent18mapToGraphicsSceneERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void) -> *mut c_void;
fn QPanGesture_Class_Size() -> c_int;
// proto: QPointF QPanGesture::offset();
fn C_ZNK11QPanGesture6offsetEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: QPointF QPanGesture::delta();
fn C_ZNK11QPanGesture5deltaEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QPanGesture::setOffset(const QPointF & value);
fn C_ZN11QPanGesture9setOffsetERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void);
// proto: qreal QPanGesture::acceleration();
fn C_ZNK11QPanGesture12accelerationEv(qthis: u64 /* *mut c_void*/) -> c_double;
// proto: void QPanGesture::~QPanGesture();
fn C_ZN11QPanGestureD2Ev(qthis: u64 /* *mut c_void*/);
// proto: void QPanGesture::QPanGesture(QObject * parent);
fn C_ZN11QPanGestureC2EP7QObject(arg0: *mut c_void) -> u64;
// proto: const QMetaObject * QPanGesture::metaObject();
fn C_ZNK11QPanGesture10metaObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QPanGesture::setAcceleration(qreal value);
fn C_ZN11QPanGesture15setAccelerationEd(qthis: u64 /* *mut c_void*/, arg0: c_double);
// proto: QPointF QPanGesture::lastOffset();
fn C_ZNK11QPanGesture10lastOffsetEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QPanGesture::setLastOffset(const QPointF & value);
fn C_ZN11QPanGesture13setLastOffsetERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void);
fn QTapAndHoldGesture_Class_Size() -> c_int;
// proto: void QTapAndHoldGesture::QTapAndHoldGesture(QObject * parent);
fn C_ZN18QTapAndHoldGestureC2EP7QObject(arg0: *mut c_void) -> u64;
// proto: void QTapAndHoldGesture::~QTapAndHoldGesture();
fn C_ZN18QTapAndHoldGestureD2Ev(qthis: u64 /* *mut c_void*/);
// proto: QPointF QTapAndHoldGesture::position();
fn C_ZNK18QTapAndHoldGesture8positionEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: static void QTapAndHoldGesture::setTimeout(int msecs);
fn C_ZN18QTapAndHoldGesture10setTimeoutEi(arg0: c_int);
// proto: static int QTapAndHoldGesture::timeout();
fn C_ZN18QTapAndHoldGesture7timeoutEv() -> c_int;
// proto: const QMetaObject * QTapAndHoldGesture::metaObject();
fn C_ZNK18QTapAndHoldGesture10metaObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QTapAndHoldGesture::setPosition(const QPointF & pos);
fn C_ZN18QTapAndHoldGesture11setPositionERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void);
fn QTapGesture_Class_Size() -> c_int;
// proto: QPointF QTapGesture::position();
fn C_ZNK11QTapGesture8positionEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QTapGesture::setPosition(const QPointF & pos);
fn C_ZN11QTapGesture11setPositionERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void);
// proto: void QTapGesture::QTapGesture(QObject * parent);
fn C_ZN11QTapGestureC2EP7QObject(arg0: *mut c_void) -> u64;
// proto: const QMetaObject * QTapGesture::metaObject();
fn C_ZNK11QTapGesture10metaObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QTapGesture::~QTapGesture();
fn C_ZN11QTapGestureD2Ev(qthis: u64 /* *mut c_void*/);
fn QPinchGesture_Class_Size() -> c_int;
// proto: void QPinchGesture::setRotationAngle(qreal value);
fn C_ZN13QPinchGesture16setRotationAngleEd(qthis: u64 /* *mut c_void*/, arg0: c_double);
// proto: qreal QPinchGesture::lastScaleFactor();
fn C_ZNK13QPinchGesture15lastScaleFactorEv(qthis: u64 /* *mut c_void*/) -> c_double;
// proto: qreal QPinchGesture::lastRotationAngle();
fn C_ZNK13QPinchGesture17lastRotationAngleEv(qthis: u64 /* *mut c_void*/) -> c_double;
// proto: QPointF QPinchGesture::startCenterPoint();
fn C_ZNK13QPinchGesture16startCenterPointEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: qreal QPinchGesture::rotationAngle();
fn C_ZNK13QPinchGesture13rotationAngleEv(qthis: u64 /* *mut c_void*/) -> c_double;
// proto: QPointF QPinchGesture::lastCenterPoint();
fn C_ZNK13QPinchGesture15lastCenterPointEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QPinchGesture::QPinchGesture(QObject * parent);
fn C_ZN13QPinchGestureC2EP7QObject(arg0: *mut c_void) -> u64;
// proto: qreal QPinchGesture::totalScaleFactor();
fn C_ZNK13QPinchGesture16totalScaleFactorEv(qthis: u64 /* *mut c_void*/) -> c_double;
// proto: void QPinchGesture::setTotalScaleFactor(qreal value);
fn C_ZN13QPinchGesture19setTotalScaleFactorEd(qthis: u64 /* *mut c_void*/, arg0: c_double);
// proto: qreal QPinchGesture::totalRotationAngle();
fn C_ZNK13QPinchGesture18totalRotationAngleEv(qthis: u64 /* *mut c_void*/) -> c_double;
// proto: void QPinchGesture::setLastScaleFactor(qreal value);
fn C_ZN13QPinchGesture18setLastScaleFactorEd(qthis: u64 /* *mut c_void*/, arg0: c_double);
// proto: void QPinchGesture::setLastCenterPoint(const QPointF & value);
fn C_ZN13QPinchGesture18setLastCenterPointERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void);
// proto: const QMetaObject * QPinchGesture::metaObject();
fn C_ZNK13QPinchGesture10metaObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QPinchGesture::setLastRotationAngle(qreal value);
fn C_ZN13QPinchGesture20setLastRotationAngleEd(qthis: u64 /* *mut c_void*/, arg0: c_double);
// proto: QPointF QPinchGesture::centerPoint();
fn C_ZNK13QPinchGesture11centerPointEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QPinchGesture::setCenterPoint(const QPointF & value);
fn C_ZN13QPinchGesture14setCenterPointERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void);
// proto: void QPinchGesture::setTotalRotationAngle(qreal value);
fn C_ZN13QPinchGesture21setTotalRotationAngleEd(qthis: u64 /* *mut c_void*/, arg0: c_double);
// proto: void QPinchGesture::setScaleFactor(qreal value);
fn C_ZN13QPinchGesture14setScaleFactorEd(qthis: u64 /* *mut c_void*/, arg0: c_double);
// proto: void QPinchGesture::~QPinchGesture();
fn C_ZN13QPinchGestureD2Ev(qthis: u64 /* *mut c_void*/);
// proto: void QPinchGesture::setStartCenterPoint(const QPointF & value);
fn C_ZN13QPinchGesture19setStartCenterPointERK7QPointF(qthis: u64 /* *mut c_void*/, arg0: *mut c_void);
// proto: qreal QPinchGesture::scaleFactor();
fn C_ZNK13QPinchGesture11scaleFactorEv(qthis: u64 /* *mut c_void*/) -> c_double;
} // <= ext block end
// body block begin =>
// class sizeof(QSwipeGesture)=1
#[derive(Default)]
pub struct QSwipeGesture {
qbase: QGesture,
pub qclsinst: u64 /* *mut c_void*/,
}
// class sizeof(QGesture)=1
#[derive(Default)]
pub struct QGesture {
qbase: QObject,
pub qclsinst: u64 /* *mut c_void*/,
}
// class sizeof(QGestureEvent)=1
#[derive(Default)]
pub struct QGestureEvent {
qbase: QEvent,
pub qclsinst: u64 /* *mut c_void*/,
}
// class sizeof(QPanGesture)=1
#[derive(Default)]
pub struct QPanGesture {
qbase: QGesture,
pub qclsinst: u64 /* *mut c_void*/,
}
// class sizeof(QTapAndHoldGesture)=1
#[derive(Default)]
pub struct QTapAndHoldGesture {
qbase: QGesture,
pub qclsinst: u64 /* *mut c_void*/,
}
// class sizeof(QTapGesture)=1
#[derive(Default)]
pub struct QTapGesture {
qbase: QGesture,
pub qclsinst: u64 /* *mut c_void*/,
}
// class sizeof(QPinchGesture)=1
#[derive(Default)]
pub struct QPinchGesture {
qbase: QGesture,
pub qclsinst: u64 /* *mut c_void*/,
}
impl /*struct*/ QSwipeGesture {
pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QSwipeGesture {
return QSwipeGesture{qbase: QGesture::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
}
}
impl Deref for QSwipeGesture {
type Target = QGesture;
fn deref(&self) -> &QGesture {
return & self.qbase;
}
}
impl AsRef<QGesture> for QSwipeGesture {
fn as_ref(& self) -> & QGesture {
return & self.qbase;
}
}
// proto: void QSwipeGesture::~QSwipeGesture();
impl /*struct*/ QSwipeGesture {
pub fn free<RetType, T: QSwipeGesture_free<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.free(self);
// return 1;
}
}
pub trait QSwipeGesture_free<RetType> {
fn free(self , rsthis: & QSwipeGesture) -> RetType;
}
// proto: void QSwipeGesture::~QSwipeGesture();
impl<'a> /*trait*/ QSwipeGesture_free<()> for () {
fn free(self , rsthis: & QSwipeGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QSwipeGestureD2Ev()};
unsafe {C_ZN13QSwipeGestureD2Ev(rsthis.qclsinst)};
// return 1;
}
}
// proto: const QMetaObject * QSwipeGesture::metaObject();
impl /*struct*/ QSwipeGesture {
pub fn metaObject<RetType, T: QSwipeGesture_metaObject<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.metaObject(self);
// return 1;
}
}
pub trait QSwipeGesture_metaObject<RetType> {
fn metaObject(self , rsthis: & QSwipeGesture) -> RetType;
}
// proto: const QMetaObject * QSwipeGesture::metaObject();
impl<'a> /*trait*/ QSwipeGesture_metaObject<QMetaObject> for () {
fn metaObject(self , rsthis: & QSwipeGesture) -> QMetaObject {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QSwipeGesture10metaObjectEv()};
let mut ret = unsafe {C_ZNK13QSwipeGesture10metaObjectEv(rsthis.qclsinst)};
let mut ret1 = QMetaObject::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QSwipeGesture::setSwipeAngle(qreal value);
impl /*struct*/ QSwipeGesture {
pub fn setSwipeAngle<RetType, T: QSwipeGesture_setSwipeAngle<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setSwipeAngle(self);
// return 1;
}
}
pub trait QSwipeGesture_setSwipeAngle<RetType> {
fn setSwipeAngle(self , rsthis: & QSwipeGesture) -> RetType;
}
// proto: void QSwipeGesture::setSwipeAngle(qreal value);
impl<'a> /*trait*/ QSwipeGesture_setSwipeAngle<()> for (f64) {
fn setSwipeAngle(self , rsthis: & QSwipeGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QSwipeGesture13setSwipeAngleEd()};
let arg0 = self as c_double;
unsafe {C_ZN13QSwipeGesture13setSwipeAngleEd(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: void QSwipeGesture::QSwipeGesture(QObject * parent);
impl /*struct*/ QSwipeGesture {
pub fn new<T: QSwipeGesture_new>(value: T) -> QSwipeGesture {
let rsthis = value.new();
return rsthis;
// return 1;
}
}
pub trait QSwipeGesture_new {
fn new(self) -> QSwipeGesture;
}
// proto: void QSwipeGesture::QSwipeGesture(QObject * parent);
impl<'a> /*trait*/ QSwipeGesture_new for (Option<&'a QObject>) {
fn new(self) -> QSwipeGesture {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QSwipeGestureC2EP7QObject()};
let ctysz: c_int = unsafe{QSwipeGesture_Class_Size()};
let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64;
let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void;
let qthis: u64 = unsafe {C_ZN13QSwipeGestureC2EP7QObject(arg0)};
let rsthis = QSwipeGesture{qbase: QGesture::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
return rsthis;
// return 1;
}
}
// proto: qreal QSwipeGesture::swipeAngle();
impl /*struct*/ QSwipeGesture {
pub fn swipeAngle<RetType, T: QSwipeGesture_swipeAngle<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.swipeAngle(self);
// return 1;
}
}
pub trait QSwipeGesture_swipeAngle<RetType> {
fn swipeAngle(self , rsthis: & QSwipeGesture) -> RetType;
}
// proto: qreal QSwipeGesture::swipeAngle();
impl<'a> /*trait*/ QSwipeGesture_swipeAngle<f64> for () {
fn swipeAngle(self , rsthis: & QSwipeGesture) -> f64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QSwipeGesture10swipeAngleEv()};
let mut ret = unsafe {C_ZNK13QSwipeGesture10swipeAngleEv(rsthis.qclsinst)};
return ret as f64; // 1
// return 1;
}
}
impl /*struct*/ QGesture {
pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGesture {
return QGesture{qbase: QObject::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
}
}
impl Deref for QGesture {
type Target = QObject;
fn deref(&self) -> &QObject {
return & self.qbase;
}
}
impl AsRef<QObject> for QGesture {
fn as_ref(& self) -> & QObject {
return & self.qbase;
}
}
// proto: QPointF QGesture::hotSpot();
impl /*struct*/ QGesture {
pub fn hotSpot<RetType, T: QGesture_hotSpot<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.hotSpot(self);
// return 1;
}
}
pub trait QGesture_hotSpot<RetType> {
fn hotSpot(self , rsthis: & QGesture) -> RetType;
}
// proto: QPointF QGesture::hotSpot();
impl<'a> /*trait*/ QGesture_hotSpot<QPointF> for () {
fn hotSpot(self , rsthis: & QGesture) -> QPointF {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK8QGesture7hotSpotEv()};
let mut ret = unsafe {C_ZNK8QGesture7hotSpotEv(rsthis.qclsinst)};
let mut ret1 = QPointF::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: bool QGesture::hasHotSpot();
impl /*struct*/ QGesture {
pub fn hasHotSpot<RetType, T: QGesture_hasHotSpot<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.hasHotSpot(self);
// return 1;
}
}
pub trait QGesture_hasHotSpot<RetType> {
fn hasHotSpot(self , rsthis: & QGesture) -> RetType;
}
// proto: bool QGesture::hasHotSpot();
impl<'a> /*trait*/ QGesture_hasHotSpot<i8> for () {
fn hasHotSpot(self , rsthis: & QGesture) -> i8 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK8QGesture10hasHotSpotEv()};
let mut ret = unsafe {C_ZNK8QGesture10hasHotSpotEv(rsthis.qclsinst)};
return ret as i8; // 1
// return 1;
}
}
// proto: void QGesture::unsetHotSpot();
impl /*struct*/ QGesture {
pub fn unsetHotSpot<RetType, T: QGesture_unsetHotSpot<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.unsetHotSpot(self);
// return 1;
}
}
pub trait QGesture_unsetHotSpot<RetType> {
fn unsetHotSpot(self , rsthis: & QGesture) -> RetType;
}
// proto: void QGesture::unsetHotSpot();
impl<'a> /*trait*/ QGesture_unsetHotSpot<()> for () {
fn unsetHotSpot(self , rsthis: & QGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN8QGesture12unsetHotSpotEv()};
unsafe {C_ZN8QGesture12unsetHotSpotEv(rsthis.qclsinst)};
// return 1;
}
}
// proto: const QMetaObject * QGesture::metaObject();
impl /*struct*/ QGesture {
pub fn metaObject<RetType, T: QGesture_metaObject<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.metaObject(self);
// return 1;
}
}
pub trait QGesture_metaObject<RetType> {
fn metaObject(self , rsthis: & QGesture) -> RetType;
}
// proto: const QMetaObject * QGesture::metaObject();
impl<'a> /*trait*/ QGesture_metaObject<QMetaObject> for () {
fn metaObject(self , rsthis: & QGesture) -> QMetaObject {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK8QGesture10metaObjectEv()};
let mut ret = unsafe {C_ZNK8QGesture10metaObjectEv(rsthis.qclsinst)};
let mut ret1 = QMetaObject::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QGesture::QGesture(QObject * parent);
impl /*struct*/ QGesture {
pub fn new<T: QGesture_new>(value: T) -> QGesture {
let rsthis = value.new();
return rsthis;
// return 1;
}
}
pub trait QGesture_new {
fn new(self) -> QGesture;
}
// proto: void QGesture::QGesture(QObject * parent);
impl<'a> /*trait*/ QGesture_new for (Option<&'a QObject>) {
fn new(self) -> QGesture {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN8QGestureC2EP7QObject()};
let ctysz: c_int = unsafe{QGesture_Class_Size()};
let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64;
let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void;
let qthis: u64 = unsafe {C_ZN8QGestureC2EP7QObject(arg0)};
let rsthis = QGesture{qbase: QObject::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
return rsthis;
// return 1;
}
}
// proto: void QGesture::setHotSpot(const QPointF & value);
impl /*struct*/ QGesture {
pub fn setHotSpot<RetType, T: QGesture_setHotSpot<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setHotSpot(self);
// return 1;
}
}
pub trait QGesture_setHotSpot<RetType> {
fn setHotSpot(self , rsthis: & QGesture) -> RetType;
}
// proto: void QGesture::setHotSpot(const QPointF & value);
impl<'a> /*trait*/ QGesture_setHotSpot<()> for (&'a QPointF) {
fn setHotSpot(self , rsthis: & QGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN8QGesture10setHotSpotERK7QPointF()};
let arg0 = self.qclsinst as *mut c_void;
unsafe {C_ZN8QGesture10setHotSpotERK7QPointF(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: void QGesture::~QGesture();
impl /*struct*/ QGesture {
pub fn free<RetType, T: QGesture_free<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.free(self);
// return 1;
}
}
pub trait QGesture_free<RetType> {
fn free(self , rsthis: & QGesture) -> RetType;
}
// proto: void QGesture::~QGesture();
impl<'a> /*trait*/ QGesture_free<()> for () {
fn free(self , rsthis: & QGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN8QGestureD2Ev()};
unsafe {C_ZN8QGestureD2Ev(rsthis.qclsinst)};
// return 1;
}
}
impl /*struct*/ QGestureEvent {
pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QGestureEvent {
return QGestureEvent{qbase: QEvent::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
}
}
impl Deref for QGestureEvent {
type Target = QEvent;
fn deref(&self) -> &QEvent {
return & self.qbase;
}
}
impl AsRef<QEvent> for QGestureEvent {
fn as_ref(& self) -> & QEvent {
return & self.qbase;
}
}
// proto: bool QGestureEvent::isAccepted(QGesture * );
impl /*struct*/ QGestureEvent {
pub fn isAccepted<RetType, T: QGestureEvent_isAccepted<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.isAccepted(self);
// return 1;
}
}
pub trait QGestureEvent_isAccepted<RetType> {
fn isAccepted(self , rsthis: & QGestureEvent) -> RetType;
}
// proto: bool QGestureEvent::isAccepted(QGesture * );
impl<'a> /*trait*/ QGestureEvent_isAccepted<i8> for (&'a QGesture) {
fn isAccepted(self , rsthis: & QGestureEvent) -> i8 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QGestureEvent10isAcceptedEP8QGesture()};
let arg0 = self.qclsinst as *mut c_void;
let mut ret = unsafe {C_ZNK13QGestureEvent10isAcceptedEP8QGesture(rsthis.qclsinst, arg0)};
return ret as i8; // 1
// return 1;
}
}
// proto: QWidget * QGestureEvent::widget();
impl /*struct*/ QGestureEvent {
pub fn widget<RetType, T: QGestureEvent_widget<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.widget(self);
// return 1;
}
}
pub trait QGestureEvent_widget<RetType> {
fn widget(self , rsthis: & QGestureEvent) -> RetType;
}
// proto: QWidget * QGestureEvent::widget();
impl<'a> /*trait*/ QGestureEvent_widget<QWidget> for () {
fn widget(self , rsthis: & QGestureEvent) -> QWidget {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QGestureEvent6widgetEv()};
let mut ret = unsafe {C_ZNK13QGestureEvent6widgetEv(rsthis.qclsinst)};
let mut ret1 = QWidget::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QGestureEvent::ignore(QGesture * );
impl /*struct*/ QGestureEvent {
pub fn ignore<RetType, T: QGestureEvent_ignore<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.ignore(self);
// return 1;
}
}
pub trait QGestureEvent_ignore<RetType> {
fn ignore(self , rsthis: & QGestureEvent) -> RetType;
}
// proto: void QGestureEvent::ignore(QGesture * );
impl<'a> /*trait*/ QGestureEvent_ignore<()> for (&'a QGesture) {
fn ignore(self , rsthis: & QGestureEvent) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QGestureEvent6ignoreEP8QGesture()};
let arg0 = self.qclsinst as *mut c_void;
unsafe {C_ZN13QGestureEvent6ignoreEP8QGesture(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: void QGestureEvent::accept(QGesture * );
impl /*struct*/ QGestureEvent {
pub fn accept<RetType, T: QGestureEvent_accept<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.accept(self);
// return 1;
}
}
pub trait QGestureEvent_accept<RetType> {
fn accept(self , rsthis: & QGestureEvent) -> RetType;
}
// proto: void QGestureEvent::accept(QGesture * );
impl<'a> /*trait*/ QGestureEvent_accept<()> for (&'a QGesture) {
fn accept(self , rsthis: & QGestureEvent) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QGestureEvent6acceptEP8QGesture()};
let arg0 = self.qclsinst as *mut c_void;
unsafe {C_ZN13QGestureEvent6acceptEP8QGesture(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: QList<QGesture *> QGestureEvent::activeGestures();
impl /*struct*/ QGestureEvent {
pub fn activeGestures<RetType, T: QGestureEvent_activeGestures<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.activeGestures(self);
// return 1;
}
}
pub trait QGestureEvent_activeGestures<RetType> {
fn activeGestures(self , rsthis: & QGestureEvent) -> RetType;
}
// proto: QList<QGesture *> QGestureEvent::activeGestures();
impl<'a> /*trait*/ QGestureEvent_activeGestures<u64> for () {
fn activeGestures(self , rsthis: & QGestureEvent) -> u64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QGestureEvent14activeGesturesEv()};
let mut ret = unsafe {C_ZNK13QGestureEvent14activeGesturesEv(rsthis.qclsinst)};
return ret as u64; // 5
// return 1;
}
}
// proto: QList<QGesture *> QGestureEvent::gestures();
impl /*struct*/ QGestureEvent {
pub fn gestures<RetType, T: QGestureEvent_gestures<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.gestures(self);
// return 1;
}
}
pub trait QGestureEvent_gestures<RetType> {
fn gestures(self , rsthis: & QGestureEvent) -> RetType;
}
// proto: QList<QGesture *> QGestureEvent::gestures();
impl<'a> /*trait*/ QGestureEvent_gestures<u64> for () {
fn gestures(self , rsthis: & QGestureEvent) -> u64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QGestureEvent8gesturesEv()};
let mut ret = unsafe {C_ZNK13QGestureEvent8gesturesEv(rsthis.qclsinst)};
return ret as u64; // 5
// return 1;
}
}
// proto: void QGestureEvent::setAccepted(QGesture * , bool );
impl /*struct*/ QGestureEvent {
pub fn setAccepted<RetType, T: QGestureEvent_setAccepted<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setAccepted(self);
// return 1;
}
}
pub trait QGestureEvent_setAccepted<RetType> {
fn setAccepted(self , rsthis: & QGestureEvent) -> RetType;
}
// proto: void QGestureEvent::setAccepted(QGesture * , bool );
impl<'a> /*trait*/ QGestureEvent_setAccepted<()> for (&'a QGesture, i8) {
fn setAccepted(self , rsthis: & QGestureEvent) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QGestureEvent11setAcceptedEP8QGestureb()};
let arg0 = self.0.qclsinst as *mut c_void;
let arg1 = self.1 as c_char;
unsafe {C_ZN13QGestureEvent11setAcceptedEP8QGestureb(rsthis.qclsinst, arg0, arg1)};
// return 1;
}
}
// proto: void QGestureEvent::setWidget(QWidget * widget);
impl /*struct*/ QGestureEvent {
pub fn setWidget<RetType, T: QGestureEvent_setWidget<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setWidget(self);
// return 1;
}
}
pub trait QGestureEvent_setWidget<RetType> {
fn setWidget(self , rsthis: & QGestureEvent) -> RetType;
}
// proto: void QGestureEvent::setWidget(QWidget * widget);
impl<'a> /*trait*/ QGestureEvent_setWidget<()> for (&'a QWidget) {
fn setWidget(self , rsthis: & QGestureEvent) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QGestureEvent9setWidgetEP7QWidget()};
let arg0 = self.qclsinst as *mut c_void;
unsafe {C_ZN13QGestureEvent9setWidgetEP7QWidget(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: void QGestureEvent::~QGestureEvent();
impl /*struct*/ QGestureEvent {
pub fn free<RetType, T: QGestureEvent_free<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.free(self);
// return 1;
}
}
pub trait QGestureEvent_free<RetType> {
fn free(self , rsthis: & QGestureEvent) -> RetType;
}
// proto: void QGestureEvent::~QGestureEvent();
impl<'a> /*trait*/ QGestureEvent_free<()> for () {
fn free(self , rsthis: & QGestureEvent) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QGestureEventD2Ev()};
unsafe {C_ZN13QGestureEventD2Ev(rsthis.qclsinst)};
// return 1;
}
}
// proto: QList<QGesture *> QGestureEvent::canceledGestures();
impl /*struct*/ QGestureEvent {
pub fn canceledGestures<RetType, T: QGestureEvent_canceledGestures<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.canceledGestures(self);
// return 1;
}
}
pub trait QGestureEvent_canceledGestures<RetType> {
fn canceledGestures(self , rsthis: & QGestureEvent) -> RetType;
}
// proto: QList<QGesture *> QGestureEvent::canceledGestures();
impl<'a> /*trait*/ QGestureEvent_canceledGestures<u64> for () {
fn canceledGestures(self , rsthis: & QGestureEvent) -> u64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QGestureEvent16canceledGesturesEv()};
let mut ret = unsafe {C_ZNK13QGestureEvent16canceledGesturesEv(rsthis.qclsinst)};
return ret as u64; // 5
// return 1;
}
}
// proto: QPointF QGestureEvent::mapToGraphicsScene(const QPointF & gesturePoint);
impl /*struct*/ QGestureEvent {
pub fn mapToGraphicsScene<RetType, T: QGestureEvent_mapToGraphicsScene<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.mapToGraphicsScene(self);
// return 1;
}
}
pub trait QGestureEvent_mapToGraphicsScene<RetType> {
fn mapToGraphicsScene(self , rsthis: & QGestureEvent) -> RetType;
}
// proto: QPointF QGestureEvent::mapToGraphicsScene(const QPointF & gesturePoint);
impl<'a> /*trait*/ QGestureEvent_mapToGraphicsScene<QPointF> for (&'a QPointF) {
fn mapToGraphicsScene(self , rsthis: & QGestureEvent) -> QPointF {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QGestureEvent18mapToGraphicsSceneERK7QPointF()};
let arg0 = self.qclsinst as *mut c_void;
let mut ret = unsafe {C_ZNK13QGestureEvent18mapToGraphicsSceneERK7QPointF(rsthis.qclsinst, arg0)};
let mut ret1 = QPointF::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
impl /*struct*/ QPanGesture {
pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QPanGesture {
return QPanGesture{qbase: QGesture::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
}
}
impl Deref for QPanGesture {
type Target = QGesture;
fn deref(&self) -> &QGesture {
return & self.qbase;
}
}
impl AsRef<QGesture> for QPanGesture {
fn as_ref(& self) -> & QGesture {
return & self.qbase;
}
}
// proto: QPointF QPanGesture::offset();
impl /*struct*/ QPanGesture {
pub fn offset<RetType, T: QPanGesture_offset<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.offset(self);
// return 1;
}
}
pub trait QPanGesture_offset<RetType> {
fn offset(self , rsthis: & QPanGesture) -> RetType;
}
// proto: QPointF QPanGesture::offset();
impl<'a> /*trait*/ QPanGesture_offset<QPointF> for () {
fn offset(self , rsthis: & QPanGesture) -> QPointF {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK11QPanGesture6offsetEv()};
let mut ret = unsafe {C_ZNK11QPanGesture6offsetEv(rsthis.qclsinst)};
let mut ret1 = QPointF::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: QPointF QPanGesture::delta();
impl /*struct*/ QPanGesture {
pub fn delta<RetType, T: QPanGesture_delta<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.delta(self);
// return 1;
}
}
pub trait QPanGesture_delta<RetType> {
fn delta(self , rsthis: & QPanGesture) -> RetType;
}
// proto: QPointF QPanGesture::delta();
impl<'a> /*trait*/ QPanGesture_delta<QPointF> for () {
fn delta(self , rsthis: & QPanGesture) -> QPointF {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK11QPanGesture5deltaEv()};
let mut ret = unsafe {C_ZNK11QPanGesture5deltaEv(rsthis.qclsinst)};
let mut ret1 = QPointF::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QPanGesture::setOffset(const QPointF & value);
impl /*struct*/ QPanGesture {
pub fn setOffset<RetType, T: QPanGesture_setOffset<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setOffset(self);
// return 1;
}
}
pub trait QPanGesture_setOffset<RetType> {
fn setOffset(self , rsthis: & QPanGesture) -> RetType;
}
// proto: void QPanGesture::setOffset(const QPointF & value);
impl<'a> /*trait*/ QPanGesture_setOffset<()> for (&'a QPointF) {
fn setOffset(self , rsthis: & QPanGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN11QPanGesture9setOffsetERK7QPointF()};
let arg0 = self.qclsinst as *mut c_void;
unsafe {C_ZN11QPanGesture9setOffsetERK7QPointF(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: qreal QPanGesture::acceleration();
impl /*struct*/ QPanGesture {
pub fn acceleration<RetType, T: QPanGesture_acceleration<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.acceleration(self);
// return 1;
}
}
pub trait QPanGesture_acceleration<RetType> {
fn acceleration(self , rsthis: & QPanGesture) -> RetType;
}
// proto: qreal QPanGesture::acceleration();
impl<'a> /*trait*/ QPanGesture_acceleration<f64> for () {
fn acceleration(self , rsthis: & QPanGesture) -> f64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK11QPanGesture12accelerationEv()};
let mut ret = unsafe {C_ZNK11QPanGesture12accelerationEv(rsthis.qclsinst)};
return ret as f64; // 1
// return 1;
}
}
// proto: void QPanGesture::~QPanGesture();
impl /*struct*/ QPanGesture {
pub fn free<RetType, T: QPanGesture_free<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.free(self);
// return 1;
}
}
pub trait QPanGesture_free<RetType> {
fn free(self , rsthis: & QPanGesture) -> RetType;
}
// proto: void QPanGesture::~QPanGesture();
impl<'a> /*trait*/ QPanGesture_free<()> for () {
fn free(self , rsthis: & QPanGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN11QPanGestureD2Ev()};
unsafe {C_ZN11QPanGestureD2Ev(rsthis.qclsinst)};
// return 1;
}
}
// proto: void QPanGesture::QPanGesture(QObject * parent);
impl /*struct*/ QPanGesture {
pub fn new<T: QPanGesture_new>(value: T) -> QPanGesture {
let rsthis = value.new();
return rsthis;
// return 1;
}
}
pub trait QPanGesture_new {
fn new(self) -> QPanGesture;
}
// proto: void QPanGesture::QPanGesture(QObject * parent);
impl<'a> /*trait*/ QPanGesture_new for (Option<&'a QObject>) {
fn new(self) -> QPanGesture {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN11QPanGestureC2EP7QObject()};
let ctysz: c_int = unsafe{QPanGesture_Class_Size()};
let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64;
let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void;
let qthis: u64 = unsafe {C_ZN11QPanGestureC2EP7QObject(arg0)};
let rsthis = QPanGesture{qbase: QGesture::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
return rsthis;
// return 1;
}
}
// proto: const QMetaObject * QPanGesture::metaObject();
impl /*struct*/ QPanGesture {
pub fn metaObject<RetType, T: QPanGesture_metaObject<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.metaObject(self);
// return 1;
}
}
pub trait QPanGesture_metaObject<RetType> {
fn metaObject(self , rsthis: & QPanGesture) -> RetType;
}
// proto: const QMetaObject * QPanGesture::metaObject();
impl<'a> /*trait*/ QPanGesture_metaObject<QMetaObject> for () {
fn metaObject(self , rsthis: & QPanGesture) -> QMetaObject {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK11QPanGesture10metaObjectEv()};
let mut ret = unsafe {C_ZNK11QPanGesture10metaObjectEv(rsthis.qclsinst)};
let mut ret1 = QMetaObject::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QPanGesture::setAcceleration(qreal value);
impl /*struct*/ QPanGesture {
pub fn setAcceleration<RetType, T: QPanGesture_setAcceleration<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setAcceleration(self);
// return 1;
}
}
pub trait QPanGesture_setAcceleration<RetType> {
fn setAcceleration(self , rsthis: & QPanGesture) -> RetType;
}
// proto: void QPanGesture::setAcceleration(qreal value);
impl<'a> /*trait*/ QPanGesture_setAcceleration<()> for (f64) {
fn setAcceleration(self , rsthis: & QPanGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN11QPanGesture15setAccelerationEd()};
let arg0 = self as c_double;
unsafe {C_ZN11QPanGesture15setAccelerationEd(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: QPointF QPanGesture::lastOffset();
impl /*struct*/ QPanGesture {
pub fn lastOffset<RetType, T: QPanGesture_lastOffset<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.lastOffset(self);
// return 1;
}
}
pub trait QPanGesture_lastOffset<RetType> {
fn lastOffset(self , rsthis: & QPanGesture) -> RetType;
}
// proto: QPointF QPanGesture::lastOffset();
impl<'a> /*trait*/ QPanGesture_lastOffset<QPointF> for () {
fn lastOffset(self , rsthis: & QPanGesture) -> QPointF {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK11QPanGesture10lastOffsetEv()};
let mut ret = unsafe {C_ZNK11QPanGesture10lastOffsetEv(rsthis.qclsinst)};
let mut ret1 = QPointF::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QPanGesture::setLastOffset(const QPointF & value);
impl /*struct*/ QPanGesture {
pub fn setLastOffset<RetType, T: QPanGesture_setLastOffset<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setLastOffset(self);
// return 1;
}
}
pub trait QPanGesture_setLastOffset<RetType> {
fn setLastOffset(self , rsthis: & QPanGesture) -> RetType;
}
// proto: void QPanGesture::setLastOffset(const QPointF & value);
impl<'a> /*trait*/ QPanGesture_setLastOffset<()> for (&'a QPointF) {
fn setLastOffset(self , rsthis: & QPanGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN11QPanGesture13setLastOffsetERK7QPointF()};
let arg0 = self.qclsinst as *mut c_void;
unsafe {C_ZN11QPanGesture13setLastOffsetERK7QPointF(rsthis.qclsinst, arg0)};
// return 1;
}
}
impl /*struct*/ QTapAndHoldGesture {
pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QTapAndHoldGesture {
return QTapAndHoldGesture{qbase: QGesture::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
}
}
impl Deref for QTapAndHoldGesture {
type Target = QGesture;
fn deref(&self) -> &QGesture {
return & self.qbase;
}
}
impl AsRef<QGesture> for QTapAndHoldGesture {
fn as_ref(& self) -> & QGesture {
return & self.qbase;
}
}
// proto: void QTapAndHoldGesture::QTapAndHoldGesture(QObject * parent);
impl /*struct*/ QTapAndHoldGesture {
pub fn new<T: QTapAndHoldGesture_new>(value: T) -> QTapAndHoldGesture {
let rsthis = value.new();
return rsthis;
// return 1;
}
}
pub trait QTapAndHoldGesture_new {
fn new(self) -> QTapAndHoldGesture;
}
// proto: void QTapAndHoldGesture::QTapAndHoldGesture(QObject * parent);
impl<'a> /*trait*/ QTapAndHoldGesture_new for (Option<&'a QObject>) {
fn new(self) -> QTapAndHoldGesture {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QTapAndHoldGestureC2EP7QObject()};
let ctysz: c_int = unsafe{QTapAndHoldGesture_Class_Size()};
let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64;
let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void;
let qthis: u64 = unsafe {C_ZN18QTapAndHoldGestureC2EP7QObject(arg0)};
let rsthis = QTapAndHoldGesture{qbase: QGesture::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
return rsthis;
// return 1;
}
}
// proto: void QTapAndHoldGesture::~QTapAndHoldGesture();
impl /*struct*/ QTapAndHoldGesture {
pub fn free<RetType, T: QTapAndHoldGesture_free<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.free(self);
// return 1;
}
}
pub trait QTapAndHoldGesture_free<RetType> {
fn free(self , rsthis: & QTapAndHoldGesture) -> RetType;
}
// proto: void QTapAndHoldGesture::~QTapAndHoldGesture();
impl<'a> /*trait*/ QTapAndHoldGesture_free<()> for () {
fn free(self , rsthis: & QTapAndHoldGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QTapAndHoldGestureD2Ev()};
unsafe {C_ZN18QTapAndHoldGestureD2Ev(rsthis.qclsinst)};
// return 1;
}
}
// proto: QPointF QTapAndHoldGesture::position();
impl /*struct*/ QTapAndHoldGesture {
pub fn position<RetType, T: QTapAndHoldGesture_position<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.position(self);
// return 1;
}
}
pub trait QTapAndHoldGesture_position<RetType> {
fn position(self , rsthis: & QTapAndHoldGesture) -> RetType;
}
// proto: QPointF QTapAndHoldGesture::position();
impl<'a> /*trait*/ QTapAndHoldGesture_position<QPointF> for () {
fn position(self , rsthis: & QTapAndHoldGesture) -> QPointF {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK18QTapAndHoldGesture8positionEv()};
let mut ret = unsafe {C_ZNK18QTapAndHoldGesture8positionEv(rsthis.qclsinst)};
let mut ret1 = QPointF::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: static void QTapAndHoldGesture::setTimeout(int msecs);
impl /*struct*/ QTapAndHoldGesture {
pub fn setTimeout_s<RetType, T: QTapAndHoldGesture_setTimeout_s<RetType>>( overload_args: T) -> RetType {
return overload_args.setTimeout_s();
// return 1;
}
}
pub trait QTapAndHoldGesture_setTimeout_s<RetType> {
fn setTimeout_s(self ) -> RetType;
}
// proto: static void QTapAndHoldGesture::setTimeout(int msecs);
impl<'a> /*trait*/ QTapAndHoldGesture_setTimeout_s<()> for (i32) {
fn setTimeout_s(self ) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QTapAndHoldGesture10setTimeoutEi()};
let arg0 = self as c_int;
unsafe {C_ZN18QTapAndHoldGesture10setTimeoutEi(arg0)};
// return 1;
}
}
// proto: static int QTapAndHoldGesture::timeout();
impl /*struct*/ QTapAndHoldGesture {
pub fn timeout_s<RetType, T: QTapAndHoldGesture_timeout_s<RetType>>( overload_args: T) -> RetType {
return overload_args.timeout_s();
// return 1;
}
}
pub trait QTapAndHoldGesture_timeout_s<RetType> {
fn timeout_s(self ) -> RetType;
}
// proto: static int QTapAndHoldGesture::timeout();
impl<'a> /*trait*/ QTapAndHoldGesture_timeout_s<i32> for () {
fn timeout_s(self ) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QTapAndHoldGesture7timeoutEv()};
let mut ret = unsafe {C_ZN18QTapAndHoldGesture7timeoutEv()};
return ret as i32; // 1
// return 1;
}
}
// proto: const QMetaObject * QTapAndHoldGesture::metaObject();
impl /*struct*/ QTapAndHoldGesture {
pub fn metaObject<RetType, T: QTapAndHoldGesture_metaObject<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.metaObject(self);
// return 1;
}
}
pub trait QTapAndHoldGesture_metaObject<RetType> {
fn metaObject(self , rsthis: & QTapAndHoldGesture) -> RetType;
}
// proto: const QMetaObject * QTapAndHoldGesture::metaObject();
impl<'a> /*trait*/ QTapAndHoldGesture_metaObject<QMetaObject> for () {
fn metaObject(self , rsthis: & QTapAndHoldGesture) -> QMetaObject {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK18QTapAndHoldGesture10metaObjectEv()};
let mut ret = unsafe {C_ZNK18QTapAndHoldGesture10metaObjectEv(rsthis.qclsinst)};
let mut ret1 = QMetaObject::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QTapAndHoldGesture::setPosition(const QPointF & pos);
impl /*struct*/ QTapAndHoldGesture {
pub fn setPosition<RetType, T: QTapAndHoldGesture_setPosition<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setPosition(self);
// return 1;
}
}
pub trait QTapAndHoldGesture_setPosition<RetType> {
fn setPosition(self , rsthis: & QTapAndHoldGesture) -> RetType;
}
// proto: void QTapAndHoldGesture::setPosition(const QPointF & pos);
impl<'a> /*trait*/ QTapAndHoldGesture_setPosition<()> for (&'a QPointF) {
fn setPosition(self , rsthis: & QTapAndHoldGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QTapAndHoldGesture11setPositionERK7QPointF()};
let arg0 = self.qclsinst as *mut c_void;
unsafe {C_ZN18QTapAndHoldGesture11setPositionERK7QPointF(rsthis.qclsinst, arg0)};
// return 1;
}
}
impl /*struct*/ QTapGesture {
pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QTapGesture {
return QTapGesture{qbase: QGesture::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
}
}
impl Deref for QTapGesture {
type Target = QGesture;
fn deref(&self) -> &QGesture {
return & self.qbase;
}
}
impl AsRef<QGesture> for QTapGesture {
fn as_ref(& self) -> & QGesture {
return & self.qbase;
}
}
// proto: QPointF QTapGesture::position();
impl /*struct*/ QTapGesture {
pub fn position<RetType, T: QTapGesture_position<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.position(self);
// return 1;
}
}
pub trait QTapGesture_position<RetType> {
fn position(self , rsthis: & QTapGesture) -> RetType;
}
// proto: QPointF QTapGesture::position();
impl<'a> /*trait*/ QTapGesture_position<QPointF> for () {
fn position(self , rsthis: & QTapGesture) -> QPointF {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK11QTapGesture8positionEv()};
let mut ret = unsafe {C_ZNK11QTapGesture8positionEv(rsthis.qclsinst)};
let mut ret1 = QPointF::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QTapGesture::setPosition(const QPointF & pos);
impl /*struct*/ QTapGesture {
pub fn setPosition<RetType, T: QTapGesture_setPosition<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setPosition(self);
// return 1;
}
}
pub trait QTapGesture_setPosition<RetType> {
fn setPosition(self , rsthis: & QTapGesture) -> RetType;
}
// proto: void QTapGesture::setPosition(const QPointF & pos);
impl<'a> /*trait*/ QTapGesture_setPosition<()> for (&'a QPointF) {
fn setPosition(self , rsthis: & QTapGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN11QTapGesture11setPositionERK7QPointF()};
let arg0 = self.qclsinst as *mut c_void;
unsafe {C_ZN11QTapGesture11setPositionERK7QPointF(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: void QTapGesture::QTapGesture(QObject * parent);
impl /*struct*/ QTapGesture {
pub fn new<T: QTapGesture_new>(value: T) -> QTapGesture {
let rsthis = value.new();
return rsthis;
// return 1;
}
}
pub trait QTapGesture_new {
fn new(self) -> QTapGesture;
}
// proto: void QTapGesture::QTapGesture(QObject * parent);
impl<'a> /*trait*/ QTapGesture_new for (Option<&'a QObject>) {
fn new(self) -> QTapGesture {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN11QTapGestureC2EP7QObject()};
let ctysz: c_int = unsafe{QTapGesture_Class_Size()};
let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64;
let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void;
let qthis: u64 = unsafe {C_ZN11QTapGestureC2EP7QObject(arg0)};
let rsthis = QTapGesture{qbase: QGesture::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
return rsthis;
// return 1;
}
}
// proto: const QMetaObject * QTapGesture::metaObject();
impl /*struct*/ QTapGesture {
pub fn metaObject<RetType, T: QTapGesture_metaObject<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.metaObject(self);
// return 1;
}
}
pub trait QTapGesture_metaObject<RetType> {
fn metaObject(self , rsthis: & QTapGesture) -> RetType;
}
// proto: const QMetaObject * QTapGesture::metaObject();
impl<'a> /*trait*/ QTapGesture_metaObject<QMetaObject> for () {
fn metaObject(self , rsthis: & QTapGesture) -> QMetaObject {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK11QTapGesture10metaObjectEv()};
let mut ret = unsafe {C_ZNK11QTapGesture10metaObjectEv(rsthis.qclsinst)};
let mut ret1 = QMetaObject::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QTapGesture::~QTapGesture();
impl /*struct*/ QTapGesture {
pub fn free<RetType, T: QTapGesture_free<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.free(self);
// return 1;
}
}
pub trait QTapGesture_free<RetType> {
fn free(self , rsthis: & QTapGesture) -> RetType;
}
// proto: void QTapGesture::~QTapGesture();
impl<'a> /*trait*/ QTapGesture_free<()> for () {
fn free(self , rsthis: & QTapGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN11QTapGestureD2Ev()};
unsafe {C_ZN11QTapGestureD2Ev(rsthis.qclsinst)};
// return 1;
}
}
impl /*struct*/ QPinchGesture {
pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QPinchGesture {
return QPinchGesture{qbase: QGesture::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
}
}
impl Deref for QPinchGesture {
type Target = QGesture;
fn deref(&self) -> &QGesture {
return & self.qbase;
}
}
impl AsRef<QGesture> for QPinchGesture {
fn as_ref(& self) -> & QGesture {
return & self.qbase;
}
}
// proto: void QPinchGesture::setRotationAngle(qreal value);
impl /*struct*/ QPinchGesture {
pub fn setRotationAngle<RetType, T: QPinchGesture_setRotationAngle<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setRotationAngle(self);
// return 1;
}
}
pub trait QPinchGesture_setRotationAngle<RetType> {
fn setRotationAngle(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: void QPinchGesture::setRotationAngle(qreal value);
impl<'a> /*trait*/ QPinchGesture_setRotationAngle<()> for (f64) {
fn setRotationAngle(self , rsthis: & QPinchGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QPinchGesture16setRotationAngleEd()};
let arg0 = self as c_double;
unsafe {C_ZN13QPinchGesture16setRotationAngleEd(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: qreal QPinchGesture::lastScaleFactor();
impl /*struct*/ QPinchGesture {
pub fn lastScaleFactor<RetType, T: QPinchGesture_lastScaleFactor<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.lastScaleFactor(self);
// return 1;
}
}
pub trait QPinchGesture_lastScaleFactor<RetType> {
fn lastScaleFactor(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: qreal QPinchGesture::lastScaleFactor();
impl<'a> /*trait*/ QPinchGesture_lastScaleFactor<f64> for () {
fn lastScaleFactor(self , rsthis: & QPinchGesture) -> f64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QPinchGesture15lastScaleFactorEv()};
let mut ret = unsafe {C_ZNK13QPinchGesture15lastScaleFactorEv(rsthis.qclsinst)};
return ret as f64; // 1
// return 1;
}
}
// proto: qreal QPinchGesture::lastRotationAngle();
impl /*struct*/ QPinchGesture {
pub fn lastRotationAngle<RetType, T: QPinchGesture_lastRotationAngle<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.lastRotationAngle(self);
// return 1;
}
}
pub trait QPinchGesture_lastRotationAngle<RetType> {
fn lastRotationAngle(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: qreal QPinchGesture::lastRotationAngle();
impl<'a> /*trait*/ QPinchGesture_lastRotationAngle<f64> for () {
fn lastRotationAngle(self , rsthis: & QPinchGesture) -> f64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QPinchGesture17lastRotationAngleEv()};
let mut ret = unsafe {C_ZNK13QPinchGesture17lastRotationAngleEv(rsthis.qclsinst)};
return ret as f64; // 1
// return 1;
}
}
// proto: QPointF QPinchGesture::startCenterPoint();
impl /*struct*/ QPinchGesture {
pub fn startCenterPoint<RetType, T: QPinchGesture_startCenterPoint<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.startCenterPoint(self);
// return 1;
}
}
pub trait QPinchGesture_startCenterPoint<RetType> {
fn startCenterPoint(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: QPointF QPinchGesture::startCenterPoint();
impl<'a> /*trait*/ QPinchGesture_startCenterPoint<QPointF> for () {
fn startCenterPoint(self , rsthis: & QPinchGesture) -> QPointF {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QPinchGesture16startCenterPointEv()};
let mut ret = unsafe {C_ZNK13QPinchGesture16startCenterPointEv(rsthis.qclsinst)};
let mut ret1 = QPointF::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: qreal QPinchGesture::rotationAngle();
impl /*struct*/ QPinchGesture {
pub fn rotationAngle<RetType, T: QPinchGesture_rotationAngle<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.rotationAngle(self);
// return 1;
}
}
pub trait QPinchGesture_rotationAngle<RetType> {
fn rotationAngle(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: qreal QPinchGesture::rotationAngle();
impl<'a> /*trait*/ QPinchGesture_rotationAngle<f64> for () {
fn rotationAngle(self , rsthis: & QPinchGesture) -> f64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QPinchGesture13rotationAngleEv()};
let mut ret = unsafe {C_ZNK13QPinchGesture13rotationAngleEv(rsthis.qclsinst)};
return ret as f64; // 1
// return 1;
}
}
// proto: QPointF QPinchGesture::lastCenterPoint();
impl /*struct*/ QPinchGesture {
pub fn lastCenterPoint<RetType, T: QPinchGesture_lastCenterPoint<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.lastCenterPoint(self);
// return 1;
}
}
pub trait QPinchGesture_lastCenterPoint<RetType> {
fn lastCenterPoint(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: QPointF QPinchGesture::lastCenterPoint();
impl<'a> /*trait*/ QPinchGesture_lastCenterPoint<QPointF> for () {
fn lastCenterPoint(self , rsthis: & QPinchGesture) -> QPointF {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QPinchGesture15lastCenterPointEv()};
let mut ret = unsafe {C_ZNK13QPinchGesture15lastCenterPointEv(rsthis.qclsinst)};
let mut ret1 = QPointF::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QPinchGesture::QPinchGesture(QObject * parent);
impl /*struct*/ QPinchGesture {
pub fn new<T: QPinchGesture_new>(value: T) -> QPinchGesture {
let rsthis = value.new();
return rsthis;
// return 1;
}
}
pub trait QPinchGesture_new {
fn new(self) -> QPinchGesture;
}
// proto: void QPinchGesture::QPinchGesture(QObject * parent);
impl<'a> /*trait*/ QPinchGesture_new for (Option<&'a QObject>) {
fn new(self) -> QPinchGesture {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QPinchGestureC2EP7QObject()};
let ctysz: c_int = unsafe{QPinchGesture_Class_Size()};
let qthis_ph: u64 = unsafe{calloc(1, ctysz as usize)} as u64;
let arg0 = (if self.is_none() {0} else {self.unwrap().qclsinst}) as *mut c_void;
let qthis: u64 = unsafe {C_ZN13QPinchGestureC2EP7QObject(arg0)};
let rsthis = QPinchGesture{qbase: QGesture::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
return rsthis;
// return 1;
}
}
// proto: qreal QPinchGesture::totalScaleFactor();
impl /*struct*/ QPinchGesture {
pub fn totalScaleFactor<RetType, T: QPinchGesture_totalScaleFactor<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.totalScaleFactor(self);
// return 1;
}
}
pub trait QPinchGesture_totalScaleFactor<RetType> {
fn totalScaleFactor(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: qreal QPinchGesture::totalScaleFactor();
impl<'a> /*trait*/ QPinchGesture_totalScaleFactor<f64> for () {
fn totalScaleFactor(self , rsthis: & QPinchGesture) -> f64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QPinchGesture16totalScaleFactorEv()};
let mut ret = unsafe {C_ZNK13QPinchGesture16totalScaleFactorEv(rsthis.qclsinst)};
return ret as f64; // 1
// return 1;
}
}
// proto: void QPinchGesture::setTotalScaleFactor(qreal value);
impl /*struct*/ QPinchGesture {
pub fn setTotalScaleFactor<RetType, T: QPinchGesture_setTotalScaleFactor<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setTotalScaleFactor(self);
// return 1;
}
}
pub trait QPinchGesture_setTotalScaleFactor<RetType> {
fn setTotalScaleFactor(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: void QPinchGesture::setTotalScaleFactor(qreal value);
impl<'a> /*trait*/ QPinchGesture_setTotalScaleFactor<()> for (f64) {
fn setTotalScaleFactor(self , rsthis: & QPinchGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QPinchGesture19setTotalScaleFactorEd()};
let arg0 = self as c_double;
unsafe {C_ZN13QPinchGesture19setTotalScaleFactorEd(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: qreal QPinchGesture::totalRotationAngle();
impl /*struct*/ QPinchGesture {
pub fn totalRotationAngle<RetType, T: QPinchGesture_totalRotationAngle<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.totalRotationAngle(self);
// return 1;
}
}
pub trait QPinchGesture_totalRotationAngle<RetType> {
fn totalRotationAngle(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: qreal QPinchGesture::totalRotationAngle();
impl<'a> /*trait*/ QPinchGesture_totalRotationAngle<f64> for () {
fn totalRotationAngle(self , rsthis: & QPinchGesture) -> f64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QPinchGesture18totalRotationAngleEv()};
let mut ret = unsafe {C_ZNK13QPinchGesture18totalRotationAngleEv(rsthis.qclsinst)};
return ret as f64; // 1
// return 1;
}
}
// proto: void QPinchGesture::setLastScaleFactor(qreal value);
impl /*struct*/ QPinchGesture {
pub fn setLastScaleFactor<RetType, T: QPinchGesture_setLastScaleFactor<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setLastScaleFactor(self);
// return 1;
}
}
pub trait QPinchGesture_setLastScaleFactor<RetType> {
fn setLastScaleFactor(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: void QPinchGesture::setLastScaleFactor(qreal value);
impl<'a> /*trait*/ QPinchGesture_setLastScaleFactor<()> for (f64) {
fn setLastScaleFactor(self , rsthis: & QPinchGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QPinchGesture18setLastScaleFactorEd()};
let arg0 = self as c_double;
unsafe {C_ZN13QPinchGesture18setLastScaleFactorEd(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: void QPinchGesture::setLastCenterPoint(const QPointF & value);
impl /*struct*/ QPinchGesture {
pub fn setLastCenterPoint<RetType, T: QPinchGesture_setLastCenterPoint<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setLastCenterPoint(self);
// return 1;
}
}
pub trait QPinchGesture_setLastCenterPoint<RetType> {
fn setLastCenterPoint(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: void QPinchGesture::setLastCenterPoint(const QPointF & value);
impl<'a> /*trait*/ QPinchGesture_setLastCenterPoint<()> for (&'a QPointF) {
fn setLastCenterPoint(self , rsthis: & QPinchGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QPinchGesture18setLastCenterPointERK7QPointF()};
let arg0 = self.qclsinst as *mut c_void;
unsafe {C_ZN13QPinchGesture18setLastCenterPointERK7QPointF(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: const QMetaObject * QPinchGesture::metaObject();
impl /*struct*/ QPinchGesture {
pub fn metaObject<RetType, T: QPinchGesture_metaObject<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.metaObject(self);
// return 1;
}
}
pub trait QPinchGesture_metaObject<RetType> {
fn metaObject(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: const QMetaObject * QPinchGesture::metaObject();
impl<'a> /*trait*/ QPinchGesture_metaObject<QMetaObject> for () {
fn metaObject(self , rsthis: & QPinchGesture) -> QMetaObject {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QPinchGesture10metaObjectEv()};
let mut ret = unsafe {C_ZNK13QPinchGesture10metaObjectEv(rsthis.qclsinst)};
let mut ret1 = QMetaObject::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QPinchGesture::setLastRotationAngle(qreal value);
impl /*struct*/ QPinchGesture {
pub fn setLastRotationAngle<RetType, T: QPinchGesture_setLastRotationAngle<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setLastRotationAngle(self);
// return 1;
}
}
pub trait QPinchGesture_setLastRotationAngle<RetType> {
fn setLastRotationAngle(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: void QPinchGesture::setLastRotationAngle(qreal value);
impl<'a> /*trait*/ QPinchGesture_setLastRotationAngle<()> for (f64) {
fn setLastRotationAngle(self , rsthis: & QPinchGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QPinchGesture20setLastRotationAngleEd()};
let arg0 = self as c_double;
unsafe {C_ZN13QPinchGesture20setLastRotationAngleEd(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: QPointF QPinchGesture::centerPoint();
impl /*struct*/ QPinchGesture {
pub fn centerPoint<RetType, T: QPinchGesture_centerPoint<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.centerPoint(self);
// return 1;
}
}
pub trait QPinchGesture_centerPoint<RetType> {
fn centerPoint(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: QPointF QPinchGesture::centerPoint();
impl<'a> /*trait*/ QPinchGesture_centerPoint<QPointF> for () {
fn centerPoint(self , rsthis: & QPinchGesture) -> QPointF {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QPinchGesture11centerPointEv()};
let mut ret = unsafe {C_ZNK13QPinchGesture11centerPointEv(rsthis.qclsinst)};
let mut ret1 = QPointF::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QPinchGesture::setCenterPoint(const QPointF & value);
impl /*struct*/ QPinchGesture {
pub fn setCenterPoint<RetType, T: QPinchGesture_setCenterPoint<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setCenterPoint(self);
// return 1;
}
}
pub trait QPinchGesture_setCenterPoint<RetType> {
fn setCenterPoint(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: void QPinchGesture::setCenterPoint(const QPointF & value);
impl<'a> /*trait*/ QPinchGesture_setCenterPoint<()> for (&'a QPointF) {
fn setCenterPoint(self , rsthis: & QPinchGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QPinchGesture14setCenterPointERK7QPointF()};
let arg0 = self.qclsinst as *mut c_void;
unsafe {C_ZN13QPinchGesture14setCenterPointERK7QPointF(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: void QPinchGesture::setTotalRotationAngle(qreal value);
impl /*struct*/ QPinchGesture {
pub fn setTotalRotationAngle<RetType, T: QPinchGesture_setTotalRotationAngle<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setTotalRotationAngle(self);
// return 1;
}
}
pub trait QPinchGesture_setTotalRotationAngle<RetType> {
fn setTotalRotationAngle(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: void QPinchGesture::setTotalRotationAngle(qreal value);
impl<'a> /*trait*/ QPinchGesture_setTotalRotationAngle<()> for (f64) {
fn setTotalRotationAngle(self , rsthis: & QPinchGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QPinchGesture21setTotalRotationAngleEd()};
let arg0 = self as c_double;
unsafe {C_ZN13QPinchGesture21setTotalRotationAngleEd(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: void QPinchGesture::setScaleFactor(qreal value);
impl /*struct*/ QPinchGesture {
pub fn setScaleFactor<RetType, T: QPinchGesture_setScaleFactor<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setScaleFactor(self);
// return 1;
}
}
pub trait QPinchGesture_setScaleFactor<RetType> {
fn setScaleFactor(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: void QPinchGesture::setScaleFactor(qreal value);
impl<'a> /*trait*/ QPinchGesture_setScaleFactor<()> for (f64) {
fn setScaleFactor(self , rsthis: & QPinchGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QPinchGesture14setScaleFactorEd()};
let arg0 = self as c_double;
unsafe {C_ZN13QPinchGesture14setScaleFactorEd(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: void QPinchGesture::~QPinchGesture();
impl /*struct*/ QPinchGesture {
pub fn free<RetType, T: QPinchGesture_free<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.free(self);
// return 1;
}
}
pub trait QPinchGesture_free<RetType> {
fn free(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: void QPinchGesture::~QPinchGesture();
impl<'a> /*trait*/ QPinchGesture_free<()> for () {
fn free(self , rsthis: & QPinchGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QPinchGestureD2Ev()};
unsafe {C_ZN13QPinchGestureD2Ev(rsthis.qclsinst)};
// return 1;
}
}
// proto: void QPinchGesture::setStartCenterPoint(const QPointF & value);
impl /*struct*/ QPinchGesture {
pub fn setStartCenterPoint<RetType, T: QPinchGesture_setStartCenterPoint<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setStartCenterPoint(self);
// return 1;
}
}
pub trait QPinchGesture_setStartCenterPoint<RetType> {
fn setStartCenterPoint(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: void QPinchGesture::setStartCenterPoint(const QPointF & value);
impl<'a> /*trait*/ QPinchGesture_setStartCenterPoint<()> for (&'a QPointF) {
fn setStartCenterPoint(self , rsthis: & QPinchGesture) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN13QPinchGesture19setStartCenterPointERK7QPointF()};
let arg0 = self.qclsinst as *mut c_void;
unsafe {C_ZN13QPinchGesture19setStartCenterPointERK7QPointF(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: qreal QPinchGesture::scaleFactor();
impl /*struct*/ QPinchGesture {
pub fn scaleFactor<RetType, T: QPinchGesture_scaleFactor<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.scaleFactor(self);
// return 1;
}
}
pub trait QPinchGesture_scaleFactor<RetType> {
fn scaleFactor(self , rsthis: & QPinchGesture) -> RetType;
}
// proto: qreal QPinchGesture::scaleFactor();
impl<'a> /*trait*/ QPinchGesture_scaleFactor<f64> for () {
fn scaleFactor(self , rsthis: & QPinchGesture) -> f64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK13QPinchGesture11scaleFactorEv()};
let mut ret = unsafe {C_ZNK13QPinchGesture11scaleFactorEv(rsthis.qclsinst)};
return ret as f64; // 1
// return 1;
}
}
// <= body block end
|
use procon_reader::ProconReader;
fn main() {
let stdin = std::io::stdin();
let mut rd = ProconReader::new(stdin.lock());
let n: usize = rd.get();
let mut a: Vec<u32> = rd.get_vec(n);
let mut b: Vec<u32> = rd.get_vec(n);
let mut c: Vec<u32> = rd.get_vec(n);
a.sort();
b.sort();
c.sort();
let mut j = 0;
let mut k = 0;
let mut ans = 0;
for i in 0..n {
while j < n && b[j] <= a[i] {
j += 1;
}
if j == n {
break;
}
assert!(b[j] > a[i]);
while k < n && c[k] <= b[j] {
k += 1;
}
if k == n {
break;
}
assert!(c[k] > b[j]);
ans += 1;
j += 1;
k += 1;
}
println!("{}", ans);
}
// 1 6 8 9 14
// 2 3 10 11 12
// 4 5 7 13 15
|
//! This module describes all text information showing in the game.
use hero;
pub const STR_HERO_RACE: &str = "Race: ";
pub const STR_HERO_CLASS: &str = "Class: ";
pub const STR_HERO_LEVEL: &str = "Level: ";
pub const STR_HERO_EXP: &str = "Experience: ";
pub const STR_HERO_HP: &str = "Health/Max Health: ";
pub const STR_HERO_XY: &str = "Coordinates: ";
pub const STR_MONSTER1: &str = "Rat";
pub const STR_MONSTER2: &str = "Wolf";
pub const STR_MONSTER3: &str = "Giant Spider";
pub const STR_MONSTER4: &str = "Skeleton";
pub const STR_MONSTER5: &str = "Orc";
pub const STR_MONSTER6: &str = "Troll";
pub const STR_MONSTER7: &str = "Giant Snake";
pub const STR_TRAP: &str = "A trap works and damages your hero ";
pub const STR_LIVE: &str = "You regained your hero's health in the Source!";
pub const STR_HERO_DIED: &str = "Hero dies!";
pub const INIT_DIALOG: &str = "Select <Start> or press [Space] key to start playing.\
\nSelect <Quit> or press [Esc] key to exit.";
pub const HELP_EXIT_DIALOG: &str = "Select <Help> to get help.\n\
Select <Quit> to exit.";
pub fn help() -> String {
format!(
"[@]: Hero\n\
\n\
Tiles:\n\
[.]: Grass\n\
[:]: Ground\n\
[+]: Stairs Up\n\
[-]: Stairs Down\n\
[^]: Tree\n\
[X]: Stone\n\
\n\
Monsters:\n\
[p]: {}\n\
[%]: {}\n\
[!]: {}\n\
[#]: {}\n\
[&]: {}\n\
[j]: {}\n\
[A]: {}\n\
\n\
Gameplay keyboard shortcuts:\n\
[w], [a], [s], [d]: keys for moving of Hero\n\
[e]: Hero's slots\n\
[i]: Hero's items\n\
[Backspace]: to clear an info area on the right pane\n\
[Insert]: to take an item (you need stand on a tile with the item)",
STR_MONSTER1,
STR_MONSTER2,
STR_MONSTER3,
STR_MONSTER4,
STR_MONSTER5,
STR_MONSTER6,
STR_MONSTER7
)
}
pub const STR_MOVE_ITEM_TO_SLOTS : &str = "You move an item to your slots: ";
pub const STR_MOVE_SLOT_TO_ITEMS : &str = "You move an item from slots to items: ";
pub const STR_CANNOT_THROW_ITEM: &str = "There is the busy tile! Cannot throw the item.";
pub const STR_YOU_THROW_ITEM: &str = "You throw the item";
pub const STR_AXE: &str = "Axe";
pub const STR_SWORD: &str = "Sword";
pub const STR_BODYARMOR: &str = "Bodyarmor";
pub const STR_HELM: &str = "Helm";
pub const STR_TRAPOK: &str = "You have neutralized a trap!";
pub const STR_ADD_EXP: &str = "You increased your experience by ";
pub const STR_HANDWEAPONSKILL_OK: &str = "Now melee skills are increased.";
pub const STR_BAD_ATTACK: &str = "You missed…";
pub const STR_BAD_RANGED_ATTACK: &str = "You missed…";
pub const STR_TRAPSKILL_OK: &str = "Your skill of neutralizing traps is increased.";
pub const STR_NONE_WEAPONS: &str = "You have no weapons.";
pub const STR_NONE_RANGED_WEAPONS: &str = "You have no bow.";
pub const STR_NONE_AMMO: &str = "You have no arrows.";
pub const STR_BIG_SKIN: &str = "Monster's skin stood your blow…";
pub const STR_ATTACK: &str = "You do several points damage: ";
pub const STR_MON_KILL: &str = " is dead!";
pub const STR_MON_STOP: &str = ": attack repulsed!";
pub const STR_MON_DEF: &str = " strikes, but doesn't penetrate your defense…";
pub const STR_DEFENCESKILL_OK: &str = "You repulsed a blow!";
pub const STR_MON_ATTACK: &str = " attacks and damages your hero by";
pub const STR_HERO_ITEMS: &str = "Hero's items";
pub const STR_EMPTY_ITEM: &str = "<empty>";
pub const STR_HERO_ITEMINFO: &str = "Press [Enter] or [<key>] to move the item to `Slots`.\n\
Press [Backspace] to throw the item from `Items`.\n\
Press [q] to close the dialog.";
pub const STR_HERO_SLOTITEMS: &str = "Used items";
pub const SlotName: [&str; hero::MaxSlots] = ["Body: ", "In hand: "];
pub const STR_HERO_SLOTINFO: &str = "Press [Enter] or [<key>] to move the slot to `Items`.\n\
Press [q] to close the dialog.";
pub const STR_GAME_OVER: &str = "
######## ##### ## ## ##########
# ## # # ### ### # #
# # # ## # # ## #
## #### # # # # # # ######
# # ########### # # # #
# # # # # # # #
######## # # # # ##########
####### ## ## ########## ########
# # # # # # # #
# # # # # # #
# # # # ##### #######
# # # # # # #
# # # # # # # #
####### ##### ########## ## ##";
pub const MaxRace: usize = 4;
pub const RaceName: [&str; MaxRace] = [
"Human", "Elf", "Dwarf", "Hobbit"];
pub const MaxClass: usize = 3;
pub const ClassName: [&str; MaxClass] = [
"Warrior", "Archer", "Wizard"];
pub const STR_NEXTLEVEL: &str = "Level up!";
pub const STR_RANGEDWEAPONSKILL_OK: &str = "Archery skill has been improved!";
pub const STR_AMMO: &str = "Arrows";
pub const STR_N_TAKED_ARROWS: &str = " arrows taked!";
pub const STR_CROSS: &str = "Bow";
pub const STR_TAKED_BOW: &str = "A bow taked!";
pub const STR_TAKED_ITEM: &str = "You take the item"; |
//Include `rustful_macros` during the plugin phase
//to be able to use `router!` and `try_send!`.
#![feature(phase)]
#[phase(plugin)]
extern crate rustful_macros;
extern crate rustful;
use rustful::{Server, Request, Response};
use rustful::Method::Get;
fn say_hello(request: Request, response: Response) {
//Get the value of the path variable `:person`, from below.
let person = match request.variables.get(&"person".into_string()) {
Some(name) => name.as_slice(),
None => "stranger"
};
//Use the value of the path variable to say hello.
try_send!(response.into_writer(), format!("Hello, {}!", person) while "saying hello");
}
fn main() {
println!("Visit http://localhost:8080 or http://localhost:8080/Olivia (if your name is Olivia) to try this example.");
let router = router!{
//Handle requests for root...
"/" => Get: say_hello,
//...and one level below.
//`:person` is a path variable and it will be accessible in the handler.
"/:person" => Get: say_hello
};
//Build and run the server.
let server_result = Server::new().port(8080).handlers(router).run();
match server_result {
Ok(_server) => {},
Err(e) => println!("could not start server: {}", e)
}
} |
#[doc = r"Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r"Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::ERR {
#[doc = r"Modifies the contents of the register"]
#[inline(always)]
pub fn modify<F>(&self, f: F)
where
for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
{
let bits = self.register.get();
self.register.set(f(&R { bits }, &mut W { bits }).bits);
}
#[doc = r"Reads the contents of the register"]
#[inline(always)]
pub fn read(&self) -> R {
R {
bits: self.register.get(),
}
}
#[doc = r"Writes to the register"]
#[inline(always)]
pub fn write<F>(&self, f: F)
where
F: FnOnce(&mut W) -> &mut W,
{
self.register.set(
f(&mut W {
bits: Self::reset_value(),
})
.bits,
);
}
#[doc = r"Reset value of the register"]
#[inline(always)]
pub const fn reset_value() -> u32 {
0
}
#[doc = r"Writes the reset value to the register"]
#[inline(always)]
pub fn reset(&self) {
self.register.set(Self::reset_value())
}
}
#[doc = r"Value of the field"]
pub struct CAN_ERR_TECR {
bits: u8,
}
impl CAN_ERR_TECR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _CAN_ERR_TECW<'a> {
w: &'a mut W,
}
impl<'a> _CAN_ERR_TECW<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(255 << 0);
self.w.bits |= ((value as u32) & 255) << 0;
self.w
}
}
#[doc = r"Value of the field"]
pub struct CAN_ERR_RECR {
bits: u8,
}
impl CAN_ERR_RECR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _CAN_ERR_RECW<'a> {
w: &'a mut W,
}
impl<'a> _CAN_ERR_RECW<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits &= !(127 << 8);
self.w.bits |= ((value as u32) & 127) << 8;
self.w
}
}
#[doc = r"Value of the field"]
pub struct CAN_ERR_RPR {
bits: bool,
}
impl CAN_ERR_RPR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bit(&self) -> bool {
self.bits
}
#[doc = r"Returns `true` if the bit is clear (0)"]
#[inline(always)]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r"Returns `true` if the bit is set (1)"]
#[inline(always)]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
}
#[doc = r"Proxy"]
pub struct _CAN_ERR_RPW<'a> {
w: &'a mut W,
}
impl<'a> _CAN_ERR_RPW<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(1 << 15);
self.w.bits |= ((value as u32) & 1) << 15;
self.w
}
}
impl R {
#[doc = r"Value of the register as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u32 {
self.bits
}
#[doc = "Bits 0:7 - Transmit Error Counter"]
#[inline(always)]
pub fn can_err_tec(&self) -> CAN_ERR_TECR {
let bits = ((self.bits >> 0) & 255) as u8;
CAN_ERR_TECR { bits }
}
#[doc = "Bits 8:14 - Receive Error Counter"]
#[inline(always)]
pub fn can_err_rec(&self) -> CAN_ERR_RECR {
let bits = ((self.bits >> 8) & 127) as u8;
CAN_ERR_RECR { bits }
}
#[doc = "Bit 15 - Received Error Passive"]
#[inline(always)]
pub fn can_err_rp(&self) -> CAN_ERR_RPR {
let bits = ((self.bits >> 15) & 1) != 0;
CAN_ERR_RPR { bits }
}
}
impl W {
#[doc = r"Writes raw bits to the register"]
#[inline(always)]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.bits = bits;
self
}
#[doc = "Bits 0:7 - Transmit Error Counter"]
#[inline(always)]
pub fn can_err_tec(&mut self) -> _CAN_ERR_TECW {
_CAN_ERR_TECW { w: self }
}
#[doc = "Bits 8:14 - Receive Error Counter"]
#[inline(always)]
pub fn can_err_rec(&mut self) -> _CAN_ERR_RECW {
_CAN_ERR_RECW { w: self }
}
#[doc = "Bit 15 - Received Error Passive"]
#[inline(always)]
pub fn can_err_rp(&mut self) -> _CAN_ERR_RPW {
_CAN_ERR_RPW { w: self }
}
}
|
use floor_sqrt::floor_sqrt;
use procon_reader::ProconReader;
fn main() {
let stdin = std::io::stdin();
let mut rd = ProconReader::new(stdin.lock());
let n: usize = rd.get();
let m: usize = rd.get();
let mut g = vec![vec![]; n];
for _ in 0..m {
let a: usize = rd.get();
let b: usize = rd.get();
let (a, b) = (a - 1, b - 1);
let c: u64 = rd.get();
let d: u64 = rd.get();
g[a].push(Edge { to: b, c, d });
g[b].push(Edge { to: a, c, d });
}
let d = dijkstra(&g, 0);
if let Some(ans) = d[n - 1] {
println!("{}", ans);
} else {
println!("-1");
}
}
#[derive(Copy, Clone, Debug)]
pub struct Edge {
to: usize,
c: u64,
d: u64,
}
#[allow(clippy::many_single_char_names)]
pub fn dijkstra(g: &[Vec<Edge>], s: usize) -> Vec<Option<u64>> {
use std::cmp::Reverse;
use std::collections::BinaryHeap;
let n = g.len();
let mut dist = vec![None; n];
let mut q = BinaryHeap::new();
dist[s] = Some(0);
q.push((Reverse(0), s));
while let Some((Reverse(d), v)) = q.pop() {
match dist[v] {
Some(dv) => {
if dv < d {
continue;
}
}
None => unreachable!(),
}
for e in &g[v] {
let mut nexts = vec![d + e.c + e.d / (d + 1)];
let sqrt_d = floor_sqrt(e.d);
for dd in sqrt_d.saturating_sub(5)..=(sqrt_d + 5) {
if dd >= d {
nexts.push(dd + e.c + e.d / (dd + 1));
}
}
for next_d in nexts {
match dist[e.to] {
Some(dt) if dt <= next_d => {
continue;
}
_ => {
dist[e.to] = Some(next_d);
q.push((Reverse(next_d), e.to));
}
}
}
}
}
dist
}
|
use super::cli;
use super::exit;
use super::logging;
/// Canvasctl main function flow:
/// 1. Parse command line arguments
/// 2. Initialize logger
/// 3. Dispatch command to corresponding function
/// 4. Return
pub fn main() {
let parsed_args =
cli::CanvasCtlArgs::parse_args().unwrap_or_else(|e| exit::cleanup_and_exit(e.exit_code()));
logging::init_logger(parsed_args.verbose);
}
|
use std::error::Error;
use std::fmt::{self, Formatter};
use reqwest::Response;
use crate::data;
#[derive(Debug)]
pub enum ValidationError {
Status { expected: u16, got: u16 },
}
impl Error for ValidationError {
fn description(&self) -> &str {
match *self {
ValidationError::Status {
expected: _,
got: _,
} => "status invalid",
}
}
}
impl fmt::Display for ValidationError {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
match *self {
ValidationError::Status { expected, got } => write!(
f,
"validation error: status invalid: expected={}, got={}",
expected, got
),
}
}
}
#[derive(Clone)]
pub struct Validator {
validations: Vec<data::Validation>,
}
impl Validator {
pub fn new(validations: Option<Vec<data::Validation>>) -> Self {
let validations = match validations {
Some(v) => v,
None => Vec::new(),
};
Self { validations }
}
pub fn validate(&self, response: Response) -> Result<(), ValidationError> {
let status = response.status();
for v in self.validations.iter() {
if v.status_code != status.as_u16() {
return Err(ValidationError::Status {
expected: v.status_code,
got: status.as_u16(),
});
}
}
Ok(())
}
}
#[cfg(test)]
mod tests {
use crate::validator::ValidationError;
#[test]
fn error_test() {
let table = vec![(
ValidationError::Status {
expected: 200,
got: 200,
},
"validation error: status invalid: expected=200, got=200",
)];
for (err, res) in table {
assert_eq!(format!("{}", err), res);
}
}
}
|
use juniper::{graphql_object, GraphQLInterface};
pub struct ObjA {
id: String,
}
#[graphql_object(impl = CharacterValue)]
impl ObjA {
fn id(&self, is_present: bool) -> &str {
is_present.then_some(&*self.id).unwrap_or("missing")
}
}
#[derive(GraphQLInterface)]
#[graphql(for = ObjA)]
struct Character {
id: String,
}
fn main() {}
|
pub mod basic;
pub mod wifi;
use serial::SystemPort;
use std::io::prelude::*;
pub struct ATClient {
handle: SystemPort,
}
impl ATClient {
pub fn new(handle: SystemPort) -> Self {
ATClient { handle }
}
pub fn send(&mut self, command: &str) -> String {
// write
let command = command.to_owned() + "\r\n";
let request = command.as_bytes();
self.handle.write(&request).unwrap();
self.handle.flush().unwrap();
// read
let mut buffer = vec![0u8; 256];
let mut response: Vec<u8> = Vec::new();
loop {
let bytes_read = self.handle.read(&mut buffer).unwrap();
response.extend_from_slice(&buffer[..bytes_read]);
let response_slice = &buffer[..bytes_read];
if response_slice.ends_with(b"OK\r\n")
|| response_slice.ends_with(b"ERROR\r\n")
|| response_slice.ends_with(b"WIFI DISCONNECT\r\n")
{
break;
}
}
String::from_utf8(response).unwrap()
}
}
|
use {
StrSpan,
};
/// An XML token.
#[derive(Clone, Copy, PartialEq, Debug)]
pub enum Token<'a> {
/// Declaration token.
///
/// Version, encoding and standalone.
///
/// Example: `<?xml version="1.0"?>`
Declaration(StrSpan<'a>, Option<StrSpan<'a>>, Option<StrSpan<'a>>),
/// Processing instruction token.
///
/// Example: `<?target content?>`
ProcessingInstruction(StrSpan<'a>, Option<StrSpan<'a>>),
/// The comment token.
///
/// Example: `<!-- text -->`
Comment(StrSpan<'a>),
/// DOCTYPE start token.
///
/// Example: `<!DOCTYPE note [`
DtdStart(StrSpan<'a>, Option<ExternalId<'a>>),
/// Empty DOCTYPE token.
///
/// Example: `<!DOCTYPE note>`
EmptyDtd(StrSpan<'a>, Option<ExternalId<'a>>),
/// ENTITY token.
///
/// Can appear only inside the DTD.
///
/// Example: `<!ENTITY ns_extend "http://test.com">`
EntityDeclaration(StrSpan<'a>, EntityDefinition<'a>),
/// DOCTYPE end token.
///
/// Example: `]>`
DtdEnd,
/// Element start token.
///
/// Contains prefix and local part of the qualified name.
///
/// Example: `<elem`
ElementStart(StrSpan<'a>, StrSpan<'a>),
/// Attribute.
///
/// Contains prefix and local part of the qualified name and value.
///
/// Example: `name="value"`
Attribute((StrSpan<'a>, StrSpan<'a>), StrSpan<'a>),
/// Element end token.
ElementEnd(ElementEnd<'a>),
/// Text token.
///
/// Contains text between elements including whitespaces.
/// Basically everything between `>` and `<`.
///
/// Contains text as is. Use [`TextUnescape`] to unescape it.
///
/// Example: `<text>text</text>`
///
/// [`TextUnescape`]: struct.TextUnescape.html
Text(StrSpan<'a>),
/// Whitespaces token.
///
/// The same as `Text` token, but contains only spaces.
///
/// Spaces can be encoded like ` `.
Whitespaces(StrSpan<'a>),
/// CDATA token.
///
/// Example: `<![CDATA[text]]>`
Cdata(StrSpan<'a>),
}
/// `ElementEnd` token.
#[derive(Clone, Copy, PartialEq, Debug)]
pub enum ElementEnd<'a> {
/// Indicates `>`
Open,
/// Indicates `</name>`
Close(StrSpan<'a>, StrSpan<'a>),
/// Indicates `/>`
Empty,
}
/// Representation of the [ExternalID](https://www.w3.org/TR/xml/#NT-ExternalID) value.
#[allow(missing_docs)]
#[derive(Clone, Copy, PartialEq, Debug)]
pub enum ExternalId<'a> {
System(StrSpan<'a>),
Public(StrSpan<'a>, StrSpan<'a>),
}
/// Representation of the [EntityDef](https://www.w3.org/TR/xml/#NT-EntityDef) value.
#[allow(missing_docs)]
#[derive(Clone, Copy, PartialEq, Debug)]
pub enum EntityDefinition<'a> {
EntityValue(StrSpan<'a>),
ExternalId(ExternalId<'a>),
}
|
use std::process::Command;
#[test]
fn run_lisp_tests() {
let status = Command::new("cargo")
.args(&["test"])
.current_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/lisp"))
.spawn()
.expect("should spawn tests OK")
.wait()
.expect("should wait OK");
assert!(status.success());
}
|
use mrusty::{
self,
Mruby,
MrubyType,
MrubyImpl,
MrubyError,
MrubyFile
};
use rmp;
use rmp_rpc;
use rmp_serde;
use protocol::{
TickRequest,
TickResult,
WorldState,
Entity,
};
pub struct Runner {
mrb: MrubyType,
}
fn num_to_float(v: mrusty::Value) -> Result<f64, MrubyError> {
v.to_i32().map(|x| x as f64).or_else(|_| v.to_f64())
}
impl Runner {
pub fn new(seed: i32) -> Result<Runner, MrubyError> {
let mrb = Mruby::new();
let seed = mrb.fixnum(seed);
let random = try!(mrb.get_class("Random")).to_value();
try!(random.call("srand", vec![seed]));
WorldState::require(mrb.clone());
Entity::require(mrb.clone());
Ok(Runner {
mrb: mrb,
})
}
pub fn tick(&mut self, request: TickRequest) -> Result<TickResult, MrubyError> {
let object = self.mrb.top_self();
let player = self.mrb.obj(request.player);
let world = self.mrb.obj(request.world_state);
let result = try!(object.call("run", vec![player, world]));
let result = try!(result.to_vec());
let dx = try!(num_to_float(result[0].clone()));
let dy = try!(num_to_float(result[1].clone()));
Ok(TickResult {
dx: dx,
dy: dy,
})
}
pub fn load(&mut self, source: String) -> Result<(), MrubyError> {
self.mrb.filename("input");
try!(self.mrb.run(&source));
Ok(())
}
}
macro_rules! rpc_try {
($e:expr) => {
match $e {
Ok(v) => v,
Err(e) => {
return Err(::rmp::Value::String(e.to_string()))
}
}
}
}
impl rmp_rpc::Handler for Runner {
fn request(&mut self, method: &str, params: Vec<rmp::Value>)
-> Result<rmp::Value, rmp::Value> {
let param = params.into_iter().next();
match (method, param) {
("Runner.Load", Some(param)) => {
let request = rpc_try!(rmp_serde::from_value(param));
rpc_try!(self.load(request));
Ok(rmp::Value::Nil)
}
("Runner.Tick", Some(param)) => {
let request = rpc_try!(rmp_serde::from_value(param));
let result = rpc_try!(self.tick(request));
Ok(rmp_serde::to_value(&result))
}
_ => {
Err(rmp::Value::String(format!("invalid RPC method call: {:?}", method)))
}
}
}
}
|
pub struct Block(Vec<Statement>);
impl Block {
pub fn new() -> Block {
Block(Vec::new())
}
pub fn assign(&mut self, name: String, expr: Expr) {
self.0.push(Statement::Assign { variant: AssignVariant::None,
name: name, expr: expr, });
}
pub fn var_assign(&mut self, name: String, expr: Expr) {
self.0.push(Statement::Assign { variant: AssignVariant::Var,
name: name, expr: expr, });
}
pub fn let_assign(&mut self, name: String, expr: Expr) {
self.0.push(Statement::Assign { variant: AssignVariant::Let,
name: name, expr: expr, });
}
pub fn if_(&mut self, cond: Expr, block: Block) {
self.0.push(Statement::If { conds: vec![(cond, block)],
else_: None, });
}
pub fn expr(&mut self, expr: Expr) {
self.0.push(Statement::Expr { expr: expr, });
}
pub fn decl_fun(&mut self, name: String, args: Vec<String>, block: Block) {
self.0.push(Statement::FunctionDeclaration {
name: name,
args: args,
block: block,
});
}
pub fn scope(&mut self, block: Block) {
self.0.push(Statement::Scope { block: block });
}
pub fn block(&mut self, block: Block) {
self.0.push(Statement::Block { block: block });
}
pub fn return_(&mut self, expr: Expr) {
self.0.push(Statement::Return { expr: expr });
}
pub fn comment(&mut self, text: String) {
self.0.push(Statement::Comment { text: text });
}
pub fn for_(&mut self, init: Expr, cond: Expr, incr: Expr, block: Block) {
self.0.push(Statement::For {
init: init,
cond: cond,
incr: incr,
block: block,
});
}
pub fn switch(&mut self, input: Expr, cases: Vec<(Expr, Block)>) {
self.0.push(Statement::Switch {
input: input,
cases: cases,
})
}
}
impl ToJavascript for Block {
fn to_javascript(&self, out: &mut String, level: u64) {
for statement in &self.0 {
statement.to_javascript(out, level);
}
}
}
pub struct Expr(pub String);
impl From<String> for Expr {
fn from(string: String) -> Self {
Expr(string)
}
}
impl<'a> From<&'a str> for Expr {
fn from(string: &str) -> Self {
Expr(string.to_owned())
}
}
#[derive(Debug, Copy, Clone)]
pub enum AssignVariant {
None,
Var,
Let,
Const,
}
impl AssignVariant {
fn append(self, out: &mut String) {
let s = match self {
AssignVariant::None => "",
AssignVariant::Var => "var ",
AssignVariant::Let => "let ",
AssignVariant::Const => "const ",
};
out.push_str(s);
}
}
pub enum Statement {
Assign {
variant: AssignVariant,
name: String,
expr: Expr,
},
If {
conds: Vec<(Expr, Block)>,
else_: Option<Block>,
},
Return {
expr: Expr,
},
FunctionDeclaration {
name: String,
args: Vec<String>,
block: Block,
},
Expr {
expr: Expr,
},
Scope {
block: Block,
},
Block {
block: Block,
},
Comment {
text: String,
},
For {
init: Expr,
cond: Expr,
incr: Expr,
block: Block,
},
Switch {
input: Expr,
cases: Vec<(Expr, Block)>,
},
}
impl ToJavascript for Statement {
fn to_javascript(&self, out: &mut String, level: u64) {
match *self {
Statement::Assign { ref variant, ref name, ref expr } => {
pad_level(out, level);
variant.append(out);
out.push_str(name);
out.push_str(" = ");
out.push_str(&expr.0);
out.push_str(";\n");
}
Statement::If { ref conds, ref else_ } => {
assert!(conds.len() >= 1);
pad_level(out, level);
let mut first = true;
for &(ref cond, ref block) in conds {
if first {
out.push_str("if (");
} else {
out.push_str(" else if (");
}
first = false;
out.push_str(&cond.0);
out.push_str(") {\n");
block.to_javascript(out, level+1);
pad_level(out, level);
out.push_str("}");
}
if let &Some(ref block) = else_ {
out.push_str(" else {\n");
block.to_javascript(out, level+1);
pad_level(out, level);
out.push_str("}");
}
out.push_str("\n");
}
Statement::FunctionDeclaration { ref name, ref args, ref block } => {
pad_level(out, level);
out.push_str("function ");
out.push_str(name);
out.push_str("(");
if args.len() > 0 {
for num in 0..args.len()-1 {
out.push_str(&args[num]);
out.push_str(", ");
}
out.push_str(args.last().unwrap());
}
out.push_str(") {\n");
block.to_javascript(out, level+1);
pad_level(out, level);
out.push_str("}\n");
}
Statement::Expr { ref expr } => {
pad_level(out, level);
out.push_str(&expr.0);
out.push_str(";\n");
}
Statement::Scope { ref block } => {
pad_level(out, level);
out.push_str("{\n");
block.to_javascript(out, level+1);
pad_level(out, level);
out.push_str("}\n");
}
Statement::Block { ref block } => {
block.to_javascript(out, level);
}
Statement::Return { ref expr } => {
pad_level(out, level);
out.push_str("return ");
out.push_str(&expr.0);
out.push_str(";\n");
}
Statement::Comment { ref text } => {
pad_level(out, level);
out.push_str("// ");
out.push_str(text);
out.push_str("\n");
}
Statement::For { ref init, ref cond, ref incr, ref block } => {
pad_level(out, level);
out.push_str("for (");
out.push_str(&init.0);
out.push_str("; ");
out.push_str(&cond.0);
out.push_str("; ");
out.push_str(&incr.0);
out.push_str(") {\n");
block.to_javascript(out, level+1);
pad_level(out, level);
out.push_str("}\n");
}
Statement::Switch { ref input, ref cases } => {
pad_level(out, level);
out.push_str("switch (");
out.push_str(&input.0);
out.push_str(") {\n");
for case in cases {
pad_level(out, level+1);
out.push_str(&(case.0).0);
out.push_str(": {\n");
case.1.to_javascript(out, level+2);
pad_level(out, level+2);
out.push_str("break;\n");
pad_level(out, level+1);
out.push_str("}\n");
}
pad_level(out, level);
out.push_str("}\n");
}
//_ => unimplemented!(),
}
}
}
fn pad_level(string: &mut String, level: u64) {
for _ in 0..level {
string.push_str(" ");
}
}
pub trait ToJavascript {
fn to_javascript(&self, out: &mut String, level: u64);
}
#[cfg(all(test, feature = "js_tests"))]
mod tests {
use super::Block;
use super::ToJavascript;
fn to_string<T>(block: T) -> String where T: ToJavascript {
let mut out = String::new();
block.to_javascript(&mut out, 0);
out
}
#[test]
fn simple_expr() {
let mut b = Block::new();
b.expr("some_call(1)".into());
assert_eq!(to_string(b), "some_call(1);\n");
}
#[test]
fn simple_if() {
let mut b = Block::new();
b.if_("test == 0".into(), {
let mut b = Block::new();
b.assign("test".into(), "1".into());
b
});
assert_eq!(to_string(b), "if (test == 0) {\n test = 1;\n}\n");
}
}
|
fn read_values(program_state: &Vec<i32>, op_pos: usize) -> (i32, i32, usize) {
(
program_state[program_state[op_pos + 1] as usize],
program_state[program_state[op_pos + 2] as usize],
program_state[op_pos + 3] as usize
)
}
fn run_program(mut program_state: Vec<i32>) -> i32 {
let mut instr_ptr = 0 as usize;
loop {
match program_state[instr_ptr] {
1 => {
let (in_1, in_2, out_addr) = read_values(&program_state, instr_ptr);
program_state[out_addr] = in_1 + in_2;
},
2 => {
let (in_1, in_2, out_addr) = read_values(&program_state, instr_ptr);
program_state[out_addr] = in_1 * in_2;
},
99 => break,
_ => panic!("Unexpected op_code")
}
instr_ptr = instr_ptr + 4;
}
program_state[0]
}
fn modify_initial_state(initial_state: Vec<i32>, addr_1_val: i32, addr_2_val: i32) -> Vec<i32> {
let mut mod_state = initial_state.clone();
mod_state[1] = addr_1_val;
mod_state[2] = addr_2_val;
mod_state
}
fn find_target_value(initial_state: Vec<i32>, target_val: i32) -> (i32, i32) {
for noun in 0..=99 {
for verb in 0..=99 {
if run_program(modify_initial_state(initial_state.clone(), noun, verb)) == target_val {
return (noun, verb);
}
}
}
unreachable!("Failed to find target value!");
}
fn parse(input_str: &'static str) -> Vec<i32> {
input_str.split(',').map(|n| n.parse::<i32>().unwrap()).collect::<Vec<i32>>()
}
fn main() {
let initial_state = parse(include_str!("../input/day_2.txt"));
let program_state = modify_initial_state(initial_state.clone(), 12, 2);
println!("Part 1 => {}", run_program(program_state));
let (noun, verb) = find_target_value(initial_state.clone(), 19690720);
println!("Part 2 => {}", 100 * noun + verb);
}
#[test]
fn part_1_complete() {
let initial_state = parse(include_str!("../input/day_2.txt"));
let program_state = modify_initial_state(initial_state, 12, 2);
assert_eq!(run_program(program_state), 7210630);
}
#[test]
fn part_2_complete() {
let initial_state = parse(include_str!("../input/day_2.txt"));
let (noun, verb) = find_target_value(initial_state.clone(), 19690720);
assert_eq!(100 * noun + verb, 3892);
} |
#[macro_use]
extern crate clap;
#[macro_use]
extern crate serde_derive;
use std::fs::File;
use std::fs::OpenOptions;
use std::io::stdin;
use std::io::stdout;
use std::io::{Read, Write};
use std::path::Path;
use std::process::exit;
use clap::App;
mod datamodel_parser;
mod json_formatter;
mod dot_formatter;
fn main() {
let yaml = load_yaml!("cli.yml");
let matches = App::from_yaml(yaml).get_matches();
let model_source: Result<String, (std::io::Error, String)> =
match matches.value_of("data_model") {
Some(path) => read_datamodel(path),
None => read_stdin(),
};
let source: String = match model_source {
Ok(k) => k,
Err(e) => {
eprintln!("Error reading data model from '{}': {}", e.1, e.0);
exit(1);
}
};
let model = match datamodel_parser::models(&source) {
Ok(r) => r,
Err(e) => {
eprintln!("Parse error: {}", e);
exit(1);
}
};
let formatted = match matches.value_of("format") {
Some(s) => match s {
"json" => {
let format_options = json_formatter::JSONFormatterOptions {
pretty: matches.is_present("format_json_pretty"),
};
match json_formatter::format(format_options, model) {
Ok(buf) => buf,
Err(e) => {
eprintln!("Format error: {}", e);
exit(1);
}
}
},
"dot" => {
let format_options = dot_formatter::DOTFormatterOptions {};
match dot_formatter::format(format_options, model) {
Ok(buf) => buf,
Err(e) => {
eprintln!("Format error: {}", e);
exit(1);
}
}
},
unk => panic!("unknown formatter: {}", unk),
},
None => panic!("Formatter should not reach this point."),
};
let output_result: Result<usize, (std::io::Error, String)> = match matches.value_of("output") {
Some(path) => write_output(path, formatted),
None => write_stdout(formatted),
};
match output_result {
Ok(u) => u,
Err(e) => {
eprintln!("error writing to '{}': {}", e.1, e.0);
exit(1);
}
};
exit(0);
}
fn read_stdin() -> Result<String, (std::io::Error, String)> {
let mut source = String::new();
match stdin().read_to_string(&mut source) {
Ok(s) => s,
Err(e) => return Err((e, "STDIN".to_owned())),
};
Ok(source)
}
fn read_datamodel(path: &str) -> Result<String, (std::io::Error, String)> {
let mut source = String::new();
let resolved_path = Path::new(&path);
let mut file = match File::open(resolved_path) {
Ok(f) => f,
Err(e) => return Err((e, path.to_owned())),
};
match file.read_to_string(&mut source) {
Ok(s) => s,
Err(e) => return Err((e, path.to_owned())),
};
Ok(source)
}
fn write_stdout(source: String) -> Result<usize, (std::io::Error, String)> {
match stdout().write(&source.into_bytes()) {
Ok(s) => Ok(s),
Err(e) => Err((e, "STDOUT".to_owned())),
}
}
fn write_output(path: &str, source: String) -> Result<usize, (std::io::Error, String)> {
let resolved_path = Path::new(&path);
let mut file = match OpenOptions::new()
.create(true)
.write(true)
.open(resolved_path)
{
Ok(f) => f,
Err(e) => return Err((e, path.to_owned())),
};
match file.write(&source.into_bytes()) {
Ok(s) => Ok(s),
Err(e) => Err((e, path.to_owned())),
}
}
|
#[derive(PartialEq, Debug)]
pub enum Statement {
// Let binding
SLet(String, Expr),
// Probably side-effectual expression <expr>;
SExpr(Expr),
// TODO: Assignment?
}
#[derive(PartialEq, Debug)]
pub enum Expr {
Id(String),
Op(Box<Expr>, &'static str, Box<Expr>),
// if <cond> then <e1> else <e2>
If(Box<Expr>, Box<Expr>, Box<Expr>),
FnCall {
function: String,
args: Vec<Expr>,
},
Block(Vec<Statement>, Option<Box<Expr>>),
// ()
Unit,
StringLit(String),
IntLit(i64),
BoolLit(bool),
}
#[derive(PartialEq, Debug)]
pub struct Function {
pub name: String,
pub argument_list: Vec<(String, String)>,
pub body: Expr,
}
|
use colored::*;
use std::io::{stdout, Write};
pub struct Print;
impl Print {
/// Toggles coloring based on environment.
/// For instance, colors do not work for `cmd`on Windows.
pub fn check_support_for_colors() {
let term = term::stdout().unwrap();
if !term.supports_color() {
colored::control::set_override(false);
}
}
/// Print a header. Includes a preliminary newline.
pub fn header<S: AsRef<str>>(text: S) {
println!("\n[ {} ]", text.as_ref().green());
}
/// Print a process.
pub fn process<S: AsRef<str>>(text: S) {
println!("{}{}", "===".magenta(), text.as_ref());
}
/// Print the text without any frills.
pub fn basic<S: AsRef<str>>(text: S) {
println!("{}", text.as_ref());
}
/// Print a prompt without a new line.
pub fn prompt<S: AsRef<str>>(text: S) {
print!("{}: ", text.as_ref().blue());
stdout().flush().unwrap();
}
/// Print a step in a process.
pub fn step<S: AsRef<str>>(process: S, step: S) {
println!("{}: {}", process.as_ref().magenta(), step.as_ref())
}
/// Print a newline.
pub fn newline() {
println!("");
}
/// Print an error.
pub fn error<S: AsRef<str>>(text: S) {
println!("\n\t[ Error ]\n\t{}\n", text.as_ref().red());
}
}
|
//!
//! WAL receiver connects to the WAL safekeeper service, streams WAL,
//! decodes records and saves them in the repository for the correct
//! timeline.
//!
//! We keep one WAL receiver active per timeline.
use crate::relish::*;
use crate::restore_local_repo;
use crate::tenant_mgr;
use crate::waldecoder::*;
use crate::PageServerConf;
use anyhow::{Error, Result};
use lazy_static::lazy_static;
use log::*;
use postgres::fallible_iterator::FallibleIterator;
use postgres::replication::ReplicationIter;
use postgres::{Client, NoTls, SimpleQueryMessage, SimpleQueryRow};
use postgres_ffi::xlog_utils::*;
use postgres_ffi::*;
use postgres_protocol::message::backend::ReplicationMessage;
use postgres_types::PgLsn;
use std::cmp::{max, min};
use std::collections::HashMap;
use std::fs;
use std::str::FromStr;
use std::sync::Mutex;
use std::thread;
use std::thread::sleep;
use std::time::{Duration, SystemTime};
use zenith_utils::lsn::Lsn;
use zenith_utils::zid::ZTenantId;
use zenith_utils::zid::ZTimelineId;
//
// We keep one WAL Receiver active per timeline.
//
struct WalReceiverEntry {
wal_producer_connstr: String,
}
lazy_static! {
static ref WAL_RECEIVERS: Mutex<HashMap<ZTimelineId, WalReceiverEntry>> =
Mutex::new(HashMap::new());
}
// Launch a new WAL receiver, or tell one that's running about change in connection string
pub fn launch_wal_receiver(
conf: &'static PageServerConf,
timelineid: ZTimelineId,
wal_producer_connstr: &str,
tenantid: ZTenantId,
) {
let mut receivers = WAL_RECEIVERS.lock().unwrap();
match receivers.get_mut(&timelineid) {
Some(receiver) => {
receiver.wal_producer_connstr = wal_producer_connstr.into();
}
None => {
let receiver = WalReceiverEntry {
wal_producer_connstr: wal_producer_connstr.into(),
};
receivers.insert(timelineid, receiver);
// Also launch a new thread to handle this connection
//
// NOTE: This thread name is checked in the assertion in wait_lsn. If you change
// this, make sure you update the assertion too.
let _walreceiver_thread = thread::Builder::new()
.name("WAL receiver thread".into())
.spawn(move || {
thread_main(conf, timelineid, tenantid);
})
.unwrap();
}
};
}
// Look up current WAL producer connection string in the hash table
fn get_wal_producer_connstr(timelineid: ZTimelineId) -> String {
let receivers = WAL_RECEIVERS.lock().unwrap();
receivers
.get(&timelineid)
.unwrap()
.wal_producer_connstr
.clone()
}
//
// This is the entry point for the WAL receiver thread.
//
fn thread_main(conf: &'static PageServerConf, timelineid: ZTimelineId, tenantid: ZTenantId) {
info!(
"WAL receiver thread started for timeline : '{}'",
timelineid
);
//
// Make a connection to the WAL safekeeper, or directly to the primary PostgreSQL server,
// and start streaming WAL from it. If the connection is lost, keep retrying.
//
loop {
// Look up the current WAL producer address
let wal_producer_connstr = get_wal_producer_connstr(timelineid);
let res = walreceiver_main(conf, timelineid, &wal_producer_connstr, tenantid);
if let Err(e) = res {
info!(
"WAL streaming connection failed ({}), retrying in 1 second",
e
);
sleep(Duration::from_secs(1));
}
}
}
fn walreceiver_main(
conf: &PageServerConf,
timelineid: ZTimelineId,
wal_producer_connstr: &str,
tenantid: ZTenantId,
) -> Result<(), Error> {
// Connect to the database in replication mode.
info!("connecting to {:?}", wal_producer_connstr);
let connect_cfg = format!(
"{} application_name=pageserver replication=true",
wal_producer_connstr
);
let mut rclient = Client::connect(&connect_cfg, NoTls)?;
info!("connected!");
// Immediately increment the gauge, then create a job to decrement it on thread exit.
// One of the pros of `defer!` is that this will *most probably*
// get called, even in presence of panics.
let gauge = crate::LIVE_CONNECTIONS_COUNT.with_label_values(&["wal_receiver"]);
gauge.inc();
scopeguard::defer! {
gauge.dec();
}
let identify = identify_system(&mut rclient)?;
info!("{:?}", identify);
let end_of_wal = Lsn::from(u64::from(identify.xlogpos));
let mut caught_up = false;
let timeline = tenant_mgr::get_timeline_for_tenant(tenantid, timelineid)?;
//
// Start streaming the WAL, from where we left off previously.
//
// If we had previously received WAL up to some point in the middle of a WAL record, we
// better start from the end of last full WAL record, not in the middle of one.
let mut last_rec_lsn = timeline.get_last_record_lsn();
let mut startpoint = last_rec_lsn;
if startpoint == Lsn(0) {
error!("No previous WAL position");
}
// There might be some padding after the last full record, skip it.
startpoint += startpoint.calc_padding(8u32);
info!(
"last_record_lsn {} starting replication from {} for timeline {}, server is at {}...",
last_rec_lsn, startpoint, timelineid, end_of_wal
);
let query = format!("START_REPLICATION PHYSICAL {}", startpoint);
let copy_stream = rclient.copy_both_simple(&query)?;
let mut physical_stream = ReplicationIter::new(copy_stream);
let mut waldecoder = WalStreamDecoder::new(startpoint);
let checkpoint_bytes = timeline.get_page_at_lsn(RelishTag::Checkpoint, 0, startpoint)?;
let mut checkpoint = CheckPoint::decode(&checkpoint_bytes)?;
trace!("CheckPoint.nextXid = {}", checkpoint.nextXid.value);
while let Some(replication_message) = physical_stream.next()? {
let status_update = match replication_message {
ReplicationMessage::XLogData(xlog_data) => {
// Pass the WAL data to the decoder, and see if we can decode
// more records as a result.
let data = xlog_data.data();
let startlsn = Lsn::from(xlog_data.wal_start());
let endlsn = startlsn + data.len() as u64;
let prev_last_rec_lsn = last_rec_lsn;
trace!("received XLogData between {} and {}", startlsn, endlsn);
waldecoder.feed_bytes(data);
while let Some((lsn, recdata)) = waldecoder.poll_decode()? {
// Save old checkpoint value to compare with it after decoding WAL record
let old_checkpoint_bytes = checkpoint.encode();
let decoded = decode_wal_record(recdata.clone());
// It is important to deal with the aligned records as lsn in getPage@LSN is
// aligned and can be several bytes bigger. Without this alignment we are
// at risk of hittind a deadlock.
assert!(lsn.is_aligned());
restore_local_repo::save_decoded_record(
&mut checkpoint,
&*timeline,
&decoded,
recdata,
lsn,
)?;
let new_checkpoint_bytes = checkpoint.encode();
// Check if checkpoint data was updated by save_decoded_record
if new_checkpoint_bytes != old_checkpoint_bytes {
timeline.put_page_image(
RelishTag::Checkpoint,
0,
lsn,
new_checkpoint_bytes,
)?;
}
// Now that this record has been fully handled, including updating the
// checkpoint data, let the repository know that it is up-to-date to this LSN
timeline.advance_last_record_lsn(lsn);
last_rec_lsn = lsn;
}
// Somewhat arbitrarily, if we have at least 10 complete wal segments (16 MB each),
// "checkpoint" the repository to flush all the changes from WAL we've processed
// so far to disk. After this, we don't need the original WAL anymore, and it
// can be removed. This is probably too aggressive for production, but it's useful
// to expose bugs now.
//
// TODO: We don't actually dare to remove the WAL. It's useful for debugging,
// and we might it for logical decoding other things in the future. Although
// we should also be able to fetch it back from the WAL safekeepers or S3 if
// needed.
if prev_last_rec_lsn.segment_number(pg_constants::WAL_SEGMENT_SIZE)
!= last_rec_lsn.segment_number(pg_constants::WAL_SEGMENT_SIZE)
{
info!("switched segment {} to {}", prev_last_rec_lsn, last_rec_lsn);
let (oldest_segno, newest_segno) = find_wal_file_range(
conf,
&timelineid,
pg_constants::WAL_SEGMENT_SIZE,
last_rec_lsn,
&tenantid,
)?;
if newest_segno - oldest_segno >= 10 {
// TODO: This is where we could remove WAL older than last_rec_lsn.
//remove_wal_files(timelineid, pg_constants::WAL_SEGMENT_SIZE, last_rec_lsn)?;
}
}
if !caught_up && endlsn >= end_of_wal {
info!("caught up at LSN {}", endlsn);
caught_up = true;
}
Some(endlsn)
}
ReplicationMessage::PrimaryKeepAlive(keepalive) => {
let wal_end = keepalive.wal_end();
let timestamp = keepalive.timestamp();
let reply_requested = keepalive.reply() != 0;
trace!(
"received PrimaryKeepAlive(wal_end: {}, timestamp: {:?} reply: {})",
wal_end,
timestamp,
reply_requested,
);
if reply_requested {
Some(timeline.get_last_record_lsn())
} else {
None
}
}
_ => None,
};
if let Some(last_lsn) = status_update {
// TODO: More thought should go into what values are sent here.
let last_lsn = PgLsn::from(u64::from(last_lsn));
let write_lsn = last_lsn;
let flush_lsn = last_lsn;
let apply_lsn = PgLsn::from(0);
let ts = SystemTime::now();
const NO_REPLY: u8 = 0;
physical_stream.standby_status_update(write_lsn, flush_lsn, apply_lsn, ts, NO_REPLY)?;
}
}
Ok(())
}
fn find_wal_file_range(
conf: &PageServerConf,
timeline: &ZTimelineId,
wal_seg_size: usize,
written_upto: Lsn,
tenant: &ZTenantId,
) -> Result<(u64, u64)> {
let written_upto_segno = written_upto.segment_number(wal_seg_size);
let mut oldest_segno = written_upto_segno;
let mut newest_segno = written_upto_segno;
// Scan the wal directory, and count how many WAL filed we could remove
let wal_dir = conf.wal_dir_path(timeline, tenant);
for entry in fs::read_dir(wal_dir)? {
let entry = entry?;
let path = entry.path();
if path.is_dir() {
continue;
}
let filename = path.file_name().unwrap().to_str().unwrap();
if IsXLogFileName(filename) {
let (segno, _tli) = XLogFromFileName(filename, wal_seg_size);
if segno > written_upto_segno {
// that's strange.
warn!("there is a WAL file from future at {}", path.display());
continue;
}
oldest_segno = min(oldest_segno, segno);
newest_segno = max(newest_segno, segno);
}
}
// FIXME: would be good to assert that there are no gaps in the WAL files
Ok((oldest_segno, newest_segno))
}
/// Data returned from the postgres `IDENTIFY_SYSTEM` command
///
/// See the [postgres docs] for more details.
///
/// [postgres docs]: https://www.postgresql.org/docs/current/protocol-replication.html
#[derive(Debug)]
// As of nightly 2021-09-11, fields that are only read by the type's `Debug` impl still count as
// unused. Relevant issue: https://github.com/rust-lang/rust/issues/88900
#[allow(dead_code)]
pub struct IdentifySystem {
systemid: u64,
timeline: u32,
xlogpos: PgLsn,
dbname: Option<String>,
}
/// There was a problem parsing the response to
/// a postgres IDENTIFY_SYSTEM command.
#[derive(Debug, thiserror::Error)]
#[error("IDENTIFY_SYSTEM parse error")]
pub struct IdentifyError;
/// Run the postgres `IDENTIFY_SYSTEM` command
pub fn identify_system(client: &mut Client) -> Result<IdentifySystem, Error> {
let query_str = "IDENTIFY_SYSTEM";
let response = client.simple_query(query_str)?;
// get(N) from row, then parse it as some destination type.
fn get_parse<T>(row: &SimpleQueryRow, idx: usize) -> Result<T, IdentifyError>
where
T: FromStr,
{
let val = row.get(idx).ok_or(IdentifyError)?;
val.parse::<T>().or(Err(IdentifyError))
}
// extract the row contents into an IdentifySystem struct.
// written as a closure so I can use ? for Option here.
if let Some(SimpleQueryMessage::Row(first_row)) = response.get(0) {
Ok(IdentifySystem {
systemid: get_parse(first_row, 0)?,
timeline: get_parse(first_row, 1)?,
xlogpos: get_parse(first_row, 2)?,
dbname: get_parse(first_row, 3).ok(),
})
} else {
Err(IdentifyError.into())
}
}
|
//! # Multihash
//!
//! Implementation of [multihash](https://github.com/multiformats/multihash) in Rust.
//!
//! A `Multihash` is a structure that contains a hashing algorithm, plus some hashed data.
//! A `MultihashRef` is the same as a `Multihash`, except that it doesn't own its data.
#![deny(missing_docs)]
mod digests;
mod errors;
mod hashes;
mod storage;
#[cfg(any(test, feature = "test"))]
mod arb;
pub use digests::{
wrap, BoxedMultihashDigest, Multihash, MultihashDigest, MultihashGeneric, MultihashRef,
MultihashRefGeneric, Multihasher,
};
pub use errors::{DecodeError, DecodeOwnedError, EncodeError};
pub use hashes::*;
|
use std::cell::RefCell;
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use crate::actions::{Action, ActionAnswer, ActionContext};
use crate::collections::BaseRegistry;
use crate::exts::LockIt;
use anyhow::Result;
use async_trait::async_trait;
use lazy_static::lazy_static;
use log::error;
pub type QueryData = HashMap<String, String>;
pub type QueryResult = Vec<String>;
pub type QueryRegistry = BaseRegistry<dyn Query + Send>;
lazy_static! {
pub static ref QUERY_REG: Mutex<QueryRegistry> = Mutex::new(QueryRegistry::new());
}
pub trait Query {
fn is_monitorable(&self) -> bool;
fn execute(&mut self, data: QueryData) -> Result<QueryResult, ()>;
fn get_name(&self) -> &str;
}
struct DummyQuery {}
impl Query for DummyQuery {
fn is_monitorable(&self) -> bool {
true
}
fn execute(&mut self, _data: QueryData) -> Result<QueryResult, ()> {
Ok(vec![])
}
fn get_name(&self) -> &str {
"dummy"
}
}
#[derive(Debug)]
pub enum Condition {
Changed(RefCell<Vec<String>>),
}
impl Condition {
pub fn check(&mut self, query: &Arc<Mutex<dyn Query + Send>>, data: QueryData) -> bool {
match self {
Condition::Changed(c) => {
let mut q = query.lock_it();
match q.execute(data) {
Ok(v) => {
let res = *c.borrow() == v;
*c.borrow_mut() = v; // Store new result for later
res
}
Err(_) => {
error!("Query '{}' had an error", q.get_name());
false
}
}
}
}
}
}
pub struct ActQuery {
q: Arc<Mutex<dyn Query + Send>>,
name: String,
}
impl ActQuery {
pub fn new(q: Arc<Mutex<dyn Query + Send>>, name: String) -> Arc<Mutex<Self>> {
Arc::new(Mutex::new(Self { q, name }))
}
}
#[async_trait(?Send)]
impl Action for ActQuery {
async fn call(&mut self, _context: &ActionContext) -> Result<ActionAnswer> {
let data = HashMap::new();
let a = match self.q.lock_it().execute(data) {
Ok(v) => v
.into_iter()
.fold("".to_string(), |g, s| format!("{} {:?},", g, s)),
Err(_) => "Had an error".into(), // TODO: This should be translated
};
ActionAnswer::send_text(a, true)
}
fn get_name(&self) -> String {
self.name.clone()
}
}
|
// Copyright 2021 Datafuse Labs.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use std::time::Duration;
#[derive(Clone, Debug, Default)]
pub struct RpcClientTlsConfig {
pub rpc_tls_server_root_ca_cert: String,
pub domain_name: String,
}
impl RpcClientTlsConfig {
pub fn enabled(&self) -> bool {
!self.rpc_tls_server_root_ca_cert.is_empty() && !self.domain_name.is_empty()
}
}
#[derive(Clone, Debug, Default)]
pub struct RpcClientConf {
pub endpoints: Vec<String>,
pub username: String,
pub password: String,
pub tls_conf: Option<RpcClientTlsConfig>,
/// Timeout for an RPC
pub timeout: Option<Duration>,
/// AutoSyncInterval is the interval to update endpoints with its latest members.
/// None disables auto-sync.
pub auto_sync_interval: Option<Duration>,
}
impl RpcClientConf {
/// Whether a remote metasrv is specified.
///
/// - `endpoints` accepts multiple endpoint candidates.
///
/// If endpoints is configured(non-empty), use remote metasrv.
/// Otherwise, use a local embedded meta
pub fn local_mode(&self) -> bool {
self.endpoints.is_empty()
}
/// Returns a list of endpoints.
pub fn get_endpoints(&self) -> Vec<String> {
self.endpoints.clone()
}
}
|
use super::{Cursor, Disk, Tower};
const TOWER: &str = "|";
const TOWER_BASE: &str = "_";
const DISK: &str = "█";
const CURSOR: &str = "▼";
pub trait Drawable {
fn as_lines(&self) -> Vec<String>;
fn draw(&self) {
println!("{}", self.as_lines().join("\n"));
}
}
impl Drawable for Cursor {
fn as_lines(&self) -> Vec<String> {
vec![CURSOR.to_owned()]
}
}
impl Drawable for Disk {
fn as_lines(&self) -> Vec<String> {
vec![vec![DISK; self.size as usize].join("")]
}
}
impl Drawable for Tower {
fn as_lines(&self) -> Vec<String> {
let size = 9;
let mut foundation = String::new();
match self.peek() {
Some(_d) => (),
None => ()
};
vec![]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.