text stringlengths 8 4.13M |
|---|
use std::collections::HashSet;
use std::fs::File;
use std::io::BufRead;
use std::io::BufReader;
fn part1(v: &[i32]) {
let s: i32 = v.iter().sum();
println!("{}", s);
}
fn part2(v: &[i32]) {
let mut freq = 0;
let mut seen = HashSet::new();
seen.insert(freq);
v.iter().cycle().all(|x| {
freq += x;
seen.insert(freq)
});
println!("{}", freq);
}
fn main() {
let f = File::open("input").unwrap();
let f = BufReader::new(&f);
let v : Vec<_> = f.lines().map(|l| l.unwrap().parse().unwrap()).collect();
part1(&v);
part2(&v);
}
|
use crate::snapshot::manifest;
use crate::snapshot::Snapshot;
use std::fs;
use std::path::PathBuf;
use std::process::Command;
pub fn clean_up(app: &nannou::prelude::App, snapshot: &Snapshot) {
if !snapshot.did_capture_frames {
return;
}
app.main_window().await_capture_frame_jobs().unwrap();
fs::read_dir(images_folder_path())
.unwrap()
// Get the path for each entry.
.map(|entry| entry.unwrap().path().to_str().unwrap().to_owned())
// Only keep paths pointing to uncompressed images.
.filter(|path| path.contains("uncompressed.tif"))
.for_each(|uncompressed_path| clean_up_uncompressed_file(uncompressed_path, snapshot));
}
fn clean_up_uncompressed_file(uncompressed_path: String, snapshot: &Snapshot) {
let compressed_path = uncompressed_path.replace(" uncompressed.tif", ".tif");
// convert -compress lzw "image uncompressed.tif" image.tif
let output = Command::new("convert")
.arg("-compress")
.arg("lzw")
.arg(&uncompressed_path)
.arg(&compressed_path)
.output()
.unwrap();
if !output.status.success() {
let error_message = String::from_utf8(output.stderr).unwrap();
panic!("{}", error_message);
}
fs::remove_file(uncompressed_path).unwrap();
symlink_into_snapshots_directory(compressed_path, snapshot);
}
pub fn capture_frame(snapshot: &mut Snapshot, app: &nannou::prelude::App) {
let image_path = uncompressed_path(snapshot.image_name());
app.main_window().capture_frame(image_path);
}
fn snapshot_image_name_from_compressed_path(compressed_path_string: &str) -> String {
compressed_path_string
.replace(images_folder_path().join("").to_str().unwrap(), "")
.replace(".tif", "")
.trim()
.to_string()
}
pub fn symlink_into_snapshots_directory(compressed_path: String, snapshot: &Snapshot) {
let snapshot_image_name = snapshot_image_name_from_compressed_path(&compressed_path);
let symlink_path = symlink_path(snapshot_image_name, snapshot.source_code_folder_name());
std::os::unix::fs::symlink(compressed_path, symlink_path).unwrap();
}
fn symlink_path(snapshot_image_name: String, source_code_folder_name: String) -> PathBuf {
manifest::folder()
.join("snapshots")
.join(&source_code_folder_name)
.join(compressed_name(snapshot_image_name))
}
// fn compressed_path(snapshot_name: String) -> PathBuf {
// path(&compressed_name(snapshot_name))
// }
fn uncompressed_path(snapshot_name: String) -> PathBuf {
path(&uncompressed_name(snapshot_name))
}
fn path(name: &str) -> PathBuf {
images_folder_path().join(name)
}
fn images_folder_path() -> PathBuf {
manifest::folder().join("images")
}
fn compressed_name(snapshot_name: String) -> String {
format!("{}{}", snapshot_name, ".tif")
}
fn uncompressed_name(snapshot_name: String) -> String {
format!("{} uncompressed{}", snapshot_name, ".tif")
}
|
// auto generated, do not modify.
// created: Mon Feb 22 23:57:02 2016
// src-file: /QtGui/qpaintdevice.h
// dst-file: /src/gui/qpaintdevice.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 std::ops::Deref;
use super::qpaintengine::*; // 773
// <= use block end
// ext block begin =>
// #[link(name = "Qt5Core")]
// #[link(name = "Qt5Gui")]
// #[link(name = "Qt5Widgets")]
// #[link(name = "QtInline")]
extern {
fn QPaintDevice_Class_Size() -> c_int;
// proto: int QPaintDevice::physicalDpiY();
fn C_ZNK12QPaintDevice12physicalDpiYEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: int QPaintDevice::heightMM();
fn C_ZNK12QPaintDevice8heightMMEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: int QPaintDevice::colorCount();
fn C_ZNK12QPaintDevice10colorCountEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: int QPaintDevice::physicalDpiX();
fn C_ZNK12QPaintDevice12physicalDpiXEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: int QPaintDevice::widthMM();
fn C_ZNK12QPaintDevice7widthMMEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: int QPaintDevice::devType();
fn C_ZNK12QPaintDevice7devTypeEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: bool QPaintDevice::paintingActive();
fn C_ZNK12QPaintDevice14paintingActiveEv(qthis: u64 /* *mut c_void*/) -> c_char;
// proto: int QPaintDevice::width();
fn C_ZNK12QPaintDevice5widthEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: int QPaintDevice::devicePixelRatio();
fn C_ZNK12QPaintDevice16devicePixelRatioEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: int QPaintDevice::height();
fn C_ZNK12QPaintDevice6heightEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: int QPaintDevice::depth();
fn C_ZNK12QPaintDevice5depthEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: QPaintEngine * QPaintDevice::paintEngine();
fn C_ZNK12QPaintDevice11paintEngineEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: int QPaintDevice::logicalDpiY();
fn C_ZNK12QPaintDevice11logicalDpiYEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: void QPaintDevice::~QPaintDevice();
fn C_ZN12QPaintDeviceD2Ev(qthis: u64 /* *mut c_void*/);
// proto: int QPaintDevice::logicalDpiX();
fn C_ZNK12QPaintDevice11logicalDpiXEv(qthis: u64 /* *mut c_void*/) -> c_int;
} // <= ext block end
// body block begin =>
// class sizeof(QPaintDevice)=24
#[derive(Default)]
pub struct QPaintDevice {
// qbase: None,
pub qclsinst: u64 /* *mut c_void*/,
}
impl /*struct*/ QPaintDevice {
pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QPaintDevice {
return QPaintDevice{qclsinst: qthis, ..Default::default()};
}
}
// proto: int QPaintDevice::physicalDpiY();
impl /*struct*/ QPaintDevice {
pub fn physicalDpiY<RetType, T: QPaintDevice_physicalDpiY<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.physicalDpiY(self);
// return 1;
}
}
pub trait QPaintDevice_physicalDpiY<RetType> {
fn physicalDpiY(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::physicalDpiY();
impl<'a> /*trait*/ QPaintDevice_physicalDpiY<i32> for () {
fn physicalDpiY(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice12physicalDpiYEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice12physicalDpiYEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: int QPaintDevice::heightMM();
impl /*struct*/ QPaintDevice {
pub fn heightMM<RetType, T: QPaintDevice_heightMM<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.heightMM(self);
// return 1;
}
}
pub trait QPaintDevice_heightMM<RetType> {
fn heightMM(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::heightMM();
impl<'a> /*trait*/ QPaintDevice_heightMM<i32> for () {
fn heightMM(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice8heightMMEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice8heightMMEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: int QPaintDevice::colorCount();
impl /*struct*/ QPaintDevice {
pub fn colorCount<RetType, T: QPaintDevice_colorCount<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.colorCount(self);
// return 1;
}
}
pub trait QPaintDevice_colorCount<RetType> {
fn colorCount(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::colorCount();
impl<'a> /*trait*/ QPaintDevice_colorCount<i32> for () {
fn colorCount(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice10colorCountEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice10colorCountEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: int QPaintDevice::physicalDpiX();
impl /*struct*/ QPaintDevice {
pub fn physicalDpiX<RetType, T: QPaintDevice_physicalDpiX<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.physicalDpiX(self);
// return 1;
}
}
pub trait QPaintDevice_physicalDpiX<RetType> {
fn physicalDpiX(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::physicalDpiX();
impl<'a> /*trait*/ QPaintDevice_physicalDpiX<i32> for () {
fn physicalDpiX(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice12physicalDpiXEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice12physicalDpiXEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: int QPaintDevice::widthMM();
impl /*struct*/ QPaintDevice {
pub fn widthMM<RetType, T: QPaintDevice_widthMM<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.widthMM(self);
// return 1;
}
}
pub trait QPaintDevice_widthMM<RetType> {
fn widthMM(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::widthMM();
impl<'a> /*trait*/ QPaintDevice_widthMM<i32> for () {
fn widthMM(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice7widthMMEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice7widthMMEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: int QPaintDevice::devType();
impl /*struct*/ QPaintDevice {
pub fn devType<RetType, T: QPaintDevice_devType<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.devType(self);
// return 1;
}
}
pub trait QPaintDevice_devType<RetType> {
fn devType(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::devType();
impl<'a> /*trait*/ QPaintDevice_devType<i32> for () {
fn devType(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice7devTypeEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice7devTypeEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: bool QPaintDevice::paintingActive();
impl /*struct*/ QPaintDevice {
pub fn paintingActive<RetType, T: QPaintDevice_paintingActive<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.paintingActive(self);
// return 1;
}
}
pub trait QPaintDevice_paintingActive<RetType> {
fn paintingActive(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: bool QPaintDevice::paintingActive();
impl<'a> /*trait*/ QPaintDevice_paintingActive<i8> for () {
fn paintingActive(self , rsthis: & QPaintDevice) -> i8 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice14paintingActiveEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice14paintingActiveEv(rsthis.qclsinst)};
return ret as i8; // 1
// return 1;
}
}
// proto: int QPaintDevice::width();
impl /*struct*/ QPaintDevice {
pub fn width<RetType, T: QPaintDevice_width<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.width(self);
// return 1;
}
}
pub trait QPaintDevice_width<RetType> {
fn width(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::width();
impl<'a> /*trait*/ QPaintDevice_width<i32> for () {
fn width(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice5widthEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice5widthEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: int QPaintDevice::devicePixelRatio();
impl /*struct*/ QPaintDevice {
pub fn devicePixelRatio<RetType, T: QPaintDevice_devicePixelRatio<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.devicePixelRatio(self);
// return 1;
}
}
pub trait QPaintDevice_devicePixelRatio<RetType> {
fn devicePixelRatio(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::devicePixelRatio();
impl<'a> /*trait*/ QPaintDevice_devicePixelRatio<i32> for () {
fn devicePixelRatio(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice16devicePixelRatioEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice16devicePixelRatioEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: int QPaintDevice::height();
impl /*struct*/ QPaintDevice {
pub fn height<RetType, T: QPaintDevice_height<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.height(self);
// return 1;
}
}
pub trait QPaintDevice_height<RetType> {
fn height(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::height();
impl<'a> /*trait*/ QPaintDevice_height<i32> for () {
fn height(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice6heightEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice6heightEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: int QPaintDevice::depth();
impl /*struct*/ QPaintDevice {
pub fn depth<RetType, T: QPaintDevice_depth<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.depth(self);
// return 1;
}
}
pub trait QPaintDevice_depth<RetType> {
fn depth(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::depth();
impl<'a> /*trait*/ QPaintDevice_depth<i32> for () {
fn depth(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice5depthEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice5depthEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: QPaintEngine * QPaintDevice::paintEngine();
impl /*struct*/ QPaintDevice {
pub fn paintEngine<RetType, T: QPaintDevice_paintEngine<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.paintEngine(self);
// return 1;
}
}
pub trait QPaintDevice_paintEngine<RetType> {
fn paintEngine(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: QPaintEngine * QPaintDevice::paintEngine();
impl<'a> /*trait*/ QPaintDevice_paintEngine<QPaintEngine> for () {
fn paintEngine(self , rsthis: & QPaintDevice) -> QPaintEngine {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice11paintEngineEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice11paintEngineEv(rsthis.qclsinst)};
let mut ret1 = QPaintEngine::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: int QPaintDevice::logicalDpiY();
impl /*struct*/ QPaintDevice {
pub fn logicalDpiY<RetType, T: QPaintDevice_logicalDpiY<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.logicalDpiY(self);
// return 1;
}
}
pub trait QPaintDevice_logicalDpiY<RetType> {
fn logicalDpiY(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::logicalDpiY();
impl<'a> /*trait*/ QPaintDevice_logicalDpiY<i32> for () {
fn logicalDpiY(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice11logicalDpiYEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice11logicalDpiYEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: void QPaintDevice::~QPaintDevice();
impl /*struct*/ QPaintDevice {
pub fn free<RetType, T: QPaintDevice_free<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.free(self);
// return 1;
}
}
pub trait QPaintDevice_free<RetType> {
fn free(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: void QPaintDevice::~QPaintDevice();
impl<'a> /*trait*/ QPaintDevice_free<()> for () {
fn free(self , rsthis: & QPaintDevice) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN12QPaintDeviceD2Ev()};
unsafe {C_ZN12QPaintDeviceD2Ev(rsthis.qclsinst)};
// return 1;
}
}
// proto: int QPaintDevice::logicalDpiX();
impl /*struct*/ QPaintDevice {
pub fn logicalDpiX<RetType, T: QPaintDevice_logicalDpiX<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.logicalDpiX(self);
// return 1;
}
}
pub trait QPaintDevice_logicalDpiX<RetType> {
fn logicalDpiX(self , rsthis: & QPaintDevice) -> RetType;
}
// proto: int QPaintDevice::logicalDpiX();
impl<'a> /*trait*/ QPaintDevice_logicalDpiX<i32> for () {
fn logicalDpiX(self , rsthis: & QPaintDevice) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK12QPaintDevice11logicalDpiXEv()};
let mut ret = unsafe {C_ZNK12QPaintDevice11logicalDpiXEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// <= body block end
|
//! Thread-associated operations.
#[cfg(not(target_os = "redox"))]
mod clock;
#[cfg(linux_raw)]
mod futex;
#[cfg(linux_kernel)]
mod id;
#[cfg(linux_kernel)]
mod libcap;
#[cfg(linux_kernel)]
mod prctl;
#[cfg(linux_kernel)]
mod setns;
#[cfg(not(target_os = "redox"))]
pub use clock::*;
#[cfg(linux_raw)]
pub use futex::{futex, FutexFlags, FutexOperation};
#[cfg(linux_kernel)]
pub use id::{gettid, set_thread_gid, set_thread_res_gid, set_thread_res_uid, set_thread_uid};
#[cfg(linux_kernel)]
pub use libcap::{capabilities, set_capabilities, CapabilityFlags, CapabilitySets};
#[cfg(linux_kernel)]
pub use prctl::*;
#[cfg(linux_kernel)]
pub use setns::*;
|
use super::sma::declare_ma_var;
use super::VarResult;
use crate::ast::syntax_type::{FunctionType, FunctionTypes, SimpleSyntaxType, SyntaxType};
use crate::helper::{
move_element, pine_ref_to_bool, pine_ref_to_f64, pine_ref_to_f64_series, pine_ref_to_i64,
require_param, series_index,
};
use crate::types::{
downcast_pf_ref, int2float, Arithmetic, Callable, Evaluate, EvaluateVal, Float, Int, PineRef,
RefData, RuntimeErr, Series, SeriesCall, NA,
};
pub fn series_sum<'a>(source: &Series<Float>, length: i64) -> Result<Float, RuntimeErr> {
let mut sum_val = Some(0f64);
for i in 0..length {
let val = source.at(i as usize);
sum_val = sum_val.add(val);
}
Ok(sum_val)
}
fn sum_func<'a>(source: RefData<Series<Float>>, length: i64) -> Result<Float, RuntimeErr> {
let mut sum_val = Some(0f64);
for i in 0..length {
let val = source.index_value(i as usize).unwrap();
sum_val = sum_val.add(val);
}
Ok(sum_val)
}
pub fn declare_var<'a>() -> VarResult<'a> {
declare_ma_var("sum", sum_func)
}
#[cfg(test)]
mod tests {
use super::*;
use crate::ast::stat_expr_types::VarIndex;
use crate::ast::syntax_type::SyntaxType;
use crate::runtime::VarOperate;
use crate::runtime::{AnySeries, NoneCallback};
use crate::types::Series;
use crate::{LibInfo, PineParser, PineRunner};
// use crate::libs::{floor, exp, };
#[test]
fn sum_test() {
let lib_info = LibInfo::new(
vec![declare_var()],
vec![("close", SyntaxType::float_series())],
);
let src = "m = sum(close, 2)";
let blk = PineParser::new(src, &lib_info).parse_blk().unwrap();
let mut runner = PineRunner::new(&lib_info, &blk, &NoneCallback());
runner
.run(
&vec![(
"close",
AnySeries::from_float_vec(vec![Some(12f64), Some(6f64)]),
)],
None,
)
.unwrap();
assert_eq!(
runner.get_context().move_var(VarIndex::new(0, 0)),
Some(PineRef::new(Series::from_vec(vec![None, Some(18f64),])))
);
}
}
|
use proconio::input;
fn f(a: &[u32], x: u32, y: u32) -> usize {
for &a in a {
assert!(y <= a && a <= x);
}
let mut last_x = 0;
let mut last_y = 0;
let mut ans = 0;
for i in 0..a.len() {
if a[i] == x {
last_x = i + 1;
}
if a[i] == y {
last_y = i + 1;
}
ans += last_x.min(last_y);
}
ans
}
fn main() {
input! {
n: usize,
x: u32,
y: u32,
a: [u32; n],
};
let mut b = Vec::new();
let mut c = Vec::new();
for a in a {
if y <= a && a <= x {
c.push(a);
} else {
if c.len() >= 1 {
b.push(c.drain(..).collect::<Vec<u32>>());
}
}
}
if c.len() >= 1 {
b.push(c.drain(..).collect::<Vec<u32>>());
}
let mut ans = 0;
for a in b {
ans += f(&a, x, y);
}
println!("{}", ans);
}
|
use std::io;
fn main() {
loop {
println!("insert the number between 1...10");
let mut x = String::new();
io::stdin().read_line(&mut x).expect("fail to read");
let x: u32 = match x.trim().parse() {
Ok(result) => result,
Err(_) => {
println!("fail to parse");
continue;
}
};
if x == 0 {
println!("i want to go outside");
break;
}
let mut find_it = false;
for bet in 1..11 {
if bet == x {
println!("you put this number {} ", x);
find_it = true;
break;
} else {
println!("not yet");
}
}
if find_it {
println!("let's say hello {} times", x);
} else {
println!("i don't want say hello");
}
let mut x = x;
while x != 0 && find_it {
println!("hello");
x -= 1;
}
}
}
|
mod call;
mod literal;
mod ops;
|
use super::Float;
use std::ops::{Add, Sub, Mul, Div, AddAssign, SubAssign, MulAssign, DivAssign};
use std::cmp::Ordering;
#[derive(Debug, Copy, Clone)]
pub enum Angle<F: Float = f32> {
Radians(F),
Degrees(F),
}
impl<F: Float> Angle<F> {
pub fn radians(value: F) -> Self {
Angle::Radians(value)
}
pub fn degrees(value: F) -> Self {
Angle::Degrees(value)
}
pub fn n_pi(n: F) -> Self {
Self::radians(n * F::pi())
}
pub fn zero() -> Self {
Self::radians(F::zero())
}
pub fn value(&self) -> F {
match self {
Angle::Radians(value) => *value,
Angle::Degrees(value) => *value,
}
}
pub fn set_value(&mut self, new_value: F) {
match self {
Angle::Radians(value) => *value = new_value,
Angle::Degrees(value) => *value = new_value,
}
}
pub fn radians_value(&self) -> F {
match self {
Angle::Radians(value) => *value,
Angle::Degrees(value) => *value / F::straight_angle() * F::pi(),
}
}
pub fn degrees_value(&self) -> F {
match self {
Angle::Radians(value) => *value / F::pi() * F::straight_angle(),
Angle::Degrees(value) => *value,
}
}
pub fn to_radians(&self) -> Self {
Angle::Radians(self.radians_value())
}
pub fn to_degrees(&self) -> Self {
Angle::Degrees(self.degrees_value())
}
}
impl<F: Float> Add for Angle<F> {
type Output = Self;
fn add(self, other: Self) -> Self::Output {
match self {
Angle::Radians(value) => Angle::Radians(value + other.radians_value()),
Angle::Degrees(value) => Angle::Degrees(value + other.degrees_value()),
}
}
}
impl<F: Float> Sub for Angle<F> {
type Output = Self;
fn sub(self, other: Self) -> Self::Output {
match self {
Angle::Radians(value) => Angle::Radians(value - other.radians_value()),
Angle::Degrees(value) => Angle::Degrees(value - other.degrees_value()),
}
}
}
impl<F: Float> AddAssign for Angle<F> {
fn add_assign(&mut self, other: Self) {
match self {
Angle::Radians(value) => *value += other.radians_value(),
Angle::Degrees(value) => *value += other.degrees_value(),
}
}
}
impl<F: Float> SubAssign for Angle<F> {
fn sub_assign(&mut self, other: Self) {
match self {
Angle::Radians(value) => *value -= other.radians_value(),
Angle::Degrees(value) => *value -= other.degrees_value(),
}
}
}
impl<F: Float> Mul<F> for Angle<F> {
type Output = Self;
fn mul(self, rhs: F) -> Self::Output {
match self {
Angle::Radians(value) => Angle::Radians(value * rhs),
Angle::Degrees(value) => Angle::Degrees(value * rhs),
}
}
}
impl<F: Float> Div<F> for Angle<F> {
type Output = Self;
fn div(self, rhs: F) -> Self::Output {
match self {
Angle::Radians(value) => Angle::Radians(value / rhs),
Angle::Degrees(value) => Angle::Degrees(value / rhs),
}
}
}
impl<F: Float> MulAssign<F> for Angle<F> {
fn mul_assign(&mut self, rhs: F) {
match self {
Angle::Radians(value) => *value *= rhs,
Angle::Degrees(value) => *value *= rhs,
}
}
}
impl<F: Float> DivAssign<F> for Angle<F> {
fn div_assign(&mut self, rhs: F) {
match self {
Angle::Radians(value) => *value /= rhs,
Angle::Degrees(value) => *value /= rhs,
}
}
}
impl<F: Float> PartialEq for Angle<F> {
fn eq(&self, other: &Self) -> bool {
self.radians_value() == other.radians_value()
}
}
impl<F: Float> PartialOrd for Angle<F> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.radians_value().partial_cmp(&other.radians_value())
}
}
#[cfg(test)]
mod tests {
use super::Angle;
#[test]
fn create() {
assert_eq!(Angle::<f32>::radians(std::f32::consts::PI * 2.0), Angle::<f32>::n_pi(2.0));
assert_eq!(Angle::<f32>::n_pi(1.0), Angle::<f32>::degrees(180.0));
assert_eq!(Angle::<f32>::n_pi(2.0).value(), std::f32::consts::PI * 2.0);
assert_eq!(Angle::<f32>::degrees(90.0).value(), 90.0f32);
assert_eq!(Angle::<f32>::zero(), Angle::<f32>::radians(0.0));
assert_eq!(Angle::<f32>::zero(), Angle::<f32>::degrees(0.0));
assert_eq!(Angle::<f32>::zero().value(), 0.0f32);
}
#[test]
fn convert() {
assert_eq!(Angle::<f32>::n_pi(1.0).to_degrees().value(), 180.0f32);
assert_eq!(Angle::<f32>::degrees(90.0).to_radians().value(), std::f32::consts::PI * 0.5);
assert_eq!(Angle::<f32>::n_pi(2.0).to_degrees().value(), Angle::<f32>::n_pi(2.0).degrees_value());
assert_eq!(Angle::<f32>::degrees(180.0).to_radians().value(), Angle::<f32>::degrees(180.0).radians_value());
}
#[test]
fn operator() {
assert_eq!(Angle::<f32>::n_pi(1.0) + Angle::<f32>::n_pi(1.0), Angle::<f32>::n_pi(2.0));
assert_eq!(Angle::<f32>::degrees(90.0) + Angle::<f32>::degrees(90.0), Angle::<f32>::degrees(180.0));
assert_eq!(Angle::<f32>::n_pi(1.0) + Angle::<f32>::degrees(180.0), Angle::<f32>::n_pi(2.0));
assert_eq!(Angle::<f32>::degrees(90.0) + Angle::<f32>::n_pi(0.5), Angle::<f32>::degrees(180.0));
assert_eq!(Angle::<f32>::n_pi(2.0) - Angle::<f32>::n_pi(1.0), Angle::<f32>::n_pi(1.0));
assert_eq!(Angle::<f32>::degrees(180.0) - Angle::<f32>::degrees(90.0), Angle::<f32>::degrees(90.0));
assert_eq!(Angle::<f32>::n_pi(2.0) - Angle::<f32>::degrees(180.0), Angle::<f32>::n_pi(1.0));
assert_eq!(Angle::<f32>::degrees(180.0) - Angle::<f32>::n_pi(0.5), Angle::<f32>::degrees(90.0));
assert_eq!(Angle::<f32>::n_pi(1.0) * 2.0, Angle::<f32>::n_pi(2.0));
assert_eq!(Angle::<f32>::degrees(90.0) * 2.0, Angle::<f32>::degrees(180.0));
assert_eq!(Angle::<f32>::n_pi(2.0) / 2.0, Angle::<f32>::n_pi(1.0));
assert_eq!(Angle::<f32>::degrees(90.0) / 2.0, Angle::<f32>::degrees(45.0));
let mut angle = Angle::<f32>::n_pi(2.0);
angle += Angle::<f32>::n_pi(2.0);
assert_eq!(angle, Angle::<f32>::n_pi(4.0));
angle += Angle::<f32>::degrees(180.0);
assert_eq!(angle, Angle::<f32>::n_pi(5.0));
angle -= Angle::<f32>::n_pi(1.0);
assert_eq!(angle, Angle::<f32>::n_pi(4.0));
angle -= Angle::<f32>::degrees(180.0);
assert_eq!(angle, Angle::<f32>::n_pi(3.0));
let mut angle = Angle::<f32>::degrees(180.0);
angle += Angle::<f32>::degrees(180.0);
assert_eq!(angle, Angle::<f32>::degrees(360.0));
angle += Angle::<f32>::n_pi(2.0);
assert_eq!(angle, Angle::<f32>::degrees(720.0));
angle -= Angle::<f32>::degrees(360.0);
assert_eq!(angle, Angle::<f32>::degrees(360.0));
angle -= Angle::<f32>::n_pi(1.0);
assert_eq!(angle, Angle::<f32>::degrees(180.0));
let mut angle = Angle::<f32>::n_pi(1.0);
angle *= 4.0;
assert_eq!(angle, Angle::<f32>::n_pi(4.0));
angle /= 2.0;
assert_eq!(angle, Angle::<f32>::n_pi(2.0));
let mut angle = Angle::<f32>::degrees(180.0);
angle *= 4.0;
assert_eq!(angle, Angle::<f32>::degrees(720.0));
angle /= 2.0;
assert_eq!(angle, Angle::<f32>::degrees(360.0));
}
#[test]
fn compare() {
assert!(Angle::<f32>::n_pi(1.5) > Angle::<f32>::n_pi(0.5));
assert!(Angle::<f32>::n_pi(1.0) < Angle::<f32>::n_pi(2.0));
assert!(Angle::<f32>::degrees(90.0) > Angle::<f32>::degrees(45.0));
assert!(Angle::<f32>::degrees(30.0) < Angle::<f32>::degrees(60.0));
assert!(Angle::<f32>::n_pi(2.0) > Angle::<f32>::degrees(300.0));
assert!(Angle::<f32>::n_pi(0.5) < Angle::<f32>::degrees(135.0));
}
}
|
use std::cmp;
use std::path::{ Path, PathBuf };
use parser::{ Evaluator, Node };
use fan::Fan;
use util;
// Hwmon PWM fan
//
// Controls a PWM output of a hwmon device. Internally,
// these are represented as a text file, with possible
// values ranging from 0 to 255.
pub struct HwmonPwmFan {
path_to_pwm : PathBuf,
path_to_enable : PathBuf,
}
impl HwmonPwmFan {
pub fn create(hwmon: &str, output: &str) -> Box<Fan> {
let base_path_pwm = format!("/sys/class/hwmon/{}/{}", hwmon, output);
let base_path_enable = format!("{}_enable", &base_path_pwm);
let mut path_to_pwm_v = PathBuf::new();
path_to_pwm_v.push(Path::new(&base_path_pwm));
let mut path_to_enable_v = PathBuf::new();
path_to_enable_v.push(Path::new(&base_path_enable));
Box::new(HwmonPwmFan {
path_to_pwm : path_to_pwm_v,
path_to_enable : path_to_enable_v,
})
}
}
impl Fan for HwmonPwmFan {
fn set_enabled(&mut self, enabled: bool) -> Result<(), String> {
util::write_text_file(&self.path_to_enable, match enabled {
true => "1",
false => "0",
})
}
fn set(&mut self, v: f64) -> Result<(), String> {
let v_i = cmp::max(cmp::min(255, (v * 255.0) as i32), 0);
util::write_text_file(&self.path_to_pwm, &v_i.to_string())
}
}
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
pub struct EvalHwmonPwmFan;
impl EvalHwmonPwmFan {
pub fn new() -> EvalHwmonPwmFan {
EvalHwmonPwmFan { }
}
}
impl Evaluator<Box<Fan>> for EvalHwmonPwmFan {
fn parse_nodes(&self, nodes: &[Node]) -> Result<Box<Fan>, String> {
Ok(HwmonPwmFan::create(
try!(util::get_text_node("hwmon-pwm", nodes, 0)),
try!(util::get_text_node("hwmon-pwm", nodes, 1))))
}
} |
use std::env;
use std::fs;
use std::time::Instant;
fn main() {
// --snip--
let args: Vec<String> = env::args().collect();
let filename = &args[1];
println!("Opening file {}", filename);
let start = Instant::now();
let contents = fs::read_to_string(filename)
.expect("Something went wrong reading the file");
let numbers: Vec<i32> = contents
.split_whitespace()
.map(|s| s.parse().expect("parse error"))
.collect();
for (i, left) in numbers.iter().enumerate() {
for (j, mid) in numbers[i..].iter().enumerate() {
for (k, right) in numbers[j..].iter().enumerate() {
let sum = left + mid + right;
if sum == 2020 {
let duration = start.elapsed();
println!("Finished after {:?}", duration);
println!("left[{}] * mid[{}] * right[{}] = {}", i, j, k, left * mid * right);
}
}
}
}
}
|
//! # Parsing Partial Input
//!
//! Typically, the input being parsed is all in-memory, or is complete. Some data sources are too
//! large to fit into memory, only allowing parsing an incomplete or [`Partial`] subset of the
//! data, requiring incrementally parsing.
//!
//! By wrapping a stream, like `&[u8]`, with [`Partial`], parsers will report when the data is
//! [`Incomplete`] and more input is [`Needed`], allowing the caller to stream-in additional data
//! to be parsed. The data is then parsed a chunk at a time.
//!
//! Chunks are typically defined by either:
//! - A header reporting the number of bytes, like with [`length_value`]
//! - [`Partial`] can explicitly be changed to being complete once the specified bytes are
//! acquired via [`StreamIsPartial::complete`].
//! - A delimiter, like with [ndjson](http://ndjson.org/)
//! - You can parse up-to the delimiter or do a `take_until0(delim).and_then(parser)`
//!
//! If the chunks are not homogeneous, a state machine will be needed to track what the expected
//! parser is for the next chunk.
//!
//! Caveats:
//! - `winnow` takes the approach of re-parsing from scratch. Chunks should be relatively small to
//! prevent the re-parsing overhead from dominating.
//! - Parsers like [`repeat`] do not know when an `eof` is from insufficient data or the end of the
//! stream, causing them to always report [`Incomplete`].
//!
//! # Example
//!
//! `main.rs`:
//! ```rust,ignore
#![doc = include_str!("../../examples/ndjson/main.rs")]
//! ```
//!
//! `parser.rs`:
//! ```rust,ignore
#![doc = include_str!("../../examples/ndjson/parser.rs")]
//! ```
#![allow(unused_imports)] // Used for intra-doc links
use crate::binary::length_value;
use crate::combinator::repeat;
use crate::error::ErrMode::Incomplete;
use crate::error::Needed;
use crate::stream::Partial;
use crate::stream::StreamIsPartial;
|
#[doc = "Reader of register FSIZE"]
pub type R = crate::R<u32, super::FSIZE>;
#[doc = "Flash Size\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u16)]
pub enum SIZE_A {
#[doc = "127: 256 KB of Flash"]
_256KB = 127,
}
impl From<SIZE_A> for u16 {
#[inline(always)]
fn from(variant: SIZE_A) -> Self {
variant as _
}
}
#[doc = "Reader of field `SIZE`"]
pub type SIZE_R = crate::R<u16, SIZE_A>;
impl SIZE_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u16, SIZE_A> {
use crate::Variant::*;
match self.bits {
127 => Val(SIZE_A::_256KB),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `_256KB`"]
#[inline(always)]
pub fn is_256kb(&self) -> bool {
*self == SIZE_A::_256KB
}
}
impl R {
#[doc = "Bits 0:15 - Flash Size"]
#[inline(always)]
pub fn size(&self) -> SIZE_R {
SIZE_R::new((self.bits & 0xffff) as u16)
}
}
|
//! Pulse Width Modulation
/// Pulse Width Modulation
///
/// # Examples
///
/// Use this interface to control the power output of some actuator
///
/// ```
/// extern crate embedded_hal as hal;
///
/// use hal::prelude::*;
///
/// fn main() {
/// let mut pwm: Pwm1 = {
/// // ..
/// # Pwm1
/// };
///
/// pwm.try_set_period(1.khz()).unwrap();
///
/// let max_duty = pwm.try_get_max_duty().unwrap();
///
/// // brightest LED
/// pwm.try_set_duty(Channel::_1, max_duty).unwrap();
///
/// // dimmer LED
/// pwm.try_set_duty(Channel::_2, max_duty / 4).unwrap();
/// }
///
/// # use core::convert::Infallible;
/// # struct KiloHertz(u32);
/// # trait U32Ext { fn khz(self) -> KiloHertz; }
/// # impl U32Ext for u32 { fn khz(self) -> KiloHertz { KiloHertz(self) } }
/// # enum Channel { _1, _2 }
/// # struct Pwm1;
/// # impl hal::pwm::Pwm for Pwm1 {
/// # type Error = Infallible;
/// # type Channel = Channel;
/// # type Time = KiloHertz;
/// # type Duty = u16;
/// # fn try_disable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
/// # fn try_enable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
/// # fn try_get_duty(&self, _: Channel) -> Result<u16, Self::Error> { unimplemented!() }
/// # fn try_get_max_duty(&self) -> Result<u16, Self::Error> { Ok(0) }
/// # fn try_set_duty(&mut self, _: Channel, _: u16) -> Result<(), Self::Error> { Ok(()) }
/// # fn try_get_period(&self) -> Result<KiloHertz, Self::Error> { unimplemented!() }
/// # fn try_set_period<T>(&mut self, _: T) -> Result<(), Self::Error> where T: Into<KiloHertz> { Ok(()) }
/// # }
/// ```
// unproven reason: pre-singletons API. The `PwmPin` trait seems more useful because it models independent
// PWM channels. Here a certain number of channels are multiplexed in a single implementer.
pub trait Pwm {
/// Enumeration of `Pwm` errors
type Error;
/// Enumeration of channels that can be used with this `Pwm` interface
///
/// If your `Pwm` interface has no channels you can use the type `()`
/// here
type Channel;
/// A time unit that can be converted into a human time unit (e.g. seconds)
type Time;
/// Type for the `duty` methods
///
/// The implementer is free to choose a float / percentage representation
/// (e.g. `0.0 .. 1.0`) or an integer representation (e.g. `0 .. 65535`)
type Duty;
/// Disables a PWM `channel`
fn try_disable(&mut self, channel: Self::Channel) -> Result<(), Self::Error>;
/// Enables a PWM `channel`
fn try_enable(&mut self, channel: Self::Channel) -> Result<(), Self::Error>;
/// Returns the current PWM period
fn try_get_period(&self) -> Result<Self::Time, Self::Error>;
/// Returns the current duty cycle
///
/// While the pin is transitioning to the new duty cycle after a `try_set_duty` call, this may
/// return the old or the new duty cycle depending on the implementation.
fn try_get_duty(&self, channel: Self::Channel) -> Result<Self::Duty, Self::Error>;
/// Returns the maximum duty cycle value
fn try_get_max_duty(&self) -> Result<Self::Duty, Self::Error>;
/// Sets a new duty cycle
fn try_set_duty(&mut self, channel: Self::Channel, duty: Self::Duty)
-> Result<(), Self::Error>;
/// Sets a new PWM period
fn try_set_period<P>(&mut self, period: P) -> Result<(), Self::Error>
where
P: Into<Self::Time>;
}
/// A single PWM channel / pin
///
/// See `Pwm` for details
pub trait PwmPin {
/// Enumeration of `PwmPin` errors
type Error;
/// Type for the `duty` methods
///
/// The implementer is free to choose a float / percentage representation
/// (e.g. `0.0 .. 1.0`) or an integer representation (e.g. `0 .. 65535`)
type Duty;
/// Disables a PWM `channel`
fn try_disable(&mut self) -> Result<(), Self::Error>;
/// Enables a PWM `channel`
fn try_enable(&mut self) -> Result<(), Self::Error>;
/// Returns the current duty cycle
///
/// While the pin is transitioning to the new duty cycle after a `try_set_duty` call, this may
/// return the old or the new duty cycle depending on the implementation.
fn try_get_duty(&self) -> Result<Self::Duty, Self::Error>;
/// Returns the maximum duty cycle value
fn try_get_max_duty(&self) -> Result<Self::Duty, Self::Error>;
/// Sets a new duty cycle
fn try_set_duty(&mut self, duty: Self::Duty) -> Result<(), Self::Error>;
}
|
use std::process::Command;
fn main() {
assert!(Command::new("make")
.args(&["-C", "tests/parser"])
.status()
.unwrap()
.success());
}
|
use projecteuler::{helper, square_roots};
fn main() {
helper::check_bench(|| {
solve(100, 1_000_000);
});
helper::check_bench(|| {
solve(100_000_000, 1_000_000);
});
helper::check_bench(|| {
solve(100_000_000, 100_000_000);
});
helper::check_bench(|| {
solve(1_000_000_000, 1_000_000_000);
});
helper::check_bench(|| {
solve(100_000, 10usize.pow(16));
});
assert_eq!(solve(7, 12), 7);
assert_eq!(solve(7, 16), 5);
assert_eq!(solve(100, 1_000_000), 4075);
assert_eq!(solve(100_000_000, 1_000_000), 4_999_999_947_996_535);
assert_eq!(solve(100_000, 10usize.pow(16)), 4_999_290_674);
dbg!(solve(100, 1_000_000));
dbg!(solve(100_000_000, 1_000_000));
dbg!(solve(1_000_000_000, 1_000_000_000));
dbg!(solve(100_000, 10usize.pow(16)));
}
fn solve(n: usize, bound: usize) -> usize {
//we could construct the whole pascals triangle and just count all values bigger than one million, but we can do better
let mut count = 0;
let mut line: Vec<_> = Vec::new();
line.push(1);
let mut i = 1;
while i < n {
i += 1;
if count != 0 && line.len() <= 3 {
//dbg!(&line, count);
{
let total_elements = i + 1;
let missing = total_elements - line.len() * 2;
count += euler_range(missing, missing + n - i);
}
//special case the linear increasing second value
if line.len() >= 2 {
//last line thats smaller than bound
//i<bound
if bound < n {
count += (n - bound + 1) * 2;
}
}
//dbg!(&line);
if line.len() >= 3 {
//(i-1)*(i)/2 < bound
//i < (\sqrt(8*bound + 1) + 1)/2
//i*2 -1 < \sqrt(8*bound + 1)
//i*2 -1 < ceil(\sqrt(8*bound + 1))
let (sqrt_floor, _sqrt_ceil) = square_roots::sqrt(8 * bound + 1);
let mut i = (sqrt_floor + 1) / 2;
while i * (i + 1) / 2 < bound {
dbg!("dingding");
i += 1;
}
if i < n {
count += (n - i) * 2;
}
}
break;
}
let last = if count == 0 && i & 0b1 == 0 {
let last = line.len() - 1;
let new = line[last] * 2;
line.push(new);
line.len() - 1
} else {
line.len()
};
let mut prev = 0;
for j in 0..line.len() {
if j < last {
let temp = line[j];
line[j] += prev;
prev = temp;
}
if line[j] >= bound {
line.truncate(j);
break;
}
}
//dbg!(&line);
if line.len() < i / 2 + 1 {
//how many elements the row should have:
let total_elements = i + 1;
//how many elements the line has
count += total_elements - line.len() * 2;
//dbg!(i,total_elements,line.len(),count);
}
}
count
}
//returns the sum 1+2+...+n
fn euler_sum(n: usize) -> usize {
n * (n + 1) / 2
}
//returns the sum n+ n+1 + n+2 + .. + m
fn euler_range(n: usize, m: usize) -> usize {
euler_sum(m) - euler_sum(n - 1)
}
|
use super::JniInstance;
use crate::errors::{self, Result};
use crate::store::StoreData;
use crate::{interop, utils, wextern};
use jni::objects::{JClass, JObject, JString};
use jni::sys::jlong;
use jni::JNIEnv;
use wasmtime::{Func, Instance, Memory, Module, Store};
pub(super) struct JniInstanceImpl;
impl<'a> JniInstance<'a> for JniInstanceImpl {
type Error = errors::Error;
fn dispose(env: &JNIEnv, this: JObject) -> Result<(), Self::Error> {
interop::dispose_inner::<Instance>(&env, this)?;
Ok(())
}
fn native_get_func(
env: &JNIEnv,
this: JObject,
store_ptr: jlong,
name: JString,
) -> Result<jlong, Self::Error> {
let mut store = interop::ref_from_raw::<Store<StoreData>>(store_ptr)?;
let instance = interop::get_inner::<Instance>(env, this)?;
let name = utils::get_string(env, *name)?;
let func = instance.get_func(&mut *store, &name);
Ok(func.map(|f| interop::into_raw::<Func>(f)).unwrap_or(0))
}
fn native_get_memory(
env: &JNIEnv,
this: JObject,
store_ptr: jlong,
name: JString,
) -> Result<jlong, Self::Error> {
let mut store = interop::ref_from_raw::<Store<StoreData>>(store_ptr)?;
let instance = interop::get_inner::<Instance>(env, this)?;
let name = utils::get_string(env, *name)?;
let memory = instance.get_memory(&mut *store, &name);
Ok(memory.map(|m| interop::into_raw::<Memory>(m)).unwrap_or(0))
}
fn new_instance(
env: &JNIEnv,
_clazz: JClass,
store_ptr: jlong,
module_ptr: jlong,
externs: jni::sys::jarray,
) -> Result<jlong, Self::Error> {
let mut store = interop::ref_from_raw::<Store<StoreData>>(store_ptr)?;
let module = interop::ref_from_raw::<Module>(module_ptr)?;
// Convert Java Extern into wasmtime Extern
let iter = utils::JavaArrayIter::new(env, externs)?;
let mut imports = Vec::with_capacity(iter.len());
for ext in iter {
imports.push(wextern::from_java(env, ext?)?);
}
let instance = Instance::new(&mut *store, &module, &imports)?;
Ok(interop::into_raw::<Instance>(instance))
}
}
|
mod matrix;
use matrix::*;
mod threadTest;
use threadTest::*;
fn main() {
let a = vec![3,2,1,1,0,2];
let b = vec![1,2,4,5,0,1,3,2,4,0,0,1];
a=7;
let l: usize = 2; //Zeilen von A
let m: usize = 3; //Spalten von A, Zeilen von B
let n: usize = 4; //Spalten von B
//let c = matrix_mul(&a,&b,l,m,n);
//println!("{:?}",c);
let t = vec![7;1000];
let c = hello_thread(&t);
println!("{:?}\n{:?}", c, b);
}
|
use self::{
close_encoder::serialize_close_request_body, create_encoder::serialize_create_request_body,
echo_encoder::serialize_serialize_echo_request_body,
negotiate_encoder::serialize_negotiate_request_body,
query_info_encoder::serialize_query_info_request_body,
session_setup_encoder::serialize_session_setup_request_body,
tree_connect_encoder::serialize_tree_connect_request_body,
};
use crate::smb2::{
header::{GenericHeader, SyncHeader},
requests::RequestType,
};
pub mod close_encoder;
pub mod create_encoder;
pub mod echo_encoder;
pub mod negotiate_encoder;
pub mod query_info_encoder;
pub mod security_blob_encoder;
pub mod session_setup_encoder;
pub mod tree_connect_encoder;
/// Serializes the netbios session prefix by calculating the packet size.
pub fn serialize_netbios_session_prefix(packet_size: usize) -> Vec<u8> {
let mut byte_size = packet_size.to_le_bytes().to_vec();
byte_size.truncate(3);
byte_size.reverse();
let mut prefix: Vec<u8> = vec![0];
prefix.append(&mut byte_size);
prefix
}
/// Serializes the complete negotiate request.
pub fn serialize_request(header: &SyncHeader, body: &RequestType) -> Vec<u8> {
let mut packet = serialize_sync_header(header);
packet.append(&mut match body {
RequestType::Negotiate(negotiate) => serialize_negotiate_request_body(&negotiate),
RequestType::SessionSetupNeg(session_setup)
| RequestType::SessionSetupAuth(session_setup) => {
serialize_session_setup_request_body(&session_setup)
}
RequestType::TreeConnect(tree_connect) => {
serialize_tree_connect_request_body(&tree_connect)
}
RequestType::Create(create) => serialize_create_request_body(&create),
RequestType::QueryInfo(query_info) => serialize_query_info_request_body(query_info),
RequestType::Close(close) => serialize_close_request_body(&close),
RequestType::Echo(echo) => serialize_serialize_echo_request_body(&echo),
});
let mut request = serialize_netbios_session_prefix(packet.len());
request.append(&mut packet);
request
}
/// Serializes the generic part of the SMB header.
pub fn serialize_generic_header(header: &GenericHeader) -> Vec<u8> {
let mut serialized_header: Vec<u8> = Vec::new();
serialized_header.append(&mut header.protocol_id.clone());
serialized_header.append(&mut header.structure_size.clone());
serialized_header.append(&mut header.credit_charge.clone());
serialized_header.append(&mut header.channel_sequence.clone());
serialized_header.append(&mut header.reserved.clone());
serialized_header.append(&mut header.command.clone());
serialized_header.append(&mut header.credit.clone());
serialized_header.append(&mut header.flags.clone());
serialized_header.append(&mut header.next_command.clone());
serialized_header.append(&mut header.message_id.clone());
serialized_header
}
/// Serializes the sync variant of the SMB header.
pub fn serialize_sync_header(header: &SyncHeader) -> Vec<u8> {
let mut serialized_header: Vec<u8> = Vec::new();
serialized_header.append(&mut serialize_generic_header(&header.generic));
serialized_header.append(&mut header.reserved.clone());
serialized_header.append(&mut header.tree_id.clone());
serialized_header.append(&mut header.session_id.clone());
serialized_header.append(&mut header.signature.clone());
serialized_header
}
#[cfg(test)]
mod tests {
use crate::smb2::header::Commands;
use super::*;
struct Setup {
generic_header: GenericHeader,
}
impl Setup {
pub fn new() -> Self {
let mut generic_header = GenericHeader::default();
generic_header.protocol_id = b"\xfe\x53\x4d\x42".to_vec();
generic_header.structure_size = b"\x40\x00".to_vec();
generic_header.credit_charge = b"\x01\x00".to_vec();
generic_header.channel_sequence = vec![0; 2];
generic_header.reserved = vec![0; 2];
generic_header.command = Commands::Negotiate.unpack_byte_code();
generic_header.credit = vec![0; 2];
generic_header.flags = vec![0; 4];
generic_header.next_command = vec![0; 4];
generic_header.message_id = vec![0; 8];
Setup { generic_header }
}
}
#[test]
fn test_serialize_netbios_session_prefix() {
assert_eq!(vec![0, 0, 0, 234], serialize_netbios_session_prefix(234));
}
#[test]
fn test_serialize_generic_header() {
let setup = Setup::new();
let mut expected_byte_array: Vec<u8> = b"\xfe\x53\x4d\x42\x40\x00\x01\x00".to_vec();
expected_byte_array.append(&mut vec![0; 24]);
let serialized_header = serialize_generic_header(&setup.generic_header);
assert_eq!(expected_byte_array, serialized_header);
}
#[test]
fn test_serialize_sync_header() {
let setup = Setup::new();
let mut sync_header = SyncHeader::default();
sync_header.generic = setup.generic_header;
sync_header.tree_id = vec![0; 4];
sync_header.session_id = vec![0; 8];
sync_header.signature = vec![0; 16];
let mut expected_byte_array: Vec<u8> = b"\xfe\x53\x4d\x42\x40\x00\x01\x00".to_vec();
expected_byte_array.append(&mut vec![0; 56]);
assert_eq!(expected_byte_array, serialize_sync_header(&sync_header));
}
}
|
// LCOV_EXCL_START
#![allow(missing_docs)]
use std::error::Error as StdError;
use std::fmt::Error as FmtError;
use std::fmt::{Display, Formatter};
use std::io::Error as IOError;
use std::result::Result as StdResult;
use diesel::result::Error as DieselError;
use diesel_migrations::RunMigrationsError;
use http::header::{InvalidHeaderValue, ToStrError};
use iron::modifier::Modifier;
use iron::status::Status;
use iron::{IronError, Response};
use reqwest::Error as ReqwestError;
use ruma_identifiers::RoomId;
use serde::{Deserialize, Deserializer};
use serde_json;
use i18n::*;
macro_rules! simple_error {
($e:expr) => {
Error { error_chain: $e.into(), user_message: None }
};
}
macro_rules! user_error {
($e:expr, $u:expr) => {
Error { error_chain: $e.into(), user_message: Some($u) }
};
}
macro_rules! bail_error {
($e:expr) => {
return Err(simple_error!($e));
};
($e:expr, $u:expr) => {
return Err(user_error!($e, $u));
};
}
macro_rules! body_params_error {
($e:expr) => {
ErrorKind::InvalidJSON(format!("Could not serialize {} body params", $e))
};
}
/// `ErrorResponse` defines the format that is used to send an error response as JSON.
#[derive(Serialize)]
struct ErrorResponse {
error: String,
causes: Vec<String>,
}
/// Response from the Matrix homeserver when an error occurred
#[derive(Deserialize, Serialize)]
pub struct MatrixErrorResponse {
/// Error code returned by the Matrix API
pub errcode: String,
/// Error message returned by the Matrix API
pub error: String,
}
/// Response from the Rocket.Chat server when an error occurred
#[derive(Deserialize, Serialize)]
pub struct RocketchatErrorResponse {
/// Status returned by the Rocket.Chat API
pub status: Option<String>,
/// Error message returned by the Rocket.Chat API
pub message: Option<String>,
/// The error that occured
#[serde(default, deserialize_with = "deserialize_error")]
pub error: Option<String>,
}
pub fn deserialize_error<'de, D>(deserializer: D) -> StdResult<Option<String>, D::Error>
where
D: Deserializer<'de>,
{
#[derive(Deserialize)]
#[serde(untagged)]
enum ErrorValue {
String(String),
Int(i64),
None,
}
match ErrorValue::deserialize(deserializer)? {
ErrorValue::String(s) => Ok(Some(s)),
ErrorValue::Int(i) => Ok(Some(format!("{}", i))),
ErrorValue::None => Ok(None),
}
}
#[derive(Debug)]
pub struct Error {
/// The chained errors
pub error_chain: ErrorChain,
/// An optional message that is shown to the user
pub user_message: Option<I18n>,
}
pub type Result<T> = StdResult<T, Error>;
error_chain!{
types {
ErrorChain, ErrorKind, ResultExt;
}
errors {
InvalidAccessToken(token: String) {
description("The provided access token is not valid")
display("Could not process request, the access token `{}` is not valid", token)
}
MissingAccessToken {
description("The access token is missing")
display("Could not process request, no access token was provided")
}
InvalidRocketchatToken(token: String) {
description("The provided access token is not valid")
display("Could not process request, the access token `{}` did not match any bridged Rocket.Chat server", token)
}
MissingRocketchatToken {
description("The Rocket.Chat token is missing")
display("Could not process request, no Rocket.Chat token provided")
}
InvalidJSON(msg: String) {
description("The provided data is not valid.")
display("Could not process request, the submitted data is not valid: {}", msg)
}
InvalidYAML(msg: String) {
description("The provided YAML is not valid.")
display("The submitted data is not valid YAML: {}", msg)
}
InvalidUserId(user_id: String) {
description("The provided user ID is not valid")
display("The provided user ID {} is not valid", user_id)
}
InvalidRoomAliasId(room_alias_id: String) {
description("The provided room alias ID is not valid")
display("The provided room alias ID {} is not valid", room_alias_id)
}
InvalidHostname(hostname: String) {
description("The provided hostname ist not valid")
display("The provided hostname {} is not valid", hostname)
}
EventIdGenerationFailed{
description("Generating a new event ID failed")
display("Could not generate a new event ID")
}
UnsupportedHttpMethod(method: String) {
description("The REST API was called with an unsupported method")
display("Unsupported HTTP method {}", method)
}
RocketchatAuthenticationFailed(error_msg: String) {
description("Rocket.Chat authentication failed")
display("User login on Rocket.Chat server failed: {}", error_msg)
}
ApiCallFailed(url: String) {
description("Call to REST API failed")
display("Could not call REST API endpoint {}", url)
}
MatrixError(error_msg: String) {
description("Errors returned by the Matrix homeserver")
display("Matrix error: {}", error_msg)
}
UnsupportedMatrixApiVersion(versions: String) {
description("The homeserver's API version is not compatible with the application service")
display("No supported API version found for the Matrix homeserver, found versions: {}", versions)
}
RocketchatError(error_msg: String) {
description("Errors returned by the Rocket.Chat API")
display("Rocket.Chat error: {}", error_msg)
}
NoRocketchatServer(url: String){
description("The server is not a Rocket.Chat server")
display("No Rocket.Chat server found when querying {} (version information is missing from the response)", url)
}
RocketchatServerUnreachable(url: String) {
description("The Rocket.Chat is not reachable")
display("Could not reach Rocket.Chat server {}", url)
}
UnsupportedRocketchatApiVersion(min_version: String, versions: String) {
description("The Rocket.Chat server's version is not compatible with the application service")
display("No supported API version (>= {}) found for the Rocket.Chat server, found version: {}",
min_version,
versions
)
}
ReadFileError(path: String) {
description("Error when reading a file")
display("Reading file from {} failed", path)
}
RoomNotConnected(room_id: String) {
description("The room is not connected, but has to be for the command the user submitted")
display("Room {} is not connected to a Rocket.Chat server, cannot execute command", room_id)
}
RoomAlreadyConnected(room_id: String) {
description("The Room is already connected to a Rocket.Chat server")
display("Room {} is already connected", room_id)
}
AdminRoomForRocketchatServerNotFound(rocketchat_url: String) {
description("The user does not have an admin room that is connected to the given Rocket.Chat server")
display("No admin room found that is connected to the Rocket.Chat server {}", rocketchat_url)
}
RocketchatTokenMissing{
description("A token is needed to connect new Rocket.Chat servers")
display("Attempt to connect a Rocket.Chat server without a token")
}
RocketchatServerAlreadyConnected(rocketchat_url: String) {
description("The Rocket.Chat server is already connected to the application service")
display("Attempt to connect {}, but the Rocket.Chat server is already connected", rocketchat_url)
}
ConnectWithoutRocketchatServerId{
description("Connect command without a Rocket.Chat server ID.")
display("Attempt to connect to a Rocket.Chat server without an ID")
}
ConnectWithInvalidRocketchatServerId(rocketchat_server_id: String) {
description("Connect command with an invalid Rocket.Chat server ID.")
display("Attempt to connect with the Rocket.Chat server ID {}, which contains invalid characters.",
rocketchat_server_id)
}
RocketchatServerIdAlreadyInUse(rocketchat_server_id: String) {
description("Connecting with a Rocket.Chat server id that is already in use")
display("Attempt to connect with the Rocket.Chat server ID {}, which is already in use.", rocketchat_server_id)
}
RocketchatTokenAlreadyInUse(token: String) {
description("The token is already used by another server")
display("The token {} is already in use by another server", token)
}
RocketchatChannelOrGroupNotFound(rocketchat_room_name: String) {
description("No channel or group with the given name found on the Rocket.Chat server")
display("The channel or group {} does not exist on the Rocket.Chat server", rocketchat_room_name)
}
RocketchatChannelAlreadyBridged(channel_name: String) {
description("The channel with the given name is already bridged")
display("The channel {} is already bridged", channel_name)
}
RocketchatJoinFirst(channel_name: String) {
description("The user has to join the channel on Rocket.Chat before it can be bridged")
display("Bridging the channel {} failed, because the user hasn't joined it on Rocket.Chat", channel_name)
}
RocketchatUploadFailed(url: String, err: String) {
description("Uploading file to Rocket.Chat failed")
display("Uploading file {} to Rocket.Chat failed: {}", url, err)
}
UnbridgeOfNotBridgedRoom(display_name: String) {
description("Room with the given display name could not be found")
display("No room with display_name {} found", display_name)
}
RoomNotEmpty(display_name: String, users: String) {
description("Non virtual users are in the room")
display("The room {} has matrix users ({}) in it, cannot unbridge", display_name, users)
}
RoomAssociatedWithAliases(display_name: String, aliases: String) {
description("Aliases are associated with the room")
display("The room {} has aliases ({}) associated with it, cannot unbridge", display_name, aliases)
}
ReadConfigError {
description("Error when reading the config content to a string")
display("Could not read config content to string")
}
ServerStartupError {
description("Error when starting the application service")
display("Could not start application service")
}
DatabaseSetupError {
description("Error when setting up the database")
display("Could not setup database")
}
MigrationError {
description("Error when running migrations")
display("Could not run migrations")
}
DBConnectionError {
description("Error when establishing a connection to the database")
display("Could not establish database connection")
}
LoggerExtractionError {
description("Error when getting the logger from the request")
display("Could not get logger from iron")
}
GettingMatrixUserForDirectMessageRoomError {
description("Error when getting matrix user for a direct message room")
display("Could not get matrix user for direct message room")
}
TooManyUsersInAdminRoom(room_id: RoomId) {
description("Too many users in admin room")
display("Room {} has more then two members and cannot be used as admin room", room_id)
}
ConnectionPoolExtractionError {
description("Error when getting the connection pool from the request")
display("Could not get connection pool from iron request")
}
ConnectionPoolCreationError {
description("Error when creating the connection pool")
display("Could not create connection pool")
}
GetConnectionError {
description("Error when getting a connection from the connection pool")
display("Could not get connection from connection pool")
}
DBInsertError {
description("Error when inserting a record")
display("Inserting record into the database failed")
}
DBUpdateError {
description("Error when editing a record")
display("Editing record in the database failed")
}
DBSelectError {
description("Error when selecting a record")
display("Select record from the database failed")
}
DBDeleteError {
description("Error when deleting a record")
display("Deleting record from the database failed")
}
UnknownMimeType(mimetype: String) {
description("The mime type of the file is unknown")
display("Don't know how to handle mime type '{}'", mimetype)
}
MissingMimeType {
description("The mime type of the file is missing")
display("The mime type of the file is missing")
}
TooManyRequests(endpoint: String) {
description("Too many requests to API endpoint")
display("Too many requests to API endpoint {}", endpoint)
}
InternalServerError {
description("An internal error")
display("An internal error occurred")
}
}
}
impl Error {
pub fn status_code(&self) -> Status {
match *self.error_chain {
ErrorKind::InvalidAccessToken(_) | ErrorKind::InvalidRocketchatToken(_) => Status::Forbidden,
ErrorKind::MissingAccessToken
| ErrorKind::MissingRocketchatToken
| ErrorKind::RocketchatAuthenticationFailed(_) => Status::Unauthorized,
ErrorKind::InvalidJSON(_) => Status::UnprocessableEntity,
ErrorKind::AdminRoomForRocketchatServerNotFound(_) => Status::NotFound,
_ => Status::InternalServerError,
}
}
}
impl StdError for Error {
fn description(&self) -> &str {
self.error_chain.description()
}
}
impl Display for Error {
fn fmt(&self, f: &mut Formatter) -> StdResult<(), FmtError> {
write!(f, "{}", self.error_chain)
}
}
impl From<ErrorChain> for Error {
fn from(error: ErrorChain) -> Error {
simple_error!(error)
}
}
impl From<ErrorKind> for Error {
fn from(error: ErrorKind) -> Error {
simple_error!(error)
}
}
impl From<DieselError> for Error {
fn from(error: DieselError) -> Error {
simple_error!(format!("{}", error))
}
}
impl From<RunMigrationsError> for Error {
fn from(error: RunMigrationsError) -> Error {
simple_error!(format!("{}", error))
}
}
impl From<InvalidHeaderValue> for Error {
fn from(error: InvalidHeaderValue) -> Error {
simple_error!(format!("{}", error))
}
}
impl From<ToStrError> for Error {
fn from(error: ToStrError) -> Error {
simple_error!(format!("{}", error))
}
}
impl From<ReqwestError> for Error {
fn from(error: ReqwestError) -> Error {
simple_error!(format!("{}", error))
}
}
impl From<IOError> for Error {
fn from(error: IOError) -> Error {
simple_error!(format!("{}", error))
}
}
impl From<Error> for IronError {
fn from(error: Error) -> IronError {
let response = Response::with(&error);
IronError { error: Box::new(error), response }
}
}
impl<'a> Modifier<Response> for &'a Error {
fn modify(self, response: &mut Response) {
let error_message = match self.user_message {
Some(ref user_message) => user_message.l(DEFAULT_LANGUAGE),
None => format!("{}", self),
};
let causes = self.error_chain.iter().skip(1).map(|e| format!("{}", e)).collect();
let resp = ErrorResponse { error: error_message, causes };
let err_msg = serde_json::to_string(&resp).expect("ErrorResponse is always serializable");
response.status = Some(self.status_code());
response.body = Some(Box::new(err_msg));
}
}
// LCOV_EXCL_STOP
|
extern crate serde;
mod test_utils;
use bigdecimal::BigDecimal;
use flexi_logger::LoggerHandle;
use hdbconnect::{Connection, HdbResult, HdbValue};
use log::{debug, info};
use num::FromPrimitive;
use serde::Deserialize;
//cargo test --test test_025_decimals -- --nocapture
#[test]
fn test_025_decimals() -> HdbResult<()> {
let mut log_handle = test_utils::init_logger();
let start = std::time::Instant::now();
let mut connection = test_utils::get_authenticated_connection()?;
if connection.data_format_version_2()? > 7 {
info!("=== run test for FIXED8 ===");
test_025_decimals_impl(TS::Fixed8, &mut log_handle, &mut connection)?;
info!("=== run test for FIXED12 ===");
test_025_decimals_impl(TS::Fixed12, &mut log_handle, &mut connection)?;
info!("=== run test for FIXED16 ===");
test_025_decimals_impl(TS::Fixed16, &mut log_handle, &mut connection)?;
} else {
// Old HdbDecimal implementation
info!("=== run test for HdbDecimal ===");
test_025_decimals_impl(TS::Decimal, &mut log_handle, &mut connection)?;
}
test_utils::closing_info(connection, start)
}
enum TS {
Fixed8,
Fixed12,
Fixed16,
Decimal,
}
fn test_025_decimals_impl(
ts: TS,
_log_handle: &mut LoggerHandle,
connection: &mut Connection,
) -> HdbResult<()> {
info!("setup ...");
connection.multiple_statements_ignore_err(vec!["drop table TEST_DECIMALS"]);
let stmts = vec![
match ts {
TS::Decimal =>
"create table TEST_DECIMALS (f1 NVARCHAR(100) primary key, f2 DECIMAL(7,5), f3 integer)",
TS::Fixed8 =>
"create table TEST_DECIMALS (f1 NVARCHAR(100) primary key, f2 DECIMAL(7,5), f3 integer)",
TS::Fixed12 =>
"create table TEST_DECIMALS (f1 NVARCHAR(100) primary key, f2 DECIMAL(28,5), f3 integer)",
TS::Fixed16 =>
"create table TEST_DECIMALS (f1 NVARCHAR(100) primary key, f2 DECIMAL(38,5), f3 integer)",
},
"insert into TEST_DECIMALS (f1, f2) values('0.00000', 0.000)",
"insert into TEST_DECIMALS (f1, f2) values('0.00100', 0.001)",
"insert into TEST_DECIMALS (f1, f2) values('-0.00100', -0.001)",
"insert into TEST_DECIMALS (f1, f2) values('0.00300', 0.003)",
"insert into TEST_DECIMALS (f1, f2) values('0.00700', 0.007)",
"insert into TEST_DECIMALS (f1, f2) values('0.25500', 0.255)",
"insert into TEST_DECIMALS (f1, f2) values('65.53500', 65.535)",
"insert into TEST_DECIMALS (f1, f2) values('-65.53500', -65.535)",
];
connection.multiple_statements(stmts)?;
#[derive(Deserialize)]
struct TestData {
#[serde(rename = "F1")]
f1: String,
#[serde(rename = "F2")]
f2: BigDecimal,
}
let insert_stmt_str = "insert into TEST_DECIMALS (F1, F2) values(?, ?)";
info!("prepare & execute");
let mut insert_stmt = connection.prepare(insert_stmt_str)?;
insert_stmt.add_batch(&("75.53500", BigDecimal::from_f32(75.535).unwrap()))?;
insert_stmt.add_batch(&("87.65432", 87.654_32_f32))?;
insert_stmt.add_batch(&("0.00500", 0.005_f32))?;
insert_stmt.add_batch(&("-0.00600", -0.006_00_f64))?;
insert_stmt.add_batch(&("-7.65432", -7.654_32_f64))?;
insert_stmt.add_batch(&("99.00000", 99))?;
insert_stmt.add_batch(&("-50.00000", -50_i16))?;
insert_stmt.add_batch(&("22.00000", 22_i64))?;
insert_stmt.execute_batch()?;
insert_stmt.add_batch(&("-0.05600", "-0.05600"))?;
insert_stmt.add_batch(&("-8.65432", "-8.65432"))?;
insert_stmt.execute_batch()?;
info!("Read and verify decimals");
let resultset = connection.query("select f1, f2 from TEST_DECIMALS order by f2")?;
for row in resultset {
let row = row?;
if let HdbValue::DECIMAL(ref bd) = &row[1] {
assert_eq!(format!("{}", &row[0]), format!("{bd}"));
} else {
panic!("Unexpected value type");
}
}
info!("Read and verify decimals to struct");
let resultset = connection.query("select f1, f2 from TEST_DECIMALS order by f2")?;
let scale = resultset.metadata()[1].scale() as usize;
let result: Vec<TestData> = resultset.try_into()?;
for td in result {
debug!("{:?}, {:?}", td.f1, td.f2);
assert_eq!(td.f1, format!("{0:.1$}", td.f2, scale));
}
info!("Read and verify decimals to tuple");
let result: Vec<(String, String)> = connection
.query("select * from TEST_DECIMALS")?
.try_into()?;
for row in result {
debug!("{}, {}", row.0, row.1);
assert_eq!(row.0, row.1);
}
info!("Read and verify decimal to single value");
let resultset = connection.query("select AVG(F3) from TEST_DECIMALS")?;
let mydata: Option<BigDecimal> = resultset.try_into()?;
assert_eq!(mydata, None);
let mydata: Option<i64> = connection
.query("select AVG(F2) from TEST_DECIMALS where f2 = '65.53500'")?
.try_into()?;
assert_eq!(mydata, Some(65));
info!("test failing conversion");
let mydata: HdbResult<i8> = connection
.query("select SUM(ABS(F2)) from TEST_DECIMALS")?
.try_into();
assert!(mydata.is_err());
info!("test working conversion");
let mydata: i64 = connection
.query("select SUM(ABS(F2)) from TEST_DECIMALS")?
.try_into()?;
assert_eq!(mydata, 481);
Ok(())
}
|
use std::collections::HashSet;
use std::str::CharIndices;
use super::super::automaton::{Automaton, Label};
use super::{Mapping, Marker};
/// Enumerate all the matches of a variable automata over a text.
///
/// ** For this naive implementation, there is no garantee that produced matches
/// are distincts. **
pub struct NaiveEnum<'a, 't> {
automaton: &'a Automaton,
text: &'t str,
/// Holds current positions of the runs as a stack of:
/// - current state on the automata
/// - current index on the word
/// - assignations that have been done so far
curr_state: Vec<(usize, CharIndices<'t>, Vec<(&'a Marker, usize)>)>,
/// Keep track of already outputed values
curr_output: HashSet<Mapping<'t>>,
}
impl<'a, 't> NaiveEnum<'a, 't> {
pub fn new(automaton: &'a Automaton, text: &'t str) -> NaiveEnum<'a, 't> {
NaiveEnum {
automaton,
text,
curr_state: vec![(0, text.char_indices(), Vec::new())],
curr_output: HashSet::new(),
}
}
}
impl<'a, 't> Iterator for NaiveEnum<'a, 't> {
type Item = Mapping<'t>;
fn next(&mut self) -> Option<Mapping<'t>> {
while let Some((state, index, assigns)) = self.curr_state.pop() {
let curr_char = index.clone().next();
for (label, target) in &self.automaton.get_adj()[state] {
match **label {
Label::Atom(ref atom) if curr_char != None => {
if let Some((_, curr_char)) = curr_char {
if !atom.is_match(&curr_char) {
continue;
}
}
let mut new_index = index.clone();
new_index.next();
self.curr_state.push((*target, new_index, assigns.clone()));
}
Label::Assignation(ref marker) => {
let mut new_assigns = assigns.clone();
let pos = match curr_char {
None => self.text.len(),
Some((pos, _)) => pos,
};
new_assigns.push((marker, pos));
self.curr_state.push((*target, index.clone(), new_assigns));
}
_ => (),
}
}
if curr_char == None && self.automaton.finals.contains(&state) {
let mapping = Mapping::from_markers(
self.text,
assigns
.into_iter()
.map(|(marker, pos)| (marker.clone(), pos)),
);
if !self.curr_output.contains(&mapping) {
self.curr_output.insert(mapping.clone());
return Some(mapping);
}
}
}
None
}
}
|
use std::io;
fn main() {
println!("Enter Value : ");
let mut input = String::new();
io::stdin() .read_line(&mut input).expect("Failed to read line");
let input:u8 = match input.trim().parse(){
Ok(num) => num,
Err(_) => (0)
};
println!("You Print : {}", input);
}
|
#[doc = "Reader of register MIIADDR"]
pub type R = crate::R<u32, super::MIIADDR>;
#[doc = "Writer for register MIIADDR"]
pub type W = crate::W<u32, super::MIIADDR>;
#[doc = "Register MIIADDR `reset()`'s with value 0"]
impl crate::ResetValue for super::MIIADDR {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `MIIB`"]
pub type MIIB_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `MIIB`"]
pub struct MIIB_W<'a> {
w: &'a mut W,
}
impl<'a> MIIB_W<'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 = (self.w.bits & !0x01) | ((value as u32) & 0x01);
self.w
}
}
#[doc = "Reader of field `MIIW`"]
pub type MIIW_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `MIIW`"]
pub struct MIIW_W<'a> {
w: &'a mut W,
}
impl<'a> MIIW_W<'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 = (self.w.bits & !(0x01 << 1)) | (((value as u32) & 0x01) << 1);
self.w
}
}
#[doc = "Clock Reference Frequency Selection\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CR_A {
#[doc = "0: The frequency of the System Clock is 60 to 100 MHz providing a MDIO clock of SYSCLK/42"]
_60_100 = 0,
#[doc = "1: The frequency of the System Clock is 100 to 150 MHz providing a MDIO clock of SYSCLK/62"]
_100_150 = 1,
#[doc = "2: The frequency of the System Clock is 20-35 MHz providing a MDIO clock of System Clock/16"]
_20_35 = 2,
#[doc = "3: The frequency of the System Clock is 35 to 60 MHz providing a MDIO clock of System Clock/26"]
_35_60 = 3,
}
impl From<CR_A> for u8 {
#[inline(always)]
fn from(variant: CR_A) -> Self {
variant as _
}
}
#[doc = "Reader of field `CR`"]
pub type CR_R = crate::R<u8, CR_A>;
impl CR_R {
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, CR_A> {
use crate::Variant::*;
match self.bits {
0 => Val(CR_A::_60_100),
1 => Val(CR_A::_100_150),
2 => Val(CR_A::_20_35),
3 => Val(CR_A::_35_60),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `_60_100`"]
#[inline(always)]
pub fn is_60_100(&self) -> bool {
*self == CR_A::_60_100
}
#[doc = "Checks if the value of the field is `_100_150`"]
#[inline(always)]
pub fn is_100_150(&self) -> bool {
*self == CR_A::_100_150
}
#[doc = "Checks if the value of the field is `_20_35`"]
#[inline(always)]
pub fn is_20_35(&self) -> bool {
*self == CR_A::_20_35
}
#[doc = "Checks if the value of the field is `_35_60`"]
#[inline(always)]
pub fn is_35_60(&self) -> bool {
*self == CR_A::_35_60
}
}
#[doc = "Write proxy for field `CR`"]
pub struct CR_W<'a> {
w: &'a mut W,
}
impl<'a> CR_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: CR_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "The frequency of the System Clock is 60 to 100 MHz providing a MDIO clock of SYSCLK/42"]
#[inline(always)]
pub fn _60_100(self) -> &'a mut W {
self.variant(CR_A::_60_100)
}
#[doc = "The frequency of the System Clock is 100 to 150 MHz providing a MDIO clock of SYSCLK/62"]
#[inline(always)]
pub fn _100_150(self) -> &'a mut W {
self.variant(CR_A::_100_150)
}
#[doc = "The frequency of the System Clock is 20-35 MHz providing a MDIO clock of System Clock/16"]
#[inline(always)]
pub fn _20_35(self) -> &'a mut W {
self.variant(CR_A::_20_35)
}
#[doc = "The frequency of the System Clock is 35 to 60 MHz providing a MDIO clock of System Clock/26"]
#[inline(always)]
pub fn _35_60(self) -> &'a mut W {
self.variant(CR_A::_35_60)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x0f << 2)) | (((value as u32) & 0x0f) << 2);
self.w
}
}
#[doc = "Reader of field `MII`"]
pub type MII_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `MII`"]
pub struct MII_W<'a> {
w: &'a mut W,
}
impl<'a> MII_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x1f << 6)) | (((value as u32) & 0x1f) << 6);
self.w
}
}
#[doc = "Reader of field `PLA`"]
pub type PLA_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `PLA`"]
pub struct PLA_W<'a> {
w: &'a mut W,
}
impl<'a> PLA_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x1f << 11)) | (((value as u32) & 0x1f) << 11);
self.w
}
}
impl R {
#[doc = "Bit 0 - MII Busy"]
#[inline(always)]
pub fn miib(&self) -> MIIB_R {
MIIB_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - MII Write"]
#[inline(always)]
pub fn miiw(&self) -> MIIW_R {
MIIW_R::new(((self.bits >> 1) & 0x01) != 0)
}
#[doc = "Bits 2:5 - Clock Reference Frequency Selection"]
#[inline(always)]
pub fn cr(&self) -> CR_R {
CR_R::new(((self.bits >> 2) & 0x0f) as u8)
}
#[doc = "Bits 6:10 - MII Register"]
#[inline(always)]
pub fn mii(&self) -> MII_R {
MII_R::new(((self.bits >> 6) & 0x1f) as u8)
}
#[doc = "Bits 11:15 - Physical Layer Address"]
#[inline(always)]
pub fn pla(&self) -> PLA_R {
PLA_R::new(((self.bits >> 11) & 0x1f) as u8)
}
}
impl W {
#[doc = "Bit 0 - MII Busy"]
#[inline(always)]
pub fn miib(&mut self) -> MIIB_W {
MIIB_W { w: self }
}
#[doc = "Bit 1 - MII Write"]
#[inline(always)]
pub fn miiw(&mut self) -> MIIW_W {
MIIW_W { w: self }
}
#[doc = "Bits 2:5 - Clock Reference Frequency Selection"]
#[inline(always)]
pub fn cr(&mut self) -> CR_W {
CR_W { w: self }
}
#[doc = "Bits 6:10 - MII Register"]
#[inline(always)]
pub fn mii(&mut self) -> MII_W {
MII_W { w: self }
}
#[doc = "Bits 11:15 - Physical Layer Address"]
#[inline(always)]
pub fn pla(&mut self) -> PLA_W {
PLA_W { w: self }
}
}
|
// pub mod item;
pub mod locale;
pub mod recipe;
|
use challenges::random_bytes;
use cipher::{self, Mode};
use encoding::base64::*;
use std::collections::HashMap;
use std::convert::TryInto;
fn main() {
println!("🔓 Challenge 14 (should take ~ 16X than chal12)");
let key = Key::new();
break_ecb_harder(&key);
}
fn break_ecb_harder(key: &Key) {
// decipher unknown length
let unknown_len = decipher_unknown_len(&key);
assert_eq!(unknown_len, 138); // make sure this is correct for this specific case
println!("The length of the target bytes: {}", unknown_len);
println!("Decrypting one byte at a time now ...");
// break ECB one byte at a time, starting from the last byte
let mut deciphered: Vec<u8> = Vec::with_capacity(unknown_len);
for i in 0..unknown_len {
let target_suffix_len = 16 - deciphered.len() % 16 - 1;
let target_prefix_len: u32 = (i as i32 + 1 - unknown_len as i32)
.rem_euclid(16i32)
.try_into()
.unwrap();
let mut control_group_pt = vec![0 as u8; 2 * 16];
control_group_pt.extend_from_slice(&random_bytes(target_prefix_len));
let control_group_ct = target_ct_mod0(&control_group_pt, &key, true);
let mut focus_block = (control_group_ct.len() / 16) - (i / 16) - 1;
// NOTE: this next block really kills me to debug. think again please, reader
if (target_prefix_len + unknown_len as u32) % 16 == 0 {
focus_block -= 1; // because there will be a dummy block padded
}
for byte in u8::min_value()..u8::max_value() {
let mut pt_experiment: Vec<u8> = vec![];
if deciphered.len() < 16 {
pt_experiment.push(byte);
pt_experiment.extend_from_slice(&deciphered[..]);
pt_experiment.extend_from_slice(&vec![target_suffix_len as u8; target_suffix_len]);
} else {
pt_experiment.push(byte);
pt_experiment.extend_from_slice(&deciphered[..15]);
}
pt_experiment.extend(pt_experiment.clone());
pt_experiment.extend_from_slice(&random_bytes(target_prefix_len));
let experiment_group_ct = target_ct_mod0(&pt_experiment, &key, false);
if experiment_group_ct[..16]
== control_group_ct[focus_block * 16..(focus_block + 1) * 16]
{
deciphered.insert(0, byte);
break;
}
}
println!(
"progress: {} bytes decrypted: {:?}",
deciphered.len(),
String::from_utf8(deciphered.clone()).unwrap()
);
}
println!("Decrypted: \n{:?}", String::from_utf8(deciphered).unwrap());
}
#[derive(Default)]
pub struct Key(Vec<u8>);
impl Key {
pub fn new() -> Key {
Key(random_bytes(16))
}
pub fn encryption_oracle(&self, input: &[u8]) -> Vec<u8> {
let unknown_base64 = Base64::from_str(
&"
Um9sbGluJyBpbiBteSA1LjAKV2l0aCBteSByYWctdG9wIGRvd24gc28gbXkg
aGFpciBjYW4gYmxvdwpUaGUgZ2lybGllcyBvbiBzdGFuZGJ5IHdhdmluZyBq
dXN0IHRvIHNheSBoaQpEaWQgeW91IHN0b3A/IE5vLCBJIGp1c3QgZHJvdmUg
YnkK"
.lines()
.collect::<String>(),
)
.unwrap();
let mut actual_input = vec![];
// NOTE: the next line is the difference between chal14 and chal12
// i.e. a random-length prefix
actual_input.extend_from_slice(&random_bytes(rand::random::<u8>() as u32)[..]);
actual_input.extend_from_slice(&input);
actual_input.extend_from_slice(&unknown_base64.as_bytes()[..]);
let ecb_cipher = cipher::new(Mode::ECB);
ecb_cipher.encrypt(&self.0, &actual_input).split_off(16)
}
}
fn decipher_unknown_len(key: &Key) -> usize {
// feed 3 same controlled blocks, the first could be used to pad the random prefix to exact multiple
// then there should be at least 2 same block in the ciphertext.
// (prefix.len + controlled.len) mod 16 is 0~15, each has an equal probability of 1/16
// by repeatedly calling encryption oracle, and identifying the ciphertext of the prefixed_unknown:
// [blah, blah, blah, same, same, prefixed_unknown]
// the two "same" block is due to the controlled msg we pass in, and the prefix for the target could be
// any of 0~15, and by collecting all possible ciphertext, we could deduce the length
let mut occurance: HashMap<Vec<u8>, usize> = HashMap::new();
let mut max_unknown_len = 0;
while occurance.len() < 16 {
let prefixed_unknown_ct_candidate: Vec<u8> =
get_post_signal_ct(&key.encryption_oracle(&[0 as u8; 3 * 16 - 1])).unwrap();
let ct_candidate_len = prefixed_unknown_ct_candidate.len();
if ct_candidate_len > max_unknown_len {
max_unknown_len = ct_candidate_len;
}
occurance.insert(prefixed_unknown_ct_candidate, ct_candidate_len);
}
// find how many among the 16 candidates have a 16 byte longer blocks
// and the actual_len = max_len - (16 - # of 1 block longer candidates)
let mut longer_block_count = 0;
for val in occurance.values() {
if *val == max_unknown_len {
longer_block_count += 1;
}
}
max_unknown_len - (16 - longer_block_count) - 16
}
// two equal blocks in the ciphertext input is called the "signal blocks", and the remaining
// blocks are post-signal portion, which is the output of this function
fn get_post_signal_ct(ct: &[u8]) -> Option<Vec<u8>> {
// NOTE: precondition check skipped on whether `ct` is an exact_multiple, for simplicity
let ct_2d = cipher::into_blocks(&ct, 16);
let result = ct_2d
.iter()
.fold((vec![], false), |mut acc: (Vec<Vec<u8>>, bool), x| {
if !acc.1 {
if !acc.0.is_empty() && acc.0[0] == *x {
acc.0.clear();
acc.1 = true;
} else {
acc.0.clear();
acc.0.push(x.clone());
}
} else {
acc.0.push(x.clone());
}
acc
});
if result.1 {
Some(result.0.into_iter().flatten().collect::<Vec<u8>>())
} else {
None
}
}
fn get_signal_ct(ct: &[u8]) -> Option<Vec<u8>> {
let ct_2d = cipher::into_blocks(&ct, 16);
for i in 0..ct_2d.len() - 1 {
if ct_2d[i] == ct_2d[i + 1] {
return Some(ct_2d[i].clone());
}
}
None
}
// Apologize that I couldn't come up with a better name, this sounds confusing as hell.
// This function returns the post-signal ciphertext only when the plaintext has a 0(mod 16)
// length prefix, which means the controlled input starts on fresh block, which gives us
// control over how many bytes are we pushing the unknown portion(given that we already knew
// its length)
fn target_ct_mod0(pt: &[u8], key: &Key, controlled: bool) -> Vec<u8> {
// On average, this loop will repeat 16 times before getting a desirable ciphertext
// because the random-length prefix, the probability of a fresh block start for controlled
// input in the middle is 1/16
loop {
let ct: Vec<u8> = key.encryption_oracle(pt);
if controlled {
let result = get_post_signal_ct(&ct);
if let Some(val) = result {
return val;
}
} else {
let result = get_signal_ct(&ct);
if let Some(val) = result {
return val;
}
}
}
}
|
use std::{borrow::Cow, io::Read, sync::Arc};
#[cfg(feature = "unblock")]
use futures_util::io::AsyncRead;
use crate::{
registry, registry::MetaTypeId, Context, InputType, InputValueError, InputValueResult, Value,
};
/// A file upload value.
pub struct UploadValue {
/// The name of the file.
pub filename: String,
/// The content type of the file.
pub content_type: Option<String>,
/// The file data.
#[cfg(feature = "tempfile")]
pub content: std::fs::File,
/// The file data.
#[cfg(not(feature = "tempfile"))]
pub content: bytes::Bytes,
}
impl UploadValue {
/// Attempt to clone the upload value. This type's `Clone` implementation
/// simply calls this and panics on failure.
///
/// # Errors
///
/// Fails if cloning the inner `File` fails.
pub fn try_clone(&self) -> std::io::Result<Self> {
#[cfg(feature = "tempfile")]
{
Ok(Self {
filename: self.filename.clone(),
content_type: self.content_type.clone(),
content: self.content.try_clone()?,
})
}
#[cfg(not(feature = "tempfile"))]
{
Ok(Self {
filename: self.filename.clone(),
content_type: self.content_type.clone(),
content: self.content.clone(),
})
}
}
/// Convert to a `Read`.
///
/// **Note**: this is a *synchronous/blocking* reader.
pub fn into_read(self) -> impl Read + Sync + Send + 'static {
#[cfg(feature = "tempfile")]
{
self.content
}
#[cfg(not(feature = "tempfile"))]
{
std::io::Cursor::new(self.content)
}
}
/// Convert to a `AsyncRead`.
#[cfg(feature = "unblock")]
#[cfg_attr(docsrs, doc(cfg(feature = "unblock")))]
pub fn into_async_read(self) -> impl AsyncRead + Sync + Send + 'static {
#[cfg(feature = "tempfile")]
{
blocking::Unblock::new(self.content)
}
#[cfg(not(feature = "tempfile"))]
{
std::io::Cursor::new(self.content)
}
}
/// Returns the size of the file, in bytes.
pub fn size(&self) -> std::io::Result<u64> {
#[cfg(feature = "tempfile")]
{
self.content.metadata().map(|meta| meta.len())
}
#[cfg(not(feature = "tempfile"))]
{
Ok(self.content.len() as u64)
}
}
}
/// Uploaded file
///
/// **Reference:** <https://github.com/jaydenseric/graphql-multipart-request-spec>
///
///
/// Graphql supports file uploads via `multipart/form-data`.
/// Enable this feature by accepting an argument of type `Upload` (single file)
/// or `Vec<Upload>` (multiple files) in your mutation like in the example blow.
///
///
/// # Example
/// *[Full Example](<https://github.com/async-graphql/examples/blob/master/models/files/src/lib.rs>)*
///
/// ```
/// use async_graphql::*;
///
/// struct Mutation;
///
/// #[Object]
/// impl Mutation {
/// async fn upload(&self, ctx: &Context<'_>, file: Upload) -> bool {
/// println!("upload: filename={}", file.value(ctx).unwrap().filename);
/// true
/// }
/// }
/// ```
/// # Example Curl Request
///
/// Assuming you have defined your Mutation like in the example above,
/// you can now upload a file `myFile.txt` with the below curl command:
///
/// ```curl
/// curl 'localhost:8000' \
/// --form 'operations={
/// "query": "mutation ($file: Upload!) { upload(file: $file) }",
/// "variables": { "file": null }}' \
/// --form 'map={ "0": ["variables.file"] }' \
/// --form '0=@myFile.txt'
/// ```
pub struct Upload(usize);
impl Upload {
/// Get the upload value.
pub fn value(&self, ctx: &Context<'_>) -> std::io::Result<UploadValue> {
ctx.query_env.uploads[self.0].try_clone()
}
}
impl InputType for Upload {
type RawValueType = Self;
fn type_name() -> Cow<'static, str> {
Cow::Borrowed("Upload")
}
fn create_type_info(registry: &mut registry::Registry) -> String {
registry.create_input_type::<Self, _>(MetaTypeId::Scalar, |_| registry::MetaType::Scalar {
name: Self::type_name().to_string(),
description: None,
is_valid: Some(Arc::new(|value| matches!(value, Value::String(_)))),
visible: None,
inaccessible: false,
tags: Default::default(),
specified_by_url: Some(
"https://github.com/jaydenseric/graphql-multipart-request-spec".to_string(),
),
})
}
fn parse(value: Option<Value>) -> InputValueResult<Self> {
const PREFIX: &str = "#__graphql_file__:";
let value = value.unwrap_or_default();
if let Value::String(s) = &value {
if let Some(filename) = s.strip_prefix(PREFIX) {
return Ok(Upload(filename.parse::<usize>().unwrap()));
}
}
Err(InputValueError::expected_type(value))
}
fn to_value(&self) -> Value {
Value::Null
}
fn as_raw_value(&self) -> Option<&Self::RawValueType> {
Some(self)
}
}
|
use serde::ser::{Serialize, SerializeStruct, Serializer};
use serde_json;
pub struct City {
pub name: String,
pub population: usize,
}
pub struct Faction {
pub name: String,
pub cities: Vec<City>,
}
impl Faction {
pub fn new(name: String) -> Faction {
Faction {
name,
cities: vec![],
}
}
pub fn add_city(&mut self, name: String, population: usize) -> &mut Faction {
self.cities.push(City { name, population });
self
}
pub fn total_cities(&self) -> usize {
self.cities.len()
}
pub fn as_json(&mut self) -> serde_json::Result<String> {
serde_json::to_string_pretty(&self)
}
}
impl Serialize for Faction {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut state = serializer.serialize_struct("Faction", 3)?;
state.serialize_field("name", &self.name)?;
state.serialize_field("cities", &self.cities)?;
state.serialize_field("totalCities", &self.cities.len())?;
state.end()
}
}
impl Serialize for City {
fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
let mut state = serializer.serialize_struct("City", 2)?;
state.serialize_field("name", &self.name)?;
state.serialize_field("population", &self.population)?;
state.end()
}
}
|
use rbatis::crud::CRUDTable;
use rbatis_macro_driver::CRUDTable;
use serde::Deserialize;
use serde::Serialize;
use wallets_macro::{db_append_shared, DbBeforeSave, DbBeforeUpdate};
use crate::kits;
use crate::ma::dao::{self, Shared};
use crate::ma::TxShared;
//eee
#[db_append_shared]
#[derive(PartialEq, Serialize, Deserialize, Clone, Debug, Default, CRUDTable, DbBeforeSave, DbBeforeUpdate)]
pub struct MEeeChainToken {
#[serde(default)]
pub next_id: String,
// 手动加入的token就没有token shared内容
// [crate::db::EeeChainTokenShared]
#[serde(default)]
pub chain_token_shared_id: String,
// [crate::db::Wallet]
#[serde(default)]
pub wallet_id: String,
#[serde(default)]
pub chain_type: String,
//是否显示
//#[serde(default, deserialize_with = "bool_from_u32", serialize_with = "bool_to_u32")]
#[serde(default)]
pub show: u32,
// 精度
#[serde(default)]
pub decimal: i32,
}
impl MEeeChainToken {
pub const fn create_table_script() -> &'static str {
std::include_str!("../../../sql/m_eee_chain_token.sql")
}
}
/// eee chain的交易
#[db_append_shared(CRUDTable)]
#[derive(PartialEq, Serialize, Deserialize, Clone, Debug, Default, DbBeforeSave, DbBeforeUpdate)]
pub struct MEeeChainTx {
#[serde(flatten)]
pub tx_shared: TxShared,
#[serde(default)]
pub wallet_account: String,
//from是数据库的关键字,所以加上 address
#[serde(default)]
pub from_address: String,
#[serde(default)]
pub to_address: String,
#[serde(default)]
pub value: String,
//#[serde(default, deserialize_with = "bool_from_u32", serialize_with = "bool_to_u32")]
#[serde(default)]
pub status: u32,
// 扩展数据
#[serde(default)]
pub extension: String,
}
impl MEeeChainTx {
pub const fn create_table_script() -> &'static str {
std::include_str!("../../../sql/m_eee_chain_tx.sql")
}
}
#[db_append_shared(CRUDTable)]
#[derive(PartialEq, Serialize, Deserialize, Clone, Debug, Default, DbBeforeSave, DbBeforeUpdate)]
pub struct MEeeTokenxTx {
#[serde(flatten)]
pub tx_shared: TxShared,
#[serde(default)]
pub wallet_account: String,
//from是数据库的关键字,所以加上 address
#[serde(default)]
pub from_address: String,
#[serde(default)]
pub to_address: String,
#[serde(default)]
pub value: String,
// #[serde(default, deserialize_with = "bool_from_u32", serialize_with = "bool_to_u32")]
#[serde(default)]
pub status: u32,
// 扩展数据
#[serde(default)]
pub extension: String,
}
impl MEeeTokenxTx {
pub const fn create_table_script() -> &'static str {
std::include_str!("../../../sql/m_eee_tokenx_tx.sql")
}
}
#[db_append_shared]
#[derive(PartialEq, Serialize, Deserialize, Clone, Debug, Default, CRUDTable, DbBeforeSave, DbBeforeUpdate)]
pub struct MSubChainBasicInfo {
#[serde(default)]
pub genesis_hash: String,
#[serde(default)]
pub metadata: String,
#[serde(default)]
pub runtime_version: i32,
#[serde(default)]
pub tx_version: i32,
#[serde(default)]
pub ss58_format_prefix: i32,
#[serde(default)]
pub token_decimals: i32,
#[serde(default)]
pub token_symbol: String,
#[serde(default)]
pub is_default: u32,
}
impl MSubChainBasicInfo {
pub const fn create_table_script() -> &'static str {
std::include_str!("../../../sql/m_sub_chain_basic_info.sql")
}
}
#[db_append_shared]
#[derive(PartialEq, Serialize, Deserialize, Clone, Debug, Default, CRUDTable, DbBeforeSave, DbBeforeUpdate)]
pub struct MAccountInfoSyncProg {
#[serde(default)]
pub account: String,
#[serde(default)]
pub block_no: String,
#[serde(default)]
pub block_hash: String,
}
impl MAccountInfoSyncProg {
pub const fn create_table_script() -> &'static str {
std::include_str!("../../../sql/m_account_info_sync_prog.sql")
}
}
//eee end
#[cfg(test)]
mod tests {
use futures::executor::block_on;
use rbatis::crud::CRUDTable;
use rbatis::rbatis::Rbatis;
use crate::ChainType;
use crate::kits::test::make_memory_rbatis_test;
use crate::ma::{Db, DbCreateType, MAccountInfoSyncProg, MEeeChainToken, MEeeTokenxTx, MSubChainBasicInfo};
use crate::ma::dao::{BeforeSave, BeforeUpdate, Dao, Shared};
use crate::ma::data_eee::MEeeChainTx;
#[test]
fn m_eee_chain_token_test() {
let rb = block_on(init_memory());
let re = block_on(MEeeChainToken::list(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let mut m = MEeeChainToken::default();
m.chain_type = ChainType::EEE.to_string();
m.wallet_id = "wallet_id".to_owned();
let re = block_on(m.save(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let re = block_on(MEeeChainToken::list(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let ms = re.unwrap();
assert_eq!(1, ms.len(), "{:?}", ms);
let db_m = &ms.as_slice()[0];
assert_eq!(&m, db_m);
let re = block_on(MEeeChainToken::fetch_by_id(&rb, "", &m.id));
assert_eq!(false, re.is_err(), "{:?}", re);
let db_m = re.unwrap().unwrap();
assert_eq!(m, db_m);
}
#[test]
#[allow(non_snake_case)]
fn m_eee_chain_tx_test() {
// let colx = EeeChainTx::table_columns();
let mut m = MEeeChainTx::default();
assert_eq!("", Shared::get_id(&m));
assert_eq!(0, m.get_create_time());
assert_eq!(0, m.get_update_time());
assert_eq!(false, m.status);
assert_eq!("", m.extension);
assert_eq!("", m.from_address);
assert_eq!("", m.to_address);
assert_eq!("", m.value);
assert_eq!("", m.tx_shared.block_hash);
assert_eq!("", m.tx_shared.block_number);
assert_eq!("", m.tx_shared.tx_bytes);
assert_eq!("", m.tx_shared.tx_hash);
m.before_save();
assert_ne!("", Shared::get_id(&m));
assert_ne!(0, m.get_create_time());
assert_ne!(0, m.get_update_time());
assert_eq!(m.get_create_time(), m.get_update_time());
let mut m = MEeeChainTx::default();
m.before_update();
assert_eq!("", Shared::get_id(&m));
assert_eq!(0, m.get_create_time());
assert_ne!(0, m.get_update_time());
let rb = block_on(init_memory());
let mut m = MEeeChainTx::default();
m.from_address = "test".to_owned();
m.extension = "eee".to_owned();
m.status = false;
m.tx_shared.tx_hash = "hash".to_owned();
let err = block_on(m.save(&rb, ""));
if let Err(e) = &err {
let s = e.to_string();
println!("{}", s);
assert!(e.to_string().is_empty());
}
let re = block_on(MEeeChainTx::fetch_by_id(&rb, "", &m.id));
if let Err(e) = &re {
println!("{}", e);
}
assert_eq!(false, re.is_err(), "{:?}", re);
let m2 = re.unwrap().unwrap();
assert_eq!(m, m2);
let mut m3 = MEeeChainTx::default();
m3.tx_shared.tx_hash = "m3".to_owned();
let re = block_on(m3.save(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let re = block_on(MEeeChainTx::list(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let list = re.unwrap();
assert_eq!(2, list.len());
}
#[test]
fn m_eee_tokenx_tx_test() {
let rb = block_on(init_memory());
let re = block_on(MEeeTokenxTx::list(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let mut m = MEeeTokenxTx::default();
m.value = "value".to_owned();
let re = block_on(m.save(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let re = block_on(MEeeTokenxTx::list(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let ms = re.unwrap();
assert_eq!(1, ms.len(), "{:?}", ms);
let db_m = &ms.as_slice()[0];
assert_eq!(&m, db_m);
let re = block_on(MEeeTokenxTx::fetch_by_id(&rb, "", &m.id));
assert_eq!(false, re.is_err(), "{:?}", re);
let db_m = re.unwrap().unwrap();
assert_eq!(m, db_m);
}
#[test]
fn m_sub_chain_basic_info_test() {
let rb = block_on(init_memory());
let re = block_on(MSubChainBasicInfo::list(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let mut m = MSubChainBasicInfo::default();
m.metadata = "metadata".to_owned();
let re = block_on(m.save(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let re = block_on(MSubChainBasicInfo::list(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let ms = re.unwrap();
assert_eq!(1, ms.len(), "{:?}", ms);
let db_m = &ms.as_slice()[0];
assert_eq!(&m, db_m);
let re = block_on(MSubChainBasicInfo::fetch_by_id(&rb, "", &m.id));
assert_eq!(false, re.is_err(), "{:?}", re);
let db_m = re.unwrap().unwrap();
assert_eq!(m, db_m);
}
#[test]
fn m_account_info_sync_prog_test() {
let rb = block_on(init_memory());
let re = block_on(MAccountInfoSyncProg::list(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let mut m = MAccountInfoSyncProg::default();
m.block_no = "block_no".to_owned();
let re = block_on(m.save(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let re = block_on(MAccountInfoSyncProg::list(&rb, ""));
assert_eq!(false, re.is_err(), "{:?}", re);
let ms = re.unwrap();
assert_eq!(1, ms.len(), "{:?}", ms);
let db_m = &ms.as_slice()[0];
assert_eq!(&m, db_m);
let re = block_on(MAccountInfoSyncProg::fetch_by_id(&rb, "", &m.id));
assert_eq!(false, re.is_err(), "{:?}", re);
let db_m = re.unwrap().unwrap();
assert_eq!(m, db_m);
}
async fn init_memory() -> Rbatis {
let rb = make_memory_rbatis_test().await;
let r = Db::create_table(&rb, MEeeChainToken::create_table_script(), &MEeeChainToken::table_name(), &DbCreateType::Drop).await;
assert_eq!(false, r.is_err(), "{:?}", r);
let r = Db::create_table(&rb, MEeeChainTx::create_table_script(), &MEeeChainTx::table_name(), &DbCreateType::Drop).await;
assert_eq!(false, r.is_err(), "{:?}", r);
let r = Db::create_table(&rb, MEeeTokenxTx::create_table_script(), &MEeeTokenxTx::table_name(), &DbCreateType::Drop).await;
assert_eq!(false, r.is_err(), "{:?}", r);
let r = Db::create_table(&rb, MSubChainBasicInfo::create_table_script(), &MSubChainBasicInfo::table_name(), &DbCreateType::Drop).await;
assert_eq!(false, r.is_err(), "{:?}", r);
let r = Db::create_table(&rb, MAccountInfoSyncProg::create_table_script(), &MAccountInfoSyncProg::table_name(), &DbCreateType::Drop).await;
assert_eq!(false, r.is_err(), "{:?}", r);
rb
}
}
|
#![allow(dead_code)]
extern crate tqapi;
extern crate chrono;
use tqapi::api::*;
use std::thread::sleep;
use std::time::Duration;
struct Callback {
}
impl DataApiCallback for Callback {
fn on_quote(&mut self, quote : MarketQuote) {
println!("on_quote {}", quote);
}
fn on_bar (&mut self, cycle : &str, bar : Bar) {
println!("on_bar {}, {}",cycle, bar);
}
}
impl TradeApiCallback for Callback {
fn on_order (&mut self, order : Order) {
println!("on_order {}", order);
}
fn on_trade (&mut self, trade : Trade) {
println!("on_trade {}", trade);
}
fn on_account_status (&mut self, account : AccountInfo) {
println!("on_account_status {}", account);
}
}
fn test_dapi() {
let cb = Callback{};
let mut api = DataApi::new("tcp://127.0.0.1:10001");
api.set_callback(Some(Box::new(cb)));
print!("subscribe\n");
let code = "RB.SHF";
api.subscribe( &vec!["RB.SHF", "000001.SH"].join(",")).expect("subscribed error");
print!("call get_ticks\n");
match api.get_ticks(code, 0, 0) {
Ok(quotes) => for q in quotes { println!("{}", q);}
Err(msg) => println!("error: {}", msg)
}
// let count = 1;
// let begin_time = chrono::Local::now();
// for _ in 0..count {
// match api.get_ticks(code, 0) {
// Ok(quotes) => for q in quotes { println!("{}", q);}
// Err(msg) => println!("error: {}", msg)
// }
// }
// let end_time = chrono::Local::now();
// println!("{} ", (end_time - begin_time) / count);
// println!("call get_ticks done\n");
for _ in 0..3 {
sleep(Duration::new(1,0));
}
}
fn test_tapi() {
let cb = Callback{};
let mut api = TradeApi::new("tcp://127.0.0.1:10001");
api.set_callback(Some(Box::new(cb)));
println!("query_accounts");
match api.query_accounts() {
Ok(accounts) => for a in accounts { println!("{}", a);}
Err(msg) => println!("error: {}", msg)
}
for _ in 0..3 {
sleep(Duration::new(1,0));
}
}
pub struct TestStralet {
}
impl Stralet for TestStralet {
fn on_init (&mut self, ctx: &mut dyn StraletContext) {
ctx.log_info( format!{"on_init {}", ctx.get_trading_day()}.as_str() );
ctx.get_data_api().subscribe("000001.SH").expect("subscribe error");
}
fn on_fini (&mut self, ctx: &mut dyn StraletContext) {
ctx.log_info( format!{"on_fini {}", ctx.get_trading_day()}.as_str() );
}
fn on_quote (&mut self, _ctx: &mut dyn StraletContext, _quote : MarketQuote) {
//ctx.log_info( format!{"on_quote: {}", quote}.as_str() );
}
fn on_bar (&mut self, _ctx: &mut dyn StraletContext, _cycle : &str, _bar : Bar) {
}
fn on_order (&mut self, _ctx: &mut dyn StraletContext, _order : Order) {
}
fn on_trade (&mut self, _ctx: &mut dyn StraletContext, _trade : Trade) {
}
fn on_timer (&mut self, _ctx: &mut dyn StraletContext, _id : i64, _data : usize) {
}
fn on_event (&mut self, _ctx: &mut dyn StraletContext, _name : &str, _data : usize) {
}
fn on_account_status (&mut self, _ctx: &mut dyn StraletContext, _account : AccountInfo) {
}
}
fn create_stralet() -> Box<dyn Stralet>{
Box::new(TestStralet{})
}
pub fn test_stralet() {
let cfg = BackTestConfig {
dapi_addr : Some("tcp://127.0.0.1:10001"),
data_level : Some("tk"),
begin_date : 20190101,
end_date : 20190501,
// result_dir : None,
// properties : None
..Default::default()
};
BackTest::run(&cfg, create_stralet );
}
fn main() {
//test_dapi();
//test_tapi();
test_stralet();
}
|
#[crate_id = "redis#0.1"];
#[crate_type = "lib"];
#[license = "BSD"];
#[comment = "Bindings and wrapper functions for redis."];
#[deny(non_camel_case_types)];
#[feature(macro_rules)];
#[feature(globs)];
extern crate extra;
extern crate time;
extern crate collections;
extern crate serialize;
pub use parser::parse_redis_value;
pub use parser::Parser;
pub use enums::*;
pub use client::Client;
pub use script::Script;
pub use connection::Connection;
mod parser;
mod client;
mod script;
mod enums;
mod utils;
mod connection;
mod scan;
|
//! Timers
use nb;
/// A count down timer
///
/// # Contract
///
/// - `self.start(count); block!(self.try_wait());` MUST block for AT LEAST the time specified by
/// `count`.
///
/// *Note* that the implementer doesn't necessarily have to be a *downcounting* timer; it could also
/// be an *upcounting* timer as long as the above contract is upheld.
///
/// # Examples
///
/// You can use this timer to create delays
///
/// ```
/// extern crate embedded_hal as hal;
/// #[macro_use(block)]
/// extern crate nb;
///
/// use hal::prelude::*;
///
/// fn main() {
/// let mut led: Led = {
/// // ..
/// # Led
/// };
/// let mut timer: Timer6 = {
/// // ..
/// # Timer6
/// };
///
/// Led.on();
/// timer.try_start(1.s()).unwrap();
/// block!(timer.try_wait()); // blocks for 1 second
/// Led.off();
/// }
///
/// # use core::convert::Infallible;
/// # struct Seconds(u32);
/// # trait U32Ext { fn s(self) -> Seconds; }
/// # impl U32Ext for u32 { fn s(self) -> Seconds { Seconds(self) } }
/// # struct Led;
/// # impl Led {
/// # pub fn off(&mut self) {}
/// # pub fn on(&mut self) {}
/// # }
/// # struct Timer6;
/// # impl hal::timer::CountDown for Timer6 {
/// # type Error = Infallible;
/// # type Time = Seconds;
/// # fn try_start<T>(&mut self, _: T) -> Result<(), Self::Error> where T: Into<Seconds> { Ok(()) }
/// # fn try_wait(&mut self) -> ::nb::Result<(), Infallible> { Ok(()) }
/// # }
/// ```
pub trait CountDown {
/// An enumeration of `CountDown` errors.
///
/// For infallible implementations, will be `Infallible`
type Error;
/// The unit of time used by this timer
type Time;
/// Starts a new count down
fn try_start<T>(&mut self, count: T) -> Result<(), Self::Error>
where
T: Into<Self::Time>;
/// Non-blockingly "waits" until the count down finishes
///
/// # Contract
///
/// - If `Self: Periodic`, the timer will start a new count down right after the last one
/// finishes.
/// - Otherwise the behavior of calling `try_wait` after the last call returned `Ok` is UNSPECIFIED.
/// Implementers are suggested to panic on this scenario to signal a programmer error.
fn try_wait(&mut self) -> nb::Result<(), Self::Error>;
}
/// Marker trait that indicates that a timer is periodic
pub trait Periodic {}
/// Trait for cancelable countdowns.
pub trait Cancel: CountDown {
/// Tries to cancel this countdown.
///
/// # Errors
///
/// An error will be returned if the countdown has already been canceled or was never started.
/// An error is also returned if the countdown is not `Periodic` and has already expired.
fn try_cancel(&mut self) -> Result<(), Self::Error>;
}
|
extern crate cgl;
use std::fs::File;
use cgl::{Color, Image, Renderer, read_bmp};
use cgl::{Shader, Vert, Mat4, Vec3, Vec4};
mod demo;
fn main() {
let model = demo::african_head();
let mut renderer = Renderer::with_dimensions(512, 512);
let matrix = demo::african_head_matrix();
let texture = {
let mut file = File::open("assets/african_head/diffuse.bmp")
.expect("Should open assets/african_head/diffuse.bmp");
read_bmp(&mut file).expect("Should read image")
};
let normals = {
let mut file = File::open("assets/african_head/global_normal.bmp")
.expect("Should open assets/african_head/global_normal.bmp");
read_bmp(&mut file).expect("Should read image")
};
let shader = TexturedGlobalNormal;
renderer.model(&shader, &(matrix, texture, normals), &model);
demo::save(renderer.image(), 11);
}
struct TexturedGlobalNormal;
impl Shader<Vert, (Mat4<f32>, Image<Color>, Image<Color>)> for TexturedGlobalNormal {
type VOut = Vert;
fn vertex(&self, vertex: Vert,
&(matrix, _, _): &(Mat4<f32>, Image<Color>, Image<Color>),
pos: &mut Vec4<f32>)
-> Vert
{
*pos = matrix * vertex.pos.augment();
vertex
}
fn fragment(&self, input: Vert,
&(_, ref texture, ref nmap): &(Mat4<f32>, Image<Color>, Image<Color>))
-> Color
{
let norm = nmap.sample_clamp(input.tex.0, input.tex.1);
let normal = Vec3(norm.r as f32, norm.g as f32, norm.b as f32);
let normal = (normal - Vec3(128.0, 128.0, 128.0)) / 128.0;
let light = normal.dot(Vec3(0.2f32, 1.0, 0.4).normalized()) + 0.2;
let albedo = texture.sample_clamp(input.tex.0, input.tex.1);
albedo * light
}
}
|
use matrix_sdk::identifiers::RoomId;
use regex::Regex;
use serde::de::{self, MapAccess, Visitor};
use serde::{Deserialize, Deserializer};
use std::fmt;
use std::marker::PhantomData;
use std::path::PathBuf;
use std::str::FromStr;
use url::Url;
use void::Void;
/// Holds the configuration for the bot.
#[derive(Clone, Deserialize)]
pub struct Config {
/// The URL for the homeserver we should connect to
pub homeserver: Url,
/// The bot's account username
pub username: String,
/// The bot's account password
pub password: String,
/// Path to a directory where the bot will store Matrix state and current session information.
pub state_dir: PathBuf,
/// ID of the Matrix room where the bot should post messages. The bot will only accept
/// invitations to this room.
pub room_id: RoomId,
/// Units to watch for logs
#[serde(deserialize_with = "list_of_units")]
pub units: Vec<Unit>,
}
/// Holds a single unit's configuration.
#[derive(Clone, Debug, Deserialize)]
pub struct Unit {
/// Can be serialized from a string only instead of a map.
pub name: String,
/// Regex to filter each line read from the unit's logs.
#[serde(with = "serde_regex")]
pub filter: Option<Regex>,
}
impl PartialEq for Unit {
fn eq(&self, other: &Self) -> bool {
self.name == other.name
}
}
impl Eq for Unit {}
#[derive(Debug, Deserialize)]
#[serde(transparent)]
struct SerializedUnit(#[serde(deserialize_with = "unit_name_or_struct")] Unit);
impl From<SerializedUnit> for Unit {
fn from(s: SerializedUnit) -> Self {
s.0
}
}
impl FromStr for Unit {
type Err = Void;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Unit {
name: s.to_string(),
filter: None,
})
}
}
fn list_of_units<'de, D>(deserializer: D) -> Result<Vec<Unit>, D::Error>
where
D: Deserializer<'de>,
{
let units: Vec<SerializedUnit> = Deserialize::deserialize(deserializer)?;
Ok(units.into_iter().map(From::from).collect())
}
fn unit_name_or_struct<'de, T, D>(deserializer: D) -> Result<T, D::Error>
where
T: Deserialize<'de> + FromStr<Err = Void>,
D: Deserializer<'de>,
{
struct StringOrStruct<T>(PhantomData<fn() -> T>);
impl<'de, T> Visitor<'de> for StringOrStruct<T>
where
T: Deserialize<'de> + FromStr<Err = Void>,
{
type Value = T;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("string or map")
}
fn visit_str<E>(self, value: &str) -> Result<T, E>
where
E: de::Error,
{
Ok(FromStr::from_str(value).unwrap())
}
fn visit_map<M>(self, map: M) -> Result<T, M::Error>
where
M: MapAccess<'de>,
{
Deserialize::deserialize(de::value::MapAccessDeserializer::new(map))
}
}
deserializer.deserialize_any(StringOrStruct(PhantomData))
}
|
use super::{DropdownID, ExampleBox, Model, Msg};
use seed::{prelude::*, *};
use seed_bootstrap::button::{self, Button};
use seed_bootstrap::dropdown::{self, Dropdown};
use seed_bootstrap::navbar::{Nav, NavBar, NavLink};
pub fn view(model: &Model) -> Node<Msg> {
div![
C!["pt-5"],
h1!["Navbars"],
hr![],
ExampleBox::new("Basic example")
.content(div![
NavBar::new(plain!("Navbar"), "#")
.fixed_top(false)
.update_toggle(|toggle| toggle.add_on_click(|_| Msg::ToggleNavbar))
.add_attrs(C!["navbar-expand-lg", "navbar-light", "bg-light"])
.content(vec![
Nav::default()
.add_attrs(C!["mr-auto"])
.content(vec![
NavLink::new("Home", "#").active(true).view(),
NavLink::new("Link", "#").view(),
NavLink::new("Disabled", "#").disabled(true).view(),
Dropdown::new("Dropdown")
.items(vec![
dropdown::Item::button("Action", ()),
dropdown::Item::button("Another action", ()),
dropdown::Item::divider(),
dropdown::Item::button("Something else here", ()),
])
.view_in_nav(&model.dropdowns[&DropdownID::NavBarButton], |msg| Msg::DropdownMsg(msg, DropdownID::NavBarButton)),
]
).view(),
// --- search ---
form![C!["form-inline", "my-2", "my-lg-0"],
input![C!["form-control", "mr-sm-2"], attrs!{At::Type => "text", At::Placeholder => "Search", At::from("aria-label") => "Search"}],
Button::new("Search").outline().success().button(button::Type::Submit).add_attrs(C!["my-2", "my-sm-0"]),
]
])
.view_collapsable(model.navbar_expanded, "navbarsExampleDefault")
])
.code(
r##"NavBar::new(plain!("Navbar"), "#")
.fixed_top(false)
.update_toggle(|toggle| toggle.add_on_click(|_| Msg::ToggleNavbar))
.add_attrs(C!["navbar-expand-lg", "navbar-light", "bg-light"])
.content(vec![
Nav::default()
.add_attrs(C!["mr-auto"])
.content(vec![
NavLink::new("Home", "#").active(true).view(),
NavLink::new("Link", "#").view(),
NavLink::new("Disabled", "#").disabled(true).view(),
Dropdown::new("Dropdown")
.items(vec![
dropdown::Item::button("Action", ()),
dropdown::Item::button("Another action", ()),
dropdown::Item::divider(),
dropdown::Item::button("Something else here", ()),
])
.view_in_nav(&model.dropdowns[&DropdownID::NavBarButton], |msg| Msg::DropdownMsg(msg, DropdownID::NavBarButton)),
]
).view(),
// --- search ---
form![C!["form-inline", "my-2", "my-lg-0"],
input![C!["form-control", "mr-sm-2"], attrs!{At::Type => "text", At::Placeholder => "Search", At::from("aria-label") => "Search"}],
Button::new("Search").outline().success().button(button::Type::Submit).add_attrs(C!["my-2", "my-sm-0"]),
]
])
.view_collapsable(model.navbar_expanded, "navbarsExampleDefault")"##
),
]
}
|
use parser::functions::*;
use parser::lists::*;
use parser::primitives::*;
use pest::iterators::Pair;
use pest::Parser;
use std::collections::HashMap;
use super::stdlib;
mod primitives;
pub mod functions;
mod lists;
#[derive(Debug, PartialEq, Clone)]
pub struct Function {
pub args: Vec<Constant>,
pub base_fn: Option<Box<Constant>>,
pub implementation: Option<fn(Vec<Constant>) -> Constant>,
pub argc: usize
}
#[derive(Debug, PartialEq, Clone)]
pub enum Constant {
Float(f32),
Integer(i32),
String(String),
Boolean(bool),
Function(Function),
List(Vec<Constant>),
Index(usize)
}
#[derive(Parser)]
#[grammar = "parser/grammar.pest"]
struct PioterParser;
pub fn parse(contents: String) {
let p_starts = PioterParser::parse(Rule::p_start, &contents).unwrap_or_else(|e| panic!("{}", e));
let mut memory: HashMap<&str, Constant> = HashMap::new();
stdlib::register(&mut memory);
for p_start in p_starts {
for p_def in p_start.into_inner() {
match p_def.as_rule() {
Rule::p_dump => {
let pair = p_def.into_inner().nth(0).unwrap();
let name = pair.clone().into_span().as_str();
let constant = parse_p_eip(pair, &memory);
println!("{} = {:?}", name, constant)
}
Rule::p_def => {
let mut name = "";
for p_def_inner in p_def.into_inner() {
match p_def_inner.as_rule() {
Rule::def => (),
Rule::constant => {
name = p_def_inner.into_span().as_str();
if memory.get(name).is_some() {
println!("Constant \"{}\" is already defined!", name);
panic!();
}
}
Rule::p_eip => {
for p_eip_inner in p_def_inner.into_inner() {
let value = parse_p_eip(p_eip_inner, &memory);
memory.insert(name, value);
}
}
_ => unreachable!()
}
}
}
_ => unreachable!()
}
}
}
}
pub fn parse_p_eip(pair: Pair<Rule>, memory: &HashMap<&str, Constant>) -> Constant {
match pair.as_rule() {
Rule::number => parse_number(pair.into_inner().nth(0).unwrap()),
Rule::string => parse_string(pair),
Rule::boolean => parse_boolean(pair.into_inner().nth(0).unwrap()),
Rule::constant => parse_constant(pair, memory),
Rule::p_funcall => parse_funcall(pair, memory, None),
Rule::p_fundef => parse_fundef(pair, memory),
Rule::p_eip => parse_p_eip(pair.into_inner().nth(0).unwrap(), memory),
Rule::p_list => parse_p_list(pair.into_inner().nth(0).unwrap(), memory),
_ => unreachable!()
}
}
#[allow(dead_code)]
pub fn debug_pair(pair: Pair<Rule>) {
let span = pair.clone().into_span();
println!("Rule: {:?}", pair.as_rule());
println!("Span: {:?}", span);
println!("Text: {}", span.as_str());
}
|
#[macro_use]
pub mod logger;
pub use logger::init as logger_init;
|
use super::{TraitDefinition, *};
use as_derive_utils::parse_utils::ParseBufferExt;
use syn::{parse::ParseBuffer, Attribute, ItemTrait, TraitItem, TraitItemMethod};
#[allow(unused_imports)]
use core_extensions::SelfOps;
use crate::{arenas::Arenas, attribute_parsing::contains_doc_hidden, utils::LinearResult};
/// Configuration parsed from the helper attributes of `#[sabi_trait]`
pub(crate) struct SabiTraitOptions<'a> {
/// Whether the output of the proc-macro is printed with println.
pub(crate) debug_print_trait: bool,
pub(crate) debug_output_tokens: bool,
pub(crate) doc_hidden_attr: Option<&'a TokenStream2>,
pub(crate) trait_definition: TraitDefinition<'a>,
}
impl<'a> SabiTraitOptions<'a> {
fn new(
trait_: &'a ItemTrait,
this: SabiTraitAttrs<'a>,
arenas: &'a Arenas,
ctokens: &'a CommonTokens,
) -> Result<Self, syn::Error> {
let doc_hidden_attr = if this.is_hidden {
Some(arenas.alloc(quote!(#[doc(hidden)])))
} else {
None
};
Ok(Self {
debug_print_trait: this.debug_print_trait,
debug_output_tokens: this.debug_output_tokens,
doc_hidden_attr,
trait_definition: TraitDefinition::new(trait_, this, arenas, ctokens)?,
})
}
}
mod kw {
syn::custom_keyword! {no_default_fallback}
syn::custom_keyword! {debug_print_trait}
syn::custom_keyword! {debug_output_tokens}
syn::custom_keyword! {use_dyntrait}
syn::custom_keyword! {use_dyn_trait}
syn::custom_keyword! {no_trait_impl}
}
////////////////////////////////////////////////////////////////////////////////
/// The attributes used in the vtable,and the trait.
#[derive(Debug, Clone, Default)]
pub(crate) struct OwnedDeriveAndOtherAttrs {
/// The attributes used in the vtable.
pub(crate) derive_attrs: Vec<Attribute>,
/// The attributes used in the trait.
pub(crate) other_attrs: Vec<Attribute>,
}
////////////////////////////////////////////////////////////////////////////////
/// The `syn` type for methods,as well as its attributes split by where they are used.
#[derive(Debug, Clone)]
pub(crate) struct MethodWithAttrs<'a> {
/// The attributes used in the vtable,and the trait.
pub(crate) attrs: OwnedDeriveAndOtherAttrs,
pub(crate) item: &'a TraitItemMethod,
}
impl<'a> MethodWithAttrs<'a> {
/// Constructs a `MethodWithAttrs` with no attributes.
fn new(item: &'a TraitItemMethod) -> Self {
Self {
attrs: OwnedDeriveAndOtherAttrs {
derive_attrs: Vec::new(),
other_attrs: Vec::new(),
},
item,
}
}
}
////////////////////////////////////////////////////////////////////////////////
/// A datastructure used while parsing the helper attributes of #[sabi_trait].
#[derive(Default)]
pub(super) struct SabiTraitAttrs<'a> {
/// Whether the output of the proc-macro is printed with println.
pub(super) debug_print_trait: bool,
/// The attributes used in the vtable,and the trait.
pub(super) attrs: OwnedDeriveAndOtherAttrs,
/// The `syn` type for methods,as well as their attributes split by where they are used.
pub(super) methods_with_attrs: Vec<MethodWithAttrs<'a>>,
/// Which type to use as the underlying implementation of the trait object,
/// either DynTrait or RObject.
pub(super) which_object: WhichObject,
/// If true,removes the `impl Trait for Trait_TO`
pub(super) disable_trait_impl: bool,
/// If true,doesn't use the default implementation of methods when
/// the vtable entry is absent.
pub(super) disable_inherent_default: Vec<bool>,
pub(super) is_hidden: bool,
pub(super) debug_output_tokens: bool,
pub(super) errors: LinearResult<()>,
}
/// Used as context while parsing helper attributes of #[sabi_trait].
#[derive(Debug, Copy, Clone)]
enum ParseContext {
TraitAttr,
Method { index: usize },
}
/// Parses the helper attributes for `#[sabi_trait]`.
pub(crate) fn parse_attrs_for_sabi_trait<'a>(
trait_: &'a ItemTrait,
arenas: &'a Arenas,
ctokens: &'a CommonTokens,
) -> Result<SabiTraitOptions<'a>, syn::Error> {
let mut this = SabiTraitAttrs::default();
let assoc_fns: Vec<&'a TraitItemMethod> = trait_
.items
.iter()
.filter_map(|item| match item {
TraitItem::Method(x) => Some(x),
_ => None,
})
.collect();
this.methods_with_attrs.reserve(assoc_fns.len());
this.disable_inherent_default.resize(assoc_fns.len(), false);
parse_inner(&mut this, &*trait_.attrs, ParseContext::TraitAttr, arenas)?;
for (index, assoc_fn) in assoc_fns.iter().cloned().enumerate() {
this.methods_with_attrs.push(MethodWithAttrs::new(assoc_fn));
parse_inner(
&mut this,
&*assoc_fn.attrs,
ParseContext::Method { index },
arenas,
)?;
}
this.errors.take()?;
SabiTraitOptions::new(trait_, this, arenas, ctokens)
}
/// Parses all the attributes on an item.
fn parse_inner<'a, I>(
this: &mut SabiTraitAttrs<'a>,
attrs: I,
pctx: ParseContext,
arenas: &'a Arenas,
) -> Result<(), syn::Error>
where
I: IntoIterator<Item = &'a Attribute>,
{
for attr in attrs {
if attr.path.is_ident("sabi") {
attr.parse_args_with(|input: &ParseBuffer<'_>| {
parse_sabi_trait_attr(this, pctx, input, attr, arenas)
})?;
} else if attr.path.is_ident("doc")
&& matches!(pctx, ParseContext::TraitAttr)
&& syn::parse::Parser::parse2(contains_doc_hidden, attr.tokens.clone())?
{
this.is_hidden = true;
} else if let ParseContext::TraitAttr = pctx {
this.attrs.other_attrs.push(attr.clone());
} else if let ParseContext::Method { .. } = pctx {
this.methods_with_attrs
.last_mut()
.unwrap()
.attrs
.other_attrs
.push(attr.clone());
}
}
Ok(())
}
/// Parses the `#[sabi()]` attributes on an item.
fn parse_sabi_trait_attr<'a>(
this: &mut SabiTraitAttrs<'a>,
pctx: ParseContext,
input: &ParseBuffer<'_>,
attr: &Attribute,
_arenas: &'a Arenas,
) -> Result<(), syn::Error> {
fn push_attr(
this: &mut SabiTraitAttrs<'_>,
pctx: ParseContext,
input: &ParseBuffer<'_>,
attr: Attribute,
) {
input.ignore_rest();
match pctx {
ParseContext::Method { .. } => {
this.methods_with_attrs
.last_mut()
.unwrap()
.attrs
.derive_attrs
.push(attr);
}
ParseContext::TraitAttr => {
this.attrs.derive_attrs.push(attr);
}
}
}
if input.check_parse(kw::no_default_fallback)? {
match pctx {
ParseContext::TraitAttr => {
for is_disabled in &mut this.disable_inherent_default {
*is_disabled = true;
}
}
ParseContext::Method { index } => {
this.disable_inherent_default[index] = true;
}
}
} else if input.check_parse(kw::debug_print_trait)? {
this.debug_print_trait = true;
} else if input.check_parse(kw::debug_output_tokens)? {
this.debug_output_tokens = true;
} else if let ParseContext::TraitAttr = pctx {
if input.check_parse(kw::use_dyntrait)? || input.check_parse(kw::use_dyn_trait)? {
this.which_object = WhichObject::DynTrait;
} else if input.check_parse(kw::no_trait_impl)? {
this.disable_trait_impl = true;
} else {
push_attr(this, pctx, input, attr.clone());
}
} else {
push_attr(this, pctx, input, attr.clone())
}
Ok(())
}
|
// Copyright 2020-2021, The Tremor Team
//
// 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.
#![cfg(not(tarpaulin_include))]
use crate::source::prelude::*;
use async_std::fs::File as FSFile;
use async_std::io::prelude::*;
use async_std::io::{BufReader, Lines};
use async_std::prelude::*;
use tremor_common::asy::file;
/// Testing source for verifying correct CB Ack/Fail behaviour of the whole downstream pipeline/offramps
///
/// takes events from a file and expects at least one (or exactly one) ack or fail for each event.
///
/// ### Notes:
///
/// * In case the connected pipeline drops events no ack or fail is received with the current runtime.
/// * In case the pipeline branches off, it copies the event and it reaches two offramps, we might receive more than 1 ack or fail for an event with the current runtime.
#[derive(Deserialize, Debug, Clone)]
pub struct Config {
/// path to file to load data from
source: String,
// timeout in millis
#[serde(default = "default_timeout")]
timeout: u64,
// only expect the latest event to be acked, the earliest to be failed
#[serde(default = "default_expect_batched")]
expect_batched: bool,
}
/// 10 seconds
fn default_timeout() -> u64 {
10_000
}
fn default_expect_batched() -> bool {
false
}
impl ConfigImpl for Config {}
pub struct Cb {
onramp_id: TremorUrl,
config: Config,
}
impl onramp::Impl for Cb {
fn from_config(id: &TremorUrl, config: &Option<YamlValue>) -> Result<Box<dyn Onramp>> {
if let Some(config) = config {
let config: Config = Config::new(config)?;
Ok(Box::new(Self {
onramp_id: id.clone(),
config,
}))
} else {
Err("Missing config for cb onramp".into())
}
}
}
#[derive(Default, Debug)]
struct ReceivedCbs {
ack: Vec<u64>, // collect ids of acks
fail: Vec<u64>, // collect ids of fails
trigger: u64, // counter
restore: u64, // counter
}
impl ReceivedCbs {
fn count(&self) -> usize {
self.ack.len() + self.fail.len()
}
fn max(&self) -> Option<u64> {
self.ack
.iter()
.copied()
.max()
.max(self.fail.iter().copied().max())
}
}
#[derive(Debug)]
struct Int {
id: TremorUrl,
uid: u64,
num_sent: usize,
last_sent: u64, // we assume we have an increasing run of ids without gap, so we only store the latest
received_cbs: ReceivedCbs,
lines: Lines<BufReader<FSFile>>,
config: Config,
finished: bool,
}
impl Int {
async fn from_config(uid: u64, onramp_id: TremorUrl, config: Config) -> Result<Self> {
info!("[Source::{}] started with uid {}", onramp_id, uid);
let f = file::open(&config.source).await?;
let lines = BufReader::new(f).lines();
Ok(Self {
id: onramp_id,
uid,
num_sent: 0,
last_sent: 0,
received_cbs: ReceivedCbs::default(),
lines,
config,
finished: false,
})
}
}
#[async_trait::async_trait()]
impl Source for Int {
async fn pull_event(&mut self, id: u64) -> Result<SourceReply> {
match self.lines.next().await {
Some(Ok(line)) => {
self.num_sent += 1;
self.last_sent = self.last_sent.max(id);
Ok(SourceReply::Data {
origin_uri: EventOriginUri {
uid: self.uid,
scheme: "tremor-cb".to_owned(),
host: hostname(),
..EventOriginUri::default()
},
data: line.into_bytes(),
meta: None,
codec_override: None,
stream: 0,
})
}
Some(Err(e)) => Err(e.into()),
None => {
let wait = 100;
if self.finished {
if self.config.timeout == 0 {
// timeout reached check if we received all cb events
let max_cb_received = self.received_cbs.max().unwrap_or_default();
let cbs_missing = if self.config.expect_batched {
max_cb_received < self.last_sent
} else {
self.received_cbs.count() < self.num_sent
};
let status = if cbs_missing {
// report failures to stderr and exit with 1
eprintln!("Expected CB events up to id {}.", self.last_sent);
eprintln!("Got acks: {:?}", self.received_cbs.ack);
eprintln!("Got fails: {:?}", self.received_cbs.fail);
1
} else {
0
};
// ALLOW: this is the supposed to exit
std::process::exit(status);
} else {
self.config.timeout = self.config.timeout.saturating_sub(wait);
}
} else {
self.finished = true;
}
Ok(SourceReply::Empty(wait))
}
}
}
async fn init(&mut self) -> Result<SourceState> {
Ok(SourceState::Connected)
}
fn id(&self) -> &TremorUrl {
&self.id
}
fn trigger_breaker(&mut self) {
self.received_cbs.trigger += 1;
}
fn restore_breaker(&mut self) {
self.received_cbs.restore += 1;
}
fn ack(&mut self, id: u64) {
self.received_cbs.ack.push(id);
if self.finished && self.received_cbs.count() == self.num_sent
|| (self.config.expect_batched
&& self
.received_cbs
.max()
.map(|m| m == self.last_sent)
.unwrap_or_default())
{
eprintln!("All required CB events received.");
}
}
fn fail(&mut self, id: u64) {
self.received_cbs.fail.push(id);
if self.finished && self.received_cbs.count() == self.num_sent
|| (self.config.expect_batched
&& self
.received_cbs
.max()
.map(|m| m == self.last_sent)
.unwrap_or_default())
{
eprintln!("All required CB events received.");
}
}
fn is_transactional(&self) -> bool {
true
}
}
#[async_trait::async_trait]
impl Onramp for Cb {
async fn start(&mut self, config: OnrampConfig<'_>) -> Result<onramp::Addr> {
let source = Int::from_config(
config.onramp_uid,
self.onramp_id.clone(),
self.config.clone(),
)
.await?;
SourceManager::start(source, config).await
}
fn default_codec(&self) -> &str {
"json"
}
}
|
use crate::{
format::convert_byte_array_to_int,
ntlmssp::{self, challenge::Challenge, AvId, AvPair, MessageType},
};
/// Decodes the NTLMSSP security response body.
pub fn decode_security_response(security_response: Vec<u8>) -> ntlmssp::Header {
let ntlmssp_response = remove_gss_wrapper(security_response);
let mut header = ntlmssp::Header::default();
header.signature = ntlmssp_response[..8].to_vec();
header.message_type = ntlmssp_response[8..12].to_vec();
let mut challenge = Challenge::default();
challenge.target_name_fields.target_name_len = ntlmssp_response[12..14].to_vec();
challenge.target_name_fields.target_name_max_len = ntlmssp_response[14..16].to_vec();
challenge.target_name_fields.target_name_buffer_offset = ntlmssp_response[16..20].to_vec();
challenge.negotiate_flags = ntlmssp_response[20..24].to_vec();
challenge.server_challenge = ntlmssp_response[24..32].to_vec();
challenge.target_info_fields.target_info_len = ntlmssp_response[40..42].to_vec();
challenge.target_info_fields.target_info_max_len = ntlmssp_response[42..44].to_vec();
challenge.target_info_fields.target_info_buffer_offset = ntlmssp_response[44..48].to_vec();
challenge.version.product_major_version = ntlmssp_response[48..49].to_vec();
challenge.version.product_minor_version = ntlmssp_response[49..50].to_vec();
challenge.version.product_build = ntlmssp_response[50..52].to_vec();
challenge.version.ntlm_revision_current = ntlmssp_response[55..56].to_vec();
let target_info_offset = convert_byte_array_to_int(
challenge
.target_info_fields
.target_info_buffer_offset
.clone(),
false,
) as usize;
challenge.payload.target_name = ntlmssp_response[56..target_info_offset].to_vec();
let end_of_message = target_info_offset
+ convert_byte_array_to_int(challenge.target_info_fields.target_info_len.clone(), false)
as usize;
challenge.payload.target_info =
decode_target_info(ntlmssp_response, target_info_offset, end_of_message);
header.message = Some(MessageType::Challenge(challenge));
header
}
/// Decodes the AvPairs of the target info.
pub fn decode_target_info(
ntlmssp_response: Vec<u8>,
mut offset: usize,
end_of_message: usize,
) -> Vec<AvPair> {
let mut av_pairs: Vec<AvPair> = Vec::new();
while offset < end_of_message - 2 {
let mut target_info = AvPair::default();
target_info.av_id = Some(AvId::map_byte_code_to_av_id(
ntlmssp_response[offset..offset + 2].to_vec(),
));
target_info.av_len = ntlmssp_response[offset + 2..offset + 4].to_vec();
if offset < end_of_message - 3 {
let value_size = convert_byte_array_to_int(target_info.av_len.clone(), false);
target_info.value =
ntlmssp_response[offset + 4..offset + 4 + value_size as usize].to_vec();
offset = offset + 4 + value_size as usize;
av_pairs.push(target_info);
} else {
break;
}
}
av_pairs
}
/// Removes the ASN.1 encoded gss wrapper.
pub fn remove_gss_wrapper(security_response: Vec<u8>) -> Vec<u8> {
security_response[31..].to_vec()
}
#[cfg(test)]
mod tests {
use super::*;
struct Setup {
complete_byte_code: Vec<u8>,
ntlm_byte_code: Vec<u8>,
target_info: Vec<AvPair>,
}
impl Setup {
pub fn new() -> Self {
let byte_code = b"\xa1\x81\xce\x30\x81\xcb\xa0\x03\x0a\x01\x01\xa1\x0c\x06\x0a\x2b\
\x06\x01\x04\x01\x82\x37\x02\x02\x0a\xa2\x81\xb5\x04\x81\xb2\x4e\
\x54\x4c\x4d\x53\x53\x50\x00\x02\x00\x00\x00\x16\x00\x16\x00\x38\
\x00\x00\x00\x15\x82\x8a\x62\x8d\x51\x0b\x30\x2d\x45\x71\xe0\x00\
\x00\x00\x00\x00\x00\x00\x00\x64\x00\x64\x00\x4e\x00\x00\x00\x06\
\x01\x00\x00\x00\x00\x00\x0f\x52\x00\x41\x00\x53\x00\x50\x00\x42\
\x00\x45\x00\x52\x00\x52\x00\x59\x00\x50\x00\x49\x00\x02\x00\x16\
\x00\x52\x00\x41\x00\x53\x00\x50\x00\x42\x00\x45\x00\x52\x00\x52\
\x00\x59\x00\x50\x00\x49\x00\x01\x00\x16\x00\x52\x00\x41\x00\x53\
\x00\x50\x00\x42\x00\x45\x00\x52\x00\x52\x00\x59\x00\x50\x00\x49\
\x00\x04\x00\x02\x00\x00\x00\x03\x00\x16\x00\x72\x00\x61\x00\x73\
\x00\x70\x00\x62\x00\x65\x00\x72\x00\x72\x00\x79\x00\x70\x00\x69\
\x00\x07\x00\x08\x00\x60\x16\xad\x6d\x47\x21\xd7\x01\x00\x00\x00\
\x00".to_vec();
let mut first_target = AvPair::default();
first_target.av_id = Some(AvId::MsvAvNbDomainName);
first_target.av_len = b"\x16\x00".to_vec();
first_target.value = b"\x52\x00\x41\x00\x53\x00\x50\x00\x42\x00\x45\
\x00\x52\x00\x52\x00\x59\x00\x50\x00\x49\x00"
.to_vec();
let mut second_target = AvPair::default();
second_target.av_id = Some(AvId::MsvAvNbComputerName);
second_target.av_len = first_target.av_len.clone();
second_target.value = first_target.value.clone();
let mut third_target = AvPair::default();
third_target.av_id = Some(AvId::MsvAvDnsDomainName);
third_target.av_len = b"\x02\x00".to_vec();
third_target.value = b"\x00\x00".to_vec();
let mut fourth_target = AvPair::default();
fourth_target.av_id = Some(AvId::MsvAvDnsComputerName);
fourth_target.av_len = first_target.av_len.clone();
fourth_target.value = b"\x72\x00\x61\x00\x73\x00\x70\x00\x62\x00\x65\
\x00\x72\x00\x72\x00\x79\x00\x70\x00\x69\x00"
.to_vec();
let mut fifth_target = AvPair::default();
fifth_target.av_id = Some(AvId::MsvAvTimeStamp);
fifth_target.av_len = b"\x08\x00".to_vec();
fifth_target.value = b"\x60\x16\xad\x6d\x47\x21\xd7\x01".to_vec();
let mut sixth_target = AvPair::default();
sixth_target.av_id = Some(AvId::MsvAvEol);
sixth_target.av_len = b"\x00\x00".to_vec();
Setup {
complete_byte_code: byte_code.clone(),
ntlm_byte_code: byte_code[31..].to_vec(),
target_info: vec![
first_target,
second_target,
third_target,
fourth_target,
fifth_target,
sixth_target,
],
}
}
}
#[test]
fn test_decode_security_response() {
let setup = Setup::new();
let mut header = ntlmssp::Header::default();
let mut challenge = Challenge::default();
challenge.target_name_fields.target_name_len = b"\x16\x00".to_vec();
challenge.target_name_fields.target_name_max_len = b"\x16\x00".to_vec();
challenge.target_name_fields.target_name_buffer_offset = b"\x38\x00\x00\x00".to_vec();
challenge.negotiate_flags = b"\x15\x82\x8a\x62".to_vec();
challenge.server_challenge = b"\x8d\x51\x0b\x30\x2d\x45\x71\xe0".to_vec();
challenge.target_info_fields.target_info_len = b"\x64\x00".to_vec();
challenge.target_info_fields.target_info_max_len = b"\x64\x00".to_vec();
challenge.target_info_fields.target_info_buffer_offset = b"\x4e\x00\x00\x00".to_vec();
challenge.version.product_major_version = b"\x06".to_vec();
challenge.version.product_minor_version = b"\x01".to_vec();
challenge.version.product_build = b"\x00\x00".to_vec();
challenge.version.ntlm_revision_current = b"\x0f".to_vec();
challenge.payload.target_name = b"\x52\x00\x41\x00\x53\x00\x50\x00\x42\x00\x45\
\x00\x52\x00\x52\x00\x59\x00\x50\x00\x49\x00"
.to_vec();
challenge.payload.target_info = setup.target_info;
let message_type = MessageType::Challenge(challenge);
header.message_type = message_type.unpack_byte_code();
header.message = Some(message_type);
assert_eq!(header, decode_security_response(setup.complete_byte_code));
}
#[test]
fn test_decode_target_info() {
let setup = Setup::new();
assert_eq!(
setup.target_info,
decode_target_info(setup.ntlm_byte_code, 78, 178)
);
}
}
|
/*!
Implementation of the core in version:
* **v1.0** (see [v1.0 CloudEvents specification](https://github.com/cloudevents/spec/blob/v1.0/spec.md) and [v1.0 JSON Event Format](https://github.com/cloudevents/spec/blob/v1.0/json-format.md))
* **v0.2** (see [v0.2 CloudEvents specification](https://github.com/cloudevents/spec/blob/v0.2/spec.md) and [v0.2 JSON Event Format](https://github.com/cloudevents/spec/blob/v0.2/json-format.md))
This library is meant to provide the base for other CloudEvent transport bindings and formats. It only implements the core specification and the JSON format.
# Create CloudEvent according to latest spec
A cloud event can be create in two different ways:
## Using the macro
```
use cloudevents::cloudevent;
use cloudevents::{Data, CloudEventBuilder};
use cloudevents::CloudEvent;
use failure::Error;
let event: Result<CloudEvent, Error> = cloudevent!(
event_type: "test type",
source: "http://www.google.com",
event_id: "id",
time: "2019-12-04T18:33:09+00:00",
subject: "me",
dataschema: "https://lol.org/schema.json"
datacontenttype: "application/json",
data: Data::from_string("\"test\""),
);
```
## Using the builder
```
use cloudevents::{Data, CloudEventBuilder};
use cloudevents::CloudEventLatest;
use failure::Error;
let event: Result<CloudEventLatest, Error> = CloudEventBuilder::latest()
.event_id("id")
.source("http://www.google.com")
.event_type("test type")
.datacontenttype("application/json")
.data(Data::from_string("\"test\""))
.build();
```
Check out the module documentation to learn about version specific macros and builders.
# JSON encoding
The CloudEvents can be serialized/deserialized with `serde_json`
## Serialization
```
use serde_json;
use cloudevents::cloudevent;
use cloudevents::Data;
let event = cloudevent!(
event_type: "test type",
source: "http://www.google.com",
event_id: "id",
datacontenttype: "application/json",
data: Data::from_string("\"test\""),
);
let json = serde_json::to_string(&event.unwrap()).unwrap();
assert_eq!(json, "{\"type\":\"test type\",\"specversion\":\"1.0\",\"source\":\"http://www.google.com\",\"id\":\"id\",\"datacontenttype\":\"application/json\",\"data\":\"\\\"test\\\"\"}");
```
## Deserialization
```
use serde_json;
use cloudevents::cloudevent_v1_0;
use cloudevents::{Data, CloudEvent};
let data = "{\"type\":\"test type\",\"specversion\":\"1.0\",\"source\":\"http://www.google.com\",\"id\":\"id\",\"datacontenttype\":\"application/json\",\"data\":\"\\\"test\\\"\"}";
let expected_event = cloudevent_v1_0!(
event_type: "test type",
source: "http://www.google.com",
event_id: "id",
datacontenttype: "application/json",
data: Data::from_string("\"test\""),
).unwrap();
let event: CloudEvent = serde_json::from_str(data).unwrap();
match event {
CloudEvent::V1_0(event) => assert_eq!(event, expected_event),
_ => assert!(false)
}
```
# License
Licensed under either of
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
# Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.
*/
mod builder;
mod common;
mod event;
mod helper;
pub mod v0_2;
pub mod v1_0;
pub use crate::builder::CloudEventBuilder;
pub use crate::common::{Data, ExtensionValue};
pub use crate::event::CloudEvent;
use crate::v1_0::{CloudEventV1_0, CloudEventV1_0Builder};
pub type CloudEventLatest = CloudEventV1_0;
pub type CloudEventLatestBuilder = CloudEventV1_0Builder;
|
#[macro_use]
extern crate lazy_static;
extern crate itertools;
extern crate regex;
use itertools::Itertools;
use regex::Regex;
use std::collections::HashMap;
use std::ops::Range;
#[derive(Ord, PartialEq, PartialOrd, Eq, Debug)]
enum Action {
StartShift(i32),
WakeUp,
FallAsleep,
}
#[derive(Ord, PartialOrd, PartialEq, Eq, Debug)]
struct Log {
year: i32,
month: i32,
day: i32,
hour: i32,
minute: i32,
action: Action,
}
impl Log {
fn parse(raw_log: &str) -> Log {
lazy_static! {
static ref LOG_REGEX: Regex =
Regex::new(r"^\[(\d+)-(\d+)-(\d+) (\d+):(\d+)\] (.+)$").unwrap();
static ref SHIFT_REGEX: Regex = Regex::new(r"^Guard #(\d+) begins shift$").unwrap();
}
let captures = LOG_REGEX.captures(raw_log).unwrap();
let year = captures.get(1).unwrap().as_str().parse::<i32>().unwrap();
let month = captures.get(2).unwrap().as_str().parse::<i32>().unwrap();
let day = captures.get(3).unwrap().as_str().parse::<i32>().unwrap();
let hour = captures.get(4).unwrap().as_str().parse::<i32>().unwrap();
let minute = captures.get(5).unwrap().as_str().parse::<i32>().unwrap();
let action = match captures.get(6).unwrap().as_str() {
"falls asleep" => Action::FallAsleep,
"wakes up" => Action::WakeUp,
a => Action::StartShift(
SHIFT_REGEX
.captures(a)
.unwrap()
.get(1)
.unwrap()
.as_str()
.parse::<i32>()
.unwrap(),
),
};
Log {
year,
month,
day,
hour,
minute,
action,
}
}
}
fn solve(input: String) -> i32 {
let logs = input.split("\n").map(Log::parse).sorted();
let mut asleep: HashMap<i32, Vec<Range<i32>>> = HashMap::new();
let mut id = 0;
let mut start = 0;
for log in logs {
match log.action {
Action::WakeUp => {
let range = start..log.minute;
asleep
.entry(id)
.and_modify(|e| e.push(range.clone()))
.or_insert(vec![range.clone()]);
}
Action::FallAsleep => {
start = log.minute;
}
Action::StartShift(guard_id) => {
id = guard_id;
}
}
}
asleep
.iter()
.map(|(id, ranges)| {
let minutes: Vec<i32> = ranges.iter().flat_map(|r| r.clone().into_iter()).collect();
let mut times_minute = HashMap::new();
for min in &minutes {
*times_minute.entry(min).or_insert(0) += 1;
}
let most_asleep = times_minute
.iter()
.max_by(|(_, t1), (_, t2)| t1.cmp(t2))
.map(|(min, _)| *min)
.unwrap();
(*id, minutes.len() as i32, *most_asleep)
})
.max_by(|(_, m1, _), (_, m2, _)| m1.cmp(m2))
.map(|(id, _, most_asleep)| id * most_asleep)
.unwrap()
}
fn main() {
let input = include_str!("input.txt").into();
println!("{}", solve(input));
}
#[test]
fn test_04() {
let input = vec![
"[1518-11-01 00:00] Guard #10 begins shift",
"[1518-11-01 00:05] falls asleep",
"[1518-11-01 00:25] wakes up",
"[1518-11-01 00:30] falls asleep",
"[1518-11-01 00:55] wakes up",
"[1518-11-01 23:58] Guard #99 begins shift",
"[1518-11-02 00:40] falls asleep",
"[1518-11-02 00:50] wakes up",
"[1518-11-03 00:05] Guard #10 begins shift",
"[1518-11-03 00:24] falls asleep",
"[1518-11-03 00:29] wakes up",
"[1518-11-04 00:02] Guard #99 begins shift",
"[1518-11-04 00:36] falls asleep",
"[1518-11-04 00:46] wakes up",
"[1518-11-05 00:03] Guard #99 begins shift",
"[1518-11-05 00:45] falls asleep",
"[1518-11-05 00:55] wakes up",
];
let result = solve(input.join("\n"));
assert_eq!(result, 240);
}
|
mod json;
mod parser;
mod parser_dispatch;
#[allow(dead_code)]
mod parser_partial;
use winnow::error::ErrorKind;
use winnow::prelude::*;
fn main() -> Result<(), lexopt::Error> {
let args = Args::parse()?;
let data = args.input.as_deref().unwrap_or(if args.invalid {
" { \"a\"\t: 42,
\"b\": [ \"x\", \"y\", 12 ] ,
\"c\": { 1\"hello\" : \"world\"
}
} "
} else {
" { \"a\"\t: 42,
\"b\": [ \"x\", \"y\", 12 ] ,
\"c\": { \"hello\" : \"world\"
}
} "
});
let result = match args.implementation {
Impl::Naive => parser::json::<ErrorKind>.parse(data),
Impl::Dispatch => parser_dispatch::json::<ErrorKind>.parse(data),
};
match result {
Ok(json) => {
println!("{:#?}", json);
}
Err(err) => {
if args.pretty {
println!("{}", err);
} else {
println!("{:#?}", err);
}
}
}
Ok(())
}
#[derive(Default)]
struct Args {
input: Option<String>,
invalid: bool,
pretty: bool,
implementation: Impl,
}
enum Impl {
Naive,
Dispatch,
}
impl Default for Impl {
fn default() -> Self {
Self::Naive
}
}
impl Args {
fn parse() -> Result<Self, lexopt::Error> {
use lexopt::prelude::*;
let mut res = Args::default();
let mut args = lexopt::Parser::from_env();
while let Some(arg) = args.next()? {
match arg {
Long("invalid") => {
res.invalid = true;
}
Long("pretty") => {
// Only case where pretty matters
res.pretty = true;
res.invalid = true;
}
Long("impl") => {
res.implementation = args.value()?.parse_with(|s| match s {
"naive" => Ok(Impl::Naive),
"dispatch" => Ok(Impl::Dispatch),
_ => Err("expected `naive`, `dispatch`"),
})?;
}
Value(input) => {
res.input = Some(input.string()?);
}
_ => return Err(arg.unexpected()),
}
}
Ok(res)
}
}
|
use crate::object::{GoogleStorageObjectSource, Key};
use crate::Result;
use std::path::PathBuf;
pub enum RemoteSourceConfig {
GoogleStorage {
bucket: String,
config_path: PathBuf,
},
}
pub enum RemoteSource {
GoogleStorage(GoogleStorageObjectSource),
}
impl RemoteSource {
pub fn initialize(config: RemoteSourceConfig, key: &Key) -> Result<Self> {
Ok(match config {
RemoteSourceConfig::GoogleStorage {
bucket,
config_path,
} => Self::GoogleStorage(GoogleStorageObjectSource::open(
&bucket,
config_path.as_path(),
key,
)?),
})
}
}
|
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(all(feature = "alloc", not(feature = "std")))]
extern crate alloc;
#[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::vec::Vec;
#[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::string::*;
#[cfg(not(feature = "std"))]
use core::prelude::v1::*;
mod consts;
#[cfg(feature = "generate")]
pub mod gen;
#[cfg(all(not(feature = "std"), feature = "rand"))]
compile_error!("`std` feature is required for rand");
#[cfg(all(not(feature = "alloc"), feature = "smallvec"))]
compile_error!("`std` feature is required for smallvec");
#[cfg(not(feature = "alloc"))]
compile_error!("`alloc` feature is currently required");
pub mod solution_iterator;
use core::convert::From;
use core::convert::TryInto;
use core::str::FromStr;
#[derive(Default)]
struct DifficultyRecording {
step_count: usize,
apply_number_count: usize,
scan_count: usize,
hidden_single_count: usize,
}
impl solution_iterator::TechniqueRecording for DifficultyRecording {
type Output = usize;
fn record_step(&mut self, _: &Sudoku) {
self.step_count += 1;
}
fn record_apply_number(&mut self, _: usize, _: &Sudoku) {
self.apply_number_count += 1;
}
fn record_scan(&mut self, _: &Sudoku) {
self.scan_count += 1;
}
fn record_hidden_single(&mut self, _: usize, _: &Sudoku) {
self.hidden_single_count += 1;
}
fn get_recording(&self) -> usize {
self.step_count + self.apply_number_count + self.scan_count + self.hidden_single_count
}
}
#[cfg(feature = "alloc")]
#[derive(Default)]
struct FullRecording {
techniques: Vec<(String, Sudoku)>,
}
#[cfg(feature = "alloc")]
impl solution_iterator::TechniqueRecording for FullRecording {
type Output = Vec<(String, Sudoku)>;
fn record_step(&mut self, _: &Sudoku) {}
fn record_apply_number(&mut self, square: usize, state: &Sudoku) {
let mut explanation = "Found naked single: R".to_string();
explanation.push(b"123456789"[square / 9] as char);
explanation.push('C');
explanation.push(b"123456789"[square % 9] as char);
self.techniques.push((explanation, *state))
}
fn record_scan(&mut self, state: &Sudoku) {
self.techniques.push(("Scanned".to_string(), *state))
}
fn record_hidden_single(&mut self, square: usize, state: &Sudoku) {
let mut explanation = "Found hidden single: R".to_string();
explanation.push(b"123456789"[square / 9] as char);
explanation.push('C');
explanation.push(b"123456789"[square % 9] as char);
self.techniques.push((explanation, *state))
}
fn get_recording(&self) -> Self::Output {
let mut result = self.techniques.clone();
result.dedup_by_key(|(_, sudoku)| *sudoku);
result
}
}
#[macro_export]
macro_rules! get_last_digit {
($x:ident, $value_type:ty) => {{
let value = $x.trailing_zeros();
$x -= 1 << value;
value as $value_type
}};
}
/**
Structure that represents a sudoku
*/
#[derive(Copy, Clone)]
pub struct Sudoku {
cells: [u16; 81],
solved_squares: u128,
}
impl Sudoku {
/**
Remove the value at the chosen square from the set of options of each cell in the sudoku
*/
#[inline(always)]
fn apply_number(&mut self, square: usize) {
debug_assert!(square < 81);
if square >= 81 {
unsafe { core::hint::unreachable_unchecked() }
}
let not_value = !self.cells[square];
for i in &consts::CELLS_TO_CHANGE[square] {
self.cells[*i as usize] &= not_value;
}
debug_assert_eq!(self.cells[square], !not_value);
self.solved_squares |= 1 << square;
}
/**
Check what values the row, column and square it is in and compare them
*/
fn hidden_singles(&mut self, square: usize) -> Result<bool, ()> {
debug_assert!(square < 81);
if square >= 81 {
unsafe { core::hint::unreachable_unchecked() }
}
let value = self.cells[square];
self.cells[square] = 0;
let row_start = square / 9 * 9;
let column_start = square % 9;
let box_start = square / 3 % 3 * 3 + square / 27 * 27;
debug_assert!(row_start + 8 < 81);
debug_assert!(column_start + 72 < 81);
debug_assert!(box_start + 20 < 81);
let needed = consts::SUDOKU_MAX
- unsafe {
let temp = [20, 19, 18, 11, 10, 9, 2, 1, 0].iter().enumerate().fold(
(0, 0, 0),
|acc, (i, box_offset)| {
(
acc.0 | *self.cells.get_unchecked(row_start + i),
acc.1 | *self.cells.get_unchecked(column_start + i * 9),
acc.2 | *self.cells.get_unchecked(box_start + box_offset),
)
},
);
temp.0 & temp.1 & temp.2
};
if needed == 0 {
self.cells[square] = value;
Ok(false) // Don't yet know enough information to determine which value it must be
} else if (value & needed).is_power_of_two() {
self.cells[square] = value & needed;
Ok(needed != value) // It can be the value it is needed to be
} else {
Err(()) // It has to be multiple different values, sudoku cannot be solved
}
}
fn scan(&mut self) -> bool {
fn generate_masks_from_intersections(
isec: [u16; 9],
mut only: [u16; 9],
) -> ([u16; 9], [u16; 9]) {
only[0] |= isec[0] & !((isec[1] | isec[2]) & (isec[3] | isec[6]));
only[1] |= isec[1] & !((isec[0] | isec[2]) & (isec[4] | isec[7]));
only[2] |= isec[2] & !((isec[0] | isec[1]) & (isec[5] | isec[8]));
only[3] |= isec[3] & !((isec[4] | isec[5]) & (isec[0] | isec[6]));
only[4] |= isec[4] & !((isec[3] | isec[5]) & (isec[1] | isec[7]));
only[5] |= isec[5] & !((isec[3] | isec[4]) & (isec[2] | isec[8]));
only[6] |= isec[6] & !((isec[7] | isec[8]) & (isec[0] | isec[3]));
only[7] |= isec[7] & !((isec[6] | isec[8]) & (isec[1] | isec[4]));
only[8] |= isec[8] & !((isec[6] | isec[7]) & (isec[2] | isec[5]));
let resultant_mask = [
!(only[1] | only[2] | only[3] | only[6]),
!(only[0] | only[2] | only[4] | only[7]),
!(only[0] | only[1] | only[5] | only[8]),
!(only[0] | only[4] | only[5] | only[6]),
!(only[1] | only[3] | only[5] | only[7]),
!(only[2] | only[3] | only[4] | only[8]),
!(only[0] | only[3] | only[7] | only[8]),
!(only[1] | only[4] | only[6] | only[8]),
!(only[2] | only[5] | only[6] | only[7]),
];
(resultant_mask, only)
}
let mut sudoku = self.cells;
let mut sudoku_check = consts::SUDOKU_MAX;
for floor_number in (0..3).map(|x| x * 27) {
let mut only = [0; 9];
let mut intersections = [0_u16; 9]; // Intersection
for i in 0..9 {
intersections[i] = sudoku[floor_number + i * 3]
| sudoku[floor_number + i * 3 + 1]
| sudoku[floor_number + i * 3 + 2];
only[i] = intersections[i] * (intersections[i].count_ones() <= 3) as u16;
}
let (resultant_mask, only) = generate_masks_from_intersections(intersections, only);
let mut temp_total = 0;
for (i, (row, only_row)) in resultant_mask.iter().zip(only.iter()).enumerate() {
temp_total |= row;
let row =
row & [consts::SUDOKU_MAX, *only_row][(only_row.count_ones() == 3) as usize];
sudoku[floor_number + i * 3] &= row;
sudoku[floor_number + i * 3 + 1] &= row;
sudoku[floor_number + i * 3 + 2] &= row;
sudoku_check *= (only_row.count_ones() <= 3) as u16;
// If more than 3 digits can only be in intersection, then there is no solution
}
sudoku_check &= temp_total;
}
if sudoku_check != consts::SUDOKU_MAX {
return false;
}
for tower_number in (0..3).map(|x| x * 3) {
let mut only = [0; 9];
let mut intersections = [0_u16; 9]; // Intersection
for column in 0..3 {
for layer in 0..3 {
let i = column * 3 + layer;
intersections[i] = sudoku[tower_number + layer * 27 + column]
| sudoku[tower_number + layer * 27 + column + 9]
| sudoku[tower_number + layer * 27 + column + 18];
only[i] = intersections[i] * (intersections[i].count_ones() <= 3) as u16;
}
}
let (resultant_mask, only) = generate_masks_from_intersections(intersections, only);
let mut temp_total = 0;
for column_number in 0..3 {
for layer in 0..3 {
let i = column_number * 3 + layer;
let column = resultant_mask[i];
let only_column = only[i];
temp_total |= column;
let column = column
& [consts::SUDOKU_MAX, only_column]
[(only_column.count_ones() == 3) as usize];
sudoku[tower_number + layer * 27 + column_number] &= column;
sudoku[tower_number + layer * 27 + column_number + 9] &= column;
sudoku[tower_number + layer * 27 + column_number + 18] &= column;
sudoku_check *= (only_column.count_ones() <= 3) as u16;
// If more than 3 digits can only be in intersection, then there is no solution
}
}
sudoku_check &= temp_total;
}
self.cells = sudoku;
sudoku_check == consts::SUDOKU_MAX
}
/**
Convert the sudoku into a [u8; 81] containing the numerical form of each solved square
*/
pub fn to_array(&self) -> [u8; 81] {
let mut array = [0; 81];
let mut temp = self.solved_squares;
while temp != 0 {
let square = get_last_digit!(temp, usize);
if square >= 81 {
break;
}
array[square] = self.cells[square].trailing_zeros() as u8 + 1;
}
array
}
pub fn to_bytes(&self) -> [u8; 81] {
let mut chars = [b'.'; 81];
let mut temp = self.solved_squares;
while temp != 0 {
let square = get_last_digit!(temp, usize);
if square >= 81 {
break;
}
chars[square] = (b"123456789")[self.cells[square].trailing_zeros() as usize];
}
chars
}
pub fn to_pencilmark_bytes(&self) -> [u8; 1605] {
const INNER_ROW_LENGTH: usize = ((3 * 3 + 2) + 1) * 3 + 6;
const OUTER_ROW_LENGTH: usize = INNER_ROW_LENGTH * 4 + 1;
const TOTAL_LENGTH: usize = OUTER_ROW_LENGTH * 9 + INNER_ROW_LENGTH * 2;
const FORMAT_ROW: [u8; 85] = *b"---+---+---+ +---+---+---+ +---+---+---\n\n---+---+---+ +---+---+---+ +---+---+---\n";
let mut output_grid = [b'!'; TOTAL_LENGTH]; // '!' makes it easier to spot mistakes
for row in 0..9 {
let row_start = row * OUTER_ROW_LENGTH + row / 3 * (INNER_ROW_LENGTH);
for inner_row in 0..3 {
let inner_row_start = row_start + inner_row * INNER_ROW_LENGTH;
let masks = (
1 << (inner_row * 3),
1 << (inner_row * 3 + 1),
1 << (inner_row * 3 + 2),
);
let output_digits = [
(b" 1", b" 2", b" 3"),
(b" 4", b" 5", b" 6"),
(b" 7", b" 8", b" 9"),
][inner_row];
for column in 0..9 {
let digits = self.cells[row * 9 + column];
let index = inner_row_start + column * 4 + column / 3 * 3;
output_grid[index] = (output_digits.0)[(digits & masks.0 != 0) as usize];
output_grid[index + 1] = (output_digits.1)[(digits & masks.1 != 0) as usize];
output_grid[index + 2] = (output_digits.2)[(digits & masks.2 != 0) as usize];
output_grid[index + 3] = b'|';
output_grid[index + 4] = b' ';
output_grid[index + 5] = b' ';
output_grid[index + 6] = b'|';
}
output_grid[inner_row_start + INNER_ROW_LENGTH - 1] = b'\n';
}
for (ptr, value) in output_grid[row_start + INNER_ROW_LENGTH * 3..]
.iter_mut()
.zip(FORMAT_ROW.iter())
{
*ptr = *value;
}
}
output_grid
}
/**
Returns an iterator over all solutions
*/
#[inline]
pub fn iter(self) -> solution_iterator::QuickSolutionIterator {
solution_iterator::QuickSolutionIterator::new(self)
}
/**
Get the first solution.
*/
#[inline]
pub fn solve_one(self) -> Option<Self> {
self.iter().next()
}
/**
Returns the first solution if it is uniquely solvable, otherwise returns None
*/
#[inline]
pub fn solve_unique(self) -> Option<Self> {
let mut iterator = self.iter();
iterator.next().xor(iterator.next())
}
/**
Counts the number of solutions, up to maximum of n
*/
#[inline]
pub fn count_solutions(self, n: usize) -> usize {
self.iter().take(n).count()
}
/**
Check whether the sudoku has exactly one solution without returning the solution
*/
#[inline]
pub fn has_single_solution(self) -> bool {
self.count_solutions(2) == 1
}
#[inline]
pub fn has_solution(self) -> bool {
self.count_solutions(1) == 1
}
/**
Returns an empty sudoku grid, alternative to Sudoku::from([0; 81]) or Sudoku::from(vec![])
*/
#[inline]
pub const fn empty() -> Self {
Self {
cells: [consts::SUDOKU_MAX; 81],
solved_squares: 0,
}
}
/**
Estimates the difficulty
*/
#[inline]
pub fn difficulty(self, count_steps: bool) -> Option<i32> {
let mut difficulty = -(self.solved_cell_count() as i32);
if count_steps {
let mut iter = solution_iterator::SolutionIterator::<DifficultyRecording>::new(
Self::from(self.to_array()),
);
if iter.next().is_none() || iter.next().is_some() {
return None;
}
difficulty += iter.get_recording() as i32;
}
Some(difficulty)
}
#[cfg(feature = "alloc")]
pub fn list_techniques(self) -> Vec<(String, Sudoku)> {
let mut iter = solution_iterator::SolutionIterator::<FullRecording>::new(self);
iter.next();
iter.next();
iter.get_recording()
}
pub fn solved_cell_count(&self) -> usize {
(self.solved_squares & consts::SOLVED_SUDOKU).count_ones() as usize
}
#[cfg(feature = "generate")]
pub fn generate<T>(rng: T, count_steps: bool) -> gen::SudokuGenerator<T>
where
T: rand::Rng + rand_core::RngCore,
{
gen::SudokuGenerator::new(rng, count_steps)
}
#[cfg(feature = "generate")]
pub fn generate_from_seed<T>(
self,
rng: &mut T,
cells_to_remove: usize,
count_steps: bool,
) -> (Self, i32)
where
T: rand::Rng + rand_core::RngCore,
{
gen::generate_from_seed(self, rng, cells_to_remove, count_steps)
}
fn import<T: Iterator<Item = Option<u32>>>(square_iterator: T) -> Self {
let mut sudoku = Self::empty();
for (i, int) in square_iterator
.enumerate()
.take(81)
.filter_map(|(i, item)| {
item.filter(|x| *x <= 9)
.and_then(|x| x.checked_sub(1))
.map(|x| (i, x))
})
{
sudoku.cells[i] = 1 << int;
sudoku.solved_squares |= 1 << i;
}
sudoku
}
}
impl PartialEq for Sudoku {
fn eq(&self, other: &Self) -> bool {
self.solved_squares == other.solved_squares && self.cells[..] == other.cells[..]
}
}
impl<T: TryInto<u32> + Copy> From<&[T]> for Sudoku {
fn from(sudoku_array: &[T]) -> Self {
Self::import(sudoku_array.iter().map(|x| (*x).try_into().ok()))
}
}
impl<T: TryInto<u32> + Copy> From<&[T; 81]> for Sudoku {
#[inline]
fn from(sudoku_array: &[T; 81]) -> Self {
Self::from(&sudoku_array[..])
}
}
impl<T: TryInto<u32> + Copy> From<[T; 81]> for Sudoku {
#[inline]
fn from(sudoku_array: [T; 81]) -> Self {
Self::from(&sudoku_array[..])
}
}
#[cfg(feature = "alloc")]
impl<T: TryInto<u32> + Copy> From<Vec<T>> for Sudoku {
#[inline]
fn from(sudoku_array: Vec<T>) -> Self {
Self::from(&sudoku_array[..])
}
}
#[cfg(feature = "alloc")]
impl<T: TryInto<u32> + Copy> From<&Vec<T>> for Sudoku {
#[inline]
fn from(sudoku_array: &Vec<T>) -> Self {
Self::from(&sudoku_array[..])
}
}
impl FromStr for Sudoku {
type Err = core::convert::Infallible;
fn from_str(sudoku_str: &str) -> Result<Self, Self::Err> {
Ok(Self::import(
sudoku_str.chars().map(|character| character.to_digit(10)),
))
}
}
|
// Copyright (c) Calibra Research
// SPDX-License-Identifier: Apache-2.0
use super::*;
use simulated_context::*;
use smr_context::*;
use std::{
collections::hash_map::DefaultHasher,
hash::{Hash, Hasher},
};
#[test]
fn test_node() {
let mut context = SimulatedContext::new(
Author(0),
/* num_nodes */ 1,
/* max commands per epoch */ 2,
);
let initial_hash = QuorumCertificateHash(0);
let initial_state = context.last_committed_state();
let epoch_id = EpochId(0);
let mut node1 = NodeState::new(
Author(0),
initial_state.clone(),
NodeTime(0),
1000,
30,
2.0,
0.5,
&context,
);
// Make a sequence of blocks / QCs
let cmd = context.fetch().unwrap();
let b0 = Record::make_block(cmd.clone(), NodeTime(1), initial_hash, Round(1), Author(0));
let mut hasher = DefaultHasher::new();
b0.hash(&mut hasher);
let block_hash = BlockHash(hasher.finish());
let state = context
.compute(&initial_state, cmd.clone(), NodeTime(1), None, Vec::new())
.unwrap();
let v0 = match Record::make_vote(
epoch_id,
Round(1),
block_hash,
state.clone(),
Author(0),
/* commitment */ None,
) {
Record::Vote(x) => x,
_ => unreachable!(),
};
let qc0 = Record::make_quorum_certificate(
epoch_id,
Round(1),
block_hash,
state,
/* votes */ vec![(Author(0), v0.signature)],
/* commitment */ None,
Author(0),
);
let qc_hash = QuorumCertificateHash(qc0.digest());
node1.insert_network_record(epoch_id, b0, &mut context);
node1.insert_network_record(epoch_id, qc0, &mut context);
assert_eq!(
node1.record_store.highest_quorum_certificate_hash(),
qc_hash
);
}
|
#![feature(exhaustive_patterns)]
#![feature(proc_macro, conservative_impl_trait, generators)]
extern crate tokio_core;
extern crate tokio_io;
extern crate futures_await as futures;
extern crate future_utils;
#[macro_use]
extern crate unwrap;
#[macro_use]
extern crate net_literals;
mod priv_prelude;
use priv_prelude::*;
mod igd;
#[derive(Debug)]
pub struct Results {
igd: igd::IgdResults,
}
#[async]
fn test(handle: Handle) -> Result<Results, !> {
let Ok(igd) = await!(igd::check_igd(handle));
Ok(Results {
igd,
})
}
fn main() {
let mut core = unwrap!(Core::new());
let handle = core.handle();
let Ok(results) = core.run(test(handle));
println!("got results: {:?}", results);
}
|
// auto generated, do not modify.
// created: Mon Feb 22 23:57:02 2016
// src-file: /QtCore/qabstractanimation.h
// dst-file: /src/core/qabstractanimation.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::qobject::*; // 773
use std::ops::Deref;
use super::qanimationgroup::*; // 773
use super::qobjectdefs::*; // 773
// <= use block end
// ext block begin =>
// #[link(name = "Qt5Core")]
// #[link(name = "Qt5Gui")]
// #[link(name = "Qt5Widgets")]
// #[link(name = "QtInline")]
extern {
fn QAbstractAnimation_Class_Size() -> c_int;
// proto: void QAbstractAnimation::resume();
fn C_ZN18QAbstractAnimation6resumeEv(qthis: u64 /* *mut c_void*/);
// proto: void QAbstractAnimation::QAbstractAnimation(QObject * parent);
fn C_ZN18QAbstractAnimationC2EP7QObject(arg0: *mut c_void) -> u64;
// proto: void QAbstractAnimation::stop();
fn C_ZN18QAbstractAnimation4stopEv(qthis: u64 /* *mut c_void*/);
// proto: void QAbstractAnimation::pause();
fn C_ZN18QAbstractAnimation5pauseEv(qthis: u64 /* *mut c_void*/);
// proto: void QAbstractAnimation::setLoopCount(int loopCount);
fn C_ZN18QAbstractAnimation12setLoopCountEi(qthis: u64 /* *mut c_void*/, arg0: c_int);
// proto: int QAbstractAnimation::currentLoop();
fn C_ZNK18QAbstractAnimation11currentLoopEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: QAnimationGroup * QAbstractAnimation::group();
fn C_ZNK18QAbstractAnimation5groupEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QAbstractAnimation::setPaused(bool );
fn C_ZN18QAbstractAnimation9setPausedEb(qthis: u64 /* *mut c_void*/, arg0: c_char);
// proto: int QAbstractAnimation::totalDuration();
fn C_ZNK18QAbstractAnimation13totalDurationEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: int QAbstractAnimation::duration();
fn C_ZNK18QAbstractAnimation8durationEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: const QMetaObject * QAbstractAnimation::metaObject();
fn C_ZNK18QAbstractAnimation10metaObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: int QAbstractAnimation::currentLoopTime();
fn C_ZNK18QAbstractAnimation15currentLoopTimeEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: int QAbstractAnimation::currentTime();
fn C_ZNK18QAbstractAnimation11currentTimeEv(qthis: u64 /* *mut c_void*/) -> c_int;
// proto: void QAbstractAnimation::setCurrentTime(int msecs);
fn C_ZN18QAbstractAnimation14setCurrentTimeEi(qthis: u64 /* *mut c_void*/, arg0: c_int);
// proto: void QAbstractAnimation::~QAbstractAnimation();
fn C_ZN18QAbstractAnimationD2Ev(qthis: u64 /* *mut c_void*/);
// proto: int QAbstractAnimation::loopCount();
fn C_ZNK18QAbstractAnimation9loopCountEv(qthis: u64 /* *mut c_void*/) -> c_int;
fn QAnimationDriver_Class_Size() -> c_int;
// proto: void QAnimationDriver::advance();
fn C_ZN16QAnimationDriver7advanceEv(qthis: u64 /* *mut c_void*/);
// proto: void QAnimationDriver::~QAnimationDriver();
fn C_ZN16QAnimationDriverD2Ev(qthis: u64 /* *mut c_void*/);
// proto: void QAnimationDriver::QAnimationDriver(QObject * parent);
fn C_ZN16QAnimationDriverC2EP7QObject(arg0: *mut c_void) -> u64;
// proto: qint64 QAnimationDriver::elapsed();
fn C_ZNK16QAnimationDriver7elapsedEv(qthis: u64 /* *mut c_void*/) -> c_longlong;
// proto: void QAnimationDriver::install();
fn C_ZN16QAnimationDriver7installEv(qthis: u64 /* *mut c_void*/);
// proto: const QMetaObject * QAnimationDriver::metaObject();
fn C_ZNK16QAnimationDriver10metaObjectEv(qthis: u64 /* *mut c_void*/) -> *mut c_void;
// proto: void QAnimationDriver::uninstall();
fn C_ZN16QAnimationDriver9uninstallEv(qthis: u64 /* *mut c_void*/);
// proto: bool QAnimationDriver::isRunning();
fn C_ZNK16QAnimationDriver9isRunningEv(qthis: u64 /* *mut c_void*/) -> c_char;
// proto: qint64 QAnimationDriver::startTime();
fn C_ZNK16QAnimationDriver9startTimeEv(qthis: u64 /* *mut c_void*/) -> c_longlong;
// proto: void QAnimationDriver::setStartTime(qint64 startTime);
fn C_ZN16QAnimationDriver12setStartTimeEx(qthis: u64 /* *mut c_void*/, arg0: c_longlong);
fn QAbstractAnimation_SlotProxy_connect__ZN18QAbstractAnimation18currentLoopChangedEi(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void);
fn QAbstractAnimation_SlotProxy_connect__ZN18QAbstractAnimation8finishedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void);
fn QAnimationDriver_SlotProxy_connect__ZN16QAnimationDriver7stoppedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void);
fn QAnimationDriver_SlotProxy_connect__ZN16QAnimationDriver7startedEv(qthis: *mut c_void, ffifptr: *mut c_void, rsfptr: *mut c_void);
} // <= ext block end
// body block begin =>
// class sizeof(QAbstractAnimation)=1
#[derive(Default)]
pub struct QAbstractAnimation {
qbase: QObject,
pub qclsinst: u64 /* *mut c_void*/,
pub _currentLoopChanged: QAbstractAnimation_currentLoopChanged_signal,
pub _finished: QAbstractAnimation_finished_signal,
pub _stateChanged: QAbstractAnimation_stateChanged_signal,
pub _directionChanged: QAbstractAnimation_directionChanged_signal,
}
// class sizeof(QAnimationDriver)=1
#[derive(Default)]
pub struct QAnimationDriver {
qbase: QObject,
pub qclsinst: u64 /* *mut c_void*/,
pub _started: QAnimationDriver_started_signal,
pub _stopped: QAnimationDriver_stopped_signal,
}
impl /*struct*/ QAbstractAnimation {
pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QAbstractAnimation {
return QAbstractAnimation{qbase: QObject::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
}
}
impl Deref for QAbstractAnimation {
type Target = QObject;
fn deref(&self) -> &QObject {
return & self.qbase;
}
}
impl AsRef<QObject> for QAbstractAnimation {
fn as_ref(& self) -> & QObject {
return & self.qbase;
}
}
// proto: void QAbstractAnimation::resume();
impl /*struct*/ QAbstractAnimation {
pub fn resume<RetType, T: QAbstractAnimation_resume<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.resume(self);
// return 1;
}
}
pub trait QAbstractAnimation_resume<RetType> {
fn resume(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: void QAbstractAnimation::resume();
impl<'a> /*trait*/ QAbstractAnimation_resume<()> for () {
fn resume(self , rsthis: & QAbstractAnimation) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QAbstractAnimation6resumeEv()};
unsafe {C_ZN18QAbstractAnimation6resumeEv(rsthis.qclsinst)};
// return 1;
}
}
// proto: void QAbstractAnimation::QAbstractAnimation(QObject * parent);
impl /*struct*/ QAbstractAnimation {
pub fn new<T: QAbstractAnimation_new>(value: T) -> QAbstractAnimation {
let rsthis = value.new();
return rsthis;
// return 1;
}
}
pub trait QAbstractAnimation_new {
fn new(self) -> QAbstractAnimation;
}
// proto: void QAbstractAnimation::QAbstractAnimation(QObject * parent);
impl<'a> /*trait*/ QAbstractAnimation_new for (Option<&'a QObject>) {
fn new(self) -> QAbstractAnimation {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QAbstractAnimationC2EP7QObject()};
let ctysz: c_int = unsafe{QAbstractAnimation_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_ZN18QAbstractAnimationC2EP7QObject(arg0)};
let rsthis = QAbstractAnimation{qbase: QObject::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
return rsthis;
// return 1;
}
}
// proto: void QAbstractAnimation::stop();
impl /*struct*/ QAbstractAnimation {
pub fn stop<RetType, T: QAbstractAnimation_stop<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.stop(self);
// return 1;
}
}
pub trait QAbstractAnimation_stop<RetType> {
fn stop(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: void QAbstractAnimation::stop();
impl<'a> /*trait*/ QAbstractAnimation_stop<()> for () {
fn stop(self , rsthis: & QAbstractAnimation) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QAbstractAnimation4stopEv()};
unsafe {C_ZN18QAbstractAnimation4stopEv(rsthis.qclsinst)};
// return 1;
}
}
// proto: void QAbstractAnimation::pause();
impl /*struct*/ QAbstractAnimation {
pub fn pause<RetType, T: QAbstractAnimation_pause<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.pause(self);
// return 1;
}
}
pub trait QAbstractAnimation_pause<RetType> {
fn pause(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: void QAbstractAnimation::pause();
impl<'a> /*trait*/ QAbstractAnimation_pause<()> for () {
fn pause(self , rsthis: & QAbstractAnimation) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QAbstractAnimation5pauseEv()};
unsafe {C_ZN18QAbstractAnimation5pauseEv(rsthis.qclsinst)};
// return 1;
}
}
// proto: void QAbstractAnimation::setLoopCount(int loopCount);
impl /*struct*/ QAbstractAnimation {
pub fn setLoopCount<RetType, T: QAbstractAnimation_setLoopCount<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setLoopCount(self);
// return 1;
}
}
pub trait QAbstractAnimation_setLoopCount<RetType> {
fn setLoopCount(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: void QAbstractAnimation::setLoopCount(int loopCount);
impl<'a> /*trait*/ QAbstractAnimation_setLoopCount<()> for (i32) {
fn setLoopCount(self , rsthis: & QAbstractAnimation) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QAbstractAnimation12setLoopCountEi()};
let arg0 = self as c_int;
unsafe {C_ZN18QAbstractAnimation12setLoopCountEi(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: int QAbstractAnimation::currentLoop();
impl /*struct*/ QAbstractAnimation {
pub fn currentLoop<RetType, T: QAbstractAnimation_currentLoop<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.currentLoop(self);
// return 1;
}
}
pub trait QAbstractAnimation_currentLoop<RetType> {
fn currentLoop(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: int QAbstractAnimation::currentLoop();
impl<'a> /*trait*/ QAbstractAnimation_currentLoop<i32> for () {
fn currentLoop(self , rsthis: & QAbstractAnimation) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK18QAbstractAnimation11currentLoopEv()};
let mut ret = unsafe {C_ZNK18QAbstractAnimation11currentLoopEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: QAnimationGroup * QAbstractAnimation::group();
impl /*struct*/ QAbstractAnimation {
pub fn group<RetType, T: QAbstractAnimation_group<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.group(self);
// return 1;
}
}
pub trait QAbstractAnimation_group<RetType> {
fn group(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: QAnimationGroup * QAbstractAnimation::group();
impl<'a> /*trait*/ QAbstractAnimation_group<QAnimationGroup> for () {
fn group(self , rsthis: & QAbstractAnimation) -> QAnimationGroup {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK18QAbstractAnimation5groupEv()};
let mut ret = unsafe {C_ZNK18QAbstractAnimation5groupEv(rsthis.qclsinst)};
let mut ret1 = QAnimationGroup::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QAbstractAnimation::setPaused(bool );
impl /*struct*/ QAbstractAnimation {
pub fn setPaused<RetType, T: QAbstractAnimation_setPaused<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setPaused(self);
// return 1;
}
}
pub trait QAbstractAnimation_setPaused<RetType> {
fn setPaused(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: void QAbstractAnimation::setPaused(bool );
impl<'a> /*trait*/ QAbstractAnimation_setPaused<()> for (i8) {
fn setPaused(self , rsthis: & QAbstractAnimation) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QAbstractAnimation9setPausedEb()};
let arg0 = self as c_char;
unsafe {C_ZN18QAbstractAnimation9setPausedEb(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: int QAbstractAnimation::totalDuration();
impl /*struct*/ QAbstractAnimation {
pub fn totalDuration<RetType, T: QAbstractAnimation_totalDuration<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.totalDuration(self);
// return 1;
}
}
pub trait QAbstractAnimation_totalDuration<RetType> {
fn totalDuration(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: int QAbstractAnimation::totalDuration();
impl<'a> /*trait*/ QAbstractAnimation_totalDuration<i32> for () {
fn totalDuration(self , rsthis: & QAbstractAnimation) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK18QAbstractAnimation13totalDurationEv()};
let mut ret = unsafe {C_ZNK18QAbstractAnimation13totalDurationEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: int QAbstractAnimation::duration();
impl /*struct*/ QAbstractAnimation {
pub fn duration<RetType, T: QAbstractAnimation_duration<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.duration(self);
// return 1;
}
}
pub trait QAbstractAnimation_duration<RetType> {
fn duration(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: int QAbstractAnimation::duration();
impl<'a> /*trait*/ QAbstractAnimation_duration<i32> for () {
fn duration(self , rsthis: & QAbstractAnimation) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK18QAbstractAnimation8durationEv()};
let mut ret = unsafe {C_ZNK18QAbstractAnimation8durationEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: const QMetaObject * QAbstractAnimation::metaObject();
impl /*struct*/ QAbstractAnimation {
pub fn metaObject<RetType, T: QAbstractAnimation_metaObject<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.metaObject(self);
// return 1;
}
}
pub trait QAbstractAnimation_metaObject<RetType> {
fn metaObject(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: const QMetaObject * QAbstractAnimation::metaObject();
impl<'a> /*trait*/ QAbstractAnimation_metaObject<QMetaObject> for () {
fn metaObject(self , rsthis: & QAbstractAnimation) -> QMetaObject {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK18QAbstractAnimation10metaObjectEv()};
let mut ret = unsafe {C_ZNK18QAbstractAnimation10metaObjectEv(rsthis.qclsinst)};
let mut ret1 = QMetaObject::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: int QAbstractAnimation::currentLoopTime();
impl /*struct*/ QAbstractAnimation {
pub fn currentLoopTime<RetType, T: QAbstractAnimation_currentLoopTime<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.currentLoopTime(self);
// return 1;
}
}
pub trait QAbstractAnimation_currentLoopTime<RetType> {
fn currentLoopTime(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: int QAbstractAnimation::currentLoopTime();
impl<'a> /*trait*/ QAbstractAnimation_currentLoopTime<i32> for () {
fn currentLoopTime(self , rsthis: & QAbstractAnimation) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK18QAbstractAnimation15currentLoopTimeEv()};
let mut ret = unsafe {C_ZNK18QAbstractAnimation15currentLoopTimeEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: int QAbstractAnimation::currentTime();
impl /*struct*/ QAbstractAnimation {
pub fn currentTime<RetType, T: QAbstractAnimation_currentTime<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.currentTime(self);
// return 1;
}
}
pub trait QAbstractAnimation_currentTime<RetType> {
fn currentTime(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: int QAbstractAnimation::currentTime();
impl<'a> /*trait*/ QAbstractAnimation_currentTime<i32> for () {
fn currentTime(self , rsthis: & QAbstractAnimation) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK18QAbstractAnimation11currentTimeEv()};
let mut ret = unsafe {C_ZNK18QAbstractAnimation11currentTimeEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
// proto: void QAbstractAnimation::setCurrentTime(int msecs);
impl /*struct*/ QAbstractAnimation {
pub fn setCurrentTime<RetType, T: QAbstractAnimation_setCurrentTime<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setCurrentTime(self);
// return 1;
}
}
pub trait QAbstractAnimation_setCurrentTime<RetType> {
fn setCurrentTime(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: void QAbstractAnimation::setCurrentTime(int msecs);
impl<'a> /*trait*/ QAbstractAnimation_setCurrentTime<()> for (i32) {
fn setCurrentTime(self , rsthis: & QAbstractAnimation) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QAbstractAnimation14setCurrentTimeEi()};
let arg0 = self as c_int;
unsafe {C_ZN18QAbstractAnimation14setCurrentTimeEi(rsthis.qclsinst, arg0)};
// return 1;
}
}
// proto: void QAbstractAnimation::~QAbstractAnimation();
impl /*struct*/ QAbstractAnimation {
pub fn free<RetType, T: QAbstractAnimation_free<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.free(self);
// return 1;
}
}
pub trait QAbstractAnimation_free<RetType> {
fn free(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: void QAbstractAnimation::~QAbstractAnimation();
impl<'a> /*trait*/ QAbstractAnimation_free<()> for () {
fn free(self , rsthis: & QAbstractAnimation) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN18QAbstractAnimationD2Ev()};
unsafe {C_ZN18QAbstractAnimationD2Ev(rsthis.qclsinst)};
// return 1;
}
}
// proto: int QAbstractAnimation::loopCount();
impl /*struct*/ QAbstractAnimation {
pub fn loopCount<RetType, T: QAbstractAnimation_loopCount<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.loopCount(self);
// return 1;
}
}
pub trait QAbstractAnimation_loopCount<RetType> {
fn loopCount(self , rsthis: & QAbstractAnimation) -> RetType;
}
// proto: int QAbstractAnimation::loopCount();
impl<'a> /*trait*/ QAbstractAnimation_loopCount<i32> for () {
fn loopCount(self , rsthis: & QAbstractAnimation) -> i32 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK18QAbstractAnimation9loopCountEv()};
let mut ret = unsafe {C_ZNK18QAbstractAnimation9loopCountEv(rsthis.qclsinst)};
return ret as i32; // 1
// return 1;
}
}
impl /*struct*/ QAnimationDriver {
pub fn inheritFrom(qthis: u64 /* *mut c_void*/) -> QAnimationDriver {
return QAnimationDriver{qbase: QObject::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
}
}
impl Deref for QAnimationDriver {
type Target = QObject;
fn deref(&self) -> &QObject {
return & self.qbase;
}
}
impl AsRef<QObject> for QAnimationDriver {
fn as_ref(& self) -> & QObject {
return & self.qbase;
}
}
// proto: void QAnimationDriver::advance();
impl /*struct*/ QAnimationDriver {
pub fn advance<RetType, T: QAnimationDriver_advance<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.advance(self);
// return 1;
}
}
pub trait QAnimationDriver_advance<RetType> {
fn advance(self , rsthis: & QAnimationDriver) -> RetType;
}
// proto: void QAnimationDriver::advance();
impl<'a> /*trait*/ QAnimationDriver_advance<()> for () {
fn advance(self , rsthis: & QAnimationDriver) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN16QAnimationDriver7advanceEv()};
unsafe {C_ZN16QAnimationDriver7advanceEv(rsthis.qclsinst)};
// return 1;
}
}
// proto: void QAnimationDriver::~QAnimationDriver();
impl /*struct*/ QAnimationDriver {
pub fn free<RetType, T: QAnimationDriver_free<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.free(self);
// return 1;
}
}
pub trait QAnimationDriver_free<RetType> {
fn free(self , rsthis: & QAnimationDriver) -> RetType;
}
// proto: void QAnimationDriver::~QAnimationDriver();
impl<'a> /*trait*/ QAnimationDriver_free<()> for () {
fn free(self , rsthis: & QAnimationDriver) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN16QAnimationDriverD2Ev()};
unsafe {C_ZN16QAnimationDriverD2Ev(rsthis.qclsinst)};
// return 1;
}
}
// proto: void QAnimationDriver::QAnimationDriver(QObject * parent);
impl /*struct*/ QAnimationDriver {
pub fn new<T: QAnimationDriver_new>(value: T) -> QAnimationDriver {
let rsthis = value.new();
return rsthis;
// return 1;
}
}
pub trait QAnimationDriver_new {
fn new(self) -> QAnimationDriver;
}
// proto: void QAnimationDriver::QAnimationDriver(QObject * parent);
impl<'a> /*trait*/ QAnimationDriver_new for (Option<&'a QObject>) {
fn new(self) -> QAnimationDriver {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN16QAnimationDriverC2EP7QObject()};
let ctysz: c_int = unsafe{QAnimationDriver_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_ZN16QAnimationDriverC2EP7QObject(arg0)};
let rsthis = QAnimationDriver{qbase: QObject::inheritFrom(qthis), qclsinst: qthis, ..Default::default()};
return rsthis;
// return 1;
}
}
// proto: qint64 QAnimationDriver::elapsed();
impl /*struct*/ QAnimationDriver {
pub fn elapsed<RetType, T: QAnimationDriver_elapsed<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.elapsed(self);
// return 1;
}
}
pub trait QAnimationDriver_elapsed<RetType> {
fn elapsed(self , rsthis: & QAnimationDriver) -> RetType;
}
// proto: qint64 QAnimationDriver::elapsed();
impl<'a> /*trait*/ QAnimationDriver_elapsed<i64> for () {
fn elapsed(self , rsthis: & QAnimationDriver) -> i64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK16QAnimationDriver7elapsedEv()};
let mut ret = unsafe {C_ZNK16QAnimationDriver7elapsedEv(rsthis.qclsinst)};
return ret as i64; // 1
// return 1;
}
}
// proto: void QAnimationDriver::install();
impl /*struct*/ QAnimationDriver {
pub fn install<RetType, T: QAnimationDriver_install<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.install(self);
// return 1;
}
}
pub trait QAnimationDriver_install<RetType> {
fn install(self , rsthis: & QAnimationDriver) -> RetType;
}
// proto: void QAnimationDriver::install();
impl<'a> /*trait*/ QAnimationDriver_install<()> for () {
fn install(self , rsthis: & QAnimationDriver) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN16QAnimationDriver7installEv()};
unsafe {C_ZN16QAnimationDriver7installEv(rsthis.qclsinst)};
// return 1;
}
}
// proto: const QMetaObject * QAnimationDriver::metaObject();
impl /*struct*/ QAnimationDriver {
pub fn metaObject<RetType, T: QAnimationDriver_metaObject<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.metaObject(self);
// return 1;
}
}
pub trait QAnimationDriver_metaObject<RetType> {
fn metaObject(self , rsthis: & QAnimationDriver) -> RetType;
}
// proto: const QMetaObject * QAnimationDriver::metaObject();
impl<'a> /*trait*/ QAnimationDriver_metaObject<QMetaObject> for () {
fn metaObject(self , rsthis: & QAnimationDriver) -> QMetaObject {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK16QAnimationDriver10metaObjectEv()};
let mut ret = unsafe {C_ZNK16QAnimationDriver10metaObjectEv(rsthis.qclsinst)};
let mut ret1 = QMetaObject::inheritFrom(ret as u64);
return ret1;
// return 1;
}
}
// proto: void QAnimationDriver::uninstall();
impl /*struct*/ QAnimationDriver {
pub fn uninstall<RetType, T: QAnimationDriver_uninstall<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.uninstall(self);
// return 1;
}
}
pub trait QAnimationDriver_uninstall<RetType> {
fn uninstall(self , rsthis: & QAnimationDriver) -> RetType;
}
// proto: void QAnimationDriver::uninstall();
impl<'a> /*trait*/ QAnimationDriver_uninstall<()> for () {
fn uninstall(self , rsthis: & QAnimationDriver) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN16QAnimationDriver9uninstallEv()};
unsafe {C_ZN16QAnimationDriver9uninstallEv(rsthis.qclsinst)};
// return 1;
}
}
// proto: bool QAnimationDriver::isRunning();
impl /*struct*/ QAnimationDriver {
pub fn isRunning<RetType, T: QAnimationDriver_isRunning<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.isRunning(self);
// return 1;
}
}
pub trait QAnimationDriver_isRunning<RetType> {
fn isRunning(self , rsthis: & QAnimationDriver) -> RetType;
}
// proto: bool QAnimationDriver::isRunning();
impl<'a> /*trait*/ QAnimationDriver_isRunning<i8> for () {
fn isRunning(self , rsthis: & QAnimationDriver) -> i8 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK16QAnimationDriver9isRunningEv()};
let mut ret = unsafe {C_ZNK16QAnimationDriver9isRunningEv(rsthis.qclsinst)};
return ret as i8; // 1
// return 1;
}
}
// proto: qint64 QAnimationDriver::startTime();
impl /*struct*/ QAnimationDriver {
pub fn startTime<RetType, T: QAnimationDriver_startTime<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.startTime(self);
// return 1;
}
}
pub trait QAnimationDriver_startTime<RetType> {
fn startTime(self , rsthis: & QAnimationDriver) -> RetType;
}
// proto: qint64 QAnimationDriver::startTime();
impl<'a> /*trait*/ QAnimationDriver_startTime<i64> for () {
fn startTime(self , rsthis: & QAnimationDriver) -> i64 {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZNK16QAnimationDriver9startTimeEv()};
let mut ret = unsafe {C_ZNK16QAnimationDriver9startTimeEv(rsthis.qclsinst)};
return ret as i64; // 1
// return 1;
}
}
// proto: void QAnimationDriver::setStartTime(qint64 startTime);
impl /*struct*/ QAnimationDriver {
pub fn setStartTime<RetType, T: QAnimationDriver_setStartTime<RetType>>(& self, overload_args: T) -> RetType {
return overload_args.setStartTime(self);
// return 1;
}
}
pub trait QAnimationDriver_setStartTime<RetType> {
fn setStartTime(self , rsthis: & QAnimationDriver) -> RetType;
}
// proto: void QAnimationDriver::setStartTime(qint64 startTime);
impl<'a> /*trait*/ QAnimationDriver_setStartTime<()> for (i64) {
fn setStartTime(self , rsthis: & QAnimationDriver) -> () {
// let qthis: *mut c_void = unsafe{calloc(1, 32)};
// unsafe{_ZN16QAnimationDriver12setStartTimeEx()};
let arg0 = self as c_longlong;
unsafe {C_ZN16QAnimationDriver12setStartTimeEx(rsthis.qclsinst, arg0)};
// return 1;
}
}
#[derive(Default)] // for QAbstractAnimation_currentLoopChanged
pub struct QAbstractAnimation_currentLoopChanged_signal{poi:u64}
impl /* struct */ QAbstractAnimation {
pub fn currentLoopChanged(&self) -> QAbstractAnimation_currentLoopChanged_signal {
return QAbstractAnimation_currentLoopChanged_signal{poi:self.qclsinst};
}
}
impl /* struct */ QAbstractAnimation_currentLoopChanged_signal {
pub fn connect<T: QAbstractAnimation_currentLoopChanged_signal_connect>(self, overload_args: T) {
overload_args.connect(self);
}
}
pub trait QAbstractAnimation_currentLoopChanged_signal_connect {
fn connect(self, sigthis: QAbstractAnimation_currentLoopChanged_signal);
}
#[derive(Default)] // for QAbstractAnimation_finished
pub struct QAbstractAnimation_finished_signal{poi:u64}
impl /* struct */ QAbstractAnimation {
pub fn finished(&self) -> QAbstractAnimation_finished_signal {
return QAbstractAnimation_finished_signal{poi:self.qclsinst};
}
}
impl /* struct */ QAbstractAnimation_finished_signal {
pub fn connect<T: QAbstractAnimation_finished_signal_connect>(self, overload_args: T) {
overload_args.connect(self);
}
}
pub trait QAbstractAnimation_finished_signal_connect {
fn connect(self, sigthis: QAbstractAnimation_finished_signal);
}
#[derive(Default)] // for QAbstractAnimation_stateChanged
pub struct QAbstractAnimation_stateChanged_signal{poi:u64}
impl /* struct */ QAbstractAnimation {
pub fn stateChanged(&self) -> QAbstractAnimation_stateChanged_signal {
return QAbstractAnimation_stateChanged_signal{poi:self.qclsinst};
}
}
impl /* struct */ QAbstractAnimation_stateChanged_signal {
pub fn connect<T: QAbstractAnimation_stateChanged_signal_connect>(self, overload_args: T) {
overload_args.connect(self);
}
}
pub trait QAbstractAnimation_stateChanged_signal_connect {
fn connect(self, sigthis: QAbstractAnimation_stateChanged_signal);
}
#[derive(Default)] // for QAbstractAnimation_directionChanged
pub struct QAbstractAnimation_directionChanged_signal{poi:u64}
impl /* struct */ QAbstractAnimation {
pub fn directionChanged(&self) -> QAbstractAnimation_directionChanged_signal {
return QAbstractAnimation_directionChanged_signal{poi:self.qclsinst};
}
}
impl /* struct */ QAbstractAnimation_directionChanged_signal {
pub fn connect<T: QAbstractAnimation_directionChanged_signal_connect>(self, overload_args: T) {
overload_args.connect(self);
}
}
pub trait QAbstractAnimation_directionChanged_signal_connect {
fn connect(self, sigthis: QAbstractAnimation_directionChanged_signal);
}
// currentLoopChanged(int)
extern fn QAbstractAnimation_currentLoopChanged_signal_connect_cb_0(rsfptr:fn(i32), arg0: c_int) {
println!("{}:{}", file!(), line!());
let rsarg0 = arg0 as i32;
rsfptr(rsarg0);
}
extern fn QAbstractAnimation_currentLoopChanged_signal_connect_cb_box_0(rsfptr_raw:*mut Box<Fn(i32)>, arg0: c_int) {
println!("{}:{}", file!(), line!());
let rsfptr = unsafe{Box::from_raw(rsfptr_raw)};
let rsarg0 = arg0 as i32;
// rsfptr(rsarg0);
unsafe{(*rsfptr_raw)(rsarg0)};
}
impl /* trait */ QAbstractAnimation_currentLoopChanged_signal_connect for fn(i32) {
fn connect(self, sigthis: QAbstractAnimation_currentLoopChanged_signal) {
// do smth...
// self as u64; // error for Fn, Ok for fn
self as *mut c_void as u64;
self as *mut c_void;
let arg0 = sigthis.poi as *mut c_void;
let arg1 = QAbstractAnimation_currentLoopChanged_signal_connect_cb_0 as *mut c_void;
let arg2 = self as *mut c_void;
unsafe {QAbstractAnimation_SlotProxy_connect__ZN18QAbstractAnimation18currentLoopChangedEi(arg0, arg1, arg2)};
}
}
impl /* trait */ QAbstractAnimation_currentLoopChanged_signal_connect for Box<Fn(i32)> {
fn connect(self, sigthis: QAbstractAnimation_currentLoopChanged_signal) {
// do smth...
// Box::into_raw(self) as u64;
// Box::into_raw(self) as *mut c_void;
let arg0 = sigthis.poi as *mut c_void;
let arg1 = QAbstractAnimation_currentLoopChanged_signal_connect_cb_box_0 as *mut c_void;
let arg2 = Box::into_raw(Box::new(self)) as *mut c_void;
unsafe {QAbstractAnimation_SlotProxy_connect__ZN18QAbstractAnimation18currentLoopChangedEi(arg0, arg1, arg2)};
}
}
// finished()
extern fn QAbstractAnimation_finished_signal_connect_cb_1(rsfptr:fn(), ) {
println!("{}:{}", file!(), line!());
rsfptr();
}
extern fn QAbstractAnimation_finished_signal_connect_cb_box_1(rsfptr_raw:*mut Box<Fn()>, ) {
println!("{}:{}", file!(), line!());
let rsfptr = unsafe{Box::from_raw(rsfptr_raw)};
// rsfptr();
unsafe{(*rsfptr_raw)()};
}
impl /* trait */ QAbstractAnimation_finished_signal_connect for fn() {
fn connect(self, sigthis: QAbstractAnimation_finished_signal) {
// do smth...
// self as u64; // error for Fn, Ok for fn
self as *mut c_void as u64;
self as *mut c_void;
let arg0 = sigthis.poi as *mut c_void;
let arg1 = QAbstractAnimation_finished_signal_connect_cb_1 as *mut c_void;
let arg2 = self as *mut c_void;
unsafe {QAbstractAnimation_SlotProxy_connect__ZN18QAbstractAnimation8finishedEv(arg0, arg1, arg2)};
}
}
impl /* trait */ QAbstractAnimation_finished_signal_connect for Box<Fn()> {
fn connect(self, sigthis: QAbstractAnimation_finished_signal) {
// do smth...
// Box::into_raw(self) as u64;
// Box::into_raw(self) as *mut c_void;
let arg0 = sigthis.poi as *mut c_void;
let arg1 = QAbstractAnimation_finished_signal_connect_cb_box_1 as *mut c_void;
let arg2 = Box::into_raw(Box::new(self)) as *mut c_void;
unsafe {QAbstractAnimation_SlotProxy_connect__ZN18QAbstractAnimation8finishedEv(arg0, arg1, arg2)};
}
}
#[derive(Default)] // for QAnimationDriver_started
pub struct QAnimationDriver_started_signal{poi:u64}
impl /* struct */ QAnimationDriver {
pub fn started(&self) -> QAnimationDriver_started_signal {
return QAnimationDriver_started_signal{poi:self.qclsinst};
}
}
impl /* struct */ QAnimationDriver_started_signal {
pub fn connect<T: QAnimationDriver_started_signal_connect>(self, overload_args: T) {
overload_args.connect(self);
}
}
pub trait QAnimationDriver_started_signal_connect {
fn connect(self, sigthis: QAnimationDriver_started_signal);
}
#[derive(Default)] // for QAnimationDriver_stopped
pub struct QAnimationDriver_stopped_signal{poi:u64}
impl /* struct */ QAnimationDriver {
pub fn stopped(&self) -> QAnimationDriver_stopped_signal {
return QAnimationDriver_stopped_signal{poi:self.qclsinst};
}
}
impl /* struct */ QAnimationDriver_stopped_signal {
pub fn connect<T: QAnimationDriver_stopped_signal_connect>(self, overload_args: T) {
overload_args.connect(self);
}
}
pub trait QAnimationDriver_stopped_signal_connect {
fn connect(self, sigthis: QAnimationDriver_stopped_signal);
}
// stopped()
extern fn QAnimationDriver_stopped_signal_connect_cb_0(rsfptr:fn(), ) {
println!("{}:{}", file!(), line!());
rsfptr();
}
extern fn QAnimationDriver_stopped_signal_connect_cb_box_0(rsfptr_raw:*mut Box<Fn()>, ) {
println!("{}:{}", file!(), line!());
let rsfptr = unsafe{Box::from_raw(rsfptr_raw)};
// rsfptr();
unsafe{(*rsfptr_raw)()};
}
impl /* trait */ QAnimationDriver_stopped_signal_connect for fn() {
fn connect(self, sigthis: QAnimationDriver_stopped_signal) {
// do smth...
// self as u64; // error for Fn, Ok for fn
self as *mut c_void as u64;
self as *mut c_void;
let arg0 = sigthis.poi as *mut c_void;
let arg1 = QAnimationDriver_stopped_signal_connect_cb_0 as *mut c_void;
let arg2 = self as *mut c_void;
unsafe {QAnimationDriver_SlotProxy_connect__ZN16QAnimationDriver7stoppedEv(arg0, arg1, arg2)};
}
}
impl /* trait */ QAnimationDriver_stopped_signal_connect for Box<Fn()> {
fn connect(self, sigthis: QAnimationDriver_stopped_signal) {
// do smth...
// Box::into_raw(self) as u64;
// Box::into_raw(self) as *mut c_void;
let arg0 = sigthis.poi as *mut c_void;
let arg1 = QAnimationDriver_stopped_signal_connect_cb_box_0 as *mut c_void;
let arg2 = Box::into_raw(Box::new(self)) as *mut c_void;
unsafe {QAnimationDriver_SlotProxy_connect__ZN16QAnimationDriver7stoppedEv(arg0, arg1, arg2)};
}
}
// started()
extern fn QAnimationDriver_started_signal_connect_cb_1(rsfptr:fn(), ) {
println!("{}:{}", file!(), line!());
rsfptr();
}
extern fn QAnimationDriver_started_signal_connect_cb_box_1(rsfptr_raw:*mut Box<Fn()>, ) {
println!("{}:{}", file!(), line!());
let rsfptr = unsafe{Box::from_raw(rsfptr_raw)};
// rsfptr();
unsafe{(*rsfptr_raw)()};
}
impl /* trait */ QAnimationDriver_started_signal_connect for fn() {
fn connect(self, sigthis: QAnimationDriver_started_signal) {
// do smth...
// self as u64; // error for Fn, Ok for fn
self as *mut c_void as u64;
self as *mut c_void;
let arg0 = sigthis.poi as *mut c_void;
let arg1 = QAnimationDriver_started_signal_connect_cb_1 as *mut c_void;
let arg2 = self as *mut c_void;
unsafe {QAnimationDriver_SlotProxy_connect__ZN16QAnimationDriver7startedEv(arg0, arg1, arg2)};
}
}
impl /* trait */ QAnimationDriver_started_signal_connect for Box<Fn()> {
fn connect(self, sigthis: QAnimationDriver_started_signal) {
// do smth...
// Box::into_raw(self) as u64;
// Box::into_raw(self) as *mut c_void;
let arg0 = sigthis.poi as *mut c_void;
let arg1 = QAnimationDriver_started_signal_connect_cb_box_1 as *mut c_void;
let arg2 = Box::into_raw(Box::new(self)) as *mut c_void;
unsafe {QAnimationDriver_SlotProxy_connect__ZN16QAnimationDriver7startedEv(arg0, arg1, arg2)};
}
}
// <= body block end
|
fn calculate_fuel(mass: i64) -> i64 {
mass / 3 - 2
}
fn main() {
use std::io;
let mut res = 0;
loop {
let mut input = String::new();
match io::stdin().read_line(&mut input) {
Ok(_) => {
match input.trim().parse() {
Ok(mass) => {
let mut fuel = calculate_fuel(mass);
while fuel > 0 {
res += fuel;
fuel = calculate_fuel(fuel);
}
}
Err(error) => break
}
}
Err(error) => {
println!("{:?}", error);
break;
}
}
}
println!("Total fuel: {:?}", res);
}
|
mod response_wrapper;
mod error_warning;
pub use response_wrapper::ResponseWrapper;
pub use error_warning::ErrorWarning; |
#[doc = "Reader of register MACECR"]
pub type R = crate::R<u32, super::MACECR>;
#[doc = "Writer for register MACECR"]
pub type W = crate::W<u32, super::MACECR>;
#[doc = "Register MACECR `reset()`'s with value 0"]
impl crate::ResetValue for super::MACECR {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `GPSL`"]
pub type GPSL_R = crate::R<u16, u16>;
#[doc = "Write proxy for field `GPSL`"]
pub struct GPSL_W<'a> {
w: &'a mut W,
}
impl<'a> GPSL_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u16) -> &'a mut W {
self.w.bits = (self.w.bits & !0x3fff) | ((value as u32) & 0x3fff);
self.w
}
}
#[doc = "Reader of field `DCRCC`"]
pub type DCRCC_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `DCRCC`"]
pub struct DCRCC_W<'a> {
w: &'a mut W,
}
impl<'a> DCRCC_W<'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 = (self.w.bits & !(0x01 << 16)) | (((value as u32) & 0x01) << 16);
self.w
}
}
#[doc = "Reader of field `SPEN`"]
pub type SPEN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `SPEN`"]
pub struct SPEN_W<'a> {
w: &'a mut W,
}
impl<'a> SPEN_W<'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 = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17);
self.w
}
}
#[doc = "Reader of field `USP`"]
pub type USP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `USP`"]
pub struct USP_W<'a> {
w: &'a mut W,
}
impl<'a> USP_W<'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 = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18);
self.w
}
}
#[doc = "Reader of field `EIPGEN`"]
pub type EIPGEN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `EIPGEN`"]
pub struct EIPGEN_W<'a> {
w: &'a mut W,
}
impl<'a> EIPGEN_W<'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 = (self.w.bits & !(0x01 << 24)) | (((value as u32) & 0x01) << 24);
self.w
}
}
#[doc = "Reader of field `EIPG`"]
pub type EIPG_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `EIPG`"]
pub struct EIPG_W<'a> {
w: &'a mut W,
}
impl<'a> EIPG_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x1f << 25)) | (((value as u32) & 0x1f) << 25);
self.w
}
}
impl R {
#[doc = "Bits 0:13 - Giant Packet Size Limit"]
#[inline(always)]
pub fn gpsl(&self) -> GPSL_R {
GPSL_R::new((self.bits & 0x3fff) as u16)
}
#[doc = "Bit 16 - Disable CRC Checking for Received Packets"]
#[inline(always)]
pub fn dcrcc(&self) -> DCRCC_R {
DCRCC_R::new(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bit 17 - Slow Protocol Detection Enable"]
#[inline(always)]
pub fn spen(&self) -> SPEN_R {
SPEN_R::new(((self.bits >> 17) & 0x01) != 0)
}
#[doc = "Bit 18 - Unicast Slow Protocol Packet Detect"]
#[inline(always)]
pub fn usp(&self) -> USP_R {
USP_R::new(((self.bits >> 18) & 0x01) != 0)
}
#[doc = "Bit 24 - Extended Inter-Packet Gap Enable"]
#[inline(always)]
pub fn eipgen(&self) -> EIPGEN_R {
EIPGEN_R::new(((self.bits >> 24) & 0x01) != 0)
}
#[doc = "Bits 25:29 - Extended Inter-Packet Gap"]
#[inline(always)]
pub fn eipg(&self) -> EIPG_R {
EIPG_R::new(((self.bits >> 25) & 0x1f) as u8)
}
}
impl W {
#[doc = "Bits 0:13 - Giant Packet Size Limit"]
#[inline(always)]
pub fn gpsl(&mut self) -> GPSL_W {
GPSL_W { w: self }
}
#[doc = "Bit 16 - Disable CRC Checking for Received Packets"]
#[inline(always)]
pub fn dcrcc(&mut self) -> DCRCC_W {
DCRCC_W { w: self }
}
#[doc = "Bit 17 - Slow Protocol Detection Enable"]
#[inline(always)]
pub fn spen(&mut self) -> SPEN_W {
SPEN_W { w: self }
}
#[doc = "Bit 18 - Unicast Slow Protocol Packet Detect"]
#[inline(always)]
pub fn usp(&mut self) -> USP_W {
USP_W { w: self }
}
#[doc = "Bit 24 - Extended Inter-Packet Gap Enable"]
#[inline(always)]
pub fn eipgen(&mut self) -> EIPGEN_W {
EIPGEN_W { w: self }
}
#[doc = "Bits 25:29 - Extended Inter-Packet Gap"]
#[inline(always)]
pub fn eipg(&mut self) -> EIPG_W {
EIPG_W { w: self }
}
}
|
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Control register"]
pub cr: CR,
#[doc = "0x04 - Interrupt mask register"]
pub imr: IMR,
#[doc = "0x08 - Status register"]
pub sr: SR,
#[doc = "0x0c - Interrupt Flag Clear register"]
pub ifcr: IFCR,
_reserved_4_dr_: [u8; 4usize],
#[doc = "0x14 - Channel Status register"]
pub csr: CSR,
#[doc = "0x18 - Debug Information register"]
pub dir: DIR,
_reserved7: [u8; 984usize],
#[doc = "0x3f4 - SPDIFRX version register"]
pub verr: VERR,
#[doc = "0x3f8 - SPDIFRX identification register"]
pub idr: IDR,
#[doc = "0x3fc - SPDIFRX size identification register"]
pub sidr: SIDR,
}
impl RegisterBlock {
#[doc = "0x10 - Data input register"]
#[inline(always)]
pub fn dr_10(&self) -> &DR_10 {
unsafe { &*(((self as *const Self) as *const u8).add(16usize) as *const DR_10) }
}
#[doc = "0x10 - Data input register"]
#[inline(always)]
pub fn dr_10_mut(&self) -> &mut DR_10 {
unsafe { &mut *(((self as *const Self) as *mut u8).add(16usize) as *mut DR_10) }
}
#[doc = "0x10 - Data input register"]
#[inline(always)]
pub fn dr_01(&self) -> &DR_01 {
unsafe { &*(((self as *const Self) as *const u8).add(16usize) as *const DR_01) }
}
#[doc = "0x10 - Data input register"]
#[inline(always)]
pub fn dr_01_mut(&self) -> &mut DR_01 {
unsafe { &mut *(((self as *const Self) as *mut u8).add(16usize) as *mut DR_01) }
}
#[doc = "0x10 - Data input register"]
#[inline(always)]
pub fn dr_00(&self) -> &DR_00 {
unsafe { &*(((self as *const Self) as *const u8).add(16usize) as *const DR_00) }
}
#[doc = "0x10 - Data input register"]
#[inline(always)]
pub fn dr_00_mut(&self) -> &mut DR_00 {
unsafe { &mut *(((self as *const Self) as *mut u8).add(16usize) as *mut DR_00) }
}
}
#[doc = "Control register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [cr](cr) module"]
pub type CR = crate::Reg<u32, _CR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _CR;
#[doc = "`read()` method returns [cr::R](cr::R) reader structure"]
impl crate::Readable for CR {}
#[doc = "`write(|w| ..)` method takes [cr::W](cr::W) writer structure"]
impl crate::Writable for CR {}
#[doc = "Control register"]
pub mod cr;
#[doc = "Interrupt mask register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [imr](imr) module"]
pub type IMR = crate::Reg<u32, _IMR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _IMR;
#[doc = "`read()` method returns [imr::R](imr::R) reader structure"]
impl crate::Readable for IMR {}
#[doc = "`write(|w| ..)` method takes [imr::W](imr::W) writer structure"]
impl crate::Writable for IMR {}
#[doc = "Interrupt mask register"]
pub mod imr;
#[doc = "Status register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sr](sr) module"]
pub type SR = crate::Reg<u32, _SR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _SR;
#[doc = "`read()` method returns [sr::R](sr::R) reader structure"]
impl crate::Readable for SR {}
#[doc = "Status register"]
pub mod sr;
#[doc = "Interrupt Flag Clear register\n\nThis register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ifcr](ifcr) module"]
pub type IFCR = crate::Reg<u32, _IFCR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _IFCR;
#[doc = "`write(|w| ..)` method takes [ifcr::W](ifcr::W) writer structure"]
impl crate::Writable for IFCR {}
#[doc = "Interrupt Flag Clear register"]
pub mod ifcr;
#[doc = "Data input register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dr_00](dr_00) module"]
pub type DR_00 = crate::Reg<u32, _DR_00>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _DR_00;
#[doc = "`read()` method returns [dr_00::R](dr_00::R) reader structure"]
impl crate::Readable for DR_00 {}
#[doc = "Data input register"]
pub mod dr_00;
#[doc = "Channel Status register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [csr](csr) module"]
pub type CSR = crate::Reg<u32, _CSR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _CSR;
#[doc = "`read()` method returns [csr::R](csr::R) reader structure"]
impl crate::Readable for CSR {}
#[doc = "Channel Status register"]
pub mod csr;
#[doc = "Debug Information register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dir](dir) module"]
pub type DIR = crate::Reg<u32, _DIR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _DIR;
#[doc = "`read()` method returns [dir::R](dir::R) reader structure"]
impl crate::Readable for DIR {}
#[doc = "Debug Information register"]
pub mod dir;
#[doc = "SPDIFRX version register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [verr](verr) module"]
pub type VERR = crate::Reg<u32, _VERR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _VERR;
#[doc = "`read()` method returns [verr::R](verr::R) reader structure"]
impl crate::Readable for VERR {}
#[doc = "SPDIFRX version register"]
pub mod verr;
#[doc = "SPDIFRX identification register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [idr](idr) module"]
pub type IDR = crate::Reg<u32, _IDR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _IDR;
#[doc = "`read()` method returns [idr::R](idr::R) reader structure"]
impl crate::Readable for IDR {}
#[doc = "SPDIFRX identification register"]
pub mod idr;
#[doc = "SPDIFRX size identification register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sidr](sidr) module"]
pub type SIDR = crate::Reg<u32, _SIDR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _SIDR;
#[doc = "`read()` method returns [sidr::R](sidr::R) reader structure"]
impl crate::Readable for SIDR {}
#[doc = "SPDIFRX size identification register"]
pub mod sidr;
#[doc = "Data input register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dr_01](dr_01) module"]
pub type DR_01 = crate::Reg<u32, _DR_01>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _DR_01;
#[doc = "`read()` method returns [dr_01::R](dr_01::R) reader structure"]
impl crate::Readable for DR_01 {}
#[doc = "Data input register"]
pub mod dr_01;
#[doc = "Data input register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dr_10](dr_10) module"]
pub type DR_10 = crate::Reg<u32, _DR_10>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _DR_10;
#[doc = "`read()` method returns [dr_10::R](dr_10::R) reader structure"]
impl crate::Readable for DR_10 {}
#[doc = "Data input register"]
pub mod dr_10;
|
use hitable::*;
use camera::*;
use output::*;
#[derive(Debug)]
pub struct Scene {
pub world: Box<Hitable>,
pub light_shapes: Box<Hitable>,
pub camera: Camera,
pub num_samples: u32, // TODO: put inside RenderQuality
pub output_settings: OutputSettings,
}
|
//= {
//= "output": {
//= "1": [
//= "",
//= true
//= ],
//= "2": [
//= "",
//= true
//= ]
//= },
//= "children": [],
//= "exit": "Success"
//= }
#![deny(warnings, deprecated)]
extern crate constellation;
use constellation::*;
use std::{process, thread, time};
fn main() {
init(Resources {
mem: 20 * 1024 * 1024,
..Resources::default()
});
thread::sleep(time::Duration::new(0, 100_000_000));
process::exit(0);
}
|
#[allow(dead_code)]
#[derive(Debug, Clone, PartialEq)]
pub enum StockMoveEvent<Item, Location, Quantity> {
Started {
item: Item,
qty: Quantity,
from: Location,
to: Location,
},
Completed,
Cancelled,
Assigned {
item: Item,
from: Location,
assigned: Quantity,
},
Shipped {
item: Item,
from: Location,
outgoing: Quantity,
},
AssignShipped {
item: Item,
from: Location,
outgoing: Quantity,
assigned: Quantity,
},
Arrived {
item: Item,
to: Location,
incoming: Quantity,
},
} |
use super::Constant;
pub fn le(args: Vec<Constant>) -> Constant {
let pair: (&Constant, &Constant) = (args.get(0).unwrap(), args.get(1).unwrap());
match pair {
(&Constant::Float(v1), &Constant::Float(v2)) => Constant::Boolean(v1 <= v2),
(&Constant::Float(v1), &Constant::Integer(v2)) => Constant::Boolean(v1 <= (v2 as f32)),
(&Constant::Integer(v1), &Constant::Integer(v2)) => Constant::Boolean(v1 <= v2),
(&Constant::Integer(v1), &Constant::Float(v2)) => Constant::Boolean((v1 as f32) <= v2),
(&Constant::Boolean(v1), &Constant::Boolean(v2)) => Constant::Boolean(v1 <= v2),
(&Constant::String(ref v1), &Constant::String(ref v2)) => Constant::Boolean(v1.to_owned() <= v2.to_owned()),
_ => {
eprintln!("Invalid arguments passed to \"<=\"!");
panic!()
}
}
} |
/*
Copyright (c) 2015, 2016 Saurav Sachidanand
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
//! The Earth's ecliptic
use angle;
use std::f64::consts::PI;
use time;
/**
Computes the mean obliquity of the ecliptic using
J. Laskar's formula
# Returns
* `mn_oblq`: Mean obliquity of the ecliptic *| in radians*
The accuracy of `mn_oblq` is estimated to be 0.01 arcseconds
for 1000 years before and after 2000 AD, and a few arcseconds
for 10000 years before and after 2000 AD.
# Arguments
* `JD`: Julian (Ephemeris) day
**/
pub fn mn_oblq_laskar(JD: f64) -> f64
{
let u = time::julian_cent(JD) / 100.0;
Horner_eval!(
u,
angle::deg_frm_dms(23, 26, 21.448),
-angle::deg_frm_dms(0, 0, 4680.93),
-angle::deg_frm_dms(0, 0, 1.55),
angle::deg_frm_dms(0, 0, 1999.25),
-angle::deg_frm_dms(0, 0, 51.38),
-angle::deg_frm_dms(0, 0, 249.67),
-angle::deg_frm_dms(0, 0, 39.05),
angle::deg_frm_dms(0, 0, 7.12),
angle::deg_frm_dms(0, 0, 27.87),
angle::deg_frm_dms(0, 0, 5.79),
angle::deg_frm_dms(0, 0, 2.45)
).to_radians()
}
/**
Computes the mean obliquity of the ecliptic using
the IAU formula
# Returns
* `mn_oblq`: Mean obliquity of the ecliptic *| in radians*
The error in `mn_oblq` reaches 1 arcsecond over a period of
2000 years from 2000 AD, and about 10 arcseconds over a period of
4000 years from 2000 AD.
# Arguments
* `JD`: Julian (Ephemeris) day
**/
pub fn mn_oblq_IAU(JD: f64) -> f64
{
let u = time::julian_cent(JD) / 100.0;
Horner_eval!(
u,
angle::deg_frm_dms(23, 26, 21.448),
-angle::deg_frm_dms(0, 0, 46.815),
-angle::deg_frm_dms(0, 0, 0.00059),
angle::deg_frm_dms(0, 0, 0.001813)
).to_radians()
}
/**
Computes the longitudes of the two ecliptic points on
a horizon on Earth
# Returns
`(long_point_1, long_point_2)`
* `long_point_1`: Longitude of ecliptic point 1 *| in radians*
* `long_point_2`: Longitude of ecliptic point 2 *| in radians*
# Arguments
* `oblq_eclip` : Obliquity of the ecliptic *| in radians*
* `observer_lat`: The observer's geographical latitude *| in radians*
* `loc_sidreal` : Local sidereal time *| in radians*
**/
pub fn eclip_points_on_hz(oblq_eclip: f64, observer_lat: f64,
loc_sidreal: f64) -> (f64, f64)
{
let p = (-loc_sidreal.cos()).atan2 (
oblq_eclip.sin() * observer_lat.tan()
+ oblq_eclip.cos() * loc_sidreal.sin()
);
(p, p + PI)
}
/**
Computes the angle between the ecliptic and a horizon
on Earth
# Returns
* `angle`: Angle between the ecliptic and the horizon *| in radians*
# Arguments
* `oblq_eclip` : Obliquity of the ecliptic *| in radians*
* `observer_lat`: The observer's geographical latitude *| in radians*
* `loc_sidreal` : Local sidereal time *| in radians*
**/
pub fn angl_betwn_eclip_and_hz(oblq_eclip: f64, observer_lat: f64,
loc_sidreal: f64) -> f64
{
(
oblq_eclip.cos() * observer_lat.sin()
- oblq_eclip.sin() * observer_lat.cos() * loc_sidreal.sin()
).acos()
}
|
use shipyard_scenegraph::traits::required as math_traits;
use shipyard_scenegraph::traits::required::SliceExt;
const MATRIX_IDENTITY: [f32; 16] = [
1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0,
];
const VECTOR_ZERO: [f32; 3] = [0.0, 0.0, 0.0];
const VECTOR_ONE: [f32; 3] = [1.0, 1.0, 1.0];
const QUAT_IDENTITY: [f32; 4] = [0.0, 0.0, 0.0, 1.0];
#[test]
fn test_nalgebra_glm() {
let m: nalgebra_glm::Mat4 = math_traits::Matrix4Ext::identity();
assert_eq!(m.as_slice(), MATRIX_IDENTITY);
let v: nalgebra_glm::Vec3 = math_traits::Vec3Ext::zero();
assert_eq!(v.as_slice(), VECTOR_ZERO);
let v: nalgebra_glm::Vec3 = math_traits::Vec3Ext::one();
assert_eq!(v.as_slice(), VECTOR_ONE);
let q1: nalgebra_glm::Quat = math_traits::QuatExt::identity();
//The storage order for nalgebra is [ i, j, k, w ] while the arguments for this functions are in the order (w, i, j, k).
let q2 = nalgebra_glm::Quat::new(1.0, 0.0, 0.0, 0.0);
assert_eq!(q1.as_slice(), q2.coords.as_slice());
assert_eq!(q1.as_slice(), QUAT_IDENTITY);
}
|
#[cfg(test)]
extern crate env_logger;
#[macro_use]
extern crate statechart;
use std::rc::Rc;
use statechart::ast::*;
use statechart::interpreter::*;
#[test]
fn pingpong() {
let _ = env_logger::init();
let sc = states!{ root {
initial_label: Some("init".to_string()),
substates: [
state!{ init {
on_entry: [
action_assign!(key: "i", value: Value::Int(0)),
action_raise!(topic: "ping", contents: Value::Int(1))],
transitions: [goto!(target: ping)]}},
state!{ ping {
transitions: [
goto!(target: pong, topics: ["ping"],
cond: cond_fn!(|it: &Interpreter| {
match it.get_var("i") {
Some(&Value::Int(i)) => i < 10,
_ => false,
}}),
actions: [
action_raise!(topic: "pong"),
action_fn!(Rc::new(|it: &mut Interpreter| {
let i = match it.get_var("i") {
Some(&Value::Int(i)) => i,
_ => return Err(Fault::ActionError(
"i: invalid or uninitialized value".to_string())),
};
it.set_var("i", Value::Int(i+1));
Ok(())
}))]),
goto!(target: end,
cond: cond_fn!(|it: &Interpreter| {
match it.get_var("i") {
Some(&Value::Int(i)) => i >= 10,
_ => false,
}
})),
],
on_entry: [action_log!(message: "ping!")],
}},
state!{ pong {
transitions: [goto!(target: ping, topics: ["pong"],
actions: [action_raise!(topic: "ping")])],
on_entry: [action_log!(message: "pong!")],
}},
final_state!{ end {
result: Output::ValueOf(ValueOfBuilder::default().key("i").build().unwrap()),
}},
]}};
let ctx = Context::new(sc);
let mut it = Interpreter::new();
let result = it.run(&ctx);
assert!(result.is_ok(), "fault: {:?}", result.err().unwrap());
assert_eq!(result.unwrap(), Value::Int(10));
}
|
// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// 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.
#![crate_name = "alert"]
#![crate_type = "rlib"]
#[cfg(target_os="macos")]
extern crate core_foundation;
#[cfg(target_os="macos")]
extern crate cocoa;
#[cfg(target_os="linux")]
pub use linux::Alert;
#[cfg(target_os="macos")]
pub use macos::Alert;
#[cfg(target_os="android")]
pub use android::Alert;
#[cfg(target_os="linux")]
pub mod linux;
#[cfg(target_os="macos")]
pub mod macos;
#[cfg(target_os="android")]
pub mod android;
#[cfg(testalert)]
mod test;
pub trait AlertMethods {
/// Creates a new alert with an OK and Cancel button.
fn new(message_text: &str) -> Self;
/// Adds a prompt to the alert.
fn add_prompt(&mut self);
/// Runs the alert modally.
fn run(&self);
/// Returns the value of the prompt.
fn prompt_value(&self) -> String;
}
|
use git2::{ErrorCode, Repository};
use bindgen;
use cc;
use std::env;
use std::path::PathBuf;
use std::process::Command;
fn main() {
let v8_dir = match env::var("CUSTOM_V8") {
Ok(custom_v8_dir) => {
let custom_v8_dir = PathBuf::from(custom_v8_dir);
assert!(custom_v8_dir.exists());
custom_v8_dir
}
Err(_) => build_v8(),
};
compile_wrappers(v8_dir.clone());
generate_bindings(v8_dir);
}
fn build_v8() -> PathBuf {
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
let v8_repo_path = out_dir.clone().join("third_party/v8");
if v8_repo_path.exists() {
return v8_repo_path;
}
// Fetch the v8 source
fetch_v8(out_dir.clone());
// Checkout the correct v8 version
let status = Command::new("git")
.args(&["checkout", include_str!("v8-version.txt").trim()])
.current_dir(v8_repo_path.clone())
.status()
.expect("Failed to checkout correct v8 version");
assert!(status.success());
// Update third-party repos and run pre-compile hooks
let status = Command::new("gclient")
.arg("sync")
.current_dir(v8_repo_path.clone())
.status()
.expect("Failed to synchronize gclient deps");
assert!(status.success());
// Build v8
generate_config(out_dir.clone());
run_ninja(out_dir.clone());
v8_repo_path
}
fn compile_wrappers(v8_dir: PathBuf) {
let include_dir = v8_dir.join("include");
println!("cargo:rerun-if-changed=src/wrapper.cpp");
cc::Build::new()
.cpp(true)
.warnings(false)
.flag("--std=c++14")
.include(include_dir)
.file("src/wrapper.cpp")
.compile("libwrapper.a");
}
fn generate_bindings(v8_dir: PathBuf) {
println!("cargo:rustc-link-lib=v8_libbase");
println!("cargo:rustc-link-lib=v8_libplatform");
println!("cargo:rustc-link-lib=v8_monolith");
println!("cargo:rustc-link-lib=c++");
println!(
"cargo:rustc-link-search={}/out.gn/x64.release/obj",
v8_dir.to_str().unwrap()
);
println!(
"cargo:rustc-link-search={}/out.gn/x64.release/obj/third_party/icu",
v8_dir.to_str().unwrap()
);
let bindings = bindgen::Builder::default()
.generate_comments(true)
.header("src/wrapper.cpp")
.rust_target(bindgen::RustTarget::Nightly)
.clang_arg("-x")
.clang_arg("c++")
.clang_arg("--std=c++14")
.clang_arg(format!("-I{}", v8_dir.join("include").to_str().unwrap()))
// Because there are some layout problems with these
.opaque_type("std::.*")
.whitelist_type("std::unique_ptr\\<v8::Platform\\>")
.whitelist_type("v8::.*")
.blacklist_type("std::basic_string.*")
.whitelist_function("v8::.*")
.whitelist_function("osgood::.*")
.whitelist_var("v8::.*")
// Re-structure the modules a bit and hide the "root" module
.raw_line("#[doc(hidden)]")
// .generate_inline_functions(true)
.enable_cxx_namespaces()
.derive_debug(true)
.derive_hash(true)
.derive_eq(true)
.derive_partialeq(true)
.rustfmt_bindings(true) // comment this for a slightly faster build
.generate()
.expect("Unable to generate bindings");
let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
}
fn fetch_v8(out_dir: PathBuf) {
let v8_repo_path = out_dir.join("third_party/v8");
if !v8_repo_path.exists() {
let res = Command::new("fetch")
.arg("v8")
.current_dir(out_dir.join("third_party"))
.status();
let status = match res {
Ok(val) => val,
Err(_) => {
download_depot_tools(out_dir.clone());
Command::new("fetch")
.arg("v8")
.current_dir(out_dir.join("third_party"))
.status()
.unwrap()
}
};
assert!(status.success());
}
}
fn download_depot_tools(out_dir: PathBuf) {
let depot_tools_repo_url = "https://chromium.googlesource.com/chromium/tools/depot_tools.git";
let depot_tools_repo_path = out_dir.join("third_party/depot_tools");
// Clone the depot_tools repo
match Repository::clone(depot_tools_repo_url, depot_tools_repo_path.clone()) {
Ok(_) => (),
Err(ref e) if e.code() == ErrorCode::Exists => (),
Err(e) => panic!("Failed to clone depot tools: {}", e),
};
// Set the path
if let Some(path) = env::var_os("PATH") {
let mut paths = env::split_paths(&path).collect::<Vec<_>>();
paths.push(depot_tools_repo_path.clone());
let new_path = env::join_paths(paths).unwrap();
env::set_var("PATH", &new_path);
}
}
fn generate_config(out_dir: PathBuf) {
let v8_repo_path = out_dir.join("third_party/v8");
let status = Command::new("tools/dev/v8gen.py")
.args(&[
"x64.release",
"--",
"v8_monolithic=true",
"v8_use_external_startup_data=false",
"use_custom_libcxx=false",
])
.current_dir(v8_repo_path)
.status()
.expect("Failed to generate v8 build configuration");
assert!(status.success());
}
fn run_ninja(out_dir: PathBuf) {
let ninja_config_path = out_dir.join("third_party/v8/out.gn/x64.release");
let status = Command::new("ninja")
.current_dir(ninja_config_path)
.status()
.expect("Failed to compile v8");
assert!(status.success());
}
|
//! DMA
//!
//! Size: 4K
use core::marker::PhantomData;
use core::ops::{Deref, DerefMut};
use static_assertions::const_assert_eq;
pub mod channel;
pub const PADDR: usize = 0x01C0_2000;
pub const NUM_CHANNELS: usize = 8;
register! {
IrqEnable,
u32,
RW,
Fields [
Ch0HalfPkgIrqEnable WIDTH(U1) OFFSET(U0),
Ch0PkgIrqEnable WIDTH(U1) OFFSET(U1),
Ch0QueueIrqEnable WIDTH(U1) OFFSET(U2),
Ch1HalfPkgIrqEnable WIDTH(U1) OFFSET(U4),
Ch1PkgIrqEnable WIDTH(U1) OFFSET(U5),
Ch1QueueIrqEnable WIDTH(U1) OFFSET(U6),
Ch2HalfPkgIrqEnable WIDTH(U1) OFFSET(U8),
Ch2PkgIrqEnable WIDTH(U1) OFFSET(U9),
Ch2QueueIrqEnable WIDTH(U1) OFFSET(U10),
Ch3HalfPkgIrqEnable WIDTH(U1) OFFSET(U12),
Ch3PkgIrqEnable WIDTH(U1) OFFSET(U13),
Ch3QueueIrqEnable WIDTH(U1) OFFSET(U14),
Ch4HalfPkgIrqEnable WIDTH(U1) OFFSET(U16),
Ch4PkgIrqEnable WIDTH(U1) OFFSET(U17),
Ch4QueueIrqEnable WIDTH(U1) OFFSET(U18),
Ch5HalfPkgIrqEnable WIDTH(U1) OFFSET(U20),
Ch5PkgIrqEnable WIDTH(U1) OFFSET(U21),
Ch5QueueIrqEnable WIDTH(U1) OFFSET(U22),
Ch6HalfPkgIrqEnable WIDTH(U1) OFFSET(U24),
Ch6PkgIrqEnable WIDTH(U1) OFFSET(U25),
Ch6QueueIrqEnable WIDTH(U1) OFFSET(U26),
Ch7HalfPkgIrqEnable WIDTH(U1) OFFSET(U28),
Ch7PkgIrqEnable WIDTH(U1) OFFSET(U29),
Ch7QueueIrqEnable WIDTH(U1) OFFSET(U30),
]
}
register! {
IrqPending,
u32,
RW,
Fields [
Ch0HalfPkg WIDTH(U1) OFFSET(U0),
Ch0Pkg WIDTH(U1) OFFSET(U1),
Ch0Queue WIDTH(U1) OFFSET(U2),
Ch1HalfPkg WIDTH(U1) OFFSET(U4),
Ch1Pkg WIDTH(U1) OFFSET(U5),
Ch1Queue WIDTH(U1) OFFSET(U6),
Ch2HalfPkg WIDTH(U1) OFFSET(U8),
Ch2Pkg WIDTH(U1) OFFSET(U9),
Ch2Queue WIDTH(U1) OFFSET(U10),
Ch3HalfPkg WIDTH(U1) OFFSET(U12),
Ch3Pkg WIDTH(U1) OFFSET(U13),
Ch3Queue WIDTH(U1) OFFSET(U14),
Ch4HalfPkg WIDTH(U1) OFFSET(U16),
Ch4Pkg WIDTH(U1) OFFSET(U17),
Ch4Queue WIDTH(U1) OFFSET(U18),
Ch5HalfPkg WIDTH(U1) OFFSET(U20),
Ch5Pkg WIDTH(U1) OFFSET(U21),
Ch5Queue WIDTH(U1) OFFSET(U22),
Ch6HalfPkg WIDTH(U1) OFFSET(U24),
Ch6Pkg WIDTH(U1) OFFSET(U25),
Ch6Queue WIDTH(U1) OFFSET(U26),
Ch7HalfPkg WIDTH(U1) OFFSET(U28),
Ch7Pkg WIDTH(U1) OFFSET(U29),
Ch7Queue WIDTH(U1) OFFSET(U30),
]
}
register! {
Security,
u32,
RW,
Fields [
Ch0 WIDTH(U1) OFFSET(U0) [
Secure = U0,
NonSecure = U1
],
Ch1 WIDTH(U1) OFFSET(U1) [
Secure = U0,
NonSecure = U1
],
Ch2 WIDTH(U1) OFFSET(U2) [
Secure = U0,
NonSecure = U1
],
Ch3 WIDTH(U1) OFFSET(U3) [
Secure = U0,
NonSecure = U1
],
Ch4 WIDTH(U1) OFFSET(U4) [
Secure = U0,
NonSecure = U1
],
Ch5 WIDTH(U1) OFFSET(U5) [
Secure = U0,
NonSecure = U1
],
Ch6 WIDTH(U1) OFFSET(U6) [
Secure = U0,
NonSecure = U1
],
Ch7 WIDTH(U1) OFFSET(U7) [
Secure = U0,
NonSecure = U1
],
]
}
register! {
AutoGating,
u32,
RW,
Fields [
Channel WIDTH(U1) OFFSET(U0) [
Enable = U0,
Disable = U1
],
Common WIDTH(U1) OFFSET(U1) [
Enable = U0,
Disable = U1
],
MasterClock WIDTH(U1) OFFSET(U2) [
Enable = U0,
Disable = U1
],
]
}
register! {
Status,
u32,
RO,
Fields [
Ch0Busy WIDTH(U1) OFFSET(U0),
Ch1Busy WIDTH(U1) OFFSET(U1),
Ch2Busy WIDTH(U1) OFFSET(U2),
Ch3Busy WIDTH(U1) OFFSET(U3),
Ch4Busy WIDTH(U1) OFFSET(U4),
Ch5Busy WIDTH(U1) OFFSET(U5),
Ch6Busy WIDTH(U1) OFFSET(U6),
Ch7Busy WIDTH(U1) OFFSET(U7),
MBusFifoNotEmpty WIDTH(U1) OFFSET(U30),
]
}
const_assert_eq!(core::mem::size_of::<RegisterBlock>(), 0x300);
#[repr(C)]
pub struct RegisterBlock {
pub irq: IrqEnable::Register, // 0x000
__reserved_0: [u32; 3], // 0x004
pub irq_pending: IrqPending::Register, // 0x010
__reserved_1: [u32; 3], // 0x014
pub security: Security::Register, // 0x020
__reserved_2: u32, // 0x024
pub auto_gating: AutoGating::Register, // 0x028
__reserved_3: u32, // 0x02C
pub status: Status::Register, // 0x030
__reserved_4: [u32; 51], // 0x034
pub channels: [channel::RegisterBlock; NUM_CHANNELS], // 0x100
}
pub struct DMA {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for DMA {}
impl DMA {
pub unsafe fn from_paddr() -> Self {
Self {
_marker: PhantomData,
}
}
pub fn as_ptr(&self) -> *const RegisterBlock {
PADDR as *const _
}
pub const unsafe fn ptr() -> *const RegisterBlock {
PADDR as *const _
}
pub fn as_mut_ptr(&mut self) -> *mut RegisterBlock {
PADDR as *mut _
}
pub const unsafe fn mut_ptr() -> *mut RegisterBlock {
PADDR as *mut _
}
}
impl Deref for DMA {
type Target = RegisterBlock;
fn deref(&self) -> &RegisterBlock {
unsafe { &*self.as_ptr() }
}
}
impl DerefMut for DMA {
fn deref_mut(&mut self) -> &mut RegisterBlock {
unsafe { &mut *self.as_mut_ptr() }
}
}
|
// revisions: base nll
// ignore-compare-mode-nll
//[nll] compile-flags: -Z borrowck=mir
trait Foo {}
impl<T: Fn(&())> Foo for T {}
fn baz<T: Foo>(_: T) {}
fn main() {
baz(|_| ());
//[base]~^ ERROR mismatched types
//[nll]~^^ ERROR implementation of `FnOnce` is not general enough
//[nll]~| ERROR mismatched types
}
|
use crate::smb2::requests::query_info::QueryInfo;
/// Serializes a query info request from the corresponding struct.
pub fn serialize_query_info_request_body(request: &QueryInfo) -> Vec<u8> {
let mut serialized_request: Vec<u8> = Vec::new();
serialized_request.append(&mut request.structure_size.clone());
serialized_request.append(&mut request.info_type.clone());
serialized_request.append(&mut request.file_info_class.clone());
serialized_request.append(&mut request.output_buffer_length.clone());
serialized_request.append(&mut request.input_buffer_offset.clone());
serialized_request.append(&mut request.reserved.clone());
serialized_request.append(&mut request.input_buffer_length.clone());
serialized_request.append(&mut request.additional_information.clone());
serialized_request.append(&mut request.flags.clone());
serialized_request.append(&mut request.file_id.clone());
serialized_request.append(&mut request.buffer.clone());
serialized_request
}
|
//! Keep stats, and dispaly them to the user. Usually used in a broker, or main node, of some sort.
use alloc::{string::String, vec::Vec};
use core::{time, time::Duration};
use crate::utils::current_time;
const CLIENT_STATS_TIME_WINDOW_SECS: u64 = 5; // 5 seconds
/// A simple struct to keep track of client stats
#[derive(Debug, Clone, Default)]
pub struct ClientStats {
// stats (maybe we need a separated struct?)
/// The corpus size for this client
pub corpus_size: u64,
/// The total executions for this client
pub executions: u64,
/// The size of the objectives corpus for this client
pub objective_size: u64,
/// The last reported executions for this client
pub last_window_executions: u64,
/// The last time we got this information
pub last_window_time: time::Duration,
/// The last executions per sec
pub last_execs_per_sec: f32,
}
impl ClientStats {
/// We got a new information about executions for this client, insert them.
pub fn update_executions(&mut self, executions: u64, cur_time: time::Duration) {
let diff = cur_time
.checked_sub(self.last_window_time)
.map_or(0, |d| d.as_secs());
if diff > CLIENT_STATS_TIME_WINDOW_SECS {
let _ = self.execs_per_sec(cur_time);
self.last_window_time = cur_time;
self.last_window_executions = self.executions;
}
self.executions = executions;
}
/// We got a new information about corpus size for this client, insert them.
pub fn update_corpus_size(&mut self, corpus_size: u64) {
self.corpus_size = corpus_size;
}
/// We got a new information about objective corpus size for this client, insert them.
pub fn update_objective_size(&mut self, objective_size: u64) {
self.objective_size = objective_size;
}
/// Get the calculated executions per second for this client
#[allow(clippy::cast_sign_loss, clippy::cast_precision_loss)]
pub fn execs_per_sec(&mut self, cur_time: time::Duration) -> u64 {
if self.executions == 0 {
return 0;
}
let elapsed = cur_time
.checked_sub(self.last_window_time)
.map_or(0, |d| d.as_secs());
if elapsed == 0 {
return self.last_execs_per_sec as u64;
}
let cur_avg = ((self.executions - self.last_window_executions) as f32) / (elapsed as f32);
if self.last_window_executions == 0 {
self.last_execs_per_sec = cur_avg;
return self.last_execs_per_sec as u64;
}
// If there is a dramatic (5x+) jump in speed, reset the indicator more quickly
if cur_avg * 5.0 < self.last_execs_per_sec || cur_avg / 5.0 > self.last_execs_per_sec {
self.last_execs_per_sec = cur_avg;
}
self.last_execs_per_sec =
self.last_execs_per_sec * (1.0 - 1.0 / 16.0) + cur_avg * (1.0 / 16.0);
self.last_execs_per_sec as u64
}
}
/// The stats trait keeps track of all the client's stats, and offers methods to dispaly them.
pub trait Stats {
/// the client stats (mut)
fn client_stats_mut(&mut self) -> &mut Vec<ClientStats>;
/// the client stats
fn client_stats(&self) -> &[ClientStats];
/// creation time
fn start_time(&mut self) -> time::Duration;
/// show the stats to the user
fn display(&mut self, event_msg: String);
/// Amount of elements in the corpus (combined for all children)
fn corpus_size(&self) -> u64 {
self.client_stats()
.iter()
.fold(0_u64, |acc, x| acc + x.corpus_size)
}
/// Amount of elements in the objectives (combined for all children)
fn objective_size(&self) -> u64 {
self.client_stats()
.iter()
.fold(0_u64, |acc, x| acc + x.objective_size)
}
/// Total executions
#[inline]
fn total_execs(&mut self) -> u64 {
self.client_stats()
.iter()
.fold(0_u64, |acc, x| acc + x.executions)
}
/// Executions per second
#[inline]
fn execs_per_sec(&mut self) -> u64 {
let cur_time = current_time();
self.client_stats_mut()
.iter_mut()
.fold(0_u64, |acc, x| acc + x.execs_per_sec(cur_time))
}
/// The client stats for a specific id, creating new if it doesn't exist
fn client_stats_mut_for(&mut self, client_id: u32) -> &mut ClientStats {
let client_stat_count = self.client_stats().len();
for _ in client_stat_count..(client_id + 1) as usize {
self.client_stats_mut().push(ClientStats {
last_window_time: current_time(),
..ClientStats::default()
})
}
&mut self.client_stats_mut()[client_id as usize]
}
}
/// Tracking stats during fuzzing.
#[derive(Clone, Debug)]
pub struct SimpleStats<F>
where
F: FnMut(String),
{
print_fn: F,
start_time: Duration,
corpus_size: usize,
client_stats: Vec<ClientStats>,
}
impl<F> Stats for SimpleStats<F>
where
F: FnMut(String),
{
/// the client stats, mutable
fn client_stats_mut(&mut self) -> &mut Vec<ClientStats> {
&mut self.client_stats
}
/// the client stats
fn client_stats(&self) -> &[ClientStats] {
&self.client_stats
}
/// Time this fuzzing run stated
fn start_time(&mut self) -> time::Duration {
self.start_time
}
fn display(&mut self, event_msg: String) {
let fmt = format!(
"[{}] clients: {}, corpus: {}, objectives: {}, executions: {}, exec/sec: {}",
event_msg,
self.client_stats().len(),
self.corpus_size(),
self.objective_size(),
self.total_execs(),
self.execs_per_sec()
);
(self.print_fn)(fmt);
}
}
impl<F> SimpleStats<F>
where
F: FnMut(String),
{
/// Creates the stats, using the `current_time` as `start_time`.
pub fn new(print_fn: F) -> Self {
Self {
print_fn,
start_time: current_time(),
corpus_size: 0,
client_stats: vec![],
}
}
/// Creates the stats with a given `start_time`.
pub fn with_time(print_fn: F, start_time: time::Duration) -> Self {
Self {
print_fn,
start_time,
corpus_size: 0,
client_stats: vec![],
}
}
}
|
//! The module trait and some useful implementations such as
//! combinators
use crate::{Error, Result, TimerInfo};
use log::warn;
/// A decision each module has to take before a timer is executed:
/// Should it be?
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum Progress {
/// Continue the program, no action taken.
Continue,
/// Abort this chain, don't pursue it any longer. The timers won't be
/// checked again, until the user is active.
Abort,
/// Like abort, but is immediately ready to check timers again. See
/// https://github.com/jD91mZM2/xidlehook/issues/43 for a quick description
/// of why this exists: When an application goes out of fullscreen, you
/// don't want to re-check it all the time. But an application can stop
/// playing audio without user interaction.
Reset,
/// Stop the program completely. Use this sparingly.
Stop,
}
/// A generic module that controls whether timers should execute or
/// not (outside of the normal timer)
pub trait Module {
/// Decides if a timer should be allowed to execute
fn pre_timer(&mut self, _timer: TimerInfo) -> Result<Progress> {
Ok(Progress::Continue)
}
/// Decides what happens after a timer has executed
fn post_timer(&mut self, _timer: TimerInfo) -> Result<Progress> {
Ok(Progress::Continue)
}
/// Is called when there's a potentially recoverable error. Can
/// re-throw an unrecoverable error.
fn warning(&mut self, _error: &Error) -> Result<()> {
Ok(())
}
/// If this is called, the counting was reset - clear any cache
/// here
fn reset(&mut self) -> Result<()> {
Ok(())
}
}
/// The default module is also the unit type because why not
impl Module for () {
fn warning(&mut self, error: &Error) -> Result<()> {
warn!("{} (Debug: {:?})", error, error);
Ok(())
}
}
impl Module for Box<dyn Module> {
fn pre_timer(&mut self, timer: TimerInfo) -> Result<Progress> {
(&mut **self).pre_timer(timer)
}
fn post_timer(&mut self, timer: TimerInfo) -> Result<Progress> {
(&mut **self).post_timer(timer)
}
fn warning(&mut self, error: &Error) -> Result<()> {
(&mut **self).warning(error)
}
fn reset(&mut self) -> Result<()> {
(&mut **self).reset()
}
}
/// Combine two timers using the type-system. Can be recursed for a
/// fixed-size amount of timers. Similar to iterator.chain.
impl<A, B> Module for (A, B)
where
A: Module,
B: Module,
{
fn pre_timer(&mut self, timer: TimerInfo) -> Result<Progress> {
let status = self.0.pre_timer(timer)?;
if status != Progress::Continue {
return Ok(status);
}
self.1.pre_timer(timer)
}
fn post_timer(&mut self, timer: TimerInfo) -> Result<Progress> {
let status = self.0.post_timer(timer)?;
if status != Progress::Continue {
return Ok(status);
}
self.1.post_timer(timer)
}
fn warning(&mut self, error: &Error) -> Result<()> {
self.0.warning(error)?;
self.1.warning(error)
}
fn reset(&mut self) -> Result<()> {
self.0.reset()?;
self.1.reset()
}
}
/// Combine multiple modules with a dynamic size
impl<M: Module> Module for Vec<M> {
fn pre_timer(&mut self, timer: TimerInfo) -> Result<Progress> {
for module in self {
let status = module.pre_timer(timer)?;
if status != Progress::Continue {
return Ok(status);
}
}
Ok(Progress::Continue)
}
fn post_timer(&mut self, timer: TimerInfo) -> Result<Progress> {
for module in self {
let status = module.post_timer(timer)?;
if status != Progress::Continue {
return Ok(status);
}
}
Ok(Progress::Continue)
}
fn warning(&mut self, error: &Error) -> Result<()> {
for module in self {
module.warning(error)?;
}
Ok(())
}
fn reset(&mut self) -> Result<()> {
for module in self {
module.reset()?;
}
Ok(())
}
}
#[cfg(feature = "pulse")]
pub mod pulse;
pub mod stop_at;
pub mod xcb;
#[cfg(feature = "pulse")]
pub use self::pulse::NotWhenAudio;
pub use self::{stop_at::StopAt, xcb::Xcb};
|
use crate::bomb_party::*;
use serenity::{
builder::CreateEmbed,
framework::standard::{macros::command, Args, CommandResult},
model::prelude::*,
prelude::*,
};
use std::collections::hash_map::Entry;
#[command]
#[description = "Create a new game"]
pub async fn new(ctx: &Context, msg: &Message) -> CommandResult {
let key = format!("{}_{}", msg.guild_id.unwrap(), msg.channel_id);
let manager_lock = {
let data_read = ctx.data.read().await;
data_read
.get::<GameManager>()
.expect("Expected BombPartyManager in TypeMap")
.clone()
};
let status = {
let mut manager = manager_lock.lock().await;
match manager.entry(key) {
Entry::Occupied(_) => Status::GameAlreadyStarted,
Entry::Vacant(v) => {
let mut players = Vec::new();
players.push(Player::from(msg.author.id));
v.insert(GameState::new(players));
Status::NewGameCreated
}
}
};
match status {
Status::NewGameCreated => {
msg.channel_id
.say(&ctx.http, "A new game has been created!\nUse `timeout`, `target`, `dist` to config this game or `join` to join the game.\nUse `help` for more info.\nStart the game with `start` when you're ready! There's no going back!")
.await?;
}
Status::GameAlreadyStarted => {
msg.channel_id
.say(&ctx.http, "Already has a game going on in this channel!")
.await?;
}
_ => {}
}
Ok(())
}
#[command]
#[description = "Join a game before it starts"]
pub async fn join(ctx: &Context, msg: &Message) -> CommandResult {
let key = format!("{}_{}", msg.guild_id.unwrap(), msg.channel_id);
let manager_lock = {
let data_read = ctx.data.read().await;
data_read
.get::<GameManager>()
.expect("Expected BombPartyManager in TypeMap")
.clone()
};
let status = {
let mut manager = manager_lock.lock().await;
match manager.entry(key) {
Entry::Occupied(mut o) => {
let mut players = o.get().players.to_owned();
if players.contains(&Player::from(msg.author.id)) {
Status::PlayerAlreadyJoined
} else {
players.push(Player::from(msg.author.id));
o.get_mut().players = players;
Status::NewPlayerJoined
}
}
Entry::Vacant(_) => Status::NoGameCreated,
}
};
match status {
Status::NewPlayerJoined => {
msg.channel_id
.say(&ctx.http, "New player has joined the game!")
.await?;
}
Status::PlayerAlreadyJoined => {
msg.channel_id
.say(&ctx.http, "You have already joined this game!")
.await?;
}
Status::NoGameCreated => {
msg.channel_id
.say(
&ctx.http,
"No game is going on in this channel! Use `new` to create a new game",
)
.await?;
}
_ => {}
}
Ok(())
}
#[command]
#[description = "Set the target point for a game before it starts"]
pub async fn target(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
let target = args.single::<u64>()?;
let key = format!("{}_{}", msg.guild_id.unwrap(), msg.channel_id);
let manager_lock = {
let data_read = ctx.data.read().await;
data_read
.get::<GameManager>()
.expect("Expected BombPartyManager in TypeMap")
.clone()
};
let status = {
let mut manager = manager_lock.lock().await;
match manager.entry(key) {
Entry::Occupied(mut o) => {
let mut game_state = o.get_mut();
game_state.target = target;
Status::TargetSet
}
Entry::Vacant(_) => Status::NoGameCreated,
}
};
match status {
Status::TargetSet => {
msg.channel_id
.say(
&ctx.http,
format!("Point target has been set to {}!", target),
)
.await?;
}
Status::NoGameCreated => {
msg.channel_id
.say(
&ctx.http,
"No game is going on in this channel! Use `new` to create a new game",
)
.await?;
}
_ => {}
}
Ok(())
}
#[command]
#[description = "Set the timeout for a game before it starts"]
pub async fn timeout(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
let timeout = args.single::<u64>()?;
if timeout > 120 {
msg.channel_id
.say(&ctx.http, "Timeout must be less than 120 seconds!")
.await?;
return Ok(());
}
let key = format!("{}_{}", msg.guild_id.unwrap(), msg.channel_id);
let manager_lock = {
let data_read = ctx.data.read().await;
data_read
.get::<GameManager>()
.expect("Expected BombPartyManager in TypeMap")
.clone()
};
let status = {
let mut manager = manager_lock.lock().await;
match manager.entry(key) {
Entry::Occupied(mut o) => {
let mut game_state = o.get_mut();
game_state.timeout = timeout;
Status::TimeoutSet
}
Entry::Vacant(_) => Status::NoGameCreated,
}
};
match status {
Status::TimeoutSet => {
msg.channel_id
.say(&ctx.http, format!("Timeout has been set to {}!", timeout))
.await?;
}
Status::NoGameCreated => {
msg.channel_id
.say(
&ctx.http,
"No game is going on in this channel! Use `new` to create a new game",
)
.await?;
}
_ => {}
}
Ok(())
}
#[command]
#[description = "Set the weights for the distribution of objectives. Order is: Bigrams Trigrams Quadgrams"]
pub async fn dist(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
let bigrams: u64 = args.single::<u64>()?;
let trigrams: u64 = args.single::<u64>()?;
let quadgrams: u64 = args.single::<u64>()?;
let weights = vec![bigrams, trigrams, quadgrams];
let key = format!("{}_{}", msg.guild_id.unwrap(), msg.channel_id);
let manager_lock = {
let data_read = ctx.data.read().await;
data_read
.get::<GameManager>()
.expect("Expected BombPartyManager in TypeMap")
.clone()
};
let status = {
let mut manager = manager_lock.lock().await;
match manager.entry(key) {
Entry::Occupied(mut o) => {
let mut game_state = o.get_mut();
game_state.weights = weights;
Status::WeightSet
}
Entry::Vacant(_) => Status::NoGameCreated,
}
};
match status {
Status::WeightSet => {
msg.channel_id
.say(&ctx.http, "Weights has been set!")
.await?;
}
Status::NoGameCreated => {
msg.channel_id
.say(
&ctx.http,
"No game is going on in this channel! Use `new` to create a new game",
)
.await?;
}
_ => {}
}
Ok(())
}
#[command]
#[description = "Get current game configuration"]
pub async fn info(ctx: &Context, msg: &Message) -> CommandResult {
let key = format!("{}_{}", msg.guild_id.unwrap(), msg.channel_id);
let manager_lock = {
let data_read = ctx.data.read().await;
data_read
.get::<GameManager>()
.expect("Expected BombPartyManager in TypeMap")
.clone()
};
let (status, embed) = {
let mut manager = manager_lock.lock().await;
match manager.entry(key) {
Entry::Occupied(o) => {
let game_state = o.get();
(Status::InfoAcquired, create_config_embed(&game_state))
}
Entry::Vacant(_) => (Status::NoGameCreated, CreateEmbed::default()),
}
};
match status {
Status::InfoAcquired => {
msg.channel_id
.send_message(&ctx.http, |m| m.set_embed(embed))
.await?;
}
Status::NoGameCreated => {
msg.channel_id
.say(
&ctx.http,
"No game is going on in this channel! Use `new` to create a new game",
)
.await?;
}
_ => {}
}
Ok(())
}
#[command]
pub async fn start(ctx: &Context, msg: &Message) -> CommandResult {
let key = format!("{}_{}", msg.guild_id.unwrap(), msg.channel_id);
let manager_lock = {
let data_read = ctx.data.read().await;
data_read
.get::<GameManager>()
.expect("Expected BombPartyManager in TypeMap")
.clone()
};
let status = {
let manager = manager_lock.lock().await;
match manager.get(&key) {
None => Status::NoGameCreated,
Some(o) => {
if o.running {
Status::GameAlreadyRunning
} else {
Status::StartingGame
}
}
}
};
match status {
Status::NoGameCreated => {
msg.channel_id
.say(
&ctx.http,
"No game is going on in this channel! Use `new` to create a new game",
)
.await?;
}
Status::GameAlreadyRunning => {
msg.channel_id
.say(&ctx.http, "Game already running in this channel!")
.await?;
}
Status::StartingGame => {
tokio::task::spawn(game_loop(
ctx.clone(),
key,
msg.channel_id,
msg.guild_id.unwrap(), //TODO handle properly guild_id
));
}
_ => {}
}
Ok(())
}
|
use crate::qrcode::handler::qrcodes;
use actix_web::web;
pub fn route_qrcode(cfg: &mut web::ServiceConfig) {
cfg.service(web::resource("/qrcodes").route(web::post().to(qrcodes)));
}
|
#[doc = "Reader of register OR"]
pub type R = crate::R<u32, super::OR>;
#[doc = "Writer for register OR"]
pub type W = crate::W<u32, super::OR>;
#[doc = "Register OR `reset()`'s with value 0"]
impl crate::ResetValue for super::OR {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `TIM1_ETR_ADC1_RMP`"]
pub type TIM1_ETR_ADC1_RMP_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `TIM1_ETR_ADC1_RMP`"]
pub struct TIM1_ETR_ADC1_RMP_W<'a> {
w: &'a mut W,
}
impl<'a> TIM1_ETR_ADC1_RMP_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !0x03) | ((value as u32) & 0x03);
self.w
}
}
#[doc = "Reader of field `TIM1_ETR_ADC4_RMP`"]
pub type TIM1_ETR_ADC4_RMP_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `TIM1_ETR_ADC4_RMP`"]
pub struct TIM1_ETR_ADC4_RMP_W<'a> {
w: &'a mut W,
}
impl<'a> TIM1_ETR_ADC4_RMP_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 2)) | (((value as u32) & 0x03) << 2);
self.w
}
}
impl R {
#[doc = "Bits 0:1 - TIM1_ETR_ADC1 remapping capability"]
#[inline(always)]
pub fn tim1_etr_adc1_rmp(&self) -> TIM1_ETR_ADC1_RMP_R {
TIM1_ETR_ADC1_RMP_R::new((self.bits & 0x03) as u8)
}
#[doc = "Bits 2:3 - TIM1_ETR_ADC4 remapping capability"]
#[inline(always)]
pub fn tim1_etr_adc4_rmp(&self) -> TIM1_ETR_ADC4_RMP_R {
TIM1_ETR_ADC4_RMP_R::new(((self.bits >> 2) & 0x03) as u8)
}
}
impl W {
#[doc = "Bits 0:1 - TIM1_ETR_ADC1 remapping capability"]
#[inline(always)]
pub fn tim1_etr_adc1_rmp(&mut self) -> TIM1_ETR_ADC1_RMP_W {
TIM1_ETR_ADC1_RMP_W { w: self }
}
#[doc = "Bits 2:3 - TIM1_ETR_ADC4 remapping capability"]
#[inline(always)]
pub fn tim1_etr_adc4_rmp(&mut self) -> TIM1_ETR_ADC4_RMP_W {
TIM1_ETR_ADC4_RMP_W { w: self }
}
}
|
//! A [tasque] extension specialized for [fibers].
//!
//! This provides an extension trait and the default task queues.
//!
//! [tasque]: https://crates.io/crates/tasque
//! [fibers]: https://crates.io/crates/fibers
//!
//! # Examples
//!
//! ```
//! use fibers::{Executor, InPlaceExecutor};
//! use fibers_tasque::{AsyncCallError, DefaultCpuTaskQueue, DefaultIoTaskQueue, TaskQueueExt};
//!
//! let mut executor = InPlaceExecutor::new().unwrap();
//!
//! let future = DefaultCpuTaskQueue.async_call(|| 1 + 1);
//! assert_eq!(executor.run_future(future).unwrap(), Ok(2));
//!
//! let future = DefaultIoTaskQueue.async_call(|| -> () { panic!() });
//! assert_eq!(executor.run_future(future).unwrap(), Err(AsyncCallError));
//! ```
#![warn(missing_docs)]
pub use self::defaults::{DefaultCpuTaskQueue, DefaultIoTaskQueue};
pub use self::r#async::{AsyncCall, AsyncCallError, TaskQueueExt};
mod r#async;
mod defaults;
#[cfg(test)]
mod test {
use super::*;
use fibers::{Executor, InPlaceExecutor};
#[test]
fn it_works() {
let mut executor = InPlaceExecutor::new().unwrap();
let future = DefaultCpuTaskQueue.async_call(|| 1 + 1);
assert_eq!(executor.run_future(future).unwrap(), Ok(2));
let future = DefaultIoTaskQueue.async_call(|| -> () { panic!() });
assert_eq!(executor.run_future(future).unwrap(), Err(AsyncCallError));
}
}
|
//! Contains the `replace_self_path` function,and the `ReplaceWith` enum.
use as_derive_utils::spanned_err;
use syn::visit_mut::VisitMut;
use syn::{Ident, TraitItemType, TypePath};
use std::mem;
use crate::utils::{LinearResult, SynResultExt};
/// What to do with the a path component when it's found.
#[derive(Debug, Clone)]
pub(crate) enum ReplaceWith {
/// Replaces the identifier of the path component with another.
Ident(Ident),
/// Removes the path component.
Remove,
/// Keeps the path component.
Keep,
}
// This is only pub(crate) because it appears as a bound of `replace_self_path`.
pub(crate) trait VisitMutWith {
fn visit_mut_with<F>(&mut self, other: &mut SelfReplacer<F>)
where
F: FnMut(&Ident) -> Option<ReplaceWith>;
}
macro_rules! impl_visit_mut_with {
(
$( ($self_:ty,$method:path) ),*
$(,)*
) => (
$(
impl VisitMutWith for $self_{
#[inline]
fn visit_mut_with<F>(&mut self,other:&mut SelfReplacer<F>)
where
F: FnMut(&Ident) -> Option<ReplaceWith>,
{
$method(other,self);
}
}
)*
)
}
impl_visit_mut_with! {
(syn::WherePredicate,VisitMut::visit_where_predicate_mut),
(TraitItemType,VisitMut::visit_trait_item_type_mut),
(syn::Type,VisitMut::visit_type_mut),
}
/// Replaces all associated types of `Self` from `value`.
///
/// `replace_with` determines what happens to `Self::` when `Some()` is
/// returned from `is_assoc_type`.
///
/// `is_assoc_type` is used to find the associated types to replace
/// (when the function returns Some(_)),
/// as well as what to replace them with.
///
///
pub(crate) fn replace_self_path<V, F>(
value: &mut V,
replace_with: ReplaceWith,
is_assoc_type: F,
) -> Result<(), syn::Error>
where
V: VisitMutWith,
F: FnMut(&Ident) -> Option<ReplaceWith>,
{
let mut replacer = SelfReplacer {
is_assoc_type,
buffer: Vec::with_capacity(2),
replace_with,
errors: LinearResult::ok(()),
};
value.visit_mut_with(&mut replacer);
replacer.errors.into()
}
// This is only pub(crate) because it is used within the VisitMutWith trait.
pub(crate) struct SelfReplacer<F> {
is_assoc_type: F,
buffer: Vec<ReplaceWith>,
replace_with: ReplaceWith,
errors: LinearResult<()>,
}
impl<F> VisitMut for SelfReplacer<F>
where
F: FnMut(&Ident) -> Option<ReplaceWith>,
{
fn visit_type_path_mut(&mut self, i: &mut TypePath) {
if let Some(qself) = i.qself.as_mut() {
self.visit_type_mut(&mut qself.ty);
}
let segments = &mut i.path.segments;
for segment in &mut *segments {
self.visit_path_arguments_mut(&mut segment.arguments);
}
// println!("\nbefore:{}",(&*segments).into_token_stream() );
// println!("segments[1]:{}",segments.iter().nth(1).into_token_stream() );
let is_self = segments[0].ident == "Self";
match (segments.len(), is_self) {
(0, true) | (1, true) => {
self.errors.push_err(spanned_err!(
segments,
"Self can't be used in a parameter,return type,or associated type.",
));
return;
}
(2, true) => {}
(_, true) => {
self.errors.push_err(spanned_err!(
segments,
"Paths with 3 or more components are currently unsupported",
));
return;
}
(_, false) => return,
}
let is_replaced = (self.is_assoc_type)(&segments[1].ident);
// println!("is_replaced:{:?}",is_replaced );
if let Some(replace_assoc_with) = is_replaced {
let mut prev_segments = mem::take(segments).into_iter();
self.buffer.clear();
self.buffer.push(self.replace_with.clone());
self.buffer.push(replace_assoc_with);
for replace_with in self.buffer.drain(..) {
let prev_segment = prev_segments.next();
match replace_with {
ReplaceWith::Ident(ident) => {
segments.push(ident.into());
}
ReplaceWith::Remove => {}
ReplaceWith::Keep => {
segments.extend(prev_segment);
}
}
}
}
// println!("after:{}",(&*i).into_token_stream() );
}
}
|
#![no_std]
#![no_main]
//! Serial port example.
//!
//! The output is viewable with simavr
//!
//! ```
//! cargo build -Z build-std=core --target avr-atmega328p.json --examples --release
//! simavr -m atmega328p target/avr-atmega328p/release/examples/uart.elf
//! ```
use ruduino::legacy::serial;
#[no_mangle]
fn main() {
const CPU_FREQUENCY_HZ: u64 = 16_000_000;
const BAUD: u64 = 9600;
const UBRR: u16 = (CPU_FREQUENCY_HZ / 16 / BAUD - 1) as u16;
serial::Serial::new(UBRR)
.character_size(serial::CharacterSize::EightBits)
.mode(serial::Mode::Asynchronous)
.parity(serial::Parity::Disabled)
.stop_bits(serial::StopBits::OneBit)
.configure();
for &b in b"Hello, from Rust!\n" {
serial::transmit(b);
}
}
|
//! Terminal window context.
use std::error::Error;
use std::fs::File;
use std::io::Write;
use std::mem;
#[cfg(not(windows))]
use std::os::unix::io::{AsRawFd, RawFd};
use std::rc::Rc;
use std::sync::atomic::Ordering;
use std::sync::Arc;
use crossfont::Size;
use glutin::config::GetGlConfig;
use glutin::context::NotCurrentContext;
use glutin::display::GetGlDisplay;
#[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
use glutin::platform::x11::X11GlConfigExt;
use log::{error, info};
use raw_window_handle::HasRawDisplayHandle;
use serde_json as json;
#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
use wayland_client::EventQueue;
use winit::event::{Event as WinitEvent, Modifiers, WindowEvent};
use winit::event_loop::{EventLoopProxy, EventLoopWindowTarget};
use winit::window::WindowId;
use alacritty_config::SerdeReplace;
use alacritty_terminal::event::Event as TerminalEvent;
use alacritty_terminal::event_loop::{EventLoop as PtyEventLoop, Msg, Notifier};
use alacritty_terminal::grid::{Dimensions, Scroll};
use alacritty_terminal::index::Direction;
use alacritty_terminal::sync::FairMutex;
use alacritty_terminal::term::test::TermSize;
use alacritty_terminal::term::{Term, TermMode};
use alacritty_terminal::tty;
#[cfg(unix)]
use crate::cli::IpcConfig;
use crate::cli::WindowOptions;
use crate::clipboard::Clipboard;
use crate::config::UiConfig;
use crate::display::window::Window;
use crate::display::Display;
use crate::event::{ActionContext, Event, EventProxy, EventType, Mouse, SearchState, TouchPurpose};
use crate::logging::LOG_TARGET_IPC_CONFIG;
use crate::message_bar::MessageBuffer;
use crate::scheduler::Scheduler;
use crate::{input, renderer};
/// Event context for one individual Alacritty window.
pub struct WindowContext {
pub message_buffer: MessageBuffer,
pub display: Display,
event_queue: Vec<WinitEvent<'static, Event>>,
terminal: Arc<FairMutex<Term<EventProxy>>>,
cursor_blink_timed_out: bool,
modifiers: Modifiers,
search_state: SearchState,
notifier: Notifier,
font_size: Size,
mouse: Mouse,
touch: TouchPurpose,
dirty: bool,
occluded: bool,
preserve_title: bool,
#[cfg(not(windows))]
master_fd: RawFd,
#[cfg(not(windows))]
shell_pid: u32,
ipc_config: Vec<toml::Value>,
config: Rc<UiConfig>,
}
impl WindowContext {
/// Create initial window context that dous bootstrapping the graphics Api we're going to use.
pub fn initial(
event_loop: &EventLoopWindowTarget<Event>,
proxy: EventLoopProxy<Event>,
config: Rc<UiConfig>,
options: WindowOptions,
#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
wayland_event_queue: Option<&EventQueue>,
) -> Result<Self, Box<dyn Error>> {
let raw_display_handle = event_loop.raw_display_handle();
let mut identity = config.window.identity.clone();
options.window_identity.override_identity_config(&mut identity);
// Windows has different order of GL platform initialization compared to any other platform;
// it requires the window first.
#[cfg(windows)]
let window = Window::new(event_loop, &config, &identity)?;
#[cfg(windows)]
let raw_window_handle = Some(window.raw_window_handle());
#[cfg(not(windows))]
let raw_window_handle = None;
let gl_display =
renderer::platform::create_gl_display(raw_display_handle, raw_window_handle)?;
let gl_config = renderer::platform::pick_gl_config(&gl_display, raw_window_handle)?;
#[cfg(not(windows))]
let window = Window::new(
event_loop,
&config,
&identity,
#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
wayland_event_queue,
#[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
gl_config.x11_visual(),
)?;
// Create context.
let gl_context =
renderer::platform::create_gl_context(&gl_display, &gl_config, raw_window_handle)?;
Self::new(window, gl_context, config, options, proxy)
}
/// Create additional context with the graphics platform other windows are using.
pub fn additional(
&self,
event_loop: &EventLoopWindowTarget<Event>,
proxy: EventLoopProxy<Event>,
config: Rc<UiConfig>,
options: WindowOptions,
#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
wayland_event_queue: Option<&EventQueue>,
) -> Result<Self, Box<dyn Error>> {
// Get any window and take its GL config and display to build a new context.
let (gl_display, gl_config) = {
let gl_context = self.display.gl_context();
(gl_context.display(), gl_context.config())
};
let mut identity = config.window.identity.clone();
options.window_identity.override_identity_config(&mut identity);
let window = Window::new(
event_loop,
&config,
&identity,
#[cfg(all(feature = "wayland", not(any(target_os = "macos", windows))))]
wayland_event_queue,
#[cfg(all(feature = "x11", not(any(target_os = "macos", windows))))]
gl_config.x11_visual(),
)?;
// Create context.
let raw_window_handle = window.raw_window_handle();
let gl_context = renderer::platform::create_gl_context(
&gl_display,
&gl_config,
Some(raw_window_handle),
)?;
Self::new(window, gl_context, config, options, proxy)
}
/// Create a new terminal window context.
fn new(
window: Window,
context: NotCurrentContext,
config: Rc<UiConfig>,
options: WindowOptions,
proxy: EventLoopProxy<Event>,
) -> Result<Self, Box<dyn Error>> {
let mut pty_config = config.terminal_config.pty_config.clone();
options.terminal_options.override_pty_config(&mut pty_config);
let preserve_title = options.window_identity.title.is_some();
// Create a display.
//
// The display manages a window and can draw the terminal.
let display = Display::new(window, context, &config)?;
info!(
"PTY dimensions: {:?} x {:?}",
display.size_info.screen_lines(),
display.size_info.columns()
);
let event_proxy = EventProxy::new(proxy, display.window.id());
// Create the terminal.
//
// This object contains all of the state about what's being displayed. It's
// wrapped in a clonable mutex since both the I/O loop and display need to
// access it.
let terminal = Term::new(&config.terminal_config, &display.size_info, event_proxy.clone());
let terminal = Arc::new(FairMutex::new(terminal));
// Create the PTY.
//
// The PTY forks a process to run the shell on the slave side of the
// pseudoterminal. A file descriptor for the master side is retained for
// reading/writing to the shell.
let pty = tty::new(&pty_config, display.size_info.into(), display.window.id().into())?;
#[cfg(not(windows))]
let master_fd = pty.file().as_raw_fd();
#[cfg(not(windows))]
let shell_pid = pty.child().id();
// Create the pseudoterminal I/O loop.
//
// PTY I/O is ran on another thread as to not occupy cycles used by the
// renderer and input processing. Note that access to the terminal state is
// synchronized since the I/O loop updates the state, and the display
// consumes it periodically.
let event_loop = PtyEventLoop::new(
Arc::clone(&terminal),
event_proxy.clone(),
pty,
pty_config.hold,
config.debug.ref_test,
);
// The event loop channel allows write requests from the event processor
// to be sent to the pty loop and ultimately written to the pty.
let loop_tx = event_loop.channel();
// Kick off the I/O thread.
let _io_thread = event_loop.spawn();
// Start cursor blinking, in case `Focused` isn't sent on startup.
if config.terminal_config.cursor.style().blinking {
event_proxy.send_event(TerminalEvent::CursorBlinkingChange.into());
}
let font_size = config.font.size();
// Create context for the Alacritty window.
Ok(WindowContext {
preserve_title,
font_size,
terminal,
display,
#[cfg(not(windows))]
master_fd,
#[cfg(not(windows))]
shell_pid,
config,
notifier: Notifier(loop_tx),
cursor_blink_timed_out: Default::default(),
message_buffer: Default::default(),
search_state: Default::default(),
event_queue: Default::default(),
ipc_config: Default::default(),
modifiers: Default::default(),
mouse: Default::default(),
touch: Default::default(),
dirty: Default::default(),
occluded: Default::default(),
})
}
/// Update the terminal window to the latest config.
pub fn update_config(&mut self, new_config: Rc<UiConfig>) {
let old_config = mem::replace(&mut self.config, new_config);
// Apply ipc config if there are overrides.
if !self.ipc_config.is_empty() {
let mut config = (*self.config).clone();
// Apply each option, removing broken ones.
let mut i = 0;
while i < self.ipc_config.len() {
let option = &self.ipc_config[i];
match config.replace(option.clone()) {
Err(err) => {
error!(
target: LOG_TARGET_IPC_CONFIG,
"Unable to override option '{}': {}", option, err
);
self.ipc_config.swap_remove(i);
},
Ok(_) => i += 1,
}
}
self.config = Rc::new(config);
}
self.display.update_config(&self.config);
self.terminal.lock().update_config(&self.config.terminal_config);
// Reload cursor if its thickness has changed.
if (old_config.terminal_config.cursor.thickness()
- self.config.terminal_config.cursor.thickness())
.abs()
> f32::EPSILON
{
self.display.pending_update.set_cursor_dirty();
}
if old_config.font != self.config.font {
// Do not update font size if it has been changed at runtime.
if self.font_size == old_config.font.size() {
self.font_size = self.config.font.size();
}
let font = self.config.font.clone().with_size(self.font_size);
self.display.pending_update.set_font(font);
}
// Update display if either padding options or resize increments were changed.
let window_config = &old_config.window;
if window_config.padding(1.) != self.config.window.padding(1.)
|| window_config.dynamic_padding != self.config.window.dynamic_padding
|| window_config.resize_increments != self.config.window.resize_increments
{
self.display.pending_update.dirty = true;
}
// Update title on config reload according to the following table.
//
// │cli │ dynamic_title │ current_title == old_config ││ set_title │
// │ Y │ _ │ _ ││ N │
// │ N │ Y │ Y ││ Y │
// │ N │ Y │ N ││ N │
// │ N │ N │ _ ││ Y │
if !self.preserve_title
&& (!self.config.window.dynamic_title
|| self.display.window.title() == old_config.window.identity.title)
{
self.display.window.set_title(self.config.window.identity.title.clone());
}
let opaque = self.config.window_opacity() >= 1.;
// Disable shadows for transparent windows on macOS.
#[cfg(target_os = "macos")]
self.display.window.set_has_shadow(opaque);
#[cfg(target_os = "macos")]
self.display.window.set_option_as_alt(self.config.window.option_as_alt());
// Change opacity state.
self.display.window.set_transparent(!opaque);
// Update hint keys.
self.display.hint_state.update_alphabet(self.config.hints.alphabet());
// Update cursor blinking.
let event = Event::new(TerminalEvent::CursorBlinkingChange.into(), None);
self.event_queue.push(event.into());
self.dirty = true;
}
/// Update the IPC config overrides.
#[cfg(unix)]
pub fn update_ipc_config(&mut self, config: Rc<UiConfig>, ipc_config: IpcConfig) {
// Clear previous IPC errors.
self.message_buffer.remove_target(LOG_TARGET_IPC_CONFIG);
if ipc_config.reset {
self.ipc_config.clear();
} else {
for option in &ipc_config.options {
// Try and parse option as toml.
match toml::from_str(option) {
Ok(value) => self.ipc_config.push(value),
Err(err) => error!(
target: LOG_TARGET_IPC_CONFIG,
"'{}': Invalid IPC config value: {:?}", option, err
),
}
}
}
// Reload current config to pull new IPC config.
self.update_config(config);
}
/// Process events for this terminal window.
pub fn handle_event(
&mut self,
event_loop: &EventLoopWindowTarget<Event>,
event_proxy: &EventLoopProxy<Event>,
clipboard: &mut Clipboard,
scheduler: &mut Scheduler,
event: WinitEvent<'_, Event>,
) {
match event {
// Skip further event handling with no staged updates.
WinitEvent::RedrawEventsCleared if self.event_queue.is_empty() && !self.dirty => {
return;
},
// Continue to process all pending events.
WinitEvent::RedrawEventsCleared => (),
// Remap scale_factor change event to remove the lifetime.
WinitEvent::WindowEvent {
event: WindowEvent::ScaleFactorChanged { scale_factor, new_inner_size },
window_id,
} => {
let size = (new_inner_size.width, new_inner_size.height);
let event =
Event::new(EventType::ScaleFactorChanged(scale_factor, size), window_id);
self.event_queue.push(event.into());
return;
},
// Transmute to extend lifetime, which exists only for `ScaleFactorChanged` event.
// Since we remap that event to remove the lifetime, this is safe.
event => unsafe {
self.event_queue.push(mem::transmute(event));
return;
},
}
let mut terminal = self.terminal.lock();
let old_is_searching = self.search_state.history_index.is_some();
let context = ActionContext {
cursor_blink_timed_out: &mut self.cursor_blink_timed_out,
message_buffer: &mut self.message_buffer,
search_state: &mut self.search_state,
modifiers: &mut self.modifiers,
font_size: &mut self.font_size,
notifier: &mut self.notifier,
display: &mut self.display,
mouse: &mut self.mouse,
touch: &mut self.touch,
dirty: &mut self.dirty,
occluded: &mut self.occluded,
terminal: &mut terminal,
#[cfg(not(windows))]
master_fd: self.master_fd,
#[cfg(not(windows))]
shell_pid: self.shell_pid,
preserve_title: self.preserve_title,
config: &self.config,
event_proxy,
event_loop,
clipboard,
scheduler,
};
let mut processor = input::Processor::new(context);
for event in self.event_queue.drain(..) {
processor.handle_event(event);
}
// Process DisplayUpdate events.
if self.display.pending_update.dirty {
Self::submit_display_update(
&mut terminal,
&mut self.display,
&mut self.notifier,
&self.message_buffer,
&self.search_state,
old_is_searching,
&self.config,
);
self.dirty = true;
}
if self.dirty || self.mouse.hint_highlight_dirty {
self.dirty |= self.display.update_highlighted_hints(
&terminal,
&self.config,
&self.mouse,
self.modifiers.state(),
);
self.mouse.hint_highlight_dirty = false;
}
// Skip rendering until we get a new frame.
if !self.display.window.has_frame.load(Ordering::Relaxed) {
return;
}
if self.dirty && !self.occluded {
// Force the display to process any pending display update.
self.display.process_renderer_update();
self.dirty = false;
// Request immediate re-draw if visual bell animation is not finished yet.
if !self.display.visual_bell.completed() {
self.display.window.request_redraw();
}
// Redraw the window.
self.display.draw(
terminal,
scheduler,
&self.message_buffer,
&self.config,
&self.search_state,
);
}
}
/// ID of this terminal context.
pub fn id(&self) -> WindowId {
self.display.window.id()
}
/// Write the ref test results to the disk.
pub fn write_ref_test_results(&self) {
// Dump grid state.
let mut grid = self.terminal.lock().grid().clone();
grid.initialize_all();
grid.truncate();
let serialized_grid = json::to_string(&grid).expect("serialize grid");
let size_info = &self.display.size_info;
let size = TermSize::new(size_info.columns(), size_info.screen_lines());
let serialized_size = json::to_string(&size).expect("serialize size");
let serialized_config = format!("{{\"history_size\":{}}}", grid.history_size());
File::create("./grid.json")
.and_then(|mut f| f.write_all(serialized_grid.as_bytes()))
.expect("write grid.json");
File::create("./size.json")
.and_then(|mut f| f.write_all(serialized_size.as_bytes()))
.expect("write size.json");
File::create("./config.json")
.and_then(|mut f| f.write_all(serialized_config.as_bytes()))
.expect("write config.json");
}
/// Submit the pending changes to the `Display`.
fn submit_display_update(
terminal: &mut Term<EventProxy>,
display: &mut Display,
notifier: &mut Notifier,
message_buffer: &MessageBuffer,
search_state: &SearchState,
old_is_searching: bool,
config: &UiConfig,
) {
// Compute cursor positions before resize.
let num_lines = terminal.screen_lines();
let cursor_at_bottom = terminal.grid().cursor.point.line + 1 == num_lines;
let origin_at_bottom = if terminal.mode().contains(TermMode::VI) {
terminal.vi_mode_cursor.point.line == num_lines - 1
} else {
search_state.direction == Direction::Left
};
display.handle_update(
terminal,
notifier,
message_buffer,
search_state.history_index.is_some(),
config,
);
let new_is_searching = search_state.history_index.is_some();
if !old_is_searching && new_is_searching {
// Scroll on search start to make sure origin is visible with minimal viewport motion.
let display_offset = terminal.grid().display_offset();
if display_offset == 0 && cursor_at_bottom && !origin_at_bottom {
terminal.scroll_display(Scroll::Delta(1));
} else if display_offset != 0 && origin_at_bottom {
terminal.scroll_display(Scroll::Delta(-1));
}
}
}
}
impl Drop for WindowContext {
fn drop(&mut self) {
// Shutdown the terminal's PTY.
let _ = self.notifier.0.send(Msg::Shutdown);
}
}
|
cfg_if! {
if #[cfg(target_os = "linux")] {
mod linux;
pub type Manager = linux::SysFsManager;
pub type Iterator = linux::SysFsIterator;
pub type Device = linux::SysFsDevice;
} else if #[cfg(any(target_os = "macos", target_os = "ios"))] {
mod darwin;
pub type Manager = darwin::IoKitManager;
pub type Iterator = darwin::IoKitIterator;
pub type Device = darwin::IoKitDevice;
} else if #[cfg(target_os = "windows")] {
mod windows;
pub type Manager = windows::PowerManager;
pub type Iterator = windows::PowerIterator;
pub type Device = windows::PowerDevice;
} else if #[cfg(any(target_os = "dragonfly", target_os = "freebsd"))] {
mod freebsd;
pub type Manager = freebsd::IoCtlManager;
pub type Iterator = freebsd::IoCtlIterator;
pub type Device = freebsd::IoCtlDevice;
} else {
compile_error!("Support for this target OS is not implemented yet!\n \
You may want to create an issue: https://github.com/svartalf/rust-battery/issues/new");
}
}
pub mod traits;
|
/// Bitmap Graphics example.
///
/// This example uses the CPU to render a simple bitmap image to the screen.
use ctru::prelude::*;
use ctru::services::gfx::{Flush, Screen, Swap};
/// Ferris image taken from <https://rustacean.net> and scaled down to 320x240px.
/// To regenerate the data, you will need to install `imagemagick` and run this
/// command from the `examples` directory:
///
/// ```sh
/// magick assets/ferris.png -channel-fx "red<=>blue" -rotate 90 assets/ferris.rgb
/// ```
///
/// This creates an image appropriate for the default frame buffer format of
/// [`Bgr8`](ctru::services::gspgpu::FramebufferFormat::Bgr8)
/// and rotates the image 90° to account for the portrait mode screen.
static IMAGE: &[u8] = include_bytes!("assets/ferris.rgb");
fn main() {
ctru::use_panic_handler();
let gfx = Gfx::new().expect("Couldn't obtain GFX controller");
let mut hid = Hid::new().expect("Couldn't obtain HID controller");
let apt = Apt::new().expect("Couldn't obtain APT controller");
let _console = Console::new(gfx.top_screen.borrow_mut());
println!("\x1b[21;4HPress A to flip the image.");
println!("\x1b[29;16HPress Start to exit");
let mut bottom_screen = gfx.bottom_screen.borrow_mut();
// We don't need double buffering in this example.
// In this way we can draw our image only once on screen.
bottom_screen.set_double_buffering(false);
// Swapping buffers commits the change from the line above.
bottom_screen.swap_buffers();
// 3 bytes per pixel, we just want to reverse the pixels but not individual bytes
let flipped_image: Vec<_> = IMAGE.chunks(3).rev().flatten().copied().collect();
let mut image_bytes = IMAGE;
// We assume the image is the correct size already, so we drop width + height.
let frame_buffer = bottom_screen.raw_framebuffer();
// We copy the image to the framebuffer.
unsafe {
frame_buffer
.ptr
.copy_from(image_bytes.as_ptr(), image_bytes.len());
}
while apt.main_loop() {
hid.scan_input();
if hid.keys_down().contains(KeyPad::START) {
break;
}
if hid.keys_down().contains(KeyPad::A) {
image_bytes = if std::ptr::eq(image_bytes, IMAGE) {
&flipped_image[..]
} else {
IMAGE
};
let frame_buffer = bottom_screen.raw_framebuffer();
// We render the newly switched image to the framebuffer.
unsafe {
frame_buffer
.ptr
.copy_from(image_bytes.as_ptr(), image_bytes.len());
}
}
// Flush framebuffers. Since we're not using double buffering,
// this will render the pixels immediately
bottom_screen.flush_buffers();
gfx.wait_for_vblank();
}
}
|
pub use crate::{
Direction,
Edge,
EdgeIndex,
Edges,
Graph,
Node,
NodeIndex,
};
pub(crate) use crate::Next;
|
use crate::square::Square;
use yew::prelude::*;
#[derive(Clone, PartialEq, Properties)]
pub struct Props {
pub squares: [&'static str; 9],
pub onclick: Callback<usize>,
}
pub enum Msg {
HandleClick(usize),
}
pub struct Board {
link: ComponentLink<Self>,
props: Props,
}
impl Component for Board {
type Message = Msg;
type Properties = Props;
fn create(props: Self::Properties, link: ComponentLink<Self>) -> Self {
return Self { link, props };
}
fn update(&mut self, msg: Self::Message) -> bool {
match msg {
Msg::HandleClick(i) => self.props.onclick.emit(i),
}
true
}
fn change(&mut self, props: Self::Properties) -> bool {
if props != self.props {
self.props = props;
true
} else {
false
}
}
fn view(&self) -> Html {
let render_square = |i: usize| {
html! {<Square value={self.props.squares[i]} onclick={self.link.callback(move |_| Msg::HandleClick(i))} />}
};
html! {
<div>
<div class="board-row">
{render_square(0)}
{render_square(1)}
{render_square(2)}
</div>
<div class="board-row">
{render_square(3)}
{render_square(4)}
{render_square(5)}
</div>
<div class="board-row">
{render_square(6)}
{render_square(7)}
{render_square(8)}
</div>
</div>
}
}
}
|
use probe_rs::config::MemoryRegion;
use serde::{Deserialize, Serialize};
/// This describes a single chip model.
/// It can come in different configurations (memory, peripherals).
/// E.g. `nRF52832` is a `Chip` where `nRF52832_xxAA` and `nRF52832_xxBB` are its `Variant`s.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Chip {
/// This is the name of the chip in base form.
/// E.g. `nRF52832`.
pub name: String,
/// The name of the flash algorithm.
pub memory_map: Vec<MemoryRegion>,
pub flash_algorithms: Vec<String>,
}
|
pub fn demo() {
println!("{}", find_abc());
}
fn find_abc() -> u64 {
let n = 1000;
for c in 3..n-2 {
for b in 2..c {
if let Some(a) = a_given(b) {
if is_pythagorean(a, b, c) && a + b + c == n {
return a * b * c;
}
}
}
}
0
}
// Check whether a, b, and c are a pythagorean triple.
fn is_pythagorean(a: u64, b: u64, c: u64) -> bool {
a.pow(2) + b.pow(2) == c.pow(2)
}
// Given a + b + c = 1000 and a^2 + b^2 = c^2, a can be expressed in terms of b.
fn a_given(b: u64) -> Option<u64> {
use num::integer::div_rem;
use num::traits::ToPrimitive;
let b_i = b.to_i64().unwrap();
if b_i * 1000 == 500000 || b_i == 1000 {
return None;
}
let nominator = 1000 * b_i - 500000;
let denominator = b_i - 1000;
let (div, rem) = div_rem(nominator, denominator);
if rem == 0 && div > 0 { Some(div.to_u64().unwrap()) } else { None }
}
|
//! Definition of the `Option` (optional step) combinator
use {Future, Poll, Async};
impl<F, T, E> Future for Option<F> where F: Future<Item=T, Error=E> {
type Item = Option<T>;
type Error = E;
fn poll(&mut self) -> Poll<Option<T>, E> {
match *self {
None => Ok(Async::Ready(None)),
Some(ref mut x) => x.poll().map(|x| x.map(Some)),
}
}
}
|
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors.
//
// 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 alloc::boxed::Box;
use super::super::Kernel::HostSpace;
use super::super::task::*;
use super::super::qlib::common::*;
use super::super::qlib::linux_def::*;
use super::super::syscalls::syscalls::*;
use super::super::qlib::linux::time::*;
use super::super::threadmgr::task_syscall::*;
use super::super::threadmgr::thread::*;
use super::super::kernel::timer::timer::*;
use super::super::kernel::timer::*;
use super::sys_poll::TIMEOUT_PROCESS_TIME;
// The most significant 29 bits hold either a pid or a file descriptor.
pub fn PidOfClockID(c: i32) -> i32 {
return !(c >> 3)
}
// whichCPUClock returns one of CPUCLOCK_PERF, CPUCLOCK_VIRT, CPUCLOCK_SCHED or
// CLOCK_FD.
pub fn WhichCPUClock(c: i32) -> i32 {
return c & CPUCLOCK_CLOCK_MASK;
}
// isCPUClockPerThread returns true if the CPUCLOCK_PERTHREAD bit is set in the
// clock id.
pub fn IsCPUClockPerThread(c: i32) -> bool {
return c & CPUCLOCK_PERTHREAD_MASK != 0;
}
// isValidCPUClock returns checks that the cpu clock id is valid.
pub fn IsValidCPUClock(c: i32) -> bool {
// Bits 0, 1, and 2 cannot all be set.
if c & 7 == 7 {
return false;
}
if WhichCPUClock(c) >= CPUCLOCK_MAX {
return false;
}
return true;
}
pub fn TargetThread(task: &Task, c: i32) -> Option<Thread> {
let pid = PidOfClockID(c);
if c == 0 {
return Some(task.Thread());
}
return task.Thread().PIDNamespace().TaskWithID(pid)
}
pub fn GetClock(task: &Task, clockId: i32) -> Result<Clock> {
if clockId < 0 {
if !IsValidCPUClock(clockId) {
return Err(Error::SysError(SysErr::EINVAL));
}
let targetThread = match TargetThread(task, clockId) {
None => return Err(Error::SysError(SysErr::EINVAL)),
Some(t) => t,
};
if IsCPUClockPerThread(clockId) {
let target = targetThread;
match WhichCPUClock(clockId) {
CPUCLOCK_VIRT => return Ok(target.UserCPUClock()),
CPUCLOCK_PROF | CPUCLOCK_SCHED => {
// CPUCLOCK_SCHED is approximated by CPUCLOCK_PROF.
return Ok(target.CPUClock());
}
_ => return Err(Error::SysError(SysErr::EINVAL))
}
} else {
let target = targetThread.ThreadGroup();
match WhichCPUClock(clockId) {
CPUCLOCK_VIRT => return Ok(target.UserCPUClock()),
CPUCLOCK_PROF |
CPUCLOCK_SCHED => {
// CPUCLOCK_SCHED is approximated by CPUCLOCK_PROF.
return Ok(target.CPUClock());
}
_ => return Err(Error::SysError(SysErr::EINVAL))
}
}
}
match clockId {
CLOCK_REALTIME |
CLOCK_REALTIME_COARSE=> return Ok(REALTIME_CLOCK.clone()),
CLOCK_MONOTONIC |
CLOCK_MONOTONIC_COARSE |
CLOCK_MONOTONIC_RAW |
CLOCK_BOOTTIME => return Ok(MONOTONIC_CLOCK.clone()),
CLOCK_PROCESS_CPUTIME_ID => return Ok(task.Thread().ThreadGroup().CPUClock()),
CLOCK_THREAD_CPUTIME_ID => return Ok(task.Thread().CPUClock()),
_ => return Err(Error::SysError(SysErr::EINVAL)),
}
}
pub fn SysClockGetRes(task: &mut Task, args: &SyscallArguments) -> Result<i64> {
let clockID = args.arg0 as i32;
let addr = args.arg1 as u64;
GetClock(task, clockID)?;
if addr == 0 {
return Ok(0);
}
/*let ts : &mut Timespec = task.GetTypeMut(addr)?;
*ts = Timespec {
tv_sec: 0,
tv_nsec: 1,
};*/
let ts = Timespec {
tv_sec: 0,
tv_nsec: 1,
};
task.CopyOutObj(&ts, addr)?;
return Ok(0)
}
pub fn SysClockGetTime(task: &mut Task, args: &SyscallArguments) -> Result<i64> {
let clockID = args.arg0 as i32;
let addr = args.arg1 as u64;
//let clockID = 1;
let clock = GetClock(task, clockID)?;
//let ts : &mut Timespec = task.GetTypeMut(addr)?;
//*ts = clock.Now().Timespec();
let ts = clock.Now().Timespec();
task.CopyOutObj(&ts, addr)?;
//info!("SysClockGetTime: output is {:?}", ts);
return Ok(0);
}
pub fn SysClockSettime(_task: &mut Task, _args: &SyscallArguments) -> Result<i64> {
return Err(Error::SysError(SysErr::EPERM))
}
pub fn SysTime(task: &mut Task, args: &SyscallArguments) -> Result<i64> {
let addr = args.arg0 as u64;
let now = REALTIME_CLOCK.Now().0 / 1_000_000_000;
if addr == 0 {
return Ok(now)
}
//let ptr : &mut i64 = task.GetTypeMut(addr)?;
//*ptr = now;
task.CopyOutObj(&now, addr)?;
return Ok(0)
}
pub fn SysNanoSleep(task: &mut Task, args: &SyscallArguments) -> Result<i64> {
let req = args.arg0 as u64;
let rem = args.arg1 as u64;
let ts : Timespec = task.CopyInObj(req)?;
if !ts.IsValid() {
return Err(Error::SysError(SysErr::EINVAL));
}
let dur = ts.ToNs()?;
if dur < TIMEOUT_PROCESS_TIME {
return Ok(0)
}
let timer = task.blocker.GetTimer(CLOCK_MONOTONIC);
return NansleepFor(task, timer, dur, rem)
}
// SysClockNanosleep implements linux syscall clock_nanosleep(2).
pub fn SysClockNanosleep(task: &mut Task, args: &SyscallArguments) -> Result<i64> {
let clockID = args.arg0 as i32;
let flags = args.arg1 as i32;
let addr = args.arg2 as u64;
let rem = args.arg3 as u64;
let ts : Timespec = task.CopyInObj(addr)?;
if !ts.IsValid() {
return Err(Error::SysError(SysErr::EINVAL));
}
let mut dur = ts.ToNs()?;
// Only allow clock constants also allowed by Linux.
if clockID >= 0 {
if clockID != CLOCK_REALTIME &&
clockID != CLOCK_MONOTONIC &&
clockID != CLOCK_PROCESS_CPUTIME_ID {
return Err(Error::SysError(SysErr::EINVAL));
}
}
let clock = GetClock(task, clockID)?;
if flags & TIMER_ABSTIME != 0 {
let now = clock.Now();
dur = dur - now.0;
}
if dur < TIMEOUT_PROCESS_TIME {
return Ok(0)
}
let timer = task.blocker.GetTimerWithClock(&clock);
return NansleepFor(task, timer, dur, rem)
}
pub fn NansleepFor(task: &mut Task, timer: Timer, dur: i64, rem: u64) -> Result<i64> {
let (remaining, res) = task.blocker.BlockWithTimeout(timer, false, Some(dur));
if rem != 0 && remaining != 0 {
let timeleft = Timespec::FromNs(remaining);
//*task.GetTypeMut(rem)? = timeleft;
task.CopyOutObj(&timeleft, rem)?;
}
match res {
Err(Error::ErrInterrupted) => {
let b = Box::new(NanosleepRestartBlock {
dur: remaining,
rem: rem,
});
task.SetSyscallRestartBlock(b);
return Err(Error::SysError(SysErr::ERESTART_RESTARTBLOCK));
}
Err(Error::SysError(SysErr::ETIMEDOUT)) => {
return Ok(0)
}
Err(e) => {
return Err(e)
}
Ok(()) => {
panic!("NansleepFor:: impossible to get Ok result")
}
}
}
pub struct NanosleepRestartBlock {
pub dur: Duration,
pub rem: u64,
}
impl SyscallRestartBlock for NanosleepRestartBlock {
fn Restart(&self, task: &mut Task) -> Result<i64> {
if self.rem != 0 {
//let ts : &mut Timespec = task.GetTypeMut(self.rem)?;
//*ts = Timespec::FromNs(self.dur);
let ts = Timespec::FromNs(self.dur);
task.CopyOutObj(&ts, self.rem)?;
}
return Err(Error::SysError(SysErr::EINTR));
//return NansleepFor(task, self.dur, self.rem)
}
}
pub fn SysGettimeofday(task: &mut Task, args: &SyscallArguments) -> Result<i64> {
let tvAddr = args.arg0 as u64;
let tzAddr = args.arg1 as u64;
let mut timeV = Timeval::default();
let mut timezone : [u32; 2] = [0; 2];
let ret = HostSpace::GetTimeOfDay(&mut timeV as * mut _ as u64, &mut timezone[0] as * mut _ as u64);
if ret < 0 {
return Err(Error::SysError(-ret as i32));
}
if tvAddr != 0 {
//let tv : &mut Timeval = task.GetTypeMut(tvAddr)?;
//*tv = timeV;
task.CopyOutObj(&timeV, tvAddr)?;
}
if tzAddr != 0 {
//let tz : &mut [u32; 2] = task.GetTypeMut(tzAddr)?;
//*tz = timezone;
task.CopyOutObj(&timezone, tzAddr)?;
}
return Ok(0)
} |
// Various experiments with references and mutability.
//
// Lessons to be learned:
// - A value won't be mutated as long as its bound immutably.
// - When a value is moved, its old binding ^^^^^ goes away.
fn main() {
// Not allowed: mutating an immutable variable:
//
// let v = Vec::<i8>::new();
// v.push(3);
//
// Allowed: moving from an immutable to a mutable
// variable in order to mutate.
let a = Vec::<i8>::new();
let mut b = a;
b.push(13);
println!("b: {:?}", b);
// Even though v is declared as immutable, it can be
// mutated by a different function if we relinquish
// ownership of it.
let v = Vec::<i8>::new();
foo(v);
// Doesn't work, because we don't implement MutableFoo for MyFoo:
//
// let mut x = MyFoo(17);
// bar(x);
//
// Works, because &mut MyFoo implements MutableFoo.
bar(&mut MyFoo(17));
}
fn foo(v: Vec<i8>) {
// If an argument is immutable, you can mutate it by
// moving it first.
let mut u = v;
u.push(3);
println!("foo: {:?}", u);
}
fn bar<T: MutableFoo>(mut x: T) {
x.mutate(13)
}
trait MutableFoo {
fn mutate(&mut self, i: u8);
}
struct MyFoo(u8);
impl<'a> MutableFoo for &'a mut MyFoo {
fn mutate(&mut self, i: u8) {
// Self is a &mut &'a mut MyFoo.
// Note: if we had &self as the argument, then
// we wouldn't be able to mutate *self even though
// it's supposedly mut.
self.0 = i;
}
}
|
fn main() {
let mut n = 0;
let mut step = 2;
let mut times_in_step = 0;
let mut sum = 0;
let end = 1001_i32.pow(2);
println!("{}", end);
for i in 1..(end + 1) {
if n == 0 {
n = step;
times_in_step += 1;
if (times_in_step) == 4 {
times_in_step = 0;
step += 2;
}
sum += i;
}
n -= 1;
}
println!("{}", sum);
}
|
// Copyright 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.
// run-pass
#![allow(deprecated)]
// ignore-android since the dynamic linker sets a SIGPIPE handler (to do
// a crash report) so inheritance is moot on the entire platform
// libstd ignores SIGPIPE, and other libraries may set signal masks.
// Make sure that these behaviors don't get inherited to children
// spawned via std::process, since they're needed for traditional UNIX
// filter behavior. This test checks that `yes | head` terminates
// (instead of running forever), and that it does not print an error
// message about a broken pipe.
// ignore-cloudabi no subprocesses support
// ignore-emscripten no threads support
use std::process;
use std::thread;
#[cfg(unix)]
fn main() {
// Just in case `yes` doesn't check for EPIPE...
thread::spawn(|| {
thread::sleep_ms(5000);
process::exit(1);
});
let output = process::Command::new("sh").arg("-c").arg("yes | head").output().unwrap();
assert!(output.status.success());
assert!(output.stderr.len() == 0);
}
#[cfg(not(unix))]
fn main() {
// Not worried about signal masks on other platforms
}
|
pub(crate) mod geometry;
use super::{
acceleration_structure_update,
clustering,
light_binning,
prepass,
rt_shadows,
sharpen,
ssao,
taa,
};
pub(crate) mod desktop_renderer;
pub(crate) mod occlusion;
|
use std::u64;
use std::{fs, str::FromStr};
static FILENAME: &str = "inputs/inputday13";
#[derive(Debug, Copy, Clone)]
enum Bus {
OOS,
ID(u64),
}
#[derive(Debug)]
enum BusParseError {}
impl FromStr for Bus {
type Err = BusParseError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
"x" => return Ok(Bus::OOS),
_ => return Ok(Bus::ID(s.parse().unwrap())),
}
}
}
pub fn solve() {
let input = fs::read_to_string(FILENAME).unwrap();
let (timestamp, buses) = parse_input(&input);
println!("Answer to day 13 part 1 is {}", part1(timestamp, &buses));
println!("Answer to day 13 part 2 is {}", part2(&buses));
}
fn parse_input(input: &str) -> (u64, Vec<Bus>) {
let (timestamp_str, buses_str) = match input.lines().collect::<Vec<&str>>().as_slice() {
&[timestamp, buses, ..] => (timestamp, buses),
_ => unreachable!(),
};
(
timestamp_str.parse().unwrap(),
buses_str
.split(',')
.map(|x| x.parse::<Bus>().unwrap())
.collect(),
)
}
fn part1(arrival: u64, buses: &[Bus]) -> u64 {
let mut min_wait = u64::MAX;
let mut best_bus: Option<Bus> = None;
for bus in buses {
match &bus {
Bus::OOS => {}
Bus::ID(interval) => {
let wait_time = interval - arrival % interval;
if wait_time < min_wait {
min_wait = wait_time;
best_bus = Some(*bus);
}
}
}
}
match best_bus {
Some(Bus::ID(interval)) => interval * min_wait,
_ => unreachable!(),
}
}
fn part2(buses: &[Bus]) -> u64 {
let mut lcm: u64 = 1;
let mut solution = 0;
for (i, bus) in buses.iter().enumerate() {
match bus {
Bus::OOS => {}
Bus::ID(interval) => {
for time in (solution..u64::MAX).step_by(lcm as usize) {
if (time as usize + i) % *interval as usize == 0 {
solution = time;
lcm *= interval;
break;
}
}
}
}
}
solution
}
#[cfg(test)]
mod tests {
use super::{parse_input, part1, part2};
static INPUT: &str = "939
7,13,x,x,59,x,31,19";
#[test]
fn example_part1() {
let (arrival, buses) = parse_input(&INPUT);
assert_eq!(part1(arrival, &buses), 295);
}
#[test]
fn example_part2() {
let (_, buses) = parse_input(&INPUT);
assert_eq!(part2(&buses), 1068781);
}
}
|
pub struct Solution;
impl Solution {
pub fn longest_increasing_path(matrix: Vec<Vec<i32>>) -> i32 {
if matrix.len() == 0 || matrix[0].len() == 0 {
return 0;
}
Solver::new(matrix).solve()
}
}
struct Solver {
matrix: Vec<Vec<i32>>,
memo: Vec<Vec<i32>>,
}
const TODO: i32 = -1;
impl Solver {
fn new(matrix: Vec<Vec<i32>>) -> Self {
let memo = vec![vec![TODO; matrix[0].len()]; matrix.len()];
Solver { matrix, memo }
}
fn solve(&mut self) -> i32 {
let mut max = 0;
for i in 0..self.matrix.len() {
for j in 0..self.matrix[i].len() {
max = max.max(self.dfs(i, j));
}
}
max
}
fn dfs(&mut self, i: usize, j: usize) -> i32 {
if self.memo[i][j] == TODO {
self.memo[i][j] = 1 + [
if i > 0 && self.matrix[i - 1][j] > self.matrix[i][j] {
self.dfs(i - 1, j)
} else {
0
},
if j > 0 && self.matrix[i][j - 1] > self.matrix[i][j] {
self.dfs(i, j - 1)
} else {
0
},
if i + 1 < self.matrix.len() && self.matrix[i + 1][j] > self.matrix[i][j] {
self.dfs(i + 1, j)
} else {
0
},
if j + 1 < self.matrix[i].len() && self.matrix[i][j + 1] > self.matrix[i][j] {
self.dfs(i, j + 1)
} else {
0
},
]
.into_iter()
.max()
.unwrap();
}
self.memo[i][j]
}
}
#[test]
fn test0329() {
fn case(matrix: Vec<Vec<i32>>, want: i32) {
let got = Solution::longest_increasing_path(matrix);
assert_eq!(got, want);
}
case(vec![vec![9, 9, 4], vec![6, 6, 8], vec![2, 1, 1]], 4);
case(vec![vec![3, 4, 5], vec![3, 2, 6], vec![2, 2, 1]], 4);
case(vec![vec![0], vec![1], vec![5], vec![5]], 3);
}
|
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
mod test_helpers;
mod tests;
use crate::test_helpers::TextFieldWrapper;
use crate::tests::*;
use failure::{Error, ResultExt};
use fidl_fuchsia_ui_text as txt;
use fidl_fuchsia_ui_text_testing as txt_testing;
use fuchsia_async::{self as fasync, DurationExt};
use fuchsia_component::server::ServiceFs;
use fuchsia_zircon::DurationNum;
use futures::future::FutureObj;
use futures::prelude::*;
use lazy_static::lazy_static;
lazy_static! {
pub static ref TEST_TIMEOUT: fasync::Time = 10.seconds().after_now();
}
macro_rules! text_field_tests {
($list:ident: $($test_fn:ident),*) => {
static $list: &'static [(&'static str, fn(&mut TextFieldWrapper) -> FutureObj<Result<(), Error>>)] = &[
$( (stringify!($test_fn), move |wrapper| {
FutureObj::new(Box::new($test_fn(wrapper)))
}) ),*
];
};
}
text_field_tests! {
TEST_FNS:
test_noop_causes_state_update,
test_simple_content_request,
test_multibyte_unicode_content_request,
test_multiple_edit_moves_points,
test_invalid_delete_off_end_of_field
}
fn main() -> Result<(), Error> {
let mut executor = fuchsia_async::Executor::new()
.context("Creating fuchsia_async executor for text tests failed")?;
let mut fs = ServiceFs::new();
fs.dir("svc").add_fidl_service(bind_text_tester);
fs.take_and_serve_directory_handle()?;
executor.run_singlethreaded(fs.collect::<()>());
Ok(())
}
fn bind_text_tester(mut stream: txt_testing::TextFieldTestSuiteRequestStream) {
fasync::spawn(async move {
while let Some(msg) =
stream.try_next().await.expect("error reading value from IME service request stream")
{
match msg {
txt_testing::TextFieldTestSuiteRequest::RunTest { field, test_id, responder } => {
let res = run_test(
field.into_proxy().expect("failed to convert ClientEnd to proxy"),
test_id
).await;
let (ok, message) = match res {
Ok(()) => (true, format!("passed")),
Err(e) => (false, e),
};
responder.send(ok, &message).expect("failed to send response to RunTest");
}
txt_testing::TextFieldTestSuiteRequest::ListTests { responder } => {
responder
.send(&mut list_tests().iter_mut())
.expect("failed to send response to ListTests");
}
}
}
});
}
async fn run_test(text_field: txt::TextFieldProxy, test_id: u64) -> Result<(), String> {
let mut wrapper = TextFieldWrapper::new(text_field).await.map_err(|e| format!("{}", e))?;
let res = match TEST_FNS.get(test_id as usize) {
Some((_test_name, test_fn)) => test_fn(&mut wrapper).await,
None => return Err(format!("unknown test id: {}", test_id)),
};
res.map_err(|e| format!("{}", e))
}
fn list_tests() -> Vec<txt_testing::TestInfo> {
TEST_FNS
.iter()
.enumerate()
.map(|(i, (test_name, _test_fn))| txt_testing::TestInfo {
id: i as u64,
name: test_name.to_string(),
})
.collect()
}
|
//! A simple game loop implementation.
#![warn(
clippy::all,
clippy::cargo,
clippy::clone_on_ref_ptr,
clippy::indexing_slicing,
clippy::mem_forget,
clippy::missing_docs_in_private_items,
clippy::multiple_inherent_impl,
clippy::nursery,
clippy::option_unwrap_used,
clippy::pedantic,
clippy::print_stdout,
clippy::result_unwrap_used,
clippy::unimplemented,
clippy::wildcard_enum_match_arm,
clippy::wrong_pub_self_convention,
clippy::dbg_macro,
clippy::use_debug,
deprecated_in_future,
future_incompatible,
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
nonstandard_style,
rust_2018_idioms,
rustdoc,
trivial_casts,
trivial_numeric_casts,
unreachable_pub,
unsafe_code,
unused_import_braces,
unused_lifetimes,
unused_qualifications,
unused_results,
variant_size_differences,
warnings
)]
use std::fmt::Debug;
use std::time::{Duration, Instant};
/// Convenience constant, to make the rest of the code a bit easier to parse.
const NANOSECONDS_PER_SECOND: u32 = 1_000_000_000;
/// The _internal_ state of the [`GameLoop`].
///
/// Whenever [`tick()`] is called, the [`State`] goes from [`Idle`], to
/// [`Updating`], [`Rendering`], and finally back to `Idle`.
///
/// This is an internal representation, because the state can never be anything
/// other than `Idle` before and after running `tick()`.
///
#[derive(Debug, PartialEq, Eq)]
enum State {
/// The `Idle` state represents the state the [`GameLoop`] is in right
/// before calling [`tick()`], and after that method is completed.
///
/// Meaning, when inspecting the state of the GameLoop outside of that
/// method, it should never be anything other than `Idle`.
Idle,
/// The `Updating` state represents the state of the [`GameLoop`] when it is
/// being updated by calling [`Updater#update()`].
Updating,
/// The `Rendering` state represents the state of the [`GameLoop`] when it
/// is being updated by calling [`Renderer#render()`].
Rendering,
}
/// The trait responsible for _updating_ the state of the game world.
///
/// It requires a single method [`update()`] to be implemented.
///
/// This trait goes hand-in-hand with the trait to render the state of the game
/// world: [`Renderer`].
///
pub trait Updater: Debug {
/// The error type returned when updating fails.
type Error: std::error::Error;
/// What this method does is up to the implementer, but by convention, it
/// should focus on updating the _state_ of the game world, not the _visual
/// representation_.
///
/// If this method returns an error, the game loop will bubble up that error
/// to the callee of [`GameLoop::tick`].
fn update(&mut self) -> Result<(), Self::Error>;
}
/// The trait responsible for _rendering_ the state of the game world.
///
/// It requires a single method [`render()`] to be implemented.
///
/// This trait goes hand-in-hand with the trait to update the state of the game
/// world: [`Updater`].
///
pub trait Renderer: Debug {
/// The error type returned when rendering fails.
type Error: std::error::Error;
/// What this method does is up to the implementer, but by convention, it
/// should focus on updating the _visual representation_ of the game world,
/// not the _state_.
///
/// The `remainder` represents the position (0.0 >= remainder < 1.0) between
/// the last game state update and the next update. This value can be used
/// to interpolate the current game state and render the state accordingly.
///
/// If this method returns an error, the game loop will bubble up that error
/// to the callee of [`GameLoop::tick`].
fn render(&mut self, remainder: f32) -> Result<(), Self::Error>;
}
/// The main game loop.
///
/// It takes ownership of the game state, and calls its `update` and `render`
/// methods when needed.
///
/// The loop does not advance by itself, you are still required to call `tick`
/// to execute the next game tick.
///
/// You can choose to update the game as fast as possible by calling `tick` in
/// an infinite loop, limit the max frames by sleeping between ticks, or
/// manually advance the game state by calling `tick` whenever you need to, for
/// example when running tests.
#[derive(Debug)]
pub struct GameLoop<T>
where
T: Updater + Renderer + Debug,
{
/// The state of the game.
state: T,
/// The minimum amount of time that needs to pass before we trigger a game
/// state update. This is a fixed delta, to give us a predictable game
/// simulation, and decouple our simulation from the capabilities of the
/// host in terms of rendering performance.
///
/// Think of it like this: after every frame render, we've given ourselves
/// some time to perform game state updates. We'll perform those updates at
/// the interval defined here, and we'll continue those updates for as long
/// as we don't have to render the next frame.
update_interval: Duration,
/// Data associated with the previous tick run.
///
/// Based on this data, the game loop determines how many updates need to
/// happen before the next render is triggered.
previous_tick: Option<Tick>,
/// `accumulated_time` is the total time available for the update handler to
/// run. After each update step, we subtract the `update_interval` from the
/// remaining `accumulated_time`.
///
/// When the accumulated time falls below the update interval value, it
/// means there is no more room for another game update, so we render
/// another frame to the screen, informing the renderer how much
/// (normalised) residue accumulated time is left, to allow the renderer to
/// interpolate the expected game state between the last and next update
/// call.
///
/// Say for example that we moved to position X = 10 on the last update, and
/// the following is true:
///
/// * we move 2X per update
///
/// * we update the game state 100 times per second (so we need 10
/// milliseconds per update)
///
/// * our `accumulated_time` has 5 milliseconds remaining (remember, we
/// _need_ 10 milliseconds to update the game state, so the last 5
/// milliseconds are kept around)
///
/// We now know that if we had 10 milliseconds remaining, the character
/// would've moved to X = 12. But since we only had 5 milliseconds left, the
/// character position wasn't updated in the last cycle. However, as soon as
/// we add 5 more milliseconds to our accumulator in the next cycle, it will
/// move to that X = 12 position.
///
/// Given this, the normalized accumulated value will be `0.5`, since we
/// have half of the time needed to perform another game state update.
///
/// So, instead of rendering our character as "stopped" on X = 10, we'll
/// instead interpolate that we were at X = 10 in the last update, the
/// character moves at 2X per update, so we multiply that value by `0.5` to
/// guess that even though the game state doesn't reflect this yet, the
/// character is currently at X = 11, and render it in that position
/// accordingly.
///
/// If, during the next update cycle, the character is moved to X = 12, we
/// can render the character there, and we've had three frames, the first
/// one rendering the character at position 10, the second frame at 11,
/// and the third at 12.
///
/// If, however, it turns out the player instead instructed the character to
/// stop after the first frame (when the game still had the character
/// positioned at X = 10), we'll have to move the character back on the
/// screen. This will cause a (mostly unnoticeable) "stutter", but the fact
/// is that most of the time, the character would have ended up at X = 12,
/// making it a worthy trade off to have a once-every-while bad
/// interpolation, instead of constantly stuttering images due to not
/// interpolating the remaining accumulated update time every cycle.
///
/// TODO: this should probably be converted to raw numbers at some point,
/// for performance reasons, but not until we measure the results. For now
/// this is fine.
accumulated_time: Duration,
}
/// Represents a single "tick" of the game loop.
#[derive(Debug)]
struct Tick {
/// Whenever a new "tick" is started, this field is set to the current
/// timestamp. An [`Instant`] is used to record the time, so it can only be
/// used to measure the duration between two ticks, not to record _when_ a
/// tick was started.
started_at: Instant,
/// The state that the tick is currently in.
state: State,
}
/// The error state of the game loop.
///
/// If either the `Updater::update` or `Renderer::render` method returns an
/// error when calling `tick`, it is wrapped into this game loop error type, and
/// returned.
#[derive(Debug)]
pub enum Error<T>
where
T: Updater + Renderer,
{
/// The update call produced an error.
Update(<T as Updater>::Error),
/// The render call produced an error.
Render(<T as Renderer>::Error),
}
impl Default for Tick {
fn default() -> Self {
Self {
started_at: Instant::now(),
state: State::Idle,
}
}
}
impl<T> GameLoop<T>
where
T: Updater + Renderer,
{
/// Create a new game loop with the given state.
pub fn new(state: T) -> Self {
// Sets the game state update to a fixed interval. This is what
// decouples your game update behaviour from the speed at which the game
// is rendered to the screen (FPS).
//
// # See Also
//
// * https://www.koonsolo.com/news/dewitters-gameloop/
// * https://gafferongames.com/post/fix_your_timestep/
// * http://gameprogrammingpatterns.com/game-loop.html
//
// TODO: move this into a configuration struct, or add a builder.
let updates_per_second = 100;
Self {
state,
previous_tick: None,
accumulated_time: Duration::default(),
update_interval: Duration::from_nanos(
u64::from(NANOSECONDS_PER_SECOND) / updates_per_second,
),
}
}
/// A tick is a single "step" forward for the entire state of the game.
///
/// Depending on the game state, calling this method will call the
/// `Updater#update` method zero, one or multiple times, and will always
/// call the `Renderer#render` method exactly once.
pub fn tick(&mut self) -> Result<(), Error<T>> {
use State::*;
// Create a new tick instance, to keep track of this tick's progress.
let mut tick = Tick::default();
debug_assert_eq!(tick.state, Idle);
// We'll continue to drive the game state forward, until we've completed
// all the work for this tick.
loop {
match tick.state {
// The tick is about to start running, so we check how long ago
// the last tick ran, to determine the speed of the game loop,
// and set the amount of times the updater should run to catch
// up.
Idle => {
if let Some(tick) = &self.previous_tick {
let previous_tick_duration = tick.started_at.elapsed();
self.accumulated_time += previous_tick_duration;
}
tick.state = Updating;
}
// If enough time has accumulated since the last tick, run the
// updater, until it has drained the accumulated time.
//
// The required accumulated time depends on the configured
// updates per second. If set to 100, we have a budget of 10
// milliseconds per update, so `accumulated_time` needs to be 10
// milliseconds or more to perform another update.
//
// After updating the game, we keep the [`GameState`] set to
// `Updating`, and we try to update the game again, until we run
// out of `accumuated_time`.
Updating if self.accumulated_time >= self.update_interval => {
self.state.update().map_err(Error::Update)?;
self.accumulated_time -= self.update_interval;
}
// Once we run out of time to update the game state, move on to
// rendering.
Updating => {
tick.state = Rendering;
}
// Call the renderer.
//
// While the `accumulated_time` budget wasn't large enough to
// perform another game update, chances are it wasn't exactly
// zero once we were done updating the game. This means we're
// about to render the game in-between two game updates.
//
// We pass the "remainder" (a value between 0.0 and 1.0) between
// the last update, and the expected next update to the
// [`Renderer`], to allow for visual interpolation of the game
// state.
Rendering => {
self.state.render(self.remainder()).map_err(Error::Render)?;
self.previous_tick = Some(tick);
// We're done with this tick, exit the method.
return Ok(());
}
}
}
}
/// A helper method to get the remainder stored in the game loop.
///
/// This is meant to aid in unit testing the state of the game by inspecting
/// how much time is still stored as the remainder of the game loop.
pub fn remainder(&self) -> f32 {
let remainder = as_secs_f32(self.accumulated_time) / as_secs_f32(self.update_interval);
debug_assert!((remainder >= 0.0) && (remainder < 1.0));
remainder
}
/// A helper method to inspect the game state.
///
/// This is meant to aid in unit testing the state of the game by allowing
/// inspection (or mutation) of the game state after performing a game tick.
pub fn state(&mut self) -> &mut T {
&mut self.state
}
/// A helper method to increase the accumulated time by a fixed amount.
///
/// This is meant to aid in unit testing the state of the game by forcing
/// the updater to run a fixed amount of times when triggering another game
/// tick.
pub fn add_accumulated_time(&mut self, add: Duration) {
self.accumulated_time += add;
}
}
/// Convert a duration to fractional seconds.
///
/// See: <https://github.com/rust-lang/rust/pull/62756>
#[allow(clippy::cast_precision_loss)]
fn as_secs_f32(duration: Duration) -> f32 {
(duration.as_secs() as f32) + (duration.subsec_nanos() as f32) / (NANOSECONDS_PER_SECOND as f32)
}
#[cfg(test)]
#[allow(clippy::result_unwrap_used)]
mod tests {
use super::*;
#[derive(Debug, Default)]
struct State {
update: usize,
render: usize,
}
impl Updater for State {
type Error = std::io::Error;
fn update(&mut self) -> Result<(), Self::Error> {
self.update += 1;
Ok(())
}
}
impl Renderer for State {
type Error = std::io::Error;
fn render(&mut self, _remainder: f32) -> Result<(), Self::Error> {
self.render += 1;
Ok(())
}
}
#[test]
fn test_game_loop_state() {
let mut game_loop = GameLoop::new(State {
update: 1,
render: 2,
});
assert_eq!(game_loop.state().update, 1);
assert_eq!(game_loop.state().render, 2);
}
#[test]
fn test_game_loop_tick_drains_accumulated_time() {
let mut game_loop = GameLoop::new(State::default());
// we run at 100 FPS, so update the game state every 10ms
game_loop.add_accumulated_time(Duration::from_millis(10));
game_loop.tick().unwrap();
assert_eq!(game_loop.state().update, 1);
// At the last tick, the updater ran once, and drained all accumulated
// time. We add 6 more milliseconds, bringing the total to 6, so no new
// update is triggered.
game_loop.add_accumulated_time(Duration::from_millis(6));
game_loop.tick().unwrap();
assert_eq!(game_loop.state().update, 1);
// We still have 6 milliseconds accumulated, by adding 16 more, we end
// up with 22, so the updater runs twice, leaving 2 accumulated
// milliseconds.
game_loop.add_accumulated_time(Duration::from_millis(16));
game_loop.tick().unwrap();
assert_eq!(game_loop.state().update, 3);
}
#[test]
#[allow(clippy::float_cmp)]
fn test_game_loop_remainder() {
let mut game_loop = GameLoop::new(State::default());
game_loop.add_accumulated_time(Duration::from_millis(9));
assert_eq!(game_loop.remainder(), 0.9);
}
#[test]
#[should_panic]
fn test_game_loop_invalid_remainder() {
let mut game_loop = GameLoop::new(State::default());
game_loop.add_accumulated_time(Duration::from_millis(10));
// The remainder has to be 0.0 or higher, and lower than 1.0 to be
// valid. The only way this invalid state can be triggered is if the
// `add_accumulated_time` is used to manually add 10 or more
// milliseconds, without using `tick` to consume that accumulated time
// down to below 10.
let _ = game_loop.remainder();
}
#[test]
fn test_game_loop_tick_runs_renderer() {
let mut game_loop = GameLoop::new(State::default());
game_loop.tick().unwrap();
assert_eq!(game_loop.state().render, 1);
}
}
|
//! A macro to help debug unwraps.
use std;
/// Panics after if the value cannot be unwraped.
#[macro_export]
macro_rules! unwrap {
($e:expr) => {
$crate::unwrap::Unwrap::unwrap($e,
format_args!("in module {}, file {}, line {}, column {}",
module_path!(), file!(), line!(), column!()));
};
($e:expr, $($msg:tt)*) => {
$crate::unwrap::Unwrap::unwrap($e,
format_args!(": {} in module {}, file {}, line {}, column {}",
format_args!($($msg)*),
module_path!(), file!(), line!(), column!()));
}
}
pub trait Unwrap {
/// The type retruned by unwraping.
type Output;
/// Unwraps the value or panics with the given message.
fn unwrap(self, msg: std::fmt::Arguments) -> Self::Output;
}
impl<T> Unwrap for Option<T> {
type Output = T;
fn unwrap(self, msg: std::fmt::Arguments) -> Self::Output {
match self {
Some(t) => t,
None => panic!("failed unwrapping an option {}", msg),
}
}
}
impl<T, E: std::fmt::Debug> Unwrap for Result<T, E> {
type Output = T;
fn unwrap(self, msg: std::fmt::Arguments) -> Self::Output {
match self {
Ok(t) => t,
Err(err) => panic!("failed with error {:?} {}", err, msg),
}
}
}
|
//! Types for HVIF shapes
use types::path::*;
#[derive(Debug)]
/// An HVIF shape, consisting of a single style, one or more paths, and optional additional transformation data
pub struct HVIFShape {
/// The index of the style used in the shape
pub style_index: u8,
/// The indices of the paths that use this shape's style
pub path_indices: Vec<u8>,
/// A list of any optional modifications to this shape
pub modifiers: Vec<HVIFShapeModifier>,
}
#[derive(Debug)]
/// A modifier to an HVIF shape
pub enum HVIFShapeModifier {
/// A single affine transformation matrix
HVIFTransformMatrix(HVIFMatrix),
/// The shape uses hinting
HVIFHinting,
/// Level of Detail scales
/// Represents the allowable scales at which this shape will appear correctly
HVIFLODScale {
#[doc = "Minimum LOD for this shape"] min: f32,
#[doc = "Maximum LOD for this shape"] max: f32,
},
/// An optional linear translation of the shape (offset)
HVIFTranslation(HVIFPoint),
/// A list of optional transformers
HVIFTransformerList(Vec<HVIFTransformer>)
}
#[derive(Debug, Copy, Clone)]
/// A temporary implementation of an f24 value, as three bytes
pub struct HVIFf24 {
#[doc = "First (most significant) bits"] pub fst: u8,
#[doc = "Middle bits"] pub snd: u8,
#[doc = "Last (least significant) bits"] pub thr: u8
}
impl From<HVIFf24> for f32 {
// Not quite exact in its current form - be warned!
fn from(hvif_f24: HVIFf24) -> Self {
let f24_as_u32: u32 = ((hvif_f24.fst as u32) << 16) | ((hvif_f24.snd as u32) << 8) | (hvif_f24.thr as u32);
// Get the raw bits for each independent component
let sign_bit = (f24_as_u32 & 0b100000000000000000000000) >> 23;
let exponent_bits = (f24_as_u32 & 0b011111100000000000000000) >> 17;
let mantissa_bits = f24_as_u32 & 0b000000011111111111111111;
// The sign is just -1 to the power of this bit
let sign : i32 = match sign_bit {
0 => 1,
_ => -1,
};
// The exponent is actually only 6 bits, so unsigned values range from 0 to 63
// Make it a signed exponent, and offset it to range from -31 to 32
let exponent_pre = (exponent_bits as i32) - 31;
// The mantissa is 1.(bits), so we can divite the exponentiation into whole and fractional parts
let mantissa_base = f32::powf(2.0, exponent_pre as f32);
let mantissa_frac = (mantissa_bits as f32) * f32::powf(2.0, (exponent_pre -17) as f32);
(sign as f32) * (mantissa_base + mantissa_frac)
}
}
#[derive(Debug, Copy, Clone)]
/// A 2D affine transformation matrix
/// As per HVIF spec, consists of six f24 values
pub struct HVIFMatrix {
#[doc = "x1"] pub x1: HVIFf24, #[doc = "y1"] pub y1: HVIFf24, #[doc = "z1"] pub z1: HVIFf24,
#[doc = "x2"] pub x2: HVIFf24, #[doc = "y2"] pub y2: HVIFf24, #[doc = "z2"] pub z2: HVIFf24,
}
#[derive(Debug, Copy, Clone)]
/// Some transformation on a basic HVIF shape
pub enum HVIFTransformer {
/// An affine transformation using a single matrix
Affine(HVIFMatrix),
/// ?
Contour { #[doc="?"] width: f32, #[doc="?"] line_join: u8, #[doc="?"] miter_limit: u8 },
/// ?
Perspective,
/// ?
Stroke { #[doc="?"] width: f32, #[doc="?"] line_join: u8, #[doc="?"] line_cap: u8, #[doc="?"] miter_limit: u8 }
}
|
use assert_cmd::prelude::*;
use std::process::Command;
fn sub() -> Command {
Command::cargo_bin("sub").unwrap()
}
struct ReplacementTest {
pattern: &'static str,
replacement: &'static str,
input: String,
args: Vec<String>,
}
impl ReplacementTest {
pub fn new(pattern: &'static str, replacement: &'static str) -> Self {
ReplacementTest {
pattern,
replacement,
input: String::new(),
args: vec![],
}
}
pub fn arg(&mut self, argument: &str) -> &mut Self {
self.args.push(argument.to_owned());
self
}
pub fn for_input(&mut self, input: &str) -> &mut Self {
self.input = input.into();
self
}
pub fn expect_output(&mut self, output: &'static str) -> &mut Self {
sub()
.args(&self.args)
.arg(self.pattern)
.arg(self.replacement)
.with_stdin()
.buffer(self.input.as_str())
.assert()
.success()
.stdout(output);
self
}
}
#[test]
fn basic_replacement() {
ReplacementTest::new(r"foo", "bar")
.for_input("foo other foo\nfoo\n")
.expect_output("bar other bar\nbar\n");
}
#[test]
fn regex_replacement() {
ReplacementTest::new(r"\bfoo\b", "bar")
.for_input("foo, foo.\n")
.expect_output("bar, bar.\n")
.for_input("foobar\n")
.expect_output("foobar\n")
.for_input("myfoo\n")
.expect_output("myfoo\n");
}
#[test]
fn capture_group_replacement() {
ReplacementTest::new(r"foo([0-9]+)", "bar$1")
.for_input("foo123\n")
.expect_output("bar123\n")
.for_input("foo\n")
.expect_output("foo\n")
.for_input("fooABC\n")
.expect_output("fooABC\n");
}
#[test]
fn case_insensitive_replacement() {
ReplacementTest::new(r"foo", "bar")
.for_input("foo Foo")
.expect_output("bar Foo");
ReplacementTest::new(r"foo", "bar")
.arg("--ignore-case")
.for_input("foo Foo")
.expect_output("bar bar");
}
#[test]
fn fails_for_non_utf8_input() {
sub()
.arg("dummy")
.arg("dummy")
.with_stdin()
.buffer(b"\xC3\x28".as_ref())
.assert()
.failure()
.code(1);
}
#[test]
fn no_trailing_newline() {
ReplacementTest::new(r"foo", "bar")
.for_input("foo other foo\nfoo")
.expect_output("bar other bar\nbar");
}
#[test]
fn windows_newline() {
ReplacementTest::new(r"foo", "bar")
.for_input("foo other foo\r\nfoo\r\n")
.expect_output("bar other bar\r\nbar\r\n");
}
|
#![allow(unused_variables, non_upper_case_globals, non_snake_case, unused_unsafe, non_camel_case_types, dead_code, clippy::all)]
#[cfg(feature = "Win32_Storage_Xps_Printing")]
pub mod Printing;
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
pub type ABORTPROC = unsafe extern "system" fn(param0: super::super::Graphics::Gdi::HDC, param1: i32) -> super::super::Foundation::BOOL;
#[cfg(feature = "Win32_Graphics_Gdi")]
#[inline]
pub unsafe fn AbortDoc<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hdc: Param0) -> i32 {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn AbortDoc(hdc: super::super::Graphics::Gdi::HDC) -> i32;
}
::core::mem::transmute(AbortDoc(hdc.into_param().abi()))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct DEVICE_CAPABILITIES(pub u32);
pub const DC_BINNAMES: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(12u32);
pub const DC_BINS: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(6u32);
pub const DC_COLLATE: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(22u32);
pub const DC_COLORDEVICE: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(32u32);
pub const DC_COPIES: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(18u32);
pub const DC_DRIVER: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(11u32);
pub const DC_DUPLEX: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(7u32);
pub const DC_ENUMRESOLUTIONS: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(13u32);
pub const DC_EXTRA: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(9u32);
pub const DC_FIELDS: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(1u32);
pub const DC_FILEDEPENDENCIES: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(14u32);
pub const DC_MAXEXTENT: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(5u32);
pub const DC_MEDIAREADY: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(29u32);
pub const DC_MEDIATYPENAMES: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(34u32);
pub const DC_MEDIATYPES: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(35u32);
pub const DC_MINEXTENT: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(4u32);
pub const DC_ORIENTATION: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(17u32);
pub const DC_NUP: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(33u32);
pub const DC_PAPERNAMES: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(16u32);
pub const DC_PAPERS: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(2u32);
pub const DC_PAPERSIZE: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(3u32);
pub const DC_PERSONALITY: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(25u32);
pub const DC_PRINTERMEM: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(28u32);
pub const DC_PRINTRATE: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(26u32);
pub const DC_PRINTRATEPPM: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(31u32);
pub const DC_PRINTRATEUNIT: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(27u32);
pub const DC_SIZE: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(8u32);
pub const DC_STAPLE: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(30u32);
pub const DC_TRUETYPE: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(15u32);
pub const DC_VERSION: DEVICE_CAPABILITIES = DEVICE_CAPABILITIES(10u32);
impl ::core::convert::From<u32> for DEVICE_CAPABILITIES {
fn from(value: u32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for DEVICE_CAPABILITIES {
type Abi = Self;
}
impl ::core::ops::BitOr for DEVICE_CAPABILITIES {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl ::core::ops::BitAnd for DEVICE_CAPABILITIES {
type Output = Self;
fn bitand(self, rhs: Self) -> Self {
Self(self.0 & rhs.0)
}
}
impl ::core::ops::BitOrAssign for DEVICE_CAPABILITIES {
fn bitor_assign(&mut self, rhs: Self) {
self.0.bitor_assign(rhs.0)
}
}
impl ::core::ops::BitAndAssign for DEVICE_CAPABILITIES {
fn bitand_assign(&mut self, rhs: Self) {
self.0.bitand_assign(rhs.0)
}
}
impl ::core::ops::Not for DEVICE_CAPABILITIES {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DOCINFOA {
pub cbSize: i32,
pub lpszDocName: super::super::Foundation::PSTR,
pub lpszOutput: super::super::Foundation::PSTR,
pub lpszDatatype: super::super::Foundation::PSTR,
pub fwType: u32,
}
#[cfg(feature = "Win32_Foundation")]
impl DOCINFOA {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DOCINFOA {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DOCINFOA {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DOCINFOA").field("cbSize", &self.cbSize).field("lpszDocName", &self.lpszDocName).field("lpszOutput", &self.lpszOutput).field("lpszDatatype", &self.lpszDatatype).field("fwType", &self.fwType).finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DOCINFOA {
fn eq(&self, other: &Self) -> bool {
self.cbSize == other.cbSize && self.lpszDocName == other.lpszDocName && self.lpszOutput == other.lpszOutput && self.lpszDatatype == other.lpszDatatype && self.fwType == other.fwType
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DOCINFOA {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DOCINFOA {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DOCINFOW {
pub cbSize: i32,
pub lpszDocName: super::super::Foundation::PWSTR,
pub lpszOutput: super::super::Foundation::PWSTR,
pub lpszDatatype: super::super::Foundation::PWSTR,
pub fwType: u32,
}
#[cfg(feature = "Win32_Foundation")]
impl DOCINFOW {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DOCINFOW {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DOCINFOW {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DOCINFOW").field("cbSize", &self.cbSize).field("lpszDocName", &self.lpszDocName).field("lpszOutput", &self.lpszOutput).field("lpszDatatype", &self.lpszDatatype).field("fwType", &self.fwType).finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DOCINFOW {
fn eq(&self, other: &Self) -> bool {
self.cbSize == other.cbSize && self.lpszDocName == other.lpszDocName && self.lpszOutput == other.lpszOutput && self.lpszDatatype == other.lpszDatatype && self.fwType == other.fwType
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DOCINFOW {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DOCINFOW {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct DRAWPATRECT {
pub ptPosition: super::super::Foundation::POINT,
pub ptSize: super::super::Foundation::POINT,
pub wStyle: u16,
pub wPattern: u16,
}
#[cfg(feature = "Win32_Foundation")]
impl DRAWPATRECT {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for DRAWPATRECT {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for DRAWPATRECT {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("DRAWPATRECT").field("ptPosition", &self.ptPosition).field("ptSize", &self.ptSize).field("wStyle", &self.wStyle).field("wPattern", &self.wPattern).finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for DRAWPATRECT {
fn eq(&self, other: &Self) -> bool {
self.ptPosition == other.ptPosition && self.ptSize == other.ptSize && self.wStyle == other.wStyle && self.wPattern == other.wPattern
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for DRAWPATRECT {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for DRAWPATRECT {
type Abi = Self;
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
#[inline]
pub unsafe fn DeviceCapabilitiesA<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>>(pdevice: Param0, pport: Param1, fwcapability: DEVICE_CAPABILITIES, poutput: super::super::Foundation::PSTR, pdevmode: *const super::super::Graphics::Gdi::DEVMODEA) -> i32 {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn DeviceCapabilitiesA(pdevice: super::super::Foundation::PSTR, pport: super::super::Foundation::PSTR, fwcapability: DEVICE_CAPABILITIES, poutput: super::super::Foundation::PSTR, pdevmode: *const super::super::Graphics::Gdi::DEVMODEA) -> i32;
}
::core::mem::transmute(DeviceCapabilitiesA(pdevice.into_param().abi(), pport.into_param().abi(), ::core::mem::transmute(fwcapability), ::core::mem::transmute(poutput), ::core::mem::transmute(pdevmode)))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
#[inline]
pub unsafe fn DeviceCapabilitiesW<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(pdevice: Param0, pport: Param1, fwcapability: DEVICE_CAPABILITIES, poutput: super::super::Foundation::PWSTR, pdevmode: *const super::super::Graphics::Gdi::DEVMODEW) -> i32 {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn DeviceCapabilitiesW(pdevice: super::super::Foundation::PWSTR, pport: super::super::Foundation::PWSTR, fwcapability: DEVICE_CAPABILITIES, poutput: super::super::Foundation::PWSTR, pdevmode: *const super::super::Graphics::Gdi::DEVMODEW) -> i32;
}
::core::mem::transmute(DeviceCapabilitiesW(pdevice.into_param().abi(), pport.into_param().abi(), ::core::mem::transmute(fwcapability), ::core::mem::transmute(poutput), ::core::mem::transmute(pdevmode)))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[cfg(feature = "Win32_Graphics_Gdi")]
#[inline]
pub unsafe fn EndDoc<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hdc: Param0) -> i32 {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn EndDoc(hdc: super::super::Graphics::Gdi::HDC) -> i32;
}
::core::mem::transmute(EndDoc(hdc.into_param().abi()))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[cfg(feature = "Win32_Graphics_Gdi")]
#[inline]
pub unsafe fn EndPage<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hdc: Param0) -> i32 {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn EndPage(hdc: super::super::Graphics::Gdi::HDC) -> i32;
}
::core::mem::transmute(EndPage(hdc.into_param().abi()))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
#[inline]
pub unsafe fn Escape<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>>(hdc: Param0, iescape: i32, cjin: i32, pvin: Param3, pvout: *mut ::core::ffi::c_void) -> i32 {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn Escape(hdc: super::super::Graphics::Gdi::HDC, iescape: i32, cjin: i32, pvin: super::super::Foundation::PSTR, pvout: *mut ::core::ffi::c_void) -> i32;
}
::core::mem::transmute(Escape(hdc.into_param().abi(), ::core::mem::transmute(iescape), ::core::mem::transmute(cjin), pvin.into_param().abi(), ::core::mem::transmute(pvout)))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
#[inline]
pub unsafe fn ExtEscape<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>>(hdc: Param0, iescape: i32, cjinput: i32, lpindata: Param3, cjoutput: i32, lpoutdata: super::super::Foundation::PSTR) -> i32 {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn ExtEscape(hdc: super::super::Graphics::Gdi::HDC, iescape: i32, cjinput: i32, lpindata: super::super::Foundation::PSTR, cjoutput: i32, lpoutdata: super::super::Foundation::PSTR) -> i32;
}
::core::mem::transmute(ExtEscape(hdc.into_param().abi(), ::core::mem::transmute(iescape), ::core::mem::transmute(cjinput), lpindata.into_param().abi(), ::core::mem::transmute(cjoutput), ::core::mem::transmute(lpoutdata)))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy, :: core :: fmt :: Debug, :: core :: cmp :: PartialEq, :: core :: cmp :: Eq)]
#[repr(transparent)]
pub struct HPTPROVIDER(pub isize);
impl ::core::default::Default for HPTPROVIDER {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
unsafe impl ::windows::core::Handle for HPTPROVIDER {}
unsafe impl ::windows::core::Abi for HPTPROVIDER {
type Abi = Self;
}
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsDocumentPackageTarget(pub ::windows::core::IUnknown);
impl IXpsDocumentPackageTarget {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetXpsOMPackageWriter<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, documentsequencepartname: Param0, discardcontrolpartname: Param1) -> ::windows::core::Result<IXpsOMPackageWriter> {
let mut result__: <IXpsOMPackageWriter as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), documentsequencepartname.into_param().abi(), discardcontrolpartname.into_param().abi(), &mut result__).from_abi::<IXpsOMPackageWriter>(result__)
}
pub unsafe fn GetXpsOMFactory(&self) -> ::windows::core::Result<IXpsOMObjectFactory> {
let mut result__: <IXpsOMObjectFactory as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMObjectFactory>(result__)
}
pub unsafe fn GetXpsType(&self) -> ::windows::core::Result<XPS_DOCUMENT_TYPE> {
let mut result__: <XPS_DOCUMENT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_DOCUMENT_TYPE>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsDocumentPackageTarget {
type Vtable = IXpsDocumentPackageTarget_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3b0b6d38_53ad_41da_b212_d37637a6714e);
}
impl ::core::convert::From<IXpsDocumentPackageTarget> for ::windows::core::IUnknown {
fn from(value: IXpsDocumentPackageTarget) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsDocumentPackageTarget> for ::windows::core::IUnknown {
fn from(value: &IXpsDocumentPackageTarget) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsDocumentPackageTarget {
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 IXpsDocumentPackageTarget {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsDocumentPackageTarget_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documentsequencepartname: ::windows::core::RawPtr, discardcontrolpartname: ::windows::core::RawPtr, packagewriter: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, xpsfactory: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documenttype: *mut XPS_DOCUMENT_TYPE) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsDocumentPackageTarget3D(pub ::windows::core::IUnknown);
impl IXpsDocumentPackageTarget3D {
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn GetXpsOMPackageWriter3D<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param2: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param3: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(
&self,
documentsequencepartname: Param0,
discardcontrolpartname: Param1,
modelpartname: Param2,
modeldata: Param3,
) -> ::windows::core::Result<IXpsOMPackageWriter3D> {
let mut result__: <IXpsOMPackageWriter3D as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), documentsequencepartname.into_param().abi(), discardcontrolpartname.into_param().abi(), modelpartname.into_param().abi(), modeldata.into_param().abi(), &mut result__).from_abi::<IXpsOMPackageWriter3D>(result__)
}
pub unsafe fn GetXpsOMFactory(&self) -> ::windows::core::Result<IXpsOMObjectFactory> {
let mut result__: <IXpsOMObjectFactory as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMObjectFactory>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsDocumentPackageTarget3D {
type Vtable = IXpsDocumentPackageTarget3D_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x60ba71b8_3101_4984_9199_f4ea775ff01d);
}
impl ::core::convert::From<IXpsDocumentPackageTarget3D> for ::windows::core::IUnknown {
fn from(value: IXpsDocumentPackageTarget3D) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsDocumentPackageTarget3D> for ::windows::core::IUnknown {
fn from(value: &IXpsDocumentPackageTarget3D) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsDocumentPackageTarget3D {
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 IXpsDocumentPackageTarget3D {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsDocumentPackageTarget3D_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(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documentsequencepartname: ::windows::core::RawPtr, discardcontrolpartname: ::windows::core::RawPtr, modelpartname: ::windows::core::RawPtr, modeldata: ::windows::core::RawPtr, packagewriter: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, xpsfactory: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMBrush(pub ::windows::core::IUnknown);
impl IXpsOMBrush {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetOpacity(&self) -> ::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), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMBrush {
type Vtable = IXpsOMBrush_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x56a3f80c_ea4c_4187_a57b_a2a473b2b42b);
}
impl ::core::convert::From<IXpsOMBrush> for ::windows::core::IUnknown {
fn from(value: IXpsOMBrush) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMBrush> for ::windows::core::IUnknown {
fn from(value: &IXpsOMBrush) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMBrush {
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 IXpsOMBrush {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMBrush> for IXpsOMShareable {
fn from(value: IXpsOMBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMBrush> for IXpsOMShareable {
fn from(value: &IXpsOMBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMBrush_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMCanvas(pub ::windows::core::IUnknown);
impl IXpsOMCanvas {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetTransform(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn GetTransformLocal(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn SetTransformLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMMatrixTransform>>(&self, matrixtransform: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), matrixtransform.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTransformLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTransformLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetClipGeometry(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn GetClipGeometryLocal(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn SetClipGeometryLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMGeometry>>(&self, clipgeometry: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), clipgeometry.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetClipGeometryLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetClipGeometryLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetOpacity(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
pub unsafe fn GetOpacityMaskBrush(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn GetOpacityMaskBrushLocal(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn SetOpacityMaskBrushLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMBrush>>(&self, opacitymaskbrush: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), opacitymaskbrush.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetOpacityMaskBrushLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetOpacityMaskBrushLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetName(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, name: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), name.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIsHyperlinkTarget(&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).24)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetIsHyperlinkTarget<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, ishyperlink: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ishyperlink.into_param().abi()).ok()
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetHyperlinkNavigateUri(&self) -> ::windows::core::Result<super::super::System::Com::IUri> {
let mut result__: <super::super::System::Com::IUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::System::Com::IUri>(result__)
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn SetHyperlinkNavigateUri<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IUri>>(&self, hyperlinkuri: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), hyperlinkuri.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLanguage(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLanguage<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, language: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), language.into_param().abi()).ok()
}
pub unsafe fn GetVisuals(&self) -> ::windows::core::Result<IXpsOMVisualCollection> {
let mut result__: <IXpsOMVisualCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMVisualCollection>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetUseAliasedEdgeMode(&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).31)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetUseAliasedEdgeMode<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, usealiasededgemode: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), usealiasededgemode.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetAccessibilityShortDescription(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetAccessibilityShortDescription<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, shortdescription: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), shortdescription.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetAccessibilityLongDescription(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetAccessibilityLongDescription<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, longdescription: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), longdescription.into_param().abi()).ok()
}
pub unsafe fn GetDictionary(&self) -> ::windows::core::Result<IXpsOMDictionary> {
let mut result__: <IXpsOMDictionary as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDictionary>(result__)
}
pub unsafe fn GetDictionaryLocal(&self) -> ::windows::core::Result<IXpsOMDictionary> {
let mut result__: <IXpsOMDictionary as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDictionary>(result__)
}
pub unsafe fn SetDictionaryLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMDictionary>>(&self, resourcedictionary: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), resourcedictionary.into_param().abi()).ok()
}
pub unsafe fn GetDictionaryResource(&self) -> ::windows::core::Result<IXpsOMRemoteDictionaryResource> {
let mut result__: <IXpsOMRemoteDictionaryResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMRemoteDictionaryResource>(result__)
}
pub unsafe fn SetDictionaryResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMRemoteDictionaryResource>>(&self, remotedictionaryresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), remotedictionaryresource.into_param().abi()).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMCanvas> {
let mut result__: <IXpsOMCanvas as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMCanvas>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMCanvas {
type Vtable = IXpsOMCanvas_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x221d1452_331e_47c6_87e9_6ccefb9b5ba3);
}
impl ::core::convert::From<IXpsOMCanvas> for ::windows::core::IUnknown {
fn from(value: IXpsOMCanvas) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMCanvas> for ::windows::core::IUnknown {
fn from(value: &IXpsOMCanvas) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMCanvas {
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 IXpsOMCanvas {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMCanvas> for IXpsOMVisual {
fn from(value: IXpsOMCanvas) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMCanvas> for IXpsOMVisual {
fn from(value: &IXpsOMCanvas) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMVisual> for IXpsOMCanvas {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMVisual> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMVisual> for &IXpsOMCanvas {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMVisual> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMCanvas> for IXpsOMShareable {
fn from(value: IXpsOMCanvas) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMCanvas> for IXpsOMShareable {
fn from(value: &IXpsOMCanvas) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMCanvas {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMCanvas {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMCanvas_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ishyperlink: *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, ishyperlink: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hyperlinkuri: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hyperlinkuri: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, visuals: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, usealiasededgemode: *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, usealiasededgemode: 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, shortdescription: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, shortdescription: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, longdescription: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, longdescription: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, resourcedictionary: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, resourcedictionary: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, resourcedictionary: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, remotedictionaryresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, remotedictionaryresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, canvas: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMColorProfileResource(pub ::windows::core::IUnknown);
impl IXpsOMColorProfileResource {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetStream(&self) -> ::windows::core::Result<super::super::System::Com::IStream> {
let mut result__: <super::super::System::Com::IStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::System::Com::IStream>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn SetContent<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, sourcestream: Param0, partname: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), sourcestream.into_param().abi(), partname.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMColorProfileResource {
type Vtable = IXpsOMColorProfileResource_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x67bd7d69_1eef_4bb1_b5e7_6f4f87be8abe);
}
impl ::core::convert::From<IXpsOMColorProfileResource> for ::windows::core::IUnknown {
fn from(value: IXpsOMColorProfileResource) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMColorProfileResource> for ::windows::core::IUnknown {
fn from(value: &IXpsOMColorProfileResource) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMColorProfileResource {
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 IXpsOMColorProfileResource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMColorProfileResource> for IXpsOMResource {
fn from(value: IXpsOMColorProfileResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMColorProfileResource> for IXpsOMResource {
fn from(value: &IXpsOMColorProfileResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for IXpsOMColorProfileResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for &IXpsOMColorProfileResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMColorProfileResource> for IXpsOMPart {
fn from(value: IXpsOMColorProfileResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMColorProfileResource> for IXpsOMPart {
fn from(value: &IXpsOMColorProfileResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMColorProfileResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMColorProfileResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMColorProfileResource_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sourcestream: ::windows::core::RawPtr, partname: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMColorProfileResourceCollection(pub ::windows::core::IUnknown);
impl IXpsOMColorProfileResourceCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsOMColorProfileResource> {
let mut result__: <IXpsOMColorProfileResource 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::<IXpsOMColorProfileResource>(result__)
}
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMColorProfileResource>>(&self, index: u32, object: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), object.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMColorProfileResource>>(&self, index: u32, object: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), object.into_param().abi()).ok()
}
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMColorProfileResource>>(&self, object: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), object.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetByPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, partname: Param0) -> ::windows::core::Result<IXpsOMColorProfileResource> {
let mut result__: <IXpsOMColorProfileResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), partname.into_param().abi(), &mut result__).from_abi::<IXpsOMColorProfileResource>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMColorProfileResourceCollection {
type Vtable = IXpsOMColorProfileResourceCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x12759630_5fba_4283_8f7d_cca849809edb);
}
impl ::core::convert::From<IXpsOMColorProfileResourceCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMColorProfileResourceCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMColorProfileResourceCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMColorProfileResourceCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMColorProfileResourceCollection {
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 IXpsOMColorProfileResourceCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMColorProfileResourceCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, partname: ::windows::core::RawPtr, part: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMCoreProperties(pub ::windows::core::IUnknown);
impl IXpsOMCoreProperties {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<IXpsOMPackage> {
let mut result__: <IXpsOMPackage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPackage>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetCategory(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetCategory<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, category: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), category.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetContentStatus(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetContentStatus<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, contentstatus: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), contentstatus.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetContentType(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetContentType<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, contenttype: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), contenttype.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetCreated(&self) -> ::windows::core::Result<super::super::Foundation::SYSTEMTIME> {
let mut result__: <super::super::Foundation::SYSTEMTIME as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::SYSTEMTIME>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetCreated(&self, created: *const super::super::Foundation::SYSTEMTIME) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(created)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetCreator(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetCreator<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, creator: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), creator.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDescription(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetDescription<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, description: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), description.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIdentifier(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetIdentifier<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, identifier: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), identifier.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetKeywords(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetKeywords<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, keywords: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), keywords.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLanguage(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLanguage<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, language: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), language.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLastModifiedBy(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLastModifiedBy<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, lastmodifiedby: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), lastmodifiedby.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLastPrinted(&self) -> ::windows::core::Result<super::super::Foundation::SYSTEMTIME> {
let mut result__: <super::super::Foundation::SYSTEMTIME as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::SYSTEMTIME>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLastPrinted(&self, lastprinted: *const super::super::Foundation::SYSTEMTIME) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), ::core::mem::transmute(lastprinted)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetModified(&self) -> ::windows::core::Result<super::super::Foundation::SYSTEMTIME> {
let mut result__: <super::super::Foundation::SYSTEMTIME as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::SYSTEMTIME>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetModified(&self, modified: *const super::super::Foundation::SYSTEMTIME) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), ::core::mem::transmute(modified)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRevision(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetRevision<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, revision: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), revision.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSubject(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetSubject<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, subject: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), subject.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTitle(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTitle<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, title: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), title.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetVersion(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetVersion<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, version: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), version.into_param().abi()).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMCoreProperties> {
let mut result__: <IXpsOMCoreProperties as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMCoreProperties>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMCoreProperties {
type Vtable = IXpsOMCoreProperties_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3340fe8f_4027_4aa1_8f5f_d35ae45fe597);
}
impl ::core::convert::From<IXpsOMCoreProperties> for ::windows::core::IUnknown {
fn from(value: IXpsOMCoreProperties) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMCoreProperties> for ::windows::core::IUnknown {
fn from(value: &IXpsOMCoreProperties) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMCoreProperties {
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 IXpsOMCoreProperties {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMCoreProperties> for IXpsOMPart {
fn from(value: IXpsOMCoreProperties) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMCoreProperties> for IXpsOMPart {
fn from(value: &IXpsOMCoreProperties) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMCoreProperties {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMCoreProperties {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMCoreProperties_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, package: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, category: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, category: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, contentstatus: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, contentstatus: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, contenttype: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, contenttype: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, created: *mut super::super::Foundation::SYSTEMTIME) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, created: *const super::super::Foundation::SYSTEMTIME) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, creator: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, creator: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, description: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, description: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, identifier: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, identifier: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, keywords: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, keywords: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lastmodifiedby: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lastmodifiedby: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lastprinted: *mut super::super::Foundation::SYSTEMTIME) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lastprinted: *const super::super::Foundation::SYSTEMTIME) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, modified: *mut super::super::Foundation::SYSTEMTIME) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, modified: *const super::super::Foundation::SYSTEMTIME) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, revision: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, revision: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, subject: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, subject: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, title: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, title: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, version: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, version: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, coreproperties: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMDashCollection(pub ::windows::core::IUnknown);
impl IXpsOMDashCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<XPS_DASH> {
let mut result__: <XPS_DASH 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::<XPS_DASH>(result__)
}
pub unsafe fn InsertAt(&self, index: u32, dash: *const XPS_DASH) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(dash)).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
pub unsafe fn SetAt(&self, index: u32, dash: *const XPS_DASH) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(dash)).ok()
}
pub unsafe fn Append(&self, dash: *const XPS_DASH) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(dash)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMDashCollection {
type Vtable = IXpsOMDashCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x081613f4_74eb_48f2_83b3_37a9ce2d7dc6);
}
impl ::core::convert::From<IXpsOMDashCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMDashCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMDashCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMDashCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMDashCollection {
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 IXpsOMDashCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMDashCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, dash: *mut XPS_DASH) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, dash: *const XPS_DASH) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, dash: *const XPS_DASH) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dash: *const XPS_DASH) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMDictionary(pub ::windows::core::IUnknown);
impl IXpsOMDictionary {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetAt(&self, index: u32, key: *mut super::super::Foundation::PWSTR, entry: *mut ::core::option::Option<IXpsOMShareable>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), ::core::mem::transmute(key), ::core::mem::transmute(entry)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetByKey<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IXpsOMShareable>>(&self, key: Param0, beforeentry: Param1) -> ::windows::core::Result<IXpsOMShareable> {
let mut result__: <IXpsOMShareable as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), key.into_param().abi(), beforeentry.into_param().abi(), &mut result__).from_abi::<IXpsOMShareable>(result__)
}
pub unsafe fn GetIndex<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMShareable>>(&self, entry: Param0) -> ::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), entry.into_param().abi(), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, IXpsOMShareable>>(&self, key: Param0, entry: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), key.into_param().abi(), entry.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IXpsOMShareable>>(&self, index: u32, key: Param1, entry: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), key.into_param().abi(), entry.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, IXpsOMShareable>>(&self, index: u32, key: Param1, entry: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), key.into_param().abi(), entry.into_param().abi()).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMDictionary> {
let mut result__: <IXpsOMDictionary as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDictionary>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMDictionary {
type Vtable = IXpsOMDictionary_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x897c86b8_8eaf_4ae3_bdde_56419fcf4236);
}
impl ::core::convert::From<IXpsOMDictionary> for ::windows::core::IUnknown {
fn from(value: IXpsOMDictionary) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMDictionary> for ::windows::core::IUnknown {
fn from(value: &IXpsOMDictionary) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMDictionary {
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 IXpsOMDictionary {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMDictionary_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, key: *mut super::super::Foundation::PWSTR, entry: *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, key: super::super::Foundation::PWSTR, beforeentry: ::windows::core::RawPtr, entry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, entry: ::windows::core::RawPtr, index: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR, entry: ::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, index: u32, key: super::super::Foundation::PWSTR, entry: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, key: super::super::Foundation::PWSTR, entry: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionary: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMDocument(pub ::windows::core::IUnknown);
impl IXpsOMDocument {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<IXpsOMDocumentSequence> {
let mut result__: <IXpsOMDocumentSequence as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDocumentSequence>(result__)
}
pub unsafe fn GetPageReferences(&self) -> ::windows::core::Result<IXpsOMPageReferenceCollection> {
let mut result__: <IXpsOMPageReferenceCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPageReferenceCollection>(result__)
}
pub unsafe fn GetPrintTicketResource(&self) -> ::windows::core::Result<IXpsOMPrintTicketResource> {
let mut result__: <IXpsOMPrintTicketResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPrintTicketResource>(result__)
}
pub unsafe fn SetPrintTicketResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>>(&self, printticketresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), printticketresource.into_param().abi()).ok()
}
pub unsafe fn GetDocumentStructureResource(&self) -> ::windows::core::Result<IXpsOMDocumentStructureResource> {
let mut result__: <IXpsOMDocumentStructureResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDocumentStructureResource>(result__)
}
pub unsafe fn SetDocumentStructureResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMDocumentStructureResource>>(&self, documentstructureresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), documentstructureresource.into_param().abi()).ok()
}
pub unsafe fn GetSignatureBlockResources(&self) -> ::windows::core::Result<IXpsOMSignatureBlockResourceCollection> {
let mut result__: <IXpsOMSignatureBlockResourceCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMSignatureBlockResourceCollection>(result__)
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMDocument> {
let mut result__: <IXpsOMDocument as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDocument>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMDocument {
type Vtable = IXpsOMDocument_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x2c2c94cb_ac5f_4254_8ee9_23948309d9f0);
}
impl ::core::convert::From<IXpsOMDocument> for ::windows::core::IUnknown {
fn from(value: IXpsOMDocument) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMDocument> for ::windows::core::IUnknown {
fn from(value: &IXpsOMDocument) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMDocument {
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 IXpsOMDocument {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMDocument> for IXpsOMPart {
fn from(value: IXpsOMDocument) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMDocument> for IXpsOMPart {
fn from(value: &IXpsOMDocument) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMDocument {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMDocument {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMDocument_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documentsequence: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagereferences: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, printticketresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, printticketresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documentstructureresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documentstructureresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signatureblockresources: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, document: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMDocumentCollection(pub ::windows::core::IUnknown);
impl IXpsOMDocumentCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsOMDocument> {
let mut result__: <IXpsOMDocument 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::<IXpsOMDocument>(result__)
}
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMDocument>>(&self, index: u32, document: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), document.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMDocument>>(&self, index: u32, document: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), document.into_param().abi()).ok()
}
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMDocument>>(&self, document: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), document.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMDocumentCollection {
type Vtable = IXpsOMDocumentCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd1c87f0d_e947_4754_8a25_971478f7e83e);
}
impl ::core::convert::From<IXpsOMDocumentCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMDocumentCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMDocumentCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMDocumentCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMDocumentCollection {
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 IXpsOMDocumentCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMDocumentCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, document: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, document: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, document: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, document: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMDocumentSequence(pub ::windows::core::IUnknown);
impl IXpsOMDocumentSequence {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<IXpsOMPackage> {
let mut result__: <IXpsOMPackage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPackage>(result__)
}
pub unsafe fn GetDocuments(&self) -> ::windows::core::Result<IXpsOMDocumentCollection> {
let mut result__: <IXpsOMDocumentCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDocumentCollection>(result__)
}
pub unsafe fn GetPrintTicketResource(&self) -> ::windows::core::Result<IXpsOMPrintTicketResource> {
let mut result__: <IXpsOMPrintTicketResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPrintTicketResource>(result__)
}
pub unsafe fn SetPrintTicketResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>>(&self, printticketresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), printticketresource.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMDocumentSequence {
type Vtable = IXpsOMDocumentSequence_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x56492eb4_d8d5_425e_8256_4c2b64ad0264);
}
impl ::core::convert::From<IXpsOMDocumentSequence> for ::windows::core::IUnknown {
fn from(value: IXpsOMDocumentSequence) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMDocumentSequence> for ::windows::core::IUnknown {
fn from(value: &IXpsOMDocumentSequence) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMDocumentSequence {
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 IXpsOMDocumentSequence {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMDocumentSequence> for IXpsOMPart {
fn from(value: IXpsOMDocumentSequence) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMDocumentSequence> for IXpsOMPart {
fn from(value: &IXpsOMDocumentSequence) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMDocumentSequence {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMDocumentSequence {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMDocumentSequence_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, package: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documents: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, printticketresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, printticketresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMDocumentStructureResource(pub ::windows::core::IUnknown);
impl IXpsOMDocumentStructureResource {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<IXpsOMDocument> {
let mut result__: <IXpsOMDocument as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDocument>(result__)
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetStream(&self) -> ::windows::core::Result<super::super::System::Com::IStream> {
let mut result__: <super::super::System::Com::IStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::System::Com::IStream>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn SetContent<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, sourcestream: Param0, partname: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), sourcestream.into_param().abi(), partname.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMDocumentStructureResource {
type Vtable = IXpsOMDocumentStructureResource_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x85febc8a_6b63_48a9_af07_7064e4ecff30);
}
impl ::core::convert::From<IXpsOMDocumentStructureResource> for ::windows::core::IUnknown {
fn from(value: IXpsOMDocumentStructureResource) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMDocumentStructureResource> for ::windows::core::IUnknown {
fn from(value: &IXpsOMDocumentStructureResource) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMDocumentStructureResource {
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 IXpsOMDocumentStructureResource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMDocumentStructureResource> for IXpsOMResource {
fn from(value: IXpsOMDocumentStructureResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMDocumentStructureResource> for IXpsOMResource {
fn from(value: &IXpsOMDocumentStructureResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for IXpsOMDocumentStructureResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for &IXpsOMDocumentStructureResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMDocumentStructureResource> for IXpsOMPart {
fn from(value: IXpsOMDocumentStructureResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMDocumentStructureResource> for IXpsOMPart {
fn from(value: &IXpsOMDocumentStructureResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMDocumentStructureResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMDocumentStructureResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMDocumentStructureResource_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sourcestream: ::windows::core::RawPtr, partname: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMFontResource(pub ::windows::core::IUnknown);
impl IXpsOMFontResource {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetStream(&self) -> ::windows::core::Result<super::super::System::Com::IStream> {
let mut result__: <super::super::System::Com::IStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::System::Com::IStream>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn SetContent<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param2: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, sourcestream: Param0, embeddingoption: XPS_FONT_EMBEDDING, partname: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), sourcestream.into_param().abi(), ::core::mem::transmute(embeddingoption), partname.into_param().abi()).ok()
}
pub unsafe fn GetEmbeddingOption(&self) -> ::windows::core::Result<XPS_FONT_EMBEDDING> {
let mut result__: <XPS_FONT_EMBEDDING as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_FONT_EMBEDDING>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMFontResource {
type Vtable = IXpsOMFontResource_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa8c45708_47d9_4af4_8d20_33b48c9b8485);
}
impl ::core::convert::From<IXpsOMFontResource> for ::windows::core::IUnknown {
fn from(value: IXpsOMFontResource) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMFontResource> for ::windows::core::IUnknown {
fn from(value: &IXpsOMFontResource) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMFontResource {
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 IXpsOMFontResource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMFontResource> for IXpsOMResource {
fn from(value: IXpsOMFontResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMFontResource> for IXpsOMResource {
fn from(value: &IXpsOMFontResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for IXpsOMFontResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for &IXpsOMFontResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMFontResource> for IXpsOMPart {
fn from(value: IXpsOMFontResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMFontResource> for IXpsOMPart {
fn from(value: &IXpsOMFontResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMFontResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMFontResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMFontResource_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, readerstream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sourcestream: ::windows::core::RawPtr, embeddingoption: XPS_FONT_EMBEDDING, partname: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, embeddingoption: *mut XPS_FONT_EMBEDDING) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMFontResourceCollection(pub ::windows::core::IUnknown);
impl IXpsOMFontResourceCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsOMFontResource> {
let mut result__: <IXpsOMFontResource 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::<IXpsOMFontResource>(result__)
}
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMFontResource>>(&self, index: u32, value: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), value.into_param().abi()).ok()
}
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMFontResource>>(&self, index: u32, value: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), value.into_param().abi()).ok()
}
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMFontResource>>(&self, value: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), value.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetByPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, partname: Param0) -> ::windows::core::Result<IXpsOMFontResource> {
let mut result__: <IXpsOMFontResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), partname.into_param().abi(), &mut result__).from_abi::<IXpsOMFontResource>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMFontResourceCollection {
type Vtable = IXpsOMFontResourceCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x70b4a6bb_88d4_4fa8_aaf9_6d9c596fdbad);
}
impl ::core::convert::From<IXpsOMFontResourceCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMFontResourceCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMFontResourceCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMFontResourceCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMFontResourceCollection {
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 IXpsOMFontResourceCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMFontResourceCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, value: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, value: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, value: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, value: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, partname: ::windows::core::RawPtr, part: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMGeometry(pub ::windows::core::IUnknown);
impl IXpsOMGeometry {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetFigures(&self) -> ::windows::core::Result<IXpsOMGeometryFigureCollection> {
let mut result__: <IXpsOMGeometryFigureCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometryFigureCollection>(result__)
}
pub unsafe fn GetFillRule(&self) -> ::windows::core::Result<XPS_FILL_RULE> {
let mut result__: <XPS_FILL_RULE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_FILL_RULE>(result__)
}
pub unsafe fn SetFillRule(&self, fillrule: XPS_FILL_RULE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(fillrule)).ok()
}
pub unsafe fn GetTransform(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn GetTransformLocal(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn SetTransformLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMMatrixTransform>>(&self, transform: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), transform.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTransformLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR 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::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTransformLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, lookup: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), lookup.into_param().abi()).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMGeometry {
type Vtable = IXpsOMGeometry_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x64fcf3d7_4d58_44ba_ad73_a13af6492072);
}
impl ::core::convert::From<IXpsOMGeometry> for ::windows::core::IUnknown {
fn from(value: IXpsOMGeometry) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMGeometry> for ::windows::core::IUnknown {
fn from(value: &IXpsOMGeometry) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMGeometry {
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 IXpsOMGeometry {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMGeometry> for IXpsOMShareable {
fn from(value: IXpsOMGeometry) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMGeometry> for IXpsOMShareable {
fn from(value: &IXpsOMGeometry) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMGeometry {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMGeometry {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMGeometry_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, figures: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fillrule: *mut XPS_FILL_RULE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fillrule: XPS_FILL_RULE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lookup: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lookup: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, geometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMGeometryFigure(pub ::windows::core::IUnknown);
impl IXpsOMGeometryFigure {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn GetSegmentData(&self, datacount: *mut u32, segmentdata: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(datacount), ::core::mem::transmute(segmentdata)).ok()
}
pub unsafe fn GetSegmentTypes(&self, segmentcount: *mut u32, segmenttypes: *mut XPS_SEGMENT_TYPE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(segmentcount), ::core::mem::transmute(segmenttypes)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSegmentStrokes(&self, segmentcount: *mut u32, segmentstrokes: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(segmentcount), ::core::mem::transmute(segmentstrokes)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetSegments(&self, segmentcount: u32, segmentdatacount: u32, segmenttypes: *const XPS_SEGMENT_TYPE, segmentdata: *const f32, segmentstrokes: *const super::super::Foundation::BOOL) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(segmentcount), ::core::mem::transmute(segmentdatacount), ::core::mem::transmute(segmenttypes), ::core::mem::transmute(segmentdata), ::core::mem::transmute(segmentstrokes)).ok()
}
pub unsafe fn GetStartPoint(&self) -> ::windows::core::Result<XPS_POINT> {
let mut result__: <XPS_POINT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_POINT>(result__)
}
pub unsafe fn SetStartPoint(&self, startpoint: *const XPS_POINT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(startpoint)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIsClosed(&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).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetIsClosed<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, isclosed: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), isclosed.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIsFilled(&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).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetIsFilled<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, isfilled: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), isfilled.into_param().abi()).ok()
}
pub unsafe fn GetSegmentCount(&self) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetSegmentDataCount(&self) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetSegmentStrokePattern(&self) -> ::windows::core::Result<XPS_SEGMENT_STROKE_PATTERN> {
let mut result__: <XPS_SEGMENT_STROKE_PATTERN as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_SEGMENT_STROKE_PATTERN>(result__)
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMGeometryFigure> {
let mut result__: <IXpsOMGeometryFigure as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometryFigure>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMGeometryFigure {
type Vtable = IXpsOMGeometryFigure_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd410dc83_908c_443e_8947_b1795d3c165a);
}
impl ::core::convert::From<IXpsOMGeometryFigure> for ::windows::core::IUnknown {
fn from(value: IXpsOMGeometryFigure) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMGeometryFigure> for ::windows::core::IUnknown {
fn from(value: &IXpsOMGeometryFigure) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMGeometryFigure {
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 IXpsOMGeometryFigure {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMGeometryFigure_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, datacount: *mut u32, segmentdata: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, segmentcount: *mut u32, segmenttypes: *mut XPS_SEGMENT_TYPE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, segmentcount: *mut u32, segmentstrokes: *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, segmentcount: u32, segmentdatacount: u32, segmenttypes: *const XPS_SEGMENT_TYPE, segmentdata: *const f32, segmentstrokes: *const super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, startpoint: *mut XPS_POINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, startpoint: *const XPS_POINT) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, isclosed: *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, isclosed: 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, isfilled: *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, isfilled: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, segmentcount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, segmentdatacount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, segmentstrokepattern: *mut XPS_SEGMENT_STROKE_PATTERN) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, geometryfigure: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMGeometryFigureCollection(pub ::windows::core::IUnknown);
impl IXpsOMGeometryFigureCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsOMGeometryFigure> {
let mut result__: <IXpsOMGeometryFigure 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::<IXpsOMGeometryFigure>(result__)
}
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMGeometryFigure>>(&self, index: u32, geometryfigure: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), geometryfigure.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMGeometryFigure>>(&self, index: u32, geometryfigure: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), geometryfigure.into_param().abi()).ok()
}
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMGeometryFigure>>(&self, geometryfigure: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), geometryfigure.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMGeometryFigureCollection {
type Vtable = IXpsOMGeometryFigureCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xfd48c3f3_a58e_4b5a_8826_1de54abe72b2);
}
impl ::core::convert::From<IXpsOMGeometryFigureCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMGeometryFigureCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMGeometryFigureCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMGeometryFigureCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMGeometryFigureCollection {
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 IXpsOMGeometryFigureCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMGeometryFigureCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, geometryfigure: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, geometryfigure: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, geometryfigure: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, geometryfigure: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMGlyphs(pub ::windows::core::IUnknown);
impl IXpsOMGlyphs {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetTransform(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn GetTransformLocal(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn SetTransformLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMMatrixTransform>>(&self, matrixtransform: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), matrixtransform.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTransformLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTransformLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetClipGeometry(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn GetClipGeometryLocal(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn SetClipGeometryLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMGeometry>>(&self, clipgeometry: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), clipgeometry.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetClipGeometryLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetClipGeometryLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetOpacity(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
pub unsafe fn GetOpacityMaskBrush(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn GetOpacityMaskBrushLocal(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn SetOpacityMaskBrushLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMBrush>>(&self, opacitymaskbrush: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), opacitymaskbrush.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetOpacityMaskBrushLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetOpacityMaskBrushLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetName(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, name: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), name.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIsHyperlinkTarget(&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).24)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetIsHyperlinkTarget<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, ishyperlink: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ishyperlink.into_param().abi()).ok()
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetHyperlinkNavigateUri(&self) -> ::windows::core::Result<super::super::System::Com::IUri> {
let mut result__: <super::super::System::Com::IUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::System::Com::IUri>(result__)
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn SetHyperlinkNavigateUri<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IUri>>(&self, hyperlinkuri: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), hyperlinkuri.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLanguage(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLanguage<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, language: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), language.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetUnicodeString(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
pub unsafe fn GetGlyphIndexCount(&self) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetGlyphIndices(&self, indexcount: *mut u32, glyphindices: *mut XPS_GLYPH_INDEX) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), ::core::mem::transmute(indexcount), ::core::mem::transmute(glyphindices)).ok()
}
pub unsafe fn GetGlyphMappingCount(&self) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetGlyphMappings(&self, glyphmappingcount: *mut u32, glyphmappings: *mut XPS_GLYPH_MAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphmappingcount), ::core::mem::transmute(glyphmappings)).ok()
}
pub unsafe fn GetProhibitedCaretStopCount(&self) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetProhibitedCaretStops(&self, prohibitedcaretstopcount: *mut u32, prohibitedcaretstops: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), ::core::mem::transmute(prohibitedcaretstopcount), ::core::mem::transmute(prohibitedcaretstops)).ok()
}
pub unsafe fn GetBidiLevel(&self) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIsSideways(&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).38)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDeviceFontName(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
pub unsafe fn GetStyleSimulations(&self) -> ::windows::core::Result<XPS_STYLE_SIMULATION> {
let mut result__: <XPS_STYLE_SIMULATION as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_STYLE_SIMULATION>(result__)
}
pub unsafe fn SetStyleSimulations(&self, stylesimulations: XPS_STYLE_SIMULATION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), ::core::mem::transmute(stylesimulations)).ok()
}
pub unsafe fn GetOrigin(&self) -> ::windows::core::Result<XPS_POINT> {
let mut result__: <XPS_POINT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_POINT>(result__)
}
pub unsafe fn SetOrigin(&self, origin: *const XPS_POINT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self), ::core::mem::transmute(origin)).ok()
}
pub unsafe fn GetFontRenderingEmSize(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).44)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetFontRenderingEmSize(&self, fontrenderingemsize: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontrenderingemsize)).ok()
}
pub unsafe fn GetFontResource(&self) -> ::windows::core::Result<IXpsOMFontResource> {
let mut result__: <IXpsOMFontResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMFontResource>(result__)
}
pub unsafe fn SetFontResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMFontResource>>(&self, fontresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), fontresource.into_param().abi()).ok()
}
pub unsafe fn GetFontFaceIndex(&self) -> ::windows::core::Result<i16> {
let mut result__: <i16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), &mut result__).from_abi::<i16>(result__)
}
pub unsafe fn SetFontFaceIndex(&self, fontfaceindex: i16) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), ::core::mem::transmute(fontfaceindex)).ok()
}
pub unsafe fn GetFillBrush(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn GetFillBrushLocal(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn SetFillBrushLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMBrush>>(&self, fillbrush: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), fillbrush.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFillBrushLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).53)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetFillBrushLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).54)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetGlyphsEditor(&self) -> ::windows::core::Result<IXpsOMGlyphsEditor> {
let mut result__: <IXpsOMGlyphsEditor as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).55)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGlyphsEditor>(result__)
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMGlyphs> {
let mut result__: <IXpsOMGlyphs as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).56)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGlyphs>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMGlyphs {
type Vtable = IXpsOMGlyphs_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x819b3199_0a5a_4b64_bec7_a9e17e780de2);
}
impl ::core::convert::From<IXpsOMGlyphs> for ::windows::core::IUnknown {
fn from(value: IXpsOMGlyphs) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMGlyphs> for ::windows::core::IUnknown {
fn from(value: &IXpsOMGlyphs) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMGlyphs {
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 IXpsOMGlyphs {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMGlyphs> for IXpsOMVisual {
fn from(value: IXpsOMGlyphs) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMGlyphs> for IXpsOMVisual {
fn from(value: &IXpsOMGlyphs) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMVisual> for IXpsOMGlyphs {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMVisual> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMVisual> for &IXpsOMGlyphs {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMVisual> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMGlyphs> for IXpsOMShareable {
fn from(value: IXpsOMGlyphs) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMGlyphs> for IXpsOMShareable {
fn from(value: &IXpsOMGlyphs) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMGlyphs {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMGlyphs {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMGlyphs_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ishyperlink: *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, ishyperlink: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hyperlinkuri: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hyperlinkuri: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodestring: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, indexcount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, indexcount: *mut u32, glyphindices: *mut XPS_GLYPH_INDEX) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphmappingcount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphmappingcount: *mut u32, glyphmappings: *mut XPS_GLYPH_MAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prohibitedcaretstopcount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prohibitedcaretstopcount: *mut u32, prohibitedcaretstops: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bidilevel: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, issideways: *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, devicefontname: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stylesimulations: *mut XPS_STYLE_SIMULATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stylesimulations: XPS_STYLE_SIMULATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, origin: *mut XPS_POINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, origin: *const XPS_POINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontrenderingemsize: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontrenderingemsize: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfaceindex: *mut i16) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontfaceindex: i16) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fillbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fillbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fillbrush: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, editor: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphs: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMGlyphsEditor(pub ::windows::core::IUnknown);
impl IXpsOMGlyphsEditor {
pub unsafe fn ApplyEdits(&self) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetUnicodeString(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetUnicodeString<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, unicodestring: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), unicodestring.into_param().abi()).ok()
}
pub unsafe fn GetGlyphIndexCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetGlyphIndices(&self, indexcount: *mut u32, glyphindices: *mut XPS_GLYPH_INDEX) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(indexcount), ::core::mem::transmute(glyphindices)).ok()
}
pub unsafe fn SetGlyphIndices(&self, indexcount: u32, glyphindices: *const XPS_GLYPH_INDEX) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(indexcount), ::core::mem::transmute(glyphindices)).ok()
}
pub unsafe fn GetGlyphMappingCount(&self) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetGlyphMappings(&self, glyphmappingcount: *mut u32, glyphmappings: *mut XPS_GLYPH_MAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphmappingcount), ::core::mem::transmute(glyphmappings)).ok()
}
pub unsafe fn SetGlyphMappings(&self, glyphmappingcount: u32, glyphmappings: *const XPS_GLYPH_MAPPING) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(glyphmappingcount), ::core::mem::transmute(glyphmappings)).ok()
}
pub unsafe fn GetProhibitedCaretStopCount(&self) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetProhibitedCaretStops(&self, count: *mut u32, prohibitedcaretstops: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(count), ::core::mem::transmute(prohibitedcaretstops)).ok()
}
pub unsafe fn SetProhibitedCaretStops(&self, count: u32, prohibitedcaretstops: *const u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(count), ::core::mem::transmute(prohibitedcaretstops)).ok()
}
pub unsafe fn GetBidiLevel(&self) -> ::windows::core::Result<u32> {
let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn SetBidiLevel(&self, bidilevel: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(bidilevel)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIsSideways(&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).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetIsSideways<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, issideways: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), issideways.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDeviceFontName(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetDeviceFontName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, devicefontname: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), devicefontname.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMGlyphsEditor {
type Vtable = IXpsOMGlyphsEditor_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa5ab8616_5b16_4b9f_9629_89b323ed7909);
}
impl ::core::convert::From<IXpsOMGlyphsEditor> for ::windows::core::IUnknown {
fn from(value: IXpsOMGlyphsEditor) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMGlyphsEditor> for ::windows::core::IUnknown {
fn from(value: &IXpsOMGlyphsEditor) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMGlyphsEditor {
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 IXpsOMGlyphsEditor {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMGlyphsEditor_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) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodestring: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unicodestring: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, indexcount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, indexcount: *mut u32, glyphindices: *mut XPS_GLYPH_INDEX) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, indexcount: u32, glyphindices: *const XPS_GLYPH_INDEX) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphmappingcount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphmappingcount: *mut u32, glyphmappings: *mut XPS_GLYPH_MAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, glyphmappingcount: u32, glyphmappings: *const XPS_GLYPH_MAPPING) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, prohibitedcaretstopcount: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: *mut u32, prohibitedcaretstops: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, count: u32, prohibitedcaretstops: *const u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bidilevel: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bidilevel: u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, issideways: *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, 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, devicefontname: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, devicefontname: 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 IXpsOMGradientBrush(pub ::windows::core::IUnknown);
impl IXpsOMGradientBrush {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetOpacity(&self) -> ::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), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
pub unsafe fn GetGradientStops(&self) -> ::windows::core::Result<IXpsOMGradientStopCollection> {
let mut result__: <IXpsOMGradientStopCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGradientStopCollection>(result__)
}
pub unsafe fn GetTransform(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn GetTransformLocal(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn SetTransformLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMMatrixTransform>>(&self, transform: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), transform.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTransformLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR 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::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTransformLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetSpreadMethod(&self) -> ::windows::core::Result<XPS_SPREAD_METHOD> {
let mut result__: <XPS_SPREAD_METHOD as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_SPREAD_METHOD>(result__)
}
pub unsafe fn SetSpreadMethod(&self, spreadmethod: XPS_SPREAD_METHOD) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(spreadmethod)).ok()
}
pub unsafe fn GetColorInterpolationMode(&self) -> ::windows::core::Result<XPS_COLOR_INTERPOLATION> {
let mut result__: <XPS_COLOR_INTERPOLATION as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_COLOR_INTERPOLATION>(result__)
}
pub unsafe fn SetColorInterpolationMode(&self, colorinterpolationmode: XPS_COLOR_INTERPOLATION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(colorinterpolationmode)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMGradientBrush {
type Vtable = IXpsOMGradientBrush_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xedb59622_61a2_42c3_bace_acf2286c06bf);
}
impl ::core::convert::From<IXpsOMGradientBrush> for ::windows::core::IUnknown {
fn from(value: IXpsOMGradientBrush) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMGradientBrush> for ::windows::core::IUnknown {
fn from(value: &IXpsOMGradientBrush) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMGradientBrush {
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 IXpsOMGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMGradientBrush> for IXpsOMBrush {
fn from(value: IXpsOMGradientBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMGradientBrush> for IXpsOMBrush {
fn from(value: &IXpsOMGradientBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for IXpsOMGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for &IXpsOMGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMGradientBrush> for IXpsOMShareable {
fn from(value: IXpsOMGradientBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMGradientBrush> for IXpsOMShareable {
fn from(value: &IXpsOMGradientBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMGradientBrush_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gradientstops: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, spreadmethod: *mut XPS_SPREAD_METHOD) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, spreadmethod: XPS_SPREAD_METHOD) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorinterpolationmode: *mut XPS_COLOR_INTERPOLATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorinterpolationmode: XPS_COLOR_INTERPOLATION) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMGradientStop(pub ::windows::core::IUnknown);
impl IXpsOMGradientStop {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<IXpsOMGradientBrush> {
let mut result__: <IXpsOMGradientBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGradientBrush>(result__)
}
pub unsafe fn GetOffset(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOffset(&self, offset: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(offset)).ok()
}
pub unsafe fn GetColor(&self, color: *mut XPS_COLOR, colorprofile: *mut ::core::option::Option<IXpsOMColorProfileResource>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(color), ::core::mem::transmute(colorprofile)).ok()
}
pub unsafe fn SetColor<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMColorProfileResource>>(&self, color: *const XPS_COLOR, colorprofile: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(color), colorprofile.into_param().abi()).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMGradientStop> {
let mut result__: <IXpsOMGradientStop as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGradientStop>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMGradientStop {
type Vtable = IXpsOMGradientStop_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x5cf4f5cc_3969_49b5_a70a_5550b618fe49);
}
impl ::core::convert::From<IXpsOMGradientStop> for ::windows::core::IUnknown {
fn from(value: IXpsOMGradientStop) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMGradientStop> for ::windows::core::IUnknown {
fn from(value: &IXpsOMGradientStop) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMGradientStop {
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 IXpsOMGradientStop {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMGradientStop_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, offset: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, offset: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, color: *mut XPS_COLOR, colorprofile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, color: *const XPS_COLOR, colorprofile: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gradientstop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMGradientStopCollection(pub ::windows::core::IUnknown);
impl IXpsOMGradientStopCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsOMGradientStop> {
let mut result__: <IXpsOMGradientStop 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::<IXpsOMGradientStop>(result__)
}
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMGradientStop>>(&self, index: u32, stop: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), stop.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMGradientStop>>(&self, index: u32, stop: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), stop.into_param().abi()).ok()
}
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMGradientStop>>(&self, stop: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), stop.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMGradientStopCollection {
type Vtable = IXpsOMGradientStopCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc9174c3a_3cd3_4319_bda4_11a39392ceef);
}
impl ::core::convert::From<IXpsOMGradientStopCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMGradientStopCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMGradientStopCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMGradientStopCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMGradientStopCollection {
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 IXpsOMGradientStopCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMGradientStopCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, stop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, stop: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, stop: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stop: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMImageBrush(pub ::windows::core::IUnknown);
impl IXpsOMImageBrush {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetOpacity(&self) -> ::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), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
pub unsafe fn GetTransform(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn GetTransformLocal(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn SetTransformLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMMatrixTransform>>(&self, transform: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), transform.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTransformLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTransformLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetViewbox(&self) -> ::windows::core::Result<XPS_RECT> {
let mut result__: <XPS_RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_RECT>(result__)
}
pub unsafe fn SetViewbox(&self, viewbox: *const XPS_RECT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(viewbox)).ok()
}
pub unsafe fn GetViewport(&self) -> ::windows::core::Result<XPS_RECT> {
let mut result__: <XPS_RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_RECT>(result__)
}
pub unsafe fn SetViewport(&self, viewport: *const XPS_RECT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(viewport)).ok()
}
pub unsafe fn GetTileMode(&self) -> ::windows::core::Result<XPS_TILE_MODE> {
let mut result__: <XPS_TILE_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_TILE_MODE>(result__)
}
pub unsafe fn SetTileMode(&self, tilemode: XPS_TILE_MODE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(tilemode)).ok()
}
pub unsafe fn GetImageResource(&self) -> ::windows::core::Result<IXpsOMImageResource> {
let mut result__: <IXpsOMImageResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMImageResource>(result__)
}
pub unsafe fn SetImageResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(&self, imageresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), imageresource.into_param().abi()).ok()
}
pub unsafe fn GetColorProfileResource(&self) -> ::windows::core::Result<IXpsOMColorProfileResource> {
let mut result__: <IXpsOMColorProfileResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMColorProfileResource>(result__)
}
pub unsafe fn SetColorProfileResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMColorProfileResource>>(&self, colorprofileresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), colorprofileresource.into_param().abi()).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMImageBrush> {
let mut result__: <IXpsOMImageBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMImageBrush>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMImageBrush {
type Vtable = IXpsOMImageBrush_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3df0b466_d382_49ef_8550_dd94c80242e4);
}
impl ::core::convert::From<IXpsOMImageBrush> for ::windows::core::IUnknown {
fn from(value: IXpsOMImageBrush) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMImageBrush> for ::windows::core::IUnknown {
fn from(value: &IXpsOMImageBrush) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMImageBrush {
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 IXpsOMImageBrush {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMImageBrush> for IXpsOMTileBrush {
fn from(value: IXpsOMImageBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMImageBrush> for IXpsOMTileBrush {
fn from(value: &IXpsOMImageBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMTileBrush> for IXpsOMImageBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMTileBrush> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMTileBrush> for &IXpsOMImageBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMTileBrush> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMImageBrush> for IXpsOMBrush {
fn from(value: IXpsOMImageBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMImageBrush> for IXpsOMBrush {
fn from(value: &IXpsOMImageBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for IXpsOMImageBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for &IXpsOMImageBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMImageBrush> for IXpsOMShareable {
fn from(value: IXpsOMImageBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMImageBrush> for IXpsOMShareable {
fn from(value: &IXpsOMImageBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMImageBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMImageBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMImageBrush_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewbox: *mut XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewbox: *const XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewport: *mut XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewport: *const XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tilemode: *mut XPS_TILE_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tilemode: XPS_TILE_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imageresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imageresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorprofileresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorprofileresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imagebrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMImageResource(pub ::windows::core::IUnknown);
impl IXpsOMImageResource {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetStream(&self) -> ::windows::core::Result<super::super::System::Com::IStream> {
let mut result__: <super::super::System::Com::IStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::System::Com::IStream>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn SetContent<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param2: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, sourcestream: Param0, imagetype: XPS_IMAGE_TYPE, partname: Param2) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), sourcestream.into_param().abi(), ::core::mem::transmute(imagetype), partname.into_param().abi()).ok()
}
pub unsafe fn GetImageType(&self) -> ::windows::core::Result<XPS_IMAGE_TYPE> {
let mut result__: <XPS_IMAGE_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_IMAGE_TYPE>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMImageResource {
type Vtable = IXpsOMImageResource_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x3db8417d_ae50_485e_9a44_d7758f78a23f);
}
impl ::core::convert::From<IXpsOMImageResource> for ::windows::core::IUnknown {
fn from(value: IXpsOMImageResource) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMImageResource> for ::windows::core::IUnknown {
fn from(value: &IXpsOMImageResource) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMImageResource {
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 IXpsOMImageResource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMImageResource> for IXpsOMResource {
fn from(value: IXpsOMImageResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMImageResource> for IXpsOMResource {
fn from(value: &IXpsOMImageResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for IXpsOMImageResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for &IXpsOMImageResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMImageResource> for IXpsOMPart {
fn from(value: IXpsOMImageResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMImageResource> for IXpsOMPart {
fn from(value: &IXpsOMImageResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMImageResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMImageResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMImageResource_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, readerstream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sourcestream: ::windows::core::RawPtr, imagetype: XPS_IMAGE_TYPE, partname: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imagetype: *mut XPS_IMAGE_TYPE) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMImageResourceCollection(pub ::windows::core::IUnknown);
impl IXpsOMImageResourceCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsOMImageResource> {
let mut result__: <IXpsOMImageResource 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::<IXpsOMImageResource>(result__)
}
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(&self, index: u32, object: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), object.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(&self, index: u32, object: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), object.into_param().abi()).ok()
}
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(&self, object: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), object.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetByPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, partname: Param0) -> ::windows::core::Result<IXpsOMImageResource> {
let mut result__: <IXpsOMImageResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), partname.into_param().abi(), &mut result__).from_abi::<IXpsOMImageResource>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMImageResourceCollection {
type Vtable = IXpsOMImageResourceCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7a4a1a71_9cde_4b71_b33f_62de843eabfe);
}
impl ::core::convert::From<IXpsOMImageResourceCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMImageResourceCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMImageResourceCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMImageResourceCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMImageResourceCollection {
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 IXpsOMImageResourceCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMImageResourceCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, partname: ::windows::core::RawPtr, part: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMLinearGradientBrush(pub ::windows::core::IUnknown);
impl IXpsOMLinearGradientBrush {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetOpacity(&self) -> ::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), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
pub unsafe fn GetGradientStops(&self) -> ::windows::core::Result<IXpsOMGradientStopCollection> {
let mut result__: <IXpsOMGradientStopCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGradientStopCollection>(result__)
}
pub unsafe fn GetTransform(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn GetTransformLocal(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn SetTransformLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMMatrixTransform>>(&self, transform: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), transform.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTransformLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR 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::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTransformLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetSpreadMethod(&self) -> ::windows::core::Result<XPS_SPREAD_METHOD> {
let mut result__: <XPS_SPREAD_METHOD as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_SPREAD_METHOD>(result__)
}
pub unsafe fn SetSpreadMethod(&self, spreadmethod: XPS_SPREAD_METHOD) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(spreadmethod)).ok()
}
pub unsafe fn GetColorInterpolationMode(&self) -> ::windows::core::Result<XPS_COLOR_INTERPOLATION> {
let mut result__: <XPS_COLOR_INTERPOLATION as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_COLOR_INTERPOLATION>(result__)
}
pub unsafe fn SetColorInterpolationMode(&self, colorinterpolationmode: XPS_COLOR_INTERPOLATION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(colorinterpolationmode)).ok()
}
pub unsafe fn GetStartPoint(&self) -> ::windows::core::Result<XPS_POINT> {
let mut result__: <XPS_POINT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_POINT>(result__)
}
pub unsafe fn SetStartPoint(&self, startpoint: *const XPS_POINT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(startpoint)).ok()
}
pub unsafe fn GetEndPoint(&self) -> ::windows::core::Result<XPS_POINT> {
let mut result__: <XPS_POINT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_POINT>(result__)
}
pub unsafe fn SetEndPoint(&self, endpoint: *const XPS_POINT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(endpoint)).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMLinearGradientBrush> {
let mut result__: <IXpsOMLinearGradientBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMLinearGradientBrush>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMLinearGradientBrush {
type Vtable = IXpsOMLinearGradientBrush_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x005e279f_c30d_40ff_93ec_1950d3c528db);
}
impl ::core::convert::From<IXpsOMLinearGradientBrush> for ::windows::core::IUnknown {
fn from(value: IXpsOMLinearGradientBrush) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMLinearGradientBrush> for ::windows::core::IUnknown {
fn from(value: &IXpsOMLinearGradientBrush) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMLinearGradientBrush {
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 IXpsOMLinearGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMLinearGradientBrush> for IXpsOMGradientBrush {
fn from(value: IXpsOMLinearGradientBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMLinearGradientBrush> for IXpsOMGradientBrush {
fn from(value: &IXpsOMLinearGradientBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMGradientBrush> for IXpsOMLinearGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMGradientBrush> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMGradientBrush> for &IXpsOMLinearGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMGradientBrush> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMLinearGradientBrush> for IXpsOMBrush {
fn from(value: IXpsOMLinearGradientBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMLinearGradientBrush> for IXpsOMBrush {
fn from(value: &IXpsOMLinearGradientBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for IXpsOMLinearGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for &IXpsOMLinearGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMLinearGradientBrush> for IXpsOMShareable {
fn from(value: IXpsOMLinearGradientBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMLinearGradientBrush> for IXpsOMShareable {
fn from(value: &IXpsOMLinearGradientBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMLinearGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMLinearGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMLinearGradientBrush_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gradientstops: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, spreadmethod: *mut XPS_SPREAD_METHOD) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, spreadmethod: XPS_SPREAD_METHOD) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorinterpolationmode: *mut XPS_COLOR_INTERPOLATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorinterpolationmode: XPS_COLOR_INTERPOLATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, startpoint: *mut XPS_POINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, startpoint: *const XPS_POINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, endpoint: *mut XPS_POINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, endpoint: *const XPS_POINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lineargradientbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMMatrixTransform(pub ::windows::core::IUnknown);
impl IXpsOMMatrixTransform {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetMatrix(&self) -> ::windows::core::Result<XPS_MATRIX> {
let mut result__: <XPS_MATRIX as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_MATRIX>(result__)
}
pub unsafe fn SetMatrix(&self, matrix: *const XPS_MATRIX) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(matrix)).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMMatrixTransform {
type Vtable = IXpsOMMatrixTransform_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb77330ff_bb37_4501_a93e_f1b1e50bfc46);
}
impl ::core::convert::From<IXpsOMMatrixTransform> for ::windows::core::IUnknown {
fn from(value: IXpsOMMatrixTransform) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMMatrixTransform> for ::windows::core::IUnknown {
fn from(value: &IXpsOMMatrixTransform) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMMatrixTransform {
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 IXpsOMMatrixTransform {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMMatrixTransform> for IXpsOMShareable {
fn from(value: IXpsOMMatrixTransform) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMMatrixTransform> for IXpsOMShareable {
fn from(value: &IXpsOMMatrixTransform) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMMatrixTransform {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMMatrixTransform {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMMatrixTransform_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrix: *mut XPS_MATRIX) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrix: *const XPS_MATRIX) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMNameCollection(pub ::windows::core::IUnknown);
impl IXpsOMNameCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR 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::<super::super::Foundation::PWSTR>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMNameCollection {
type Vtable = IXpsOMNameCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4bddf8ec_c915_421b_a166_d173d25653d2);
}
impl ::core::convert::From<IXpsOMNameCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMNameCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMNameCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMNameCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMNameCollection {
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 IXpsOMNameCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMNameCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, name: *mut 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 IXpsOMObjectFactory(pub ::windows::core::IUnknown);
impl IXpsOMObjectFactory {
pub unsafe fn CreatePackage(&self) -> ::windows::core::Result<IXpsOMPackage> {
let mut result__: <IXpsOMPackage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPackage>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreatePackageFromFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, filename: Param0, reuseobjects: Param1) -> ::windows::core::Result<IXpsOMPackage> {
let mut result__: <IXpsOMPackage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), filename.into_param().abi(), reuseobjects.into_param().abi(), &mut result__).from_abi::<IXpsOMPackage>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))]
pub unsafe fn CreatePackageFromStream<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, stream: Param0, reuseobjects: Param1) -> ::windows::core::Result<IXpsOMPackage> {
let mut result__: <IXpsOMPackage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), stream.into_param().abi(), reuseobjects.into_param().abi(), &mut result__).from_abi::<IXpsOMPackage>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateStoryFragmentsResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMStoryFragmentsResource> {
let mut result__: <IXpsOMStoryFragmentsResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMStoryFragmentsResource>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateDocumentStructureResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMDocumentStructureResource> {
let mut result__: <IXpsOMDocumentStructureResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMDocumentStructureResource>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateSignatureBlockResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMSignatureBlockResource> {
let mut result__: <IXpsOMSignatureBlockResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMSignatureBlockResource>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn CreateRemoteDictionaryResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMDictionary>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, dictionary: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMRemoteDictionaryResource> {
let mut result__: <IXpsOMRemoteDictionaryResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), dictionary.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMRemoteDictionaryResource>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateRemoteDictionaryResourceFromStream<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param2: ::windows::core::IntoParam<'a, IXpsOMPartResources>>(&self, dictionarymarkupstream: Param0, dictionaryparturi: Param1, resources: Param2) -> ::windows::core::Result<IXpsOMRemoteDictionaryResource> {
let mut result__: <IXpsOMRemoteDictionaryResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), dictionarymarkupstream.into_param().abi(), dictionaryparturi.into_param().abi(), resources.into_param().abi(), &mut result__).from_abi::<IXpsOMRemoteDictionaryResource>(result__)
}
pub unsafe fn CreatePartResources(&self) -> ::windows::core::Result<IXpsOMPartResources> {
let mut result__: <IXpsOMPartResources as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPartResources>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn CreateDocumentSequence<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<IXpsOMDocumentSequence> {
let mut result__: <IXpsOMDocumentSequence as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMDocumentSequence>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn CreateDocument<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<IXpsOMDocument> {
let mut result__: <IXpsOMDocument as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMDocument>(result__)
}
pub unsafe fn CreatePageReference(&self, advisorypagedimensions: *const XPS_SIZE) -> ::windows::core::Result<IXpsOMPageReference> {
let mut result__: <IXpsOMPageReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(advisorypagedimensions), &mut result__).from_abi::<IXpsOMPageReference>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc"))]
pub unsafe fn CreatePage<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, pagedimensions: *const XPS_SIZE, language: Param1, parturi: Param2) -> ::windows::core::Result<IXpsOMPage> {
let mut result__: <IXpsOMPage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(pagedimensions), language.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMPage>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreatePageFromStream<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param2: ::windows::core::IntoParam<'a, IXpsOMPartResources>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, pagemarkupstream: Param0, parturi: Param1, resources: Param2, reuseobjects: Param3) -> ::windows::core::Result<IXpsOMPage> {
let mut result__: <IXpsOMPage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), pagemarkupstream.into_param().abi(), parturi.into_param().abi(), resources.into_param().abi(), reuseobjects.into_param().abi(), &mut result__).from_abi::<IXpsOMPage>(result__)
}
pub unsafe fn CreateCanvas(&self) -> ::windows::core::Result<IXpsOMCanvas> {
let mut result__: <IXpsOMCanvas as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMCanvas>(result__)
}
pub unsafe fn CreateGlyphs<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMFontResource>>(&self, fontresource: Param0) -> ::windows::core::Result<IXpsOMGlyphs> {
let mut result__: <IXpsOMGlyphs as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), fontresource.into_param().abi(), &mut result__).from_abi::<IXpsOMGlyphs>(result__)
}
pub unsafe fn CreatePath(&self) -> ::windows::core::Result<IXpsOMPath> {
let mut result__: <IXpsOMPath as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPath>(result__)
}
pub unsafe fn CreateGeometry(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn CreateGeometryFigure(&self, startpoint: *const XPS_POINT) -> ::windows::core::Result<IXpsOMGeometryFigure> {
let mut result__: <IXpsOMGeometryFigure as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(startpoint), &mut result__).from_abi::<IXpsOMGeometryFigure>(result__)
}
pub unsafe fn CreateMatrixTransform(&self, matrix: *const XPS_MATRIX) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(matrix), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn CreateSolidColorBrush<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMColorProfileResource>>(&self, color: *const XPS_COLOR, colorprofile: Param1) -> ::windows::core::Result<IXpsOMSolidColorBrush> {
let mut result__: <IXpsOMSolidColorBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(color), colorprofile.into_param().abi(), &mut result__).from_abi::<IXpsOMSolidColorBrush>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateColorProfileResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMColorProfileResource> {
let mut result__: <IXpsOMColorProfileResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMColorProfileResource>(result__)
}
pub unsafe fn CreateImageBrush<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(&self, image: Param0, viewbox: *const XPS_RECT, viewport: *const XPS_RECT) -> ::windows::core::Result<IXpsOMImageBrush> {
let mut result__: <IXpsOMImageBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), image.into_param().abi(), ::core::mem::transmute(viewbox), ::core::mem::transmute(viewport), &mut result__).from_abi::<IXpsOMImageBrush>(result__)
}
pub unsafe fn CreateVisualBrush(&self, viewbox: *const XPS_RECT, viewport: *const XPS_RECT) -> ::windows::core::Result<IXpsOMVisualBrush> {
let mut result__: <IXpsOMVisualBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), ::core::mem::transmute(viewbox), ::core::mem::transmute(viewport), &mut result__).from_abi::<IXpsOMVisualBrush>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateImageResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param2: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, contenttype: XPS_IMAGE_TYPE, parturi: Param2) -> ::windows::core::Result<IXpsOMImageResource> {
let mut result__: <IXpsOMImageResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), ::core::mem::transmute(contenttype), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMImageResource>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreatePrintTicketResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMPrintTicketResource> {
let mut result__: <IXpsOMPrintTicketResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMPrintTicketResource>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateFontResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param2: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, acquiredstream: Param0, fontembedding: XPS_FONT_EMBEDDING, parturi: Param2, isobfsourcestream: Param3) -> ::windows::core::Result<IXpsOMFontResource> {
let mut result__: <IXpsOMFontResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), ::core::mem::transmute(fontembedding), parturi.into_param().abi(), isobfsourcestream.into_param().abi(), &mut result__).from_abi::<IXpsOMFontResource>(result__)
}
pub unsafe fn CreateGradientStop<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMColorProfileResource>>(&self, color: *const XPS_COLOR, colorprofile: Param1, offset: f32) -> ::windows::core::Result<IXpsOMGradientStop> {
let mut result__: <IXpsOMGradientStop as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), ::core::mem::transmute(color), colorprofile.into_param().abi(), ::core::mem::transmute(offset), &mut result__).from_abi::<IXpsOMGradientStop>(result__)
}
pub unsafe fn CreateLinearGradientBrush<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMGradientStop>, Param1: ::windows::core::IntoParam<'a, IXpsOMGradientStop>>(&self, gradstop1: Param0, gradstop2: Param1, startpoint: *const XPS_POINT, endpoint: *const XPS_POINT) -> ::windows::core::Result<IXpsOMLinearGradientBrush> {
let mut result__: <IXpsOMLinearGradientBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), gradstop1.into_param().abi(), gradstop2.into_param().abi(), ::core::mem::transmute(startpoint), ::core::mem::transmute(endpoint), &mut result__).from_abi::<IXpsOMLinearGradientBrush>(result__)
}
pub unsafe fn CreateRadialGradientBrush<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMGradientStop>, Param1: ::windows::core::IntoParam<'a, IXpsOMGradientStop>>(&self, gradstop1: Param0, gradstop2: Param1, centerpoint: *const XPS_POINT, gradientorigin: *const XPS_POINT, radiisizes: *const XPS_SIZE) -> ::windows::core::Result<IXpsOMRadialGradientBrush> {
let mut result__: <IXpsOMRadialGradientBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), gradstop1.into_param().abi(), gradstop2.into_param().abi(), ::core::mem::transmute(centerpoint), ::core::mem::transmute(gradientorigin), ::core::mem::transmute(radiisizes), &mut result__).from_abi::<IXpsOMRadialGradientBrush>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn CreateCoreProperties<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<IXpsOMCoreProperties> {
let mut result__: <IXpsOMCoreProperties as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMCoreProperties>(result__)
}
pub unsafe fn CreateDictionary(&self) -> ::windows::core::Result<IXpsOMDictionary> {
let mut result__: <IXpsOMDictionary as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDictionary>(result__)
}
pub unsafe fn CreatePartUriCollection(&self) -> ::windows::core::Result<IXpsOMPartUriCollection> {
let mut result__: <IXpsOMPartUriCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPartUriCollection>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security", feature = "Win32_Storage_Packaging_Opc"))]
pub unsafe fn CreatePackageWriterOnFile<
'a,
Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>,
Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>,
Param5: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
Param6: ::windows::core::IntoParam<'a, IXpsOMCoreProperties>,
Param7: ::windows::core::IntoParam<'a, IXpsOMImageResource>,
Param8: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>,
Param9: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
>(
&self,
filename: Param0,
securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES,
flagsandattributes: u32,
optimizemarkupsize: Param3,
interleaving: XPS_INTERLEAVING,
documentsequencepartname: Param5,
coreproperties: Param6,
packagethumbnail: Param7,
documentsequenceprintticket: Param8,
discardcontrolpartname: Param9,
) -> ::windows::core::Result<IXpsOMPackageWriter> {
let mut result__: <IXpsOMPackageWriter as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).36)(
::core::mem::transmute_copy(self),
filename.into_param().abi(),
::core::mem::transmute(securityattributes),
::core::mem::transmute(flagsandattributes),
optimizemarkupsize.into_param().abi(),
::core::mem::transmute(interleaving),
documentsequencepartname.into_param().abi(),
coreproperties.into_param().abi(),
packagethumbnail.into_param().abi(),
documentsequenceprintticket.into_param().abi(),
discardcontrolpartname.into_param().abi(),
&mut result__,
)
.from_abi::<IXpsOMPackageWriter>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreatePackageWriterOnStream<
'a,
Param0: ::windows::core::IntoParam<'a, super::super::System::Com::ISequentialStream>,
Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>,
Param3: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
Param4: ::windows::core::IntoParam<'a, IXpsOMCoreProperties>,
Param5: ::windows::core::IntoParam<'a, IXpsOMImageResource>,
Param6: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>,
Param7: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
>(
&self,
outputstream: Param0,
optimizemarkupsize: Param1,
interleaving: XPS_INTERLEAVING,
documentsequencepartname: Param3,
coreproperties: Param4,
packagethumbnail: Param5,
documentsequenceprintticket: Param6,
discardcontrolpartname: Param7,
) -> ::windows::core::Result<IXpsOMPackageWriter> {
let mut result__: <IXpsOMPackageWriter as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(
::core::mem::transmute_copy(self),
outputstream.into_param().abi(),
optimizemarkupsize.into_param().abi(),
::core::mem::transmute(interleaving),
documentsequencepartname.into_param().abi(),
coreproperties.into_param().abi(),
packagethumbnail.into_param().abi(),
documentsequenceprintticket.into_param().abi(),
discardcontrolpartname.into_param().abi(),
&mut result__,
)
.from_abi::<IXpsOMPackageWriter>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc"))]
pub unsafe fn CreatePartUri<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, uri: Param0) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), uri.into_param().abi(), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))]
pub unsafe fn CreateReadOnlyStreamOnFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filename: Param0) -> ::windows::core::Result<super::super::System::Com::IStream> {
let mut result__: <super::super::System::Com::IStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), filename.into_param().abi(), &mut result__).from_abi::<super::super::System::Com::IStream>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMObjectFactory {
type Vtable = IXpsOMObjectFactory_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xf9b2a685_a50d_4fc2_b764_b56e093ea0ca);
}
impl ::core::convert::From<IXpsOMObjectFactory> for ::windows::core::IUnknown {
fn from(value: IXpsOMObjectFactory) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMObjectFactory> for ::windows::core::IUnknown {
fn from(value: &IXpsOMObjectFactory) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMObjectFactory {
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 IXpsOMObjectFactory {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMObjectFactory_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, package: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filename: super::super::Foundation::PWSTR, reuseobjects: super::super::Foundation::BOOL, package: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: ::windows::core::RawPtr, reuseobjects: super::super::Foundation::BOOL, package: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, storyfragmentsresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, documentstructureresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, signatureblockresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionary: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, remotedictionaryresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionarymarkupstream: ::windows::core::RawPtr, dictionaryparturi: ::windows::core::RawPtr, resources: ::windows::core::RawPtr, dictionaryresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, partresources: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, documentsequence: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, document: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, advisorypagedimensions: *const XPS_SIZE, pagereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagedimensions: *const XPS_SIZE, language: super::super::Foundation::PWSTR, parturi: ::windows::core::RawPtr, page: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagemarkupstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, resources: ::windows::core::RawPtr, reuseobjects: super::super::Foundation::BOOL, page: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, canvas: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontresource: ::windows::core::RawPtr, glyphs: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, path: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, geometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, startpoint: *const XPS_POINT, figure: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrix: *const XPS_MATRIX, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, color: *const XPS_COLOR, colorprofile: ::windows::core::RawPtr, solidcolorbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, colorprofileresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, image: ::windows::core::RawPtr, viewbox: *const XPS_RECT, viewport: *const XPS_RECT, imagebrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewbox: *const XPS_RECT, viewport: *const XPS_RECT, visualbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, contenttype: XPS_IMAGE_TYPE, parturi: ::windows::core::RawPtr, imageresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, printticketresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, fontembedding: XPS_FONT_EMBEDDING, parturi: ::windows::core::RawPtr, isobfsourcestream: super::super::Foundation::BOOL, fontresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, color: *const XPS_COLOR, colorprofile: ::windows::core::RawPtr, offset: f32, gradientstop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gradstop1: ::windows::core::RawPtr, gradstop2: ::windows::core::RawPtr, startpoint: *const XPS_POINT, endpoint: *const XPS_POINT, lineargradientbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gradstop1: ::windows::core::RawPtr, gradstop2: ::windows::core::RawPtr, centerpoint: *const XPS_POINT, gradientorigin: *const XPS_POINT, radiisizes: *const XPS_SIZE, radialgradientbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, coreproperties: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionary: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturicollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security", feature = "Win32_Storage_Packaging_Opc"))]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
filename: super::super::Foundation::PWSTR,
securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES,
flagsandattributes: u32,
optimizemarkupsize: super::super::Foundation::BOOL,
interleaving: XPS_INTERLEAVING,
documentsequencepartname: ::windows::core::RawPtr,
coreproperties: ::windows::core::RawPtr,
packagethumbnail: ::windows::core::RawPtr,
documentsequenceprintticket: ::windows::core::RawPtr,
discardcontrolpartname: ::windows::core::RawPtr,
packagewriter: *mut ::windows::core::RawPtr,
) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Security", feature = "Win32_Storage_Packaging_Opc")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, outputstream: ::windows::core::RawPtr, optimizemarkupsize: super::super::Foundation::BOOL, interleaving: XPS_INTERLEAVING, documentsequencepartname: ::windows::core::RawPtr, coreproperties: ::windows::core::RawPtr, packagethumbnail: ::windows::core::RawPtr, documentsequenceprintticket: ::windows::core::RawPtr, discardcontrolpartname: ::windows::core::RawPtr, packagewriter: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, uri: super::super::Foundation::PWSTR, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filename: super::super::Foundation::PWSTR, stream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMObjectFactory1(pub ::windows::core::IUnknown);
impl IXpsOMObjectFactory1 {
pub unsafe fn CreatePackage(&self) -> ::windows::core::Result<IXpsOMPackage> {
let mut result__: <IXpsOMPackage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPackage>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreatePackageFromFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, filename: Param0, reuseobjects: Param1) -> ::windows::core::Result<IXpsOMPackage> {
let mut result__: <IXpsOMPackage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), filename.into_param().abi(), reuseobjects.into_param().abi(), &mut result__).from_abi::<IXpsOMPackage>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))]
pub unsafe fn CreatePackageFromStream<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, stream: Param0, reuseobjects: Param1) -> ::windows::core::Result<IXpsOMPackage> {
let mut result__: <IXpsOMPackage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), stream.into_param().abi(), reuseobjects.into_param().abi(), &mut result__).from_abi::<IXpsOMPackage>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateStoryFragmentsResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMStoryFragmentsResource> {
let mut result__: <IXpsOMStoryFragmentsResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMStoryFragmentsResource>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateDocumentStructureResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMDocumentStructureResource> {
let mut result__: <IXpsOMDocumentStructureResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMDocumentStructureResource>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateSignatureBlockResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMSignatureBlockResource> {
let mut result__: <IXpsOMSignatureBlockResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMSignatureBlockResource>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn CreateRemoteDictionaryResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMDictionary>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, dictionary: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMRemoteDictionaryResource> {
let mut result__: <IXpsOMRemoteDictionaryResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), dictionary.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMRemoteDictionaryResource>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateRemoteDictionaryResourceFromStream<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param2: ::windows::core::IntoParam<'a, IXpsOMPartResources>>(&self, dictionarymarkupstream: Param0, dictionaryparturi: Param1, resources: Param2) -> ::windows::core::Result<IXpsOMRemoteDictionaryResource> {
let mut result__: <IXpsOMRemoteDictionaryResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), dictionarymarkupstream.into_param().abi(), dictionaryparturi.into_param().abi(), resources.into_param().abi(), &mut result__).from_abi::<IXpsOMRemoteDictionaryResource>(result__)
}
pub unsafe fn CreatePartResources(&self) -> ::windows::core::Result<IXpsOMPartResources> {
let mut result__: <IXpsOMPartResources as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPartResources>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn CreateDocumentSequence<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<IXpsOMDocumentSequence> {
let mut result__: <IXpsOMDocumentSequence as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMDocumentSequence>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn CreateDocument<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<IXpsOMDocument> {
let mut result__: <IXpsOMDocument as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMDocument>(result__)
}
pub unsafe fn CreatePageReference(&self, advisorypagedimensions: *const XPS_SIZE) -> ::windows::core::Result<IXpsOMPageReference> {
let mut result__: <IXpsOMPageReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(advisorypagedimensions), &mut result__).from_abi::<IXpsOMPageReference>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc"))]
pub unsafe fn CreatePage<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, pagedimensions: *const XPS_SIZE, language: Param1, parturi: Param2) -> ::windows::core::Result<IXpsOMPage> {
let mut result__: <IXpsOMPage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(pagedimensions), language.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMPage>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreatePageFromStream<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param2: ::windows::core::IntoParam<'a, IXpsOMPartResources>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, pagemarkupstream: Param0, parturi: Param1, resources: Param2, reuseobjects: Param3) -> ::windows::core::Result<IXpsOMPage> {
let mut result__: <IXpsOMPage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), pagemarkupstream.into_param().abi(), parturi.into_param().abi(), resources.into_param().abi(), reuseobjects.into_param().abi(), &mut result__).from_abi::<IXpsOMPage>(result__)
}
pub unsafe fn CreateCanvas(&self) -> ::windows::core::Result<IXpsOMCanvas> {
let mut result__: <IXpsOMCanvas as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMCanvas>(result__)
}
pub unsafe fn CreateGlyphs<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMFontResource>>(&self, fontresource: Param0) -> ::windows::core::Result<IXpsOMGlyphs> {
let mut result__: <IXpsOMGlyphs as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), fontresource.into_param().abi(), &mut result__).from_abi::<IXpsOMGlyphs>(result__)
}
pub unsafe fn CreatePath(&self) -> ::windows::core::Result<IXpsOMPath> {
let mut result__: <IXpsOMPath as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPath>(result__)
}
pub unsafe fn CreateGeometry(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn CreateGeometryFigure(&self, startpoint: *const XPS_POINT) -> ::windows::core::Result<IXpsOMGeometryFigure> {
let mut result__: <IXpsOMGeometryFigure as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), ::core::mem::transmute(startpoint), &mut result__).from_abi::<IXpsOMGeometryFigure>(result__)
}
pub unsafe fn CreateMatrixTransform(&self, matrix: *const XPS_MATRIX) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(matrix), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn CreateSolidColorBrush<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMColorProfileResource>>(&self, color: *const XPS_COLOR, colorprofile: Param1) -> ::windows::core::Result<IXpsOMSolidColorBrush> {
let mut result__: <IXpsOMSolidColorBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), ::core::mem::transmute(color), colorprofile.into_param().abi(), &mut result__).from_abi::<IXpsOMSolidColorBrush>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateColorProfileResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMColorProfileResource> {
let mut result__: <IXpsOMColorProfileResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMColorProfileResource>(result__)
}
pub unsafe fn CreateImageBrush<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(&self, image: Param0, viewbox: *const XPS_RECT, viewport: *const XPS_RECT) -> ::windows::core::Result<IXpsOMImageBrush> {
let mut result__: <IXpsOMImageBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), image.into_param().abi(), ::core::mem::transmute(viewbox), ::core::mem::transmute(viewport), &mut result__).from_abi::<IXpsOMImageBrush>(result__)
}
pub unsafe fn CreateVisualBrush(&self, viewbox: *const XPS_RECT, viewport: *const XPS_RECT) -> ::windows::core::Result<IXpsOMVisualBrush> {
let mut result__: <IXpsOMVisualBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), ::core::mem::transmute(viewbox), ::core::mem::transmute(viewport), &mut result__).from_abi::<IXpsOMVisualBrush>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateImageResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param2: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, contenttype: XPS_IMAGE_TYPE, parturi: Param2) -> ::windows::core::Result<IXpsOMImageResource> {
let mut result__: <IXpsOMImageResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), ::core::mem::transmute(contenttype), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMImageResource>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreatePrintTicketResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, acquiredstream: Param0, parturi: Param1) -> ::windows::core::Result<IXpsOMPrintTicketResource> {
let mut result__: <IXpsOMPrintTicketResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMPrintTicketResource>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateFontResource<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param2: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, acquiredstream: Param0, fontembedding: XPS_FONT_EMBEDDING, parturi: Param2, isobfsourcestream: Param3) -> ::windows::core::Result<IXpsOMFontResource> {
let mut result__: <IXpsOMFontResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), acquiredstream.into_param().abi(), ::core::mem::transmute(fontembedding), parturi.into_param().abi(), isobfsourcestream.into_param().abi(), &mut result__).from_abi::<IXpsOMFontResource>(result__)
}
pub unsafe fn CreateGradientStop<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMColorProfileResource>>(&self, color: *const XPS_COLOR, colorprofile: Param1, offset: f32) -> ::windows::core::Result<IXpsOMGradientStop> {
let mut result__: <IXpsOMGradientStop as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), ::core::mem::transmute(color), colorprofile.into_param().abi(), ::core::mem::transmute(offset), &mut result__).from_abi::<IXpsOMGradientStop>(result__)
}
pub unsafe fn CreateLinearGradientBrush<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMGradientStop>, Param1: ::windows::core::IntoParam<'a, IXpsOMGradientStop>>(&self, gradstop1: Param0, gradstop2: Param1, startpoint: *const XPS_POINT, endpoint: *const XPS_POINT) -> ::windows::core::Result<IXpsOMLinearGradientBrush> {
let mut result__: <IXpsOMLinearGradientBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), gradstop1.into_param().abi(), gradstop2.into_param().abi(), ::core::mem::transmute(startpoint), ::core::mem::transmute(endpoint), &mut result__).from_abi::<IXpsOMLinearGradientBrush>(result__)
}
pub unsafe fn CreateRadialGradientBrush<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMGradientStop>, Param1: ::windows::core::IntoParam<'a, IXpsOMGradientStop>>(&self, gradstop1: Param0, gradstop2: Param1, centerpoint: *const XPS_POINT, gradientorigin: *const XPS_POINT, radiisizes: *const XPS_SIZE) -> ::windows::core::Result<IXpsOMRadialGradientBrush> {
let mut result__: <IXpsOMRadialGradientBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), gradstop1.into_param().abi(), gradstop2.into_param().abi(), ::core::mem::transmute(centerpoint), ::core::mem::transmute(gradientorigin), ::core::mem::transmute(radiisizes), &mut result__).from_abi::<IXpsOMRadialGradientBrush>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn CreateCoreProperties<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<IXpsOMCoreProperties> {
let mut result__: <IXpsOMCoreProperties as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMCoreProperties>(result__)
}
pub unsafe fn CreateDictionary(&self) -> ::windows::core::Result<IXpsOMDictionary> {
let mut result__: <IXpsOMDictionary as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDictionary>(result__)
}
pub unsafe fn CreatePartUriCollection(&self) -> ::windows::core::Result<IXpsOMPartUriCollection> {
let mut result__: <IXpsOMPartUriCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPartUriCollection>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security", feature = "Win32_Storage_Packaging_Opc"))]
pub unsafe fn CreatePackageWriterOnFile<
'a,
Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>,
Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>,
Param5: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
Param6: ::windows::core::IntoParam<'a, IXpsOMCoreProperties>,
Param7: ::windows::core::IntoParam<'a, IXpsOMImageResource>,
Param8: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>,
Param9: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
>(
&self,
filename: Param0,
securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES,
flagsandattributes: u32,
optimizemarkupsize: Param3,
interleaving: XPS_INTERLEAVING,
documentsequencepartname: Param5,
coreproperties: Param6,
packagethumbnail: Param7,
documentsequenceprintticket: Param8,
discardcontrolpartname: Param9,
) -> ::windows::core::Result<IXpsOMPackageWriter> {
let mut result__: <IXpsOMPackageWriter as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).36)(
::core::mem::transmute_copy(self),
filename.into_param().abi(),
::core::mem::transmute(securityattributes),
::core::mem::transmute(flagsandattributes),
optimizemarkupsize.into_param().abi(),
::core::mem::transmute(interleaving),
documentsequencepartname.into_param().abi(),
coreproperties.into_param().abi(),
packagethumbnail.into_param().abi(),
documentsequenceprintticket.into_param().abi(),
discardcontrolpartname.into_param().abi(),
&mut result__,
)
.from_abi::<IXpsOMPackageWriter>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreatePackageWriterOnStream<
'a,
Param0: ::windows::core::IntoParam<'a, super::super::System::Com::ISequentialStream>,
Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>,
Param3: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
Param4: ::windows::core::IntoParam<'a, IXpsOMCoreProperties>,
Param5: ::windows::core::IntoParam<'a, IXpsOMImageResource>,
Param6: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>,
Param7: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
>(
&self,
outputstream: Param0,
optimizemarkupsize: Param1,
interleaving: XPS_INTERLEAVING,
documentsequencepartname: Param3,
coreproperties: Param4,
packagethumbnail: Param5,
documentsequenceprintticket: Param6,
discardcontrolpartname: Param7,
) -> ::windows::core::Result<IXpsOMPackageWriter> {
let mut result__: <IXpsOMPackageWriter as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(
::core::mem::transmute_copy(self),
outputstream.into_param().abi(),
optimizemarkupsize.into_param().abi(),
::core::mem::transmute(interleaving),
documentsequencepartname.into_param().abi(),
coreproperties.into_param().abi(),
packagethumbnail.into_param().abi(),
documentsequenceprintticket.into_param().abi(),
discardcontrolpartname.into_param().abi(),
&mut result__,
)
.from_abi::<IXpsOMPackageWriter>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc"))]
pub unsafe fn CreatePartUri<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, uri: Param0) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), uri.into_param().abi(), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))]
pub unsafe fn CreateReadOnlyStreamOnFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filename: Param0) -> ::windows::core::Result<super::super::System::Com::IStream> {
let mut result__: <super::super::System::Com::IStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), filename.into_param().abi(), &mut result__).from_abi::<super::super::System::Com::IStream>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDocumentTypeFromFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filename: Param0) -> ::windows::core::Result<XPS_DOCUMENT_TYPE> {
let mut result__: <XPS_DOCUMENT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), filename.into_param().abi(), &mut result__).from_abi::<XPS_DOCUMENT_TYPE>(result__)
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetDocumentTypeFromStream<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(&self, xpsdocumentstream: Param0) -> ::windows::core::Result<XPS_DOCUMENT_TYPE> {
let mut result__: <XPS_DOCUMENT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), xpsdocumentstream.into_param().abi(), &mut result__).from_abi::<XPS_DOCUMENT_TYPE>(result__)
}
pub unsafe fn ConvertHDPhotoToJpegXR<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(&self, imageresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), imageresource.into_param().abi()).ok()
}
pub unsafe fn ConvertJpegXRToHDPhoto<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(&self, imageresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self), imageresource.into_param().abi()).ok()
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security", feature = "Win32_Storage_Packaging_Opc"))]
pub unsafe fn CreatePackageWriterOnFile1<
'a,
Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>,
Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>,
Param5: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
Param6: ::windows::core::IntoParam<'a, IXpsOMCoreProperties>,
Param7: ::windows::core::IntoParam<'a, IXpsOMImageResource>,
Param8: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>,
Param9: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
>(
&self,
filename: Param0,
securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES,
flagsandattributes: u32,
optimizemarkupsize: Param3,
interleaving: XPS_INTERLEAVING,
documentsequencepartname: Param5,
coreproperties: Param6,
packagethumbnail: Param7,
documentsequenceprintticket: Param8,
discardcontrolpartname: Param9,
documenttype: XPS_DOCUMENT_TYPE,
) -> ::windows::core::Result<IXpsOMPackageWriter> {
let mut result__: <IXpsOMPackageWriter as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).44)(
::core::mem::transmute_copy(self),
filename.into_param().abi(),
::core::mem::transmute(securityattributes),
::core::mem::transmute(flagsandattributes),
optimizemarkupsize.into_param().abi(),
::core::mem::transmute(interleaving),
documentsequencepartname.into_param().abi(),
coreproperties.into_param().abi(),
packagethumbnail.into_param().abi(),
documentsequenceprintticket.into_param().abi(),
discardcontrolpartname.into_param().abi(),
::core::mem::transmute(documenttype),
&mut result__,
)
.from_abi::<IXpsOMPackageWriter>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreatePackageWriterOnStream1<
'a,
Param0: ::windows::core::IntoParam<'a, super::super::System::Com::ISequentialStream>,
Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>,
Param3: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
Param4: ::windows::core::IntoParam<'a, IXpsOMCoreProperties>,
Param5: ::windows::core::IntoParam<'a, IXpsOMImageResource>,
Param6: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>,
Param7: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>,
>(
&self,
outputstream: Param0,
optimizemarkupsize: Param1,
interleaving: XPS_INTERLEAVING,
documentsequencepartname: Param3,
coreproperties: Param4,
packagethumbnail: Param5,
documentsequenceprintticket: Param6,
discardcontrolpartname: Param7,
documenttype: XPS_DOCUMENT_TYPE,
) -> ::windows::core::Result<IXpsOMPackageWriter> {
let mut result__: <IXpsOMPackageWriter as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).45)(
::core::mem::transmute_copy(self),
outputstream.into_param().abi(),
optimizemarkupsize.into_param().abi(),
::core::mem::transmute(interleaving),
documentsequencepartname.into_param().abi(),
coreproperties.into_param().abi(),
packagethumbnail.into_param().abi(),
documentsequenceprintticket.into_param().abi(),
discardcontrolpartname.into_param().abi(),
::core::mem::transmute(documenttype),
&mut result__,
)
.from_abi::<IXpsOMPackageWriter>(result__)
}
pub unsafe fn CreatePackage1(&self) -> ::windows::core::Result<IXpsOMPackage1> {
let mut result__: <IXpsOMPackage1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPackage1>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))]
pub unsafe fn CreatePackageFromStream1<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, stream: Param0, reuseobjects: Param1) -> ::windows::core::Result<IXpsOMPackage1> {
let mut result__: <IXpsOMPackage1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), stream.into_param().abi(), reuseobjects.into_param().abi(), &mut result__).from_abi::<IXpsOMPackage1>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreatePackageFromFile1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, filename: Param0, reuseobjects: Param1) -> ::windows::core::Result<IXpsOMPackage1> {
let mut result__: <IXpsOMPackage1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), filename.into_param().abi(), reuseobjects.into_param().abi(), &mut result__).from_abi::<IXpsOMPackage1>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc"))]
pub unsafe fn CreatePage1<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, pagedimensions: *const XPS_SIZE, language: Param1, parturi: Param2) -> ::windows::core::Result<IXpsOMPage1> {
let mut result__: <IXpsOMPage1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), ::core::mem::transmute(pagedimensions), language.into_param().abi(), parturi.into_param().abi(), &mut result__).from_abi::<IXpsOMPage1>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreatePageFromStream1<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param2: ::windows::core::IntoParam<'a, IXpsOMPartResources>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, pagemarkupstream: Param0, parturi: Param1, resources: Param2, reuseobjects: Param3) -> ::windows::core::Result<IXpsOMPage1> {
let mut result__: <IXpsOMPage1 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self), pagemarkupstream.into_param().abi(), parturi.into_param().abi(), resources.into_param().abi(), reuseobjects.into_param().abi(), &mut result__).from_abi::<IXpsOMPage1>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn CreateRemoteDictionaryResourceFromStream1<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param2: ::windows::core::IntoParam<'a, IXpsOMPartResources>>(&self, dictionarymarkupstream: Param0, parturi: Param1, resources: Param2) -> ::windows::core::Result<IXpsOMRemoteDictionaryResource> {
let mut result__: <IXpsOMRemoteDictionaryResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), dictionarymarkupstream.into_param().abi(), parturi.into_param().abi(), resources.into_param().abi(), &mut result__).from_abi::<IXpsOMRemoteDictionaryResource>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMObjectFactory1 {
type Vtable = IXpsOMObjectFactory1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0a91b617_d612_4181_bf7c_be5824e9cc8f);
}
impl ::core::convert::From<IXpsOMObjectFactory1> for ::windows::core::IUnknown {
fn from(value: IXpsOMObjectFactory1) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMObjectFactory1> for ::windows::core::IUnknown {
fn from(value: &IXpsOMObjectFactory1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMObjectFactory1 {
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 IXpsOMObjectFactory1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMObjectFactory1> for IXpsOMObjectFactory {
fn from(value: IXpsOMObjectFactory1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMObjectFactory1> for IXpsOMObjectFactory {
fn from(value: &IXpsOMObjectFactory1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMObjectFactory> for IXpsOMObjectFactory1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMObjectFactory> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMObjectFactory> for &IXpsOMObjectFactory1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMObjectFactory> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMObjectFactory1_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, package: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filename: super::super::Foundation::PWSTR, reuseobjects: super::super::Foundation::BOOL, package: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: ::windows::core::RawPtr, reuseobjects: super::super::Foundation::BOOL, package: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, storyfragmentsresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, documentstructureresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, signatureblockresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionary: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, remotedictionaryresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionarymarkupstream: ::windows::core::RawPtr, dictionaryparturi: ::windows::core::RawPtr, resources: ::windows::core::RawPtr, dictionaryresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, partresources: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, documentsequence: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, document: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, advisorypagedimensions: *const XPS_SIZE, pagereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagedimensions: *const XPS_SIZE, language: super::super::Foundation::PWSTR, parturi: ::windows::core::RawPtr, page: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagemarkupstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, resources: ::windows::core::RawPtr, reuseobjects: super::super::Foundation::BOOL, page: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, canvas: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fontresource: ::windows::core::RawPtr, glyphs: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, path: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, geometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, startpoint: *const XPS_POINT, figure: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrix: *const XPS_MATRIX, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, color: *const XPS_COLOR, colorprofile: ::windows::core::RawPtr, solidcolorbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, colorprofileresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, image: ::windows::core::RawPtr, viewbox: *const XPS_RECT, viewport: *const XPS_RECT, imagebrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewbox: *const XPS_RECT, viewport: *const XPS_RECT, visualbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, contenttype: XPS_IMAGE_TYPE, parturi: ::windows::core::RawPtr, imageresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, printticketresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, acquiredstream: ::windows::core::RawPtr, fontembedding: XPS_FONT_EMBEDDING, parturi: ::windows::core::RawPtr, isobfsourcestream: super::super::Foundation::BOOL, fontresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, color: *const XPS_COLOR, colorprofile: ::windows::core::RawPtr, offset: f32, gradientstop: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gradstop1: ::windows::core::RawPtr, gradstop2: ::windows::core::RawPtr, startpoint: *const XPS_POINT, endpoint: *const XPS_POINT, lineargradientbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gradstop1: ::windows::core::RawPtr, gradstop2: ::windows::core::RawPtr, centerpoint: *const XPS_POINT, gradientorigin: *const XPS_POINT, radiisizes: *const XPS_SIZE, radialgradientbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, coreproperties: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionary: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturicollection: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security", feature = "Win32_Storage_Packaging_Opc"))]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
filename: super::super::Foundation::PWSTR,
securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES,
flagsandattributes: u32,
optimizemarkupsize: super::super::Foundation::BOOL,
interleaving: XPS_INTERLEAVING,
documentsequencepartname: ::windows::core::RawPtr,
coreproperties: ::windows::core::RawPtr,
packagethumbnail: ::windows::core::RawPtr,
documentsequenceprintticket: ::windows::core::RawPtr,
discardcontrolpartname: ::windows::core::RawPtr,
packagewriter: *mut ::windows::core::RawPtr,
) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Security", feature = "Win32_Storage_Packaging_Opc")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, outputstream: ::windows::core::RawPtr, optimizemarkupsize: super::super::Foundation::BOOL, interleaving: XPS_INTERLEAVING, documentsequencepartname: ::windows::core::RawPtr, coreproperties: ::windows::core::RawPtr, packagethumbnail: ::windows::core::RawPtr, documentsequenceprintticket: ::windows::core::RawPtr, discardcontrolpartname: ::windows::core::RawPtr, packagewriter: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, uri: super::super::Foundation::PWSTR, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filename: super::super::Foundation::PWSTR, stream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filename: super::super::Foundation::PWSTR, documenttype: *mut XPS_DOCUMENT_TYPE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, xpsdocumentstream: ::windows::core::RawPtr, documenttype: *mut XPS_DOCUMENT_TYPE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imageresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imageresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security", feature = "Win32_Storage_Packaging_Opc"))]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
filename: super::super::Foundation::PWSTR,
securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES,
flagsandattributes: u32,
optimizemarkupsize: super::super::Foundation::BOOL,
interleaving: XPS_INTERLEAVING,
documentsequencepartname: ::windows::core::RawPtr,
coreproperties: ::windows::core::RawPtr,
packagethumbnail: ::windows::core::RawPtr,
documentsequenceprintticket: ::windows::core::RawPtr,
discardcontrolpartname: ::windows::core::RawPtr,
documenttype: XPS_DOCUMENT_TYPE,
packagewriter: *mut ::windows::core::RawPtr,
) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Security", feature = "Win32_Storage_Packaging_Opc")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe extern "system" fn(
this: ::windows::core::RawPtr,
outputstream: ::windows::core::RawPtr,
optimizemarkupsize: super::super::Foundation::BOOL,
interleaving: XPS_INTERLEAVING,
documentsequencepartname: ::windows::core::RawPtr,
coreproperties: ::windows::core::RawPtr,
packagethumbnail: ::windows::core::RawPtr,
documentsequenceprintticket: ::windows::core::RawPtr,
discardcontrolpartname: ::windows::core::RawPtr,
documenttype: XPS_DOCUMENT_TYPE,
packagewriter: *mut ::windows::core::RawPtr,
) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, package: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: ::windows::core::RawPtr, reuseobjects: super::super::Foundation::BOOL, package: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filename: super::super::Foundation::PWSTR, reuseobjects: super::super::Foundation::BOOL, package: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagedimensions: *const XPS_SIZE, language: super::super::Foundation::PWSTR, parturi: ::windows::core::RawPtr, page: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagemarkupstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, resources: ::windows::core::RawPtr, reuseobjects: super::super::Foundation::BOOL, page: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionarymarkupstream: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr, resources: ::windows::core::RawPtr, dictionaryresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPackage(pub ::windows::core::IUnknown);
impl IXpsOMPackage {
pub unsafe fn GetDocumentSequence(&self) -> ::windows::core::Result<IXpsOMDocumentSequence> {
let mut result__: <IXpsOMDocumentSequence as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDocumentSequence>(result__)
}
pub unsafe fn SetDocumentSequence<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMDocumentSequence>>(&self, documentsequence: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), documentsequence.into_param().abi()).ok()
}
pub unsafe fn GetCoreProperties(&self) -> ::windows::core::Result<IXpsOMCoreProperties> {
let mut result__: <IXpsOMCoreProperties as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMCoreProperties>(result__)
}
pub unsafe fn SetCoreProperties<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMCoreProperties>>(&self, coreproperties: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), coreproperties.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetDiscardControlPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetDiscardControlPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, discardcontrolparturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), discardcontrolparturi.into_param().abi()).ok()
}
pub unsafe fn GetThumbnailResource(&self) -> ::windows::core::Result<IXpsOMImageResource> {
let mut result__: <IXpsOMImageResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMImageResource>(result__)
}
pub unsafe fn SetThumbnailResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(&self, imageresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), imageresource.into_param().abi()).ok()
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))]
pub unsafe fn WriteToFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, filename: Param0, securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES, flagsandattributes: u32, optimizemarkupsize: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), filename.into_param().abi(), ::core::mem::transmute(securityattributes), ::core::mem::transmute(flagsandattributes), optimizemarkupsize.into_param().abi()).ok()
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))]
pub unsafe fn WriteToStream<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::ISequentialStream>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, stream: Param0, optimizemarkupsize: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), stream.into_param().abi(), optimizemarkupsize.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMPackage {
type Vtable = IXpsOMPackage_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x18c3df65_81e1_4674_91dc_fc452f5a416f);
}
impl ::core::convert::From<IXpsOMPackage> for ::windows::core::IUnknown {
fn from(value: IXpsOMPackage) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPackage> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPackage) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPackage {
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 IXpsOMPackage {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPackage_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, documentsequence: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documentsequence: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, coreproperties: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, coreproperties: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, discardcontrolparturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, discardcontrolparturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imageresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imageresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filename: super::super::Foundation::PWSTR, securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES, flagsandattributes: u32, optimizemarkupsize: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Security")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: ::windows::core::RawPtr, optimizemarkupsize: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPackage1(pub ::windows::core::IUnknown);
impl IXpsOMPackage1 {
pub unsafe fn GetDocumentSequence(&self) -> ::windows::core::Result<IXpsOMDocumentSequence> {
let mut result__: <IXpsOMDocumentSequence as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDocumentSequence>(result__)
}
pub unsafe fn SetDocumentSequence<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMDocumentSequence>>(&self, documentsequence: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), documentsequence.into_param().abi()).ok()
}
pub unsafe fn GetCoreProperties(&self) -> ::windows::core::Result<IXpsOMCoreProperties> {
let mut result__: <IXpsOMCoreProperties as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMCoreProperties>(result__)
}
pub unsafe fn SetCoreProperties<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMCoreProperties>>(&self, coreproperties: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), coreproperties.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetDiscardControlPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetDiscardControlPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, discardcontrolparturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), discardcontrolparturi.into_param().abi()).ok()
}
pub unsafe fn GetThumbnailResource(&self) -> ::windows::core::Result<IXpsOMImageResource> {
let mut result__: <IXpsOMImageResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMImageResource>(result__)
}
pub unsafe fn SetThumbnailResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(&self, imageresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), imageresource.into_param().abi()).ok()
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))]
pub unsafe fn WriteToFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, filename: Param0, securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES, flagsandattributes: u32, optimizemarkupsize: Param3) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), filename.into_param().abi(), ::core::mem::transmute(securityattributes), ::core::mem::transmute(flagsandattributes), optimizemarkupsize.into_param().abi()).ok()
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))]
pub unsafe fn WriteToStream<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::ISequentialStream>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, stream: Param0, optimizemarkupsize: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), stream.into_param().abi(), optimizemarkupsize.into_param().abi()).ok()
}
pub unsafe fn GetDocumentType(&self) -> ::windows::core::Result<XPS_DOCUMENT_TYPE> {
let mut result__: <XPS_DOCUMENT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_DOCUMENT_TYPE>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))]
pub unsafe fn WriteToFile1<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, filename: Param0, securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES, flagsandattributes: u32, optimizemarkupsize: Param3, documenttype: XPS_DOCUMENT_TYPE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), filename.into_param().abi(), ::core::mem::transmute(securityattributes), ::core::mem::transmute(flagsandattributes), optimizemarkupsize.into_param().abi(), ::core::mem::transmute(documenttype)).ok()
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))]
pub unsafe fn WriteToStream1<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::ISequentialStream>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, outputstream: Param0, optimizemarkupsize: Param1, documenttype: XPS_DOCUMENT_TYPE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), outputstream.into_param().abi(), optimizemarkupsize.into_param().abi(), ::core::mem::transmute(documenttype)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMPackage1 {
type Vtable = IXpsOMPackage1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x95a9435e_12bb_461b_8e7f_c6adb04cd96a);
}
impl ::core::convert::From<IXpsOMPackage1> for ::windows::core::IUnknown {
fn from(value: IXpsOMPackage1) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPackage1> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPackage1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPackage1 {
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 IXpsOMPackage1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMPackage1> for IXpsOMPackage {
fn from(value: IXpsOMPackage1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMPackage1> for IXpsOMPackage {
fn from(value: &IXpsOMPackage1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPackage> for IXpsOMPackage1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPackage> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPackage> for &IXpsOMPackage1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPackage> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPackage1_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, documentsequence: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documentsequence: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, coreproperties: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, coreproperties: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, discardcontrolparturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, discardcontrolparturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imageresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imageresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filename: super::super::Foundation::PWSTR, securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES, flagsandattributes: u32, optimizemarkupsize: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Security")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: ::windows::core::RawPtr, optimizemarkupsize: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documenttype: *mut XPS_DOCUMENT_TYPE) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filename: super::super::Foundation::PWSTR, securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES, flagsandattributes: u32, optimizemarkupsize: super::super::Foundation::BOOL, documenttype: XPS_DOCUMENT_TYPE) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Security")))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, outputstream: ::windows::core::RawPtr, optimizemarkupsize: super::super::Foundation::BOOL, documenttype: XPS_DOCUMENT_TYPE) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPackageTarget(pub ::windows::core::IUnknown);
impl IXpsOMPackageTarget {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn CreateXpsOMPackageWriter<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param1: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>, Param2: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, documentsequencepartname: Param0, documentsequenceprintticket: Param1, discardcontrolpartname: Param2) -> ::windows::core::Result<IXpsOMPackageWriter> {
let mut result__: <IXpsOMPackageWriter as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), documentsequencepartname.into_param().abi(), documentsequenceprintticket.into_param().abi(), discardcontrolpartname.into_param().abi(), &mut result__).from_abi::<IXpsOMPackageWriter>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMPackageTarget {
type Vtable = IXpsOMPackageTarget_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x219a9db0_4959_47d0_8034_b1ce84f41a4d);
}
impl ::core::convert::From<IXpsOMPackageTarget> for ::windows::core::IUnknown {
fn from(value: IXpsOMPackageTarget) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPackageTarget> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPackageTarget) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPackageTarget {
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 IXpsOMPackageTarget {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPackageTarget_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documentsequencepartname: ::windows::core::RawPtr, documentsequenceprintticket: ::windows::core::RawPtr, discardcontrolpartname: ::windows::core::RawPtr, packagewriter: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPackageWriter(pub ::windows::core::IUnknown);
impl IXpsOMPackageWriter {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn StartNewDocument<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param1: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>, Param2: ::windows::core::IntoParam<'a, IXpsOMDocumentStructureResource>, Param3: ::windows::core::IntoParam<'a, IXpsOMSignatureBlockResourceCollection>, Param4: ::windows::core::IntoParam<'a, IXpsOMPartUriCollection>>(
&self,
documentpartname: Param0,
documentprintticket: Param1,
documentstructure: Param2,
signatureblockresources: Param3,
restrictedfonts: Param4,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), documentpartname.into_param().abi(), documentprintticket.into_param().abi(), documentstructure.into_param().abi(), signatureblockresources.into_param().abi(), restrictedfonts.into_param().abi()).ok()
}
pub unsafe fn AddPage<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMPage>, Param2: ::windows::core::IntoParam<'a, IXpsOMPartUriCollection>, Param3: ::windows::core::IntoParam<'a, IXpsOMStoryFragmentsResource>, Param4: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>, Param5: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(
&self,
page: Param0,
advisorypagedimensions: *const XPS_SIZE,
discardableresourceparts: Param2,
storyfragments: Param3,
pageprintticket: Param4,
pagethumbnail: Param5,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), page.into_param().abi(), ::core::mem::transmute(advisorypagedimensions), discardableresourceparts.into_param().abi(), storyfragments.into_param().abi(), pageprintticket.into_param().abi(), pagethumbnail.into_param().abi()).ok()
}
pub unsafe fn AddResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMResource>>(&self, resource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), resource.into_param().abi()).ok()
}
pub unsafe fn Close(&self) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsClosed(&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).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMPackageWriter {
type Vtable = IXpsOMPackageWriter_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4e2aa182_a443_42c6_b41b_4f8e9de73ff9);
}
impl ::core::convert::From<IXpsOMPackageWriter> for ::windows::core::IUnknown {
fn from(value: IXpsOMPackageWriter) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPackageWriter> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPackageWriter) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPackageWriter {
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 IXpsOMPackageWriter {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPackageWriter_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documentpartname: ::windows::core::RawPtr, documentprintticket: ::windows::core::RawPtr, documentstructure: ::windows::core::RawPtr, signatureblockresources: ::windows::core::RawPtr, restrictedfonts: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, page: ::windows::core::RawPtr, advisorypagedimensions: *const XPS_SIZE, discardableresourceparts: ::windows::core::RawPtr, storyfragments: ::windows::core::RawPtr, pageprintticket: ::windows::core::RawPtr, pagethumbnail: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, resource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
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, isclosed: *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 IXpsOMPackageWriter3D(pub ::windows::core::IUnknown);
impl IXpsOMPackageWriter3D {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn StartNewDocument<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param1: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>, Param2: ::windows::core::IntoParam<'a, IXpsOMDocumentStructureResource>, Param3: ::windows::core::IntoParam<'a, IXpsOMSignatureBlockResourceCollection>, Param4: ::windows::core::IntoParam<'a, IXpsOMPartUriCollection>>(
&self,
documentpartname: Param0,
documentprintticket: Param1,
documentstructure: Param2,
signatureblockresources: Param3,
restrictedfonts: Param4,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), documentpartname.into_param().abi(), documentprintticket.into_param().abi(), documentstructure.into_param().abi(), signatureblockresources.into_param().abi(), restrictedfonts.into_param().abi()).ok()
}
pub unsafe fn AddPage<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMPage>, Param2: ::windows::core::IntoParam<'a, IXpsOMPartUriCollection>, Param3: ::windows::core::IntoParam<'a, IXpsOMStoryFragmentsResource>, Param4: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>, Param5: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(
&self,
page: Param0,
advisorypagedimensions: *const XPS_SIZE,
discardableresourceparts: Param2,
storyfragments: Param3,
pageprintticket: Param4,
pagethumbnail: Param5,
) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), page.into_param().abi(), ::core::mem::transmute(advisorypagedimensions), discardableresourceparts.into_param().abi(), storyfragments.into_param().abi(), pageprintticket.into_param().abi(), pagethumbnail.into_param().abi()).ok()
}
pub unsafe fn AddResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMResource>>(&self, resource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), resource.into_param().abi()).ok()
}
pub unsafe fn Close(&self) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsClosed(&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).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn AddModelTexture<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param1: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(&self, texturepartname: Param0, texturedata: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), texturepartname.into_param().abi(), texturedata.into_param().abi()).ok()
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn SetModelPrintTicket<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>, Param1: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(&self, printticketpartname: Param0, printticketdata: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), printticketpartname.into_param().abi(), printticketdata.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMPackageWriter3D {
type Vtable = IXpsOMPackageWriter3D_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xe8a45033_640e_43fa_9bdf_fddeaa31c6a0);
}
impl ::core::convert::From<IXpsOMPackageWriter3D> for ::windows::core::IUnknown {
fn from(value: IXpsOMPackageWriter3D) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPackageWriter3D> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPackageWriter3D) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPackageWriter3D {
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 IXpsOMPackageWriter3D {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMPackageWriter3D> for IXpsOMPackageWriter {
fn from(value: IXpsOMPackageWriter3D) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMPackageWriter3D> for IXpsOMPackageWriter {
fn from(value: &IXpsOMPackageWriter3D) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPackageWriter> for IXpsOMPackageWriter3D {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPackageWriter> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPackageWriter> for &IXpsOMPackageWriter3D {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPackageWriter> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPackageWriter3D_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documentpartname: ::windows::core::RawPtr, documentprintticket: ::windows::core::RawPtr, documentstructure: ::windows::core::RawPtr, signatureblockresources: ::windows::core::RawPtr, restrictedfonts: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, page: ::windows::core::RawPtr, advisorypagedimensions: *const XPS_SIZE, discardableresourceparts: ::windows::core::RawPtr, storyfragments: ::windows::core::RawPtr, pageprintticket: ::windows::core::RawPtr, pagethumbnail: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, resource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
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, isclosed: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, texturepartname: ::windows::core::RawPtr, texturedata: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, printticketpartname: ::windows::core::RawPtr, printticketdata: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPage(pub ::windows::core::IUnknown);
impl IXpsOMPage {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<IXpsOMPageReference> {
let mut result__: <IXpsOMPageReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPageReference>(result__)
}
pub unsafe fn GetVisuals(&self) -> ::windows::core::Result<IXpsOMVisualCollection> {
let mut result__: <IXpsOMVisualCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMVisualCollection>(result__)
}
pub unsafe fn GetPageDimensions(&self) -> ::windows::core::Result<XPS_SIZE> {
let mut result__: <XPS_SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_SIZE>(result__)
}
pub unsafe fn SetPageDimensions(&self, pagedimensions: *const XPS_SIZE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(pagedimensions)).ok()
}
pub unsafe fn GetContentBox(&self) -> ::windows::core::Result<XPS_RECT> {
let mut result__: <XPS_RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_RECT>(result__)
}
pub unsafe fn SetContentBox(&self, contentbox: *const XPS_RECT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(contentbox)).ok()
}
pub unsafe fn GetBleedBox(&self) -> ::windows::core::Result<XPS_RECT> {
let mut result__: <XPS_RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_RECT>(result__)
}
pub unsafe fn SetBleedBox(&self, bleedbox: *const XPS_RECT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(bleedbox)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLanguage(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLanguage<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, language: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), language.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetName(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, name: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), name.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIsHyperlinkTarget(&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).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetIsHyperlinkTarget<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, ishyperlinktarget: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ishyperlinktarget.into_param().abi()).ok()
}
pub unsafe fn GetDictionary(&self) -> ::windows::core::Result<IXpsOMDictionary> {
let mut result__: <IXpsOMDictionary as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDictionary>(result__)
}
pub unsafe fn GetDictionaryLocal(&self) -> ::windows::core::Result<IXpsOMDictionary> {
let mut result__: <IXpsOMDictionary as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDictionary>(result__)
}
pub unsafe fn SetDictionaryLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMDictionary>>(&self, resourcedictionary: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), resourcedictionary.into_param().abi()).ok()
}
pub unsafe fn GetDictionaryResource(&self) -> ::windows::core::Result<IXpsOMRemoteDictionaryResource> {
let mut result__: <IXpsOMRemoteDictionaryResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMRemoteDictionaryResource>(result__)
}
pub unsafe fn SetDictionaryResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMRemoteDictionaryResource>>(&self, remotedictionaryresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), remotedictionaryresource.into_param().abi()).ok()
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))]
pub unsafe fn Write<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::ISequentialStream>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, stream: Param0, optimizemarkupsize: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), stream.into_param().abi(), optimizemarkupsize.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GenerateUnusedLookupKey(&self, r#type: XPS_OBJECT_TYPE) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(r#type), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMPage> {
let mut result__: <IXpsOMPage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPage>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMPage {
type Vtable = IXpsOMPage_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd3e18888_f120_4fee_8c68_35296eae91d4);
}
impl ::core::convert::From<IXpsOMPage> for ::windows::core::IUnknown {
fn from(value: IXpsOMPage) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPage> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPage) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPage {
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 IXpsOMPage {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMPage> for IXpsOMPart {
fn from(value: IXpsOMPage) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMPage> for IXpsOMPart {
fn from(value: &IXpsOMPage) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMPage {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMPage {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPage_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, visuals: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagedimensions: *mut XPS_SIZE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagedimensions: *const XPS_SIZE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, contentbox: *mut XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, contentbox: *const XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bleedbox: *mut XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bleedbox: *const XPS_RECT) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ishyperlinktarget: *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, ishyperlinktarget: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, resourcedictionary: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, resourcedictionary: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, resourcedictionary: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, remotedictionaryresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, remotedictionaryresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: ::windows::core::RawPtr, optimizemarkupsize: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: XPS_OBJECT_TYPE, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, page: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPage1(pub ::windows::core::IUnknown);
impl IXpsOMPage1 {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<IXpsOMPageReference> {
let mut result__: <IXpsOMPageReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPageReference>(result__)
}
pub unsafe fn GetVisuals(&self) -> ::windows::core::Result<IXpsOMVisualCollection> {
let mut result__: <IXpsOMVisualCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMVisualCollection>(result__)
}
pub unsafe fn GetPageDimensions(&self) -> ::windows::core::Result<XPS_SIZE> {
let mut result__: <XPS_SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_SIZE>(result__)
}
pub unsafe fn SetPageDimensions(&self, pagedimensions: *const XPS_SIZE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(pagedimensions)).ok()
}
pub unsafe fn GetContentBox(&self) -> ::windows::core::Result<XPS_RECT> {
let mut result__: <XPS_RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_RECT>(result__)
}
pub unsafe fn SetContentBox(&self, contentbox: *const XPS_RECT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(contentbox)).ok()
}
pub unsafe fn GetBleedBox(&self) -> ::windows::core::Result<XPS_RECT> {
let mut result__: <XPS_RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_RECT>(result__)
}
pub unsafe fn SetBleedBox(&self, bleedbox: *const XPS_RECT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(bleedbox)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLanguage(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLanguage<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, language: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), language.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetName(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, name: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), name.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIsHyperlinkTarget(&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).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetIsHyperlinkTarget<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, ishyperlinktarget: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ishyperlinktarget.into_param().abi()).ok()
}
pub unsafe fn GetDictionary(&self) -> ::windows::core::Result<IXpsOMDictionary> {
let mut result__: <IXpsOMDictionary as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDictionary>(result__)
}
pub unsafe fn GetDictionaryLocal(&self) -> ::windows::core::Result<IXpsOMDictionary> {
let mut result__: <IXpsOMDictionary as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDictionary>(result__)
}
pub unsafe fn SetDictionaryLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMDictionary>>(&self, resourcedictionary: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), resourcedictionary.into_param().abi()).ok()
}
pub unsafe fn GetDictionaryResource(&self) -> ::windows::core::Result<IXpsOMRemoteDictionaryResource> {
let mut result__: <IXpsOMRemoteDictionaryResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMRemoteDictionaryResource>(result__)
}
pub unsafe fn SetDictionaryResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMRemoteDictionaryResource>>(&self, remotedictionaryresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), remotedictionaryresource.into_param().abi()).ok()
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))]
pub unsafe fn Write<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::ISequentialStream>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, stream: Param0, optimizemarkupsize: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), stream.into_param().abi(), optimizemarkupsize.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GenerateUnusedLookupKey(&self, r#type: XPS_OBJECT_TYPE) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ::core::mem::transmute(r#type), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMPage> {
let mut result__: <IXpsOMPage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPage>(result__)
}
pub unsafe fn GetDocumentType(&self) -> ::windows::core::Result<XPS_DOCUMENT_TYPE> {
let mut result__: <XPS_DOCUMENT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_DOCUMENT_TYPE>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))]
pub unsafe fn Write1<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::ISequentialStream>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, stream: Param0, optimizemarkupsize: Param1, documenttype: XPS_DOCUMENT_TYPE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), stream.into_param().abi(), optimizemarkupsize.into_param().abi(), ::core::mem::transmute(documenttype)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMPage1 {
type Vtable = IXpsOMPage1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x305b60ef_6892_4dda_9cbb_3aa65974508a);
}
impl ::core::convert::From<IXpsOMPage1> for ::windows::core::IUnknown {
fn from(value: IXpsOMPage1) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPage1> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPage1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPage1 {
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 IXpsOMPage1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMPage1> for IXpsOMPage {
fn from(value: IXpsOMPage1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMPage1> for IXpsOMPage {
fn from(value: &IXpsOMPage1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPage> for IXpsOMPage1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPage> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPage> for &IXpsOMPage1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPage> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMPage1> for IXpsOMPart {
fn from(value: IXpsOMPage1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMPage1> for IXpsOMPart {
fn from(value: &IXpsOMPage1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMPage1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMPage1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPage1_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, visuals: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagedimensions: *mut XPS_SIZE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagedimensions: *const XPS_SIZE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, contentbox: *mut XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, contentbox: *const XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bleedbox: *mut XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, bleedbox: *const XPS_RECT) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ishyperlinktarget: *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, ishyperlinktarget: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, resourcedictionary: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, resourcedictionary: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, resourcedictionary: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, remotedictionaryresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, remotedictionaryresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: ::windows::core::RawPtr, optimizemarkupsize: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: XPS_OBJECT_TYPE, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, page: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documenttype: *mut XPS_DOCUMENT_TYPE) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: ::windows::core::RawPtr, optimizemarkupsize: super::super::Foundation::BOOL, documenttype: XPS_DOCUMENT_TYPE) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_System_Com")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPageReference(pub ::windows::core::IUnknown);
impl IXpsOMPageReference {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<IXpsOMDocument> {
let mut result__: <IXpsOMDocument as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDocument>(result__)
}
pub unsafe fn GetPage(&self) -> ::windows::core::Result<IXpsOMPage> {
let mut result__: <IXpsOMPage as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPage>(result__)
}
pub unsafe fn SetPage<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMPage>>(&self, page: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), page.into_param().abi()).ok()
}
pub unsafe fn DiscardPage(&self) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn IsPageLoaded(&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).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn GetAdvisoryPageDimensions(&self) -> ::windows::core::Result<XPS_SIZE> {
let mut result__: <XPS_SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_SIZE>(result__)
}
pub unsafe fn SetAdvisoryPageDimensions(&self, pagedimensions: *const XPS_SIZE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(pagedimensions)).ok()
}
pub unsafe fn GetStoryFragmentsResource(&self) -> ::windows::core::Result<IXpsOMStoryFragmentsResource> {
let mut result__: <IXpsOMStoryFragmentsResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMStoryFragmentsResource>(result__)
}
pub unsafe fn SetStoryFragmentsResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMStoryFragmentsResource>>(&self, storyfragmentsresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), storyfragmentsresource.into_param().abi()).ok()
}
pub unsafe fn GetPrintTicketResource(&self) -> ::windows::core::Result<IXpsOMPrintTicketResource> {
let mut result__: <IXpsOMPrintTicketResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPrintTicketResource>(result__)
}
pub unsafe fn SetPrintTicketResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMPrintTicketResource>>(&self, printticketresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), printticketresource.into_param().abi()).ok()
}
pub unsafe fn GetThumbnailResource(&self) -> ::windows::core::Result<IXpsOMImageResource> {
let mut result__: <IXpsOMImageResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMImageResource>(result__)
}
pub unsafe fn SetThumbnailResource<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMImageResource>>(&self, imageresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), imageresource.into_param().abi()).ok()
}
pub unsafe fn CollectLinkTargets(&self) -> ::windows::core::Result<IXpsOMNameCollection> {
let mut result__: <IXpsOMNameCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMNameCollection>(result__)
}
pub unsafe fn CollectPartResources(&self) -> ::windows::core::Result<IXpsOMPartResources> {
let mut result__: <IXpsOMPartResources as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPartResources>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn HasRestrictedFonts(&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).18)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMPageReference> {
let mut result__: <IXpsOMPageReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPageReference>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMPageReference {
type Vtable = IXpsOMPageReference_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xed360180_6f92_4998_890d_2f208531a0a0);
}
impl ::core::convert::From<IXpsOMPageReference> for ::windows::core::IUnknown {
fn from(value: IXpsOMPageReference) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPageReference> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPageReference) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPageReference {
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 IXpsOMPageReference {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPageReference_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, document: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, page: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, page: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
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, ispageloaded: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagedimensions: *mut XPS_SIZE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagedimensions: *const XPS_SIZE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, storyfragmentsresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, storyfragmentsresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, printticketresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, printticketresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imageresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imageresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, linktargets: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, partresources: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, restrictedfonts: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPageReferenceCollection(pub ::windows::core::IUnknown);
impl IXpsOMPageReferenceCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsOMPageReference> {
let mut result__: <IXpsOMPageReference 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::<IXpsOMPageReference>(result__)
}
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMPageReference>>(&self, index: u32, pagereference: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), pagereference.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMPageReference>>(&self, index: u32, pagereference: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), pagereference.into_param().abi()).ok()
}
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMPageReference>>(&self, pagereference: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), pagereference.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMPageReferenceCollection {
type Vtable = IXpsOMPageReferenceCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xca16ba4d_e7b9_45c5_958b_f98022473745);
}
impl ::core::convert::From<IXpsOMPageReferenceCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMPageReferenceCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPageReferenceCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPageReferenceCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPageReferenceCollection {
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 IXpsOMPageReferenceCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPageReferenceCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, pagereference: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, pagereference: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, pagereference: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pagereference: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPart(pub ::windows::core::IUnknown);
impl IXpsOMPart {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMPart {
type Vtable = IXpsOMPart_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x74eb2f0b_a91e_4486_afac_0fabeca3dfc6);
}
impl ::core::convert::From<IXpsOMPart> for ::windows::core::IUnknown {
fn from(value: IXpsOMPart) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPart> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPart) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPart {
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 IXpsOMPart {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPart_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPartResources(pub ::windows::core::IUnknown);
impl IXpsOMPartResources {
pub unsafe fn GetFontResources(&self) -> ::windows::core::Result<IXpsOMFontResourceCollection> {
let mut result__: <IXpsOMFontResourceCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMFontResourceCollection>(result__)
}
pub unsafe fn GetImageResources(&self) -> ::windows::core::Result<IXpsOMImageResourceCollection> {
let mut result__: <IXpsOMImageResourceCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMImageResourceCollection>(result__)
}
pub unsafe fn GetColorProfileResources(&self) -> ::windows::core::Result<IXpsOMColorProfileResourceCollection> {
let mut result__: <IXpsOMColorProfileResourceCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMColorProfileResourceCollection>(result__)
}
pub unsafe fn GetRemoteDictionaryResources(&self) -> ::windows::core::Result<IXpsOMRemoteDictionaryResourceCollection> {
let mut result__: <IXpsOMRemoteDictionaryResourceCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMRemoteDictionaryResourceCollection>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMPartResources {
type Vtable = IXpsOMPartResources_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xf4cf7729_4864_4275_99b3_a8717163ecaf);
}
impl ::core::convert::From<IXpsOMPartResources> for ::windows::core::IUnknown {
fn from(value: IXpsOMPartResources) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPartResources> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPartResources) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPartResources {
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 IXpsOMPartResources {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPartResources_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, fontresources: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, imageresources: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorprofileresources: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionaryresources: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPartUriCollection(pub ::windows::core::IUnknown);
impl IXpsOMPartUriCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri 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::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, index: u32, parturi: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), parturi.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, index: u32, parturi: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), parturi.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMPartUriCollection {
type Vtable = IXpsOMPartUriCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x57c650d4_067c_4893_8c33_f62a0633730f);
}
impl ::core::convert::From<IXpsOMPartUriCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMPartUriCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPartUriCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPartUriCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPartUriCollection {
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 IXpsOMPartUriCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPartUriCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPath(pub ::windows::core::IUnknown);
impl IXpsOMPath {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetTransform(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn GetTransformLocal(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn SetTransformLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMMatrixTransform>>(&self, matrixtransform: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), matrixtransform.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTransformLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTransformLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetClipGeometry(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn GetClipGeometryLocal(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn SetClipGeometryLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMGeometry>>(&self, clipgeometry: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), clipgeometry.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetClipGeometryLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetClipGeometryLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetOpacity(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
pub unsafe fn GetOpacityMaskBrush(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn GetOpacityMaskBrushLocal(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn SetOpacityMaskBrushLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMBrush>>(&self, opacitymaskbrush: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), opacitymaskbrush.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetOpacityMaskBrushLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetOpacityMaskBrushLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetName(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, name: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), name.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIsHyperlinkTarget(&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).24)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetIsHyperlinkTarget<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, ishyperlink: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ishyperlink.into_param().abi()).ok()
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetHyperlinkNavigateUri(&self) -> ::windows::core::Result<super::super::System::Com::IUri> {
let mut result__: <super::super::System::Com::IUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::System::Com::IUri>(result__)
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn SetHyperlinkNavigateUri<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IUri>>(&self, hyperlinkuri: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), hyperlinkuri.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLanguage(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLanguage<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, language: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), language.into_param().abi()).ok()
}
pub unsafe fn GetGeometry(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn GetGeometryLocal(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn SetGeometryLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMGeometry>>(&self, geometry: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), geometry.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetGeometryLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetGeometryLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, lookup: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), lookup.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetAccessibilityShortDescription(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetAccessibilityShortDescription<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, shortdescription: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), shortdescription.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetAccessibilityLongDescription(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetAccessibilityLongDescription<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, longdescription: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), longdescription.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSnapsToPixels(&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).39)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetSnapsToPixels<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, snapstopixels: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), snapstopixels.into_param().abi()).ok()
}
pub unsafe fn GetStrokeBrush(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn GetStrokeBrushLocal(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn SetStrokeBrushLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMBrush>>(&self, brush: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self), brush.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetStrokeBrushLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).44)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetStrokeBrushLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, lookup: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).45)(::core::mem::transmute_copy(self), lookup.into_param().abi()).ok()
}
pub unsafe fn GetStrokeDashes(&self) -> ::windows::core::Result<IXpsOMDashCollection> {
let mut result__: <IXpsOMDashCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).46)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDashCollection>(result__)
}
pub unsafe fn GetStrokeDashCap(&self) -> ::windows::core::Result<XPS_DASH_CAP> {
let mut result__: <XPS_DASH_CAP as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).47)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_DASH_CAP>(result__)
}
pub unsafe fn SetStrokeDashCap(&self, strokedashcap: XPS_DASH_CAP) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).48)(::core::mem::transmute_copy(self), ::core::mem::transmute(strokedashcap)).ok()
}
pub unsafe fn GetStrokeDashOffset(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).49)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetStrokeDashOffset(&self, strokedashoffset: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).50)(::core::mem::transmute_copy(self), ::core::mem::transmute(strokedashoffset)).ok()
}
pub unsafe fn GetStrokeStartLineCap(&self) -> ::windows::core::Result<XPS_LINE_CAP> {
let mut result__: <XPS_LINE_CAP as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).51)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_LINE_CAP>(result__)
}
pub unsafe fn SetStrokeStartLineCap(&self, strokestartlinecap: XPS_LINE_CAP) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).52)(::core::mem::transmute_copy(self), ::core::mem::transmute(strokestartlinecap)).ok()
}
pub unsafe fn GetStrokeEndLineCap(&self) -> ::windows::core::Result<XPS_LINE_CAP> {
let mut result__: <XPS_LINE_CAP as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).53)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_LINE_CAP>(result__)
}
pub unsafe fn SetStrokeEndLineCap(&self, strokeendlinecap: XPS_LINE_CAP) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).54)(::core::mem::transmute_copy(self), ::core::mem::transmute(strokeendlinecap)).ok()
}
pub unsafe fn GetStrokeLineJoin(&self) -> ::windows::core::Result<XPS_LINE_JOIN> {
let mut result__: <XPS_LINE_JOIN as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).55)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_LINE_JOIN>(result__)
}
pub unsafe fn SetStrokeLineJoin(&self, strokelinejoin: XPS_LINE_JOIN) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).56)(::core::mem::transmute_copy(self), ::core::mem::transmute(strokelinejoin)).ok()
}
pub unsafe fn GetStrokeMiterLimit(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).57)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetStrokeMiterLimit(&self, strokemiterlimit: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).58)(::core::mem::transmute_copy(self), ::core::mem::transmute(strokemiterlimit)).ok()
}
pub unsafe fn GetStrokeThickness(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).59)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetStrokeThickness(&self, strokethickness: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).60)(::core::mem::transmute_copy(self), ::core::mem::transmute(strokethickness)).ok()
}
pub unsafe fn GetFillBrush(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).61)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn GetFillBrushLocal(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).62)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn SetFillBrushLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMBrush>>(&self, brush: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).63)(::core::mem::transmute_copy(self), brush.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetFillBrushLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).64)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetFillBrushLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, lookup: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).65)(::core::mem::transmute_copy(self), lookup.into_param().abi()).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMPath> {
let mut result__: <IXpsOMPath as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).66)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPath>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMPath {
type Vtable = IXpsOMPath_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x37d38bb6_3ee9_4110_9312_14b194163337);
}
impl ::core::convert::From<IXpsOMPath> for ::windows::core::IUnknown {
fn from(value: IXpsOMPath) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPath> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPath) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPath {
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 IXpsOMPath {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMPath> for IXpsOMVisual {
fn from(value: IXpsOMPath) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMPath> for IXpsOMVisual {
fn from(value: &IXpsOMPath) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMVisual> for IXpsOMPath {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMVisual> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMVisual> for &IXpsOMPath {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMVisual> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMPath> for IXpsOMShareable {
fn from(value: IXpsOMPath) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMPath> for IXpsOMShareable {
fn from(value: &IXpsOMPath) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMPath {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMPath {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPath_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ishyperlink: *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, ishyperlink: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hyperlinkuri: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hyperlinkuri: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, geometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, geometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, geometry: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lookup: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lookup: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, shortdescription: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, shortdescription: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, longdescription: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, longdescription: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, snapstopixels: *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, snapstopixels: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, brush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, brush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, brush: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lookup: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lookup: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokedashes: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokedashcap: *mut XPS_DASH_CAP) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokedashcap: XPS_DASH_CAP) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokedashoffset: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokedashoffset: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokestartlinecap: *mut XPS_LINE_CAP) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokestartlinecap: XPS_LINE_CAP) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokeendlinecap: *mut XPS_LINE_CAP) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokeendlinecap: XPS_LINE_CAP) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokelinejoin: *mut XPS_LINE_JOIN) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokelinejoin: XPS_LINE_JOIN) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokemiterlimit: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokemiterlimit: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokethickness: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, strokethickness: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, brush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, brush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, brush: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lookup: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lookup: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, path: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMPrintTicketResource(pub ::windows::core::IUnknown);
impl IXpsOMPrintTicketResource {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetStream(&self) -> ::windows::core::Result<super::super::System::Com::IStream> {
let mut result__: <super::super::System::Com::IStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::System::Com::IStream>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn SetContent<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, sourcestream: Param0, partname: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), sourcestream.into_param().abi(), partname.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMPrintTicketResource {
type Vtable = IXpsOMPrintTicketResource_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xe7ff32d2_34aa_499b_bbe9_9cd4ee6c59f7);
}
impl ::core::convert::From<IXpsOMPrintTicketResource> for ::windows::core::IUnknown {
fn from(value: IXpsOMPrintTicketResource) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMPrintTicketResource> for ::windows::core::IUnknown {
fn from(value: &IXpsOMPrintTicketResource) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMPrintTicketResource {
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 IXpsOMPrintTicketResource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMPrintTicketResource> for IXpsOMResource {
fn from(value: IXpsOMPrintTicketResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMPrintTicketResource> for IXpsOMResource {
fn from(value: &IXpsOMPrintTicketResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for IXpsOMPrintTicketResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for &IXpsOMPrintTicketResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMPrintTicketResource> for IXpsOMPart {
fn from(value: IXpsOMPrintTicketResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMPrintTicketResource> for IXpsOMPart {
fn from(value: &IXpsOMPrintTicketResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMPrintTicketResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMPrintTicketResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMPrintTicketResource_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sourcestream: ::windows::core::RawPtr, partname: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMRadialGradientBrush(pub ::windows::core::IUnknown);
impl IXpsOMRadialGradientBrush {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetOpacity(&self) -> ::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), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
pub unsafe fn GetGradientStops(&self) -> ::windows::core::Result<IXpsOMGradientStopCollection> {
let mut result__: <IXpsOMGradientStopCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGradientStopCollection>(result__)
}
pub unsafe fn GetTransform(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn GetTransformLocal(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn SetTransformLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMMatrixTransform>>(&self, transform: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), transform.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTransformLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR 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::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTransformLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetSpreadMethod(&self) -> ::windows::core::Result<XPS_SPREAD_METHOD> {
let mut result__: <XPS_SPREAD_METHOD as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_SPREAD_METHOD>(result__)
}
pub unsafe fn SetSpreadMethod(&self, spreadmethod: XPS_SPREAD_METHOD) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(spreadmethod)).ok()
}
pub unsafe fn GetColorInterpolationMode(&self) -> ::windows::core::Result<XPS_COLOR_INTERPOLATION> {
let mut result__: <XPS_COLOR_INTERPOLATION as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_COLOR_INTERPOLATION>(result__)
}
pub unsafe fn SetColorInterpolationMode(&self, colorinterpolationmode: XPS_COLOR_INTERPOLATION) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(colorinterpolationmode)).ok()
}
pub unsafe fn GetCenter(&self) -> ::windows::core::Result<XPS_POINT> {
let mut result__: <XPS_POINT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_POINT>(result__)
}
pub unsafe fn SetCenter(&self, center: *const XPS_POINT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), ::core::mem::transmute(center)).ok()
}
pub unsafe fn GetRadiiSizes(&self) -> ::windows::core::Result<XPS_SIZE> {
let mut result__: <XPS_SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_SIZE>(result__)
}
pub unsafe fn SetRadiiSizes(&self, radiisizes: *const XPS_SIZE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(radiisizes)).ok()
}
pub unsafe fn GetGradientOrigin(&self) -> ::windows::core::Result<XPS_POINT> {
let mut result__: <XPS_POINT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_POINT>(result__)
}
pub unsafe fn SetGradientOrigin(&self, origin: *const XPS_POINT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(origin)).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMRadialGradientBrush> {
let mut result__: <IXpsOMRadialGradientBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMRadialGradientBrush>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMRadialGradientBrush {
type Vtable = IXpsOMRadialGradientBrush_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x75f207e5_08bf_413c_96b1_b82b4064176b);
}
impl ::core::convert::From<IXpsOMRadialGradientBrush> for ::windows::core::IUnknown {
fn from(value: IXpsOMRadialGradientBrush) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMRadialGradientBrush> for ::windows::core::IUnknown {
fn from(value: &IXpsOMRadialGradientBrush) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMRadialGradientBrush {
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 IXpsOMRadialGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMRadialGradientBrush> for IXpsOMGradientBrush {
fn from(value: IXpsOMRadialGradientBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMRadialGradientBrush> for IXpsOMGradientBrush {
fn from(value: &IXpsOMRadialGradientBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMGradientBrush> for IXpsOMRadialGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMGradientBrush> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMGradientBrush> for &IXpsOMRadialGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMGradientBrush> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMRadialGradientBrush> for IXpsOMBrush {
fn from(value: IXpsOMRadialGradientBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMRadialGradientBrush> for IXpsOMBrush {
fn from(value: &IXpsOMRadialGradientBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for IXpsOMRadialGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for &IXpsOMRadialGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMRadialGradientBrush> for IXpsOMShareable {
fn from(value: IXpsOMRadialGradientBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMRadialGradientBrush> for IXpsOMShareable {
fn from(value: &IXpsOMRadialGradientBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMRadialGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMRadialGradientBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMRadialGradientBrush_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, gradientstops: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, spreadmethod: *mut XPS_SPREAD_METHOD) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, spreadmethod: XPS_SPREAD_METHOD) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorinterpolationmode: *mut XPS_COLOR_INTERPOLATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, colorinterpolationmode: XPS_COLOR_INTERPOLATION) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, center: *mut XPS_POINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, center: *const XPS_POINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, radiisizes: *mut XPS_SIZE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, radiisizes: *const XPS_SIZE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, origin: *mut XPS_POINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, origin: *const XPS_POINT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, radialgradientbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMRemoteDictionaryResource(pub ::windows::core::IUnknown);
impl IXpsOMRemoteDictionaryResource {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
pub unsafe fn GetDictionary(&self) -> ::windows::core::Result<IXpsOMDictionary> {
let mut result__: <IXpsOMDictionary as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDictionary>(result__)
}
pub unsafe fn SetDictionary<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMDictionary>>(&self, dictionary: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), dictionary.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMRemoteDictionaryResource {
type Vtable = IXpsOMRemoteDictionaryResource_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc9bd7cd4_e16a_4bf8_8c84_c950af7a3061);
}
impl ::core::convert::From<IXpsOMRemoteDictionaryResource> for ::windows::core::IUnknown {
fn from(value: IXpsOMRemoteDictionaryResource) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMRemoteDictionaryResource> for ::windows::core::IUnknown {
fn from(value: &IXpsOMRemoteDictionaryResource) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMRemoteDictionaryResource {
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 IXpsOMRemoteDictionaryResource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMRemoteDictionaryResource> for IXpsOMResource {
fn from(value: IXpsOMRemoteDictionaryResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMRemoteDictionaryResource> for IXpsOMResource {
fn from(value: &IXpsOMRemoteDictionaryResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for IXpsOMRemoteDictionaryResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for &IXpsOMRemoteDictionaryResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMRemoteDictionaryResource> for IXpsOMPart {
fn from(value: IXpsOMRemoteDictionaryResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMRemoteDictionaryResource> for IXpsOMPart {
fn from(value: &IXpsOMRemoteDictionaryResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMRemoteDictionaryResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMRemoteDictionaryResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMRemoteDictionaryResource_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionary: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionary: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMRemoteDictionaryResource1(pub ::windows::core::IUnknown);
impl IXpsOMRemoteDictionaryResource1 {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
pub unsafe fn GetDictionary(&self) -> ::windows::core::Result<IXpsOMDictionary> {
let mut result__: <IXpsOMDictionary as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDictionary>(result__)
}
pub unsafe fn SetDictionary<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMDictionary>>(&self, dictionary: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), dictionary.into_param().abi()).ok()
}
pub unsafe fn GetDocumentType(&self) -> ::windows::core::Result<XPS_DOCUMENT_TYPE> {
let mut result__: <XPS_DOCUMENT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_DOCUMENT_TYPE>(result__)
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn Write1<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::ISequentialStream>>(&self, stream: Param0, documenttype: XPS_DOCUMENT_TYPE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), stream.into_param().abi(), ::core::mem::transmute(documenttype)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMRemoteDictionaryResource1 {
type Vtable = IXpsOMRemoteDictionaryResource1_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xbf8fc1d4_9d46_4141_ba5f_94bb9250d041);
}
impl ::core::convert::From<IXpsOMRemoteDictionaryResource1> for ::windows::core::IUnknown {
fn from(value: IXpsOMRemoteDictionaryResource1) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMRemoteDictionaryResource1> for ::windows::core::IUnknown {
fn from(value: &IXpsOMRemoteDictionaryResource1) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMRemoteDictionaryResource1 {
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 IXpsOMRemoteDictionaryResource1 {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMRemoteDictionaryResource1> for IXpsOMRemoteDictionaryResource {
fn from(value: IXpsOMRemoteDictionaryResource1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMRemoteDictionaryResource1> for IXpsOMRemoteDictionaryResource {
fn from(value: &IXpsOMRemoteDictionaryResource1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMRemoteDictionaryResource> for IXpsOMRemoteDictionaryResource1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMRemoteDictionaryResource> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMRemoteDictionaryResource> for &IXpsOMRemoteDictionaryResource1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMRemoteDictionaryResource> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMRemoteDictionaryResource1> for IXpsOMResource {
fn from(value: IXpsOMRemoteDictionaryResource1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMRemoteDictionaryResource1> for IXpsOMResource {
fn from(value: &IXpsOMRemoteDictionaryResource1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for IXpsOMRemoteDictionaryResource1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for &IXpsOMRemoteDictionaryResource1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMRemoteDictionaryResource1> for IXpsOMPart {
fn from(value: IXpsOMRemoteDictionaryResource1) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMRemoteDictionaryResource1> for IXpsOMPart {
fn from(value: &IXpsOMRemoteDictionaryResource1) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMRemoteDictionaryResource1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMRemoteDictionaryResource1 {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMRemoteDictionaryResource1_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionary: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, dictionary: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, documenttype: *mut XPS_DOCUMENT_TYPE) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: ::windows::core::RawPtr, documenttype: XPS_DOCUMENT_TYPE) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMRemoteDictionaryResourceCollection(pub ::windows::core::IUnknown);
impl IXpsOMRemoteDictionaryResourceCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsOMRemoteDictionaryResource> {
let mut result__: <IXpsOMRemoteDictionaryResource 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::<IXpsOMRemoteDictionaryResource>(result__)
}
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMRemoteDictionaryResource>>(&self, index: u32, object: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), object.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMRemoteDictionaryResource>>(&self, index: u32, object: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), object.into_param().abi()).ok()
}
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMRemoteDictionaryResource>>(&self, object: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), object.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetByPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, partname: Param0) -> ::windows::core::Result<IXpsOMRemoteDictionaryResource> {
let mut result__: <IXpsOMRemoteDictionaryResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), partname.into_param().abi(), &mut result__).from_abi::<IXpsOMRemoteDictionaryResource>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMRemoteDictionaryResourceCollection {
type Vtable = IXpsOMRemoteDictionaryResourceCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x5c38db61_7fec_464a_87bd_41e3bef018be);
}
impl ::core::convert::From<IXpsOMRemoteDictionaryResourceCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMRemoteDictionaryResourceCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMRemoteDictionaryResourceCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMRemoteDictionaryResourceCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMRemoteDictionaryResourceCollection {
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 IXpsOMRemoteDictionaryResourceCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMRemoteDictionaryResourceCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, partname: ::windows::core::RawPtr, remotedictionaryresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMResource(pub ::windows::core::IUnknown);
impl IXpsOMResource {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMResource {
type Vtable = IXpsOMResource_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xda2ac0a2_73a2_4975_ad14_74097c3ff3a5);
}
impl ::core::convert::From<IXpsOMResource> for ::windows::core::IUnknown {
fn from(value: IXpsOMResource) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMResource> for ::windows::core::IUnknown {
fn from(value: &IXpsOMResource) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMResource {
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 IXpsOMResource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMResource> for IXpsOMPart {
fn from(value: IXpsOMResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMResource> for IXpsOMPart {
fn from(value: &IXpsOMResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMResource_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMShareable(pub ::windows::core::IUnknown);
impl IXpsOMShareable {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMShareable {
type Vtable = IXpsOMShareable_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7137398f_2fc1_454d_8c6a_2c3115a16ece);
}
impl ::core::convert::From<IXpsOMShareable> for ::windows::core::IUnknown {
fn from(value: IXpsOMShareable) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMShareable> for ::windows::core::IUnknown {
fn from(value: &IXpsOMShareable) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMShareable {
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 IXpsOMShareable {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMShareable_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMSignatureBlockResource(pub ::windows::core::IUnknown);
impl IXpsOMSignatureBlockResource {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<IXpsOMDocument> {
let mut result__: <IXpsOMDocument as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMDocument>(result__)
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetStream(&self) -> ::windows::core::Result<super::super::System::Com::IStream> {
let mut result__: <super::super::System::Com::IStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::System::Com::IStream>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn SetContent<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, sourcestream: Param0, partname: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), sourcestream.into_param().abi(), partname.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMSignatureBlockResource {
type Vtable = IXpsOMSignatureBlockResource_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x4776ad35_2e04_4357_8743_ebf6c171a905);
}
impl ::core::convert::From<IXpsOMSignatureBlockResource> for ::windows::core::IUnknown {
fn from(value: IXpsOMSignatureBlockResource) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMSignatureBlockResource> for ::windows::core::IUnknown {
fn from(value: &IXpsOMSignatureBlockResource) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMSignatureBlockResource {
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 IXpsOMSignatureBlockResource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMSignatureBlockResource> for IXpsOMResource {
fn from(value: IXpsOMSignatureBlockResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMSignatureBlockResource> for IXpsOMResource {
fn from(value: &IXpsOMSignatureBlockResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for IXpsOMSignatureBlockResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for &IXpsOMSignatureBlockResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMSignatureBlockResource> for IXpsOMPart {
fn from(value: IXpsOMSignatureBlockResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMSignatureBlockResource> for IXpsOMPart {
fn from(value: &IXpsOMSignatureBlockResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMSignatureBlockResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMSignatureBlockResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMSignatureBlockResource_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sourcestream: ::windows::core::RawPtr, partname: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMSignatureBlockResourceCollection(pub ::windows::core::IUnknown);
impl IXpsOMSignatureBlockResourceCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsOMSignatureBlockResource> {
let mut result__: <IXpsOMSignatureBlockResource 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::<IXpsOMSignatureBlockResource>(result__)
}
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMSignatureBlockResource>>(&self, index: u32, signatureblockresource: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), signatureblockresource.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMSignatureBlockResource>>(&self, index: u32, signatureblockresource: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), signatureblockresource.into_param().abi()).ok()
}
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMSignatureBlockResource>>(&self, signatureblockresource: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), signatureblockresource.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetByPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, partname: Param0) -> ::windows::core::Result<IXpsOMSignatureBlockResource> {
let mut result__: <IXpsOMSignatureBlockResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), partname.into_param().abi(), &mut result__).from_abi::<IXpsOMSignatureBlockResource>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMSignatureBlockResourceCollection {
type Vtable = IXpsOMSignatureBlockResourceCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xab8f5d8e_351b_4d33_aaed_fa56f0022931);
}
impl ::core::convert::From<IXpsOMSignatureBlockResourceCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMSignatureBlockResourceCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMSignatureBlockResourceCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMSignatureBlockResourceCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMSignatureBlockResourceCollection {
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 IXpsOMSignatureBlockResourceCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMSignatureBlockResourceCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, signatureblockresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, signatureblockresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, signatureblockresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signatureblockresource: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, partname: ::windows::core::RawPtr, signatureblockresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMSolidColorBrush(pub ::windows::core::IUnknown);
impl IXpsOMSolidColorBrush {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetOpacity(&self) -> ::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), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
pub unsafe fn GetColor(&self, color: *mut XPS_COLOR, colorprofile: *mut ::core::option::Option<IXpsOMColorProfileResource>) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(color), ::core::mem::transmute(colorprofile)).ok()
}
pub unsafe fn SetColor<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMColorProfileResource>>(&self, color: *const XPS_COLOR, colorprofile: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(color), colorprofile.into_param().abi()).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMSolidColorBrush> {
let mut result__: <IXpsOMSolidColorBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMSolidColorBrush>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMSolidColorBrush {
type Vtable = IXpsOMSolidColorBrush_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa06f9f05_3be9_4763_98a8_094fc672e488);
}
impl ::core::convert::From<IXpsOMSolidColorBrush> for ::windows::core::IUnknown {
fn from(value: IXpsOMSolidColorBrush) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMSolidColorBrush> for ::windows::core::IUnknown {
fn from(value: &IXpsOMSolidColorBrush) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMSolidColorBrush {
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 IXpsOMSolidColorBrush {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMSolidColorBrush> for IXpsOMBrush {
fn from(value: IXpsOMSolidColorBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMSolidColorBrush> for IXpsOMBrush {
fn from(value: &IXpsOMSolidColorBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for IXpsOMSolidColorBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for &IXpsOMSolidColorBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMSolidColorBrush> for IXpsOMShareable {
fn from(value: IXpsOMSolidColorBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMSolidColorBrush> for IXpsOMShareable {
fn from(value: &IXpsOMSolidColorBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMSolidColorBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMSolidColorBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMSolidColorBrush_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, color: *mut XPS_COLOR, colorprofile: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, color: *const XPS_COLOR, colorprofile: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, solidcolorbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMStoryFragmentsResource(pub ::windows::core::IUnknown);
impl IXpsOMStoryFragmentsResource {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, parturi: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), parturi.into_param().abi()).ok()
}
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<IXpsOMPageReference> {
let mut result__: <IXpsOMPageReference as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMPageReference>(result__)
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetStream(&self) -> ::windows::core::Result<super::super::System::Com::IStream> {
let mut result__: <super::super::System::Com::IStream as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::System::Com::IStream>(result__)
}
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))]
pub unsafe fn SetContent<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>, Param1: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, sourcestream: Param0, partname: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), sourcestream.into_param().abi(), partname.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMStoryFragmentsResource {
type Vtable = IXpsOMStoryFragmentsResource_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xc2b3ca09_0473_4282_87ae_1780863223f0);
}
impl ::core::convert::From<IXpsOMStoryFragmentsResource> for ::windows::core::IUnknown {
fn from(value: IXpsOMStoryFragmentsResource) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMStoryFragmentsResource> for ::windows::core::IUnknown {
fn from(value: &IXpsOMStoryFragmentsResource) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMStoryFragmentsResource {
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 IXpsOMStoryFragmentsResource {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMStoryFragmentsResource> for IXpsOMResource {
fn from(value: IXpsOMStoryFragmentsResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMStoryFragmentsResource> for IXpsOMResource {
fn from(value: &IXpsOMStoryFragmentsResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for IXpsOMStoryFragmentsResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMResource> for &IXpsOMStoryFragmentsResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMResource> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMStoryFragmentsResource> for IXpsOMPart {
fn from(value: IXpsOMStoryFragmentsResource) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMStoryFragmentsResource> for IXpsOMPart {
fn from(value: &IXpsOMStoryFragmentsResource) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for IXpsOMStoryFragmentsResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMPart> for &IXpsOMStoryFragmentsResource {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMPart> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMStoryFragmentsResource_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, parturi: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sourcestream: ::windows::core::RawPtr, partname: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Storage_Packaging_Opc", feature = "Win32_System_Com")))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMThumbnailGenerator(pub ::windows::core::IUnknown);
impl IXpsOMThumbnailGenerator {
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GenerateThumbnail<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMPage>, Param3: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, page: Param0, thumbnailtype: XPS_IMAGE_TYPE, thumbnailsize: XPS_THUMBNAIL_SIZE, imageresourcepartname: Param3) -> ::windows::core::Result<IXpsOMImageResource> {
let mut result__: <IXpsOMImageResource as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), page.into_param().abi(), ::core::mem::transmute(thumbnailtype), ::core::mem::transmute(thumbnailsize), imageresourcepartname.into_param().abi(), &mut result__).from_abi::<IXpsOMImageResource>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMThumbnailGenerator {
type Vtable = IXpsOMThumbnailGenerator_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x15b873d5_1971_41e8_83a3_6578403064c7);
}
impl ::core::convert::From<IXpsOMThumbnailGenerator> for ::windows::core::IUnknown {
fn from(value: IXpsOMThumbnailGenerator) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMThumbnailGenerator> for ::windows::core::IUnknown {
fn from(value: &IXpsOMThumbnailGenerator) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMThumbnailGenerator {
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 IXpsOMThumbnailGenerator {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMThumbnailGenerator_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_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, page: ::windows::core::RawPtr, thumbnailtype: XPS_IMAGE_TYPE, thumbnailsize: XPS_THUMBNAIL_SIZE, imageresourcepartname: ::windows::core::RawPtr, imageresource: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMTileBrush(pub ::windows::core::IUnknown);
impl IXpsOMTileBrush {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetOpacity(&self) -> ::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), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
pub unsafe fn GetTransform(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn GetTransformLocal(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn SetTransformLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMMatrixTransform>>(&self, transform: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), transform.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTransformLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTransformLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetViewbox(&self) -> ::windows::core::Result<XPS_RECT> {
let mut result__: <XPS_RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_RECT>(result__)
}
pub unsafe fn SetViewbox(&self, viewbox: *const XPS_RECT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(viewbox)).ok()
}
pub unsafe fn GetViewport(&self) -> ::windows::core::Result<XPS_RECT> {
let mut result__: <XPS_RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_RECT>(result__)
}
pub unsafe fn SetViewport(&self, viewport: *const XPS_RECT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(viewport)).ok()
}
pub unsafe fn GetTileMode(&self) -> ::windows::core::Result<XPS_TILE_MODE> {
let mut result__: <XPS_TILE_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_TILE_MODE>(result__)
}
pub unsafe fn SetTileMode(&self, tilemode: XPS_TILE_MODE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(tilemode)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMTileBrush {
type Vtable = IXpsOMTileBrush_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x0fc2328d_d722_4a54_b2ec_be90218a789e);
}
impl ::core::convert::From<IXpsOMTileBrush> for ::windows::core::IUnknown {
fn from(value: IXpsOMTileBrush) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMTileBrush> for ::windows::core::IUnknown {
fn from(value: &IXpsOMTileBrush) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMTileBrush {
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 IXpsOMTileBrush {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMTileBrush> for IXpsOMBrush {
fn from(value: IXpsOMTileBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMTileBrush> for IXpsOMBrush {
fn from(value: &IXpsOMTileBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for IXpsOMTileBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for &IXpsOMTileBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMTileBrush> for IXpsOMShareable {
fn from(value: IXpsOMTileBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMTileBrush> for IXpsOMShareable {
fn from(value: &IXpsOMTileBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMTileBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMTileBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMTileBrush_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewbox: *mut XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewbox: *const XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewport: *mut XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewport: *const XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tilemode: *mut XPS_TILE_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tilemode: XPS_TILE_MODE) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMVisual(pub ::windows::core::IUnknown);
impl IXpsOMVisual {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetTransform(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn GetTransformLocal(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn SetTransformLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMMatrixTransform>>(&self, matrixtransform: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), matrixtransform.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTransformLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTransformLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetClipGeometry(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn GetClipGeometryLocal(&self) -> ::windows::core::Result<IXpsOMGeometry> {
let mut result__: <IXpsOMGeometry as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMGeometry>(result__)
}
pub unsafe fn SetClipGeometryLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMGeometry>>(&self, clipgeometry: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), clipgeometry.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetClipGeometryLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetClipGeometryLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetOpacity(&self) -> ::windows::core::Result<f32> {
let mut result__: <f32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
pub unsafe fn GetOpacityMaskBrush(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn GetOpacityMaskBrushLocal(&self) -> ::windows::core::Result<IXpsOMBrush> {
let mut result__: <IXpsOMBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMBrush>(result__)
}
pub unsafe fn SetOpacityMaskBrushLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMBrush>>(&self, opacitymaskbrush: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), opacitymaskbrush.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetOpacityMaskBrushLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetOpacityMaskBrushLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetName(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetName<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, name: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), name.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIsHyperlinkTarget(&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).24)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetIsHyperlinkTarget<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, ishyperlink: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), ishyperlink.into_param().abi()).ok()
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn GetHyperlinkNavigateUri(&self) -> ::windows::core::Result<super::super::System::Com::IUri> {
let mut result__: <super::super::System::Com::IUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::System::Com::IUri>(result__)
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn SetHyperlinkNavigateUri<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IUri>>(&self, hyperlinkuri: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), hyperlinkuri.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetLanguage(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetLanguage<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, language: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), language.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMVisual {
type Vtable = IXpsOMVisual_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xbc3e7333_fb0b_4af3_a819_0b4eaad0d2fd);
}
impl ::core::convert::From<IXpsOMVisual> for ::windows::core::IUnknown {
fn from(value: IXpsOMVisual) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMVisual> for ::windows::core::IUnknown {
fn from(value: &IXpsOMVisual) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMVisual {
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 IXpsOMVisual {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMVisual> for IXpsOMShareable {
fn from(value: IXpsOMVisual) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMVisual> for IXpsOMShareable {
fn from(value: &IXpsOMVisual) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMVisual {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMVisual {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMVisual_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, matrixtransform: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clipgeometry: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacitymaskbrush: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, name: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ishyperlink: *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, ishyperlink: super::super::Foundation::BOOL) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hyperlinkuri: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hyperlinkuri: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, language: 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 IXpsOMVisualBrush(pub ::windows::core::IUnknown);
impl IXpsOMVisualBrush {
pub unsafe fn GetOwner(&self) -> ::windows::core::Result<::windows::core::IUnknown> {
let mut result__: <::windows::core::IUnknown as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<::windows::core::IUnknown>(result__)
}
pub unsafe fn GetType(&self) -> ::windows::core::Result<XPS_OBJECT_TYPE> {
let mut result__: <XPS_OBJECT_TYPE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_OBJECT_TYPE>(result__)
}
pub unsafe fn GetOpacity(&self) -> ::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), &mut result__).from_abi::<f32>(result__)
}
pub unsafe fn SetOpacity(&self, opacity: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(opacity)).ok()
}
pub unsafe fn GetTransform(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn GetTransformLocal(&self) -> ::windows::core::Result<IXpsOMMatrixTransform> {
let mut result__: <IXpsOMMatrixTransform as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMMatrixTransform>(result__)
}
pub unsafe fn SetTransformLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMMatrixTransform>>(&self, transform: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), transform.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetTransformLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetTransformLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, key: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), key.into_param().abi()).ok()
}
pub unsafe fn GetViewbox(&self) -> ::windows::core::Result<XPS_RECT> {
let mut result__: <XPS_RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_RECT>(result__)
}
pub unsafe fn SetViewbox(&self, viewbox: *const XPS_RECT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(viewbox)).ok()
}
pub unsafe fn GetViewport(&self) -> ::windows::core::Result<XPS_RECT> {
let mut result__: <XPS_RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_RECT>(result__)
}
pub unsafe fn SetViewport(&self, viewport: *const XPS_RECT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(viewport)).ok()
}
pub unsafe fn GetTileMode(&self) -> ::windows::core::Result<XPS_TILE_MODE> {
let mut result__: <XPS_TILE_MODE as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_TILE_MODE>(result__)
}
pub unsafe fn SetTileMode(&self, tilemode: XPS_TILE_MODE) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(tilemode)).ok()
}
pub unsafe fn GetVisual(&self) -> ::windows::core::Result<IXpsOMVisual> {
let mut result__: <IXpsOMVisual as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMVisual>(result__)
}
pub unsafe fn GetVisualLocal(&self) -> ::windows::core::Result<IXpsOMVisual> {
let mut result__: <IXpsOMVisual as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMVisual>(result__)
}
pub unsafe fn SetVisualLocal<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMVisual>>(&self, visual: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), visual.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetVisualLookup(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetVisualLookup<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, lookup: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), lookup.into_param().abi()).ok()
}
pub unsafe fn Clone(&self) -> ::windows::core::Result<IXpsOMVisualBrush> {
let mut result__: <IXpsOMVisualBrush as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsOMVisualBrush>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsOMVisualBrush {
type Vtable = IXpsOMVisualBrush_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x97e294af_5b37_46b4_8057_874d2f64119b);
}
impl ::core::convert::From<IXpsOMVisualBrush> for ::windows::core::IUnknown {
fn from(value: IXpsOMVisualBrush) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMVisualBrush> for ::windows::core::IUnknown {
fn from(value: &IXpsOMVisualBrush) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMVisualBrush {
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 IXpsOMVisualBrush {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
impl ::core::convert::From<IXpsOMVisualBrush> for IXpsOMTileBrush {
fn from(value: IXpsOMVisualBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMVisualBrush> for IXpsOMTileBrush {
fn from(value: &IXpsOMVisualBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMTileBrush> for IXpsOMVisualBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMTileBrush> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMTileBrush> for &IXpsOMVisualBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMTileBrush> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMVisualBrush> for IXpsOMBrush {
fn from(value: IXpsOMVisualBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMVisualBrush> for IXpsOMBrush {
fn from(value: &IXpsOMVisualBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for IXpsOMVisualBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMBrush> for &IXpsOMVisualBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMBrush> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
impl ::core::convert::From<IXpsOMVisualBrush> for IXpsOMShareable {
fn from(value: IXpsOMVisualBrush) -> Self {
unsafe { ::core::mem::transmute(value) }
}
}
impl ::core::convert::From<&IXpsOMVisualBrush> for IXpsOMShareable {
fn from(value: &IXpsOMVisualBrush) -> Self {
::core::convert::From::from(::core::clone::Clone::clone(value))
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for IXpsOMVisualBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) })
}
}
impl<'a> ::windows::core::IntoParam<'a, IXpsOMShareable> for &IXpsOMVisualBrush {
fn into_param(self) -> ::windows::core::Param<'a, IXpsOMShareable> {
::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) })
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMVisualBrush_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, owner: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, r#type: *mut XPS_OBJECT_TYPE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: *mut f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, opacity: f32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, transform: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, key: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewbox: *mut XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewbox: *const XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewport: *mut XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, viewport: *const XPS_RECT) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tilemode: *mut XPS_TILE_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, tilemode: XPS_TILE_MODE) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, visual: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, visual: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, visual: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lookup: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, lookup: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, visualbrush: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsOMVisualCollection(pub ::windows::core::IUnknown);
impl IXpsOMVisualCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsOMVisual> {
let mut result__: <IXpsOMVisual 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::<IXpsOMVisual>(result__)
}
pub unsafe fn InsertAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMVisual>>(&self, index: u32, object: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), object.into_param().abi()).ok()
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
pub unsafe fn SetAt<'a, Param1: ::windows::core::IntoParam<'a, IXpsOMVisual>>(&self, index: u32, object: Param1) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), ::core::mem::transmute(index), object.into_param().abi()).ok()
}
pub unsafe fn Append<'a, Param0: ::windows::core::IntoParam<'a, IXpsOMVisual>>(&self, object: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), object.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsOMVisualCollection {
type Vtable = IXpsOMVisualCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x94d8abde_ab91_46a8_82b7_f5b05ef01a96);
}
impl ::core::convert::From<IXpsOMVisualCollection> for ::windows::core::IUnknown {
fn from(value: IXpsOMVisualCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsOMVisualCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsOMVisualCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsOMVisualCollection {
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 IXpsOMVisualCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsOMVisualCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, object: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsSignature(pub ::windows::core::IUnknown);
impl IXpsSignature {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSignatureId(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR 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::PWSTR>(result__)
}
pub unsafe fn GetSignatureValue(&self, signaturehashvalue: *mut *mut u8, count: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(signaturehashvalue), ::core::mem::transmute(count)).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetCertificateEnumerator(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcCertificateEnumerator> {
let mut result__: <super::Packaging::Opc::IOpcCertificateEnumerator as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcCertificateEnumerator>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSigningTime(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetSigningTimeFormat(&self) -> ::windows::core::Result<super::Packaging::Opc::OPC_SIGNATURE_TIME_FORMAT> {
let mut result__: <super::Packaging::Opc::OPC_SIGNATURE_TIME_FORMAT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::OPC_SIGNATURE_TIME_FORMAT>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetSignaturePartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security_Cryptography"))]
pub unsafe fn Verify(&self, x509certificate: *const super::super::Security::Cryptography::CERT_CONTEXT) -> ::windows::core::Result<XPS_SIGNATURE_STATUS> {
let mut result__: <XPS_SIGNATURE_STATUS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(x509certificate), &mut result__).from_abi::<XPS_SIGNATURE_STATUS>(result__)
}
pub unsafe fn GetPolicy(&self) -> ::windows::core::Result<XPS_SIGN_POLICY> {
let mut result__: <XPS_SIGN_POLICY as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_SIGN_POLICY>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetCustomObjectEnumerator(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcSignatureCustomObjectEnumerator> {
let mut result__: <super::Packaging::Opc::IOpcSignatureCustomObjectEnumerator as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcSignatureCustomObjectEnumerator>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetCustomReferenceEnumerator(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcSignatureReferenceEnumerator> {
let mut result__: <super::Packaging::Opc::IOpcSignatureReferenceEnumerator as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcSignatureReferenceEnumerator>(result__)
}
pub unsafe fn GetSignatureXml(&self, signaturexml: *mut *mut u8, count: *mut u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(signaturexml), ::core::mem::transmute(count)).ok()
}
pub unsafe fn SetSignatureXml(&self, signaturexml: *const u8, count: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(signaturexml), ::core::mem::transmute(count)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsSignature {
type Vtable = IXpsSignature_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x6ae4c93e_1ade_42fb_898b_3a5658284857);
}
impl ::core::convert::From<IXpsSignature> for ::windows::core::IUnknown {
fn from(value: IXpsSignature) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsSignature> for ::windows::core::IUnknown {
fn from(value: &IXpsSignature) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsSignature {
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 IXpsSignature {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsSignature_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, sigid: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signaturehashvalue: *mut *mut u8, count: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, certificateenumerator: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, sigdatetimestring: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, timeformat: *mut super::Packaging::Opc::OPC_SIGNATURE_TIME_FORMAT) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signaturepartname: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security_Cryptography"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, x509certificate: *const super::super::Security::Cryptography::CERT_CONTEXT, sigstatus: *mut XPS_SIGNATURE_STATUS) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Security_Cryptography")))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, policy: *mut XPS_SIGN_POLICY) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, customobjectenumerator: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, customreferenceenumerator: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signaturexml: *mut *mut u8, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signaturexml: *const u8, count: u32) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsSignatureBlock(pub ::windows::core::IUnknown);
impl IXpsSignatureBlock {
pub unsafe fn GetRequests(&self) -> ::windows::core::Result<IXpsSignatureRequestCollection> {
let mut result__: <IXpsSignatureRequestCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsSignatureRequestCollection>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
pub unsafe fn GetDocumentIndex(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetDocumentName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn CreateRequest<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, requestid: Param0) -> ::windows::core::Result<IXpsSignatureRequest> {
let mut result__: <IXpsSignatureRequest as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), requestid.into_param().abi(), &mut result__).from_abi::<IXpsSignatureRequest>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsSignatureBlock {
type Vtable = IXpsSignatureBlock_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x151fac09_0b97_4ac6_a323_5e4297d4322b);
}
impl ::core::convert::From<IXpsSignatureBlock> for ::windows::core::IUnknown {
fn from(value: IXpsSignatureBlock) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsSignatureBlock> for ::windows::core::IUnknown {
fn from(value: &IXpsSignatureBlock) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsSignatureBlock {
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 IXpsSignatureBlock {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsSignatureBlock_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, requests: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, partname: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fixeddocumentindex: *mut u32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fixeddocumentname: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, requestid: super::super::Foundation::PWSTR, signaturerequest: *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 IXpsSignatureBlockCollection(pub ::windows::core::IUnknown);
impl IXpsSignatureBlockCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsSignatureBlock> {
let mut result__: <IXpsSignatureBlock 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::<IXpsSignatureBlock>(result__)
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsSignatureBlockCollection {
type Vtable = IXpsSignatureBlockCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x23397050_fe99_467a_8dce_9237f074ffe4);
}
impl ::core::convert::From<IXpsSignatureBlockCollection> for ::windows::core::IUnknown {
fn from(value: IXpsSignatureBlockCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsSignatureBlockCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsSignatureBlockCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsSignatureBlockCollection {
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 IXpsSignatureBlockCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsSignatureBlockCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, signatureblock: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsSignatureCollection(pub ::windows::core::IUnknown);
impl IXpsSignatureCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsSignature> {
let mut result__: <IXpsSignature 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::<IXpsSignature>(result__)
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsSignatureCollection {
type Vtable = IXpsSignatureCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xa2d1d95d_add2_4dff_ab27_6b9c645ff322);
}
impl ::core::convert::From<IXpsSignatureCollection> for ::windows::core::IUnknown {
fn from(value: IXpsSignatureCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsSignatureCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsSignatureCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsSignatureCollection {
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 IXpsSignatureCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsSignatureCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, signature: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsSignatureManager(pub ::windows::core::IUnknown);
impl IXpsSignatureManager {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn LoadPackageFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filename: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), filename.into_param().abi()).ok()
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn LoadPackageStream<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(&self, stream: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), stream.into_param().abi()).ok()
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security_Cryptography"))]
pub unsafe fn Sign<'a, Param0: ::windows::core::IntoParam<'a, IXpsSigningOptions>>(&self, signoptions: Param0, x509certificate: *const super::super::Security::Cryptography::CERT_CONTEXT) -> ::windows::core::Result<IXpsSignature> {
let mut result__: <IXpsSignature as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), signoptions.into_param().abi(), ::core::mem::transmute(x509certificate), &mut result__).from_abi::<IXpsSignature>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetSignatureOriginPartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetSignatureOriginPartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, signatureoriginpartname: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), signatureoriginpartname.into_param().abi()).ok()
}
pub unsafe fn GetSignatures(&self) -> ::windows::core::Result<IXpsSignatureCollection> {
let mut result__: <IXpsSignatureCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsSignatureCollection>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn AddSignatureBlock<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, partname: Param0, fixeddocumentindex: u32) -> ::windows::core::Result<IXpsSignatureBlock> {
let mut result__: <IXpsSignatureBlock as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), partname.into_param().abi(), ::core::mem::transmute(fixeddocumentindex), &mut result__).from_abi::<IXpsSignatureBlock>(result__)
}
pub unsafe fn GetSignatureBlocks(&self) -> ::windows::core::Result<IXpsSignatureBlockCollection> {
let mut result__: <IXpsSignatureBlockCollection as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsSignatureBlockCollection>(result__)
}
pub unsafe fn CreateSigningOptions(&self) -> ::windows::core::Result<IXpsSigningOptions> {
let mut result__: <IXpsSigningOptions as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsSigningOptions>(result__)
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))]
pub unsafe fn SavePackageToFile<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, filename: Param0, securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES, flagsandattributes: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), filename.into_param().abi(), ::core::mem::transmute(securityattributes), ::core::mem::transmute(flagsandattributes)).ok()
}
#[cfg(feature = "Win32_System_Com")]
pub unsafe fn SavePackageToStream<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(&self, stream: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), stream.into_param().abi()).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsSignatureManager {
type Vtable = IXpsSignatureManager_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xd3e8d338_fdc4_4afc_80b5_d532a1782ee1);
}
impl ::core::convert::From<IXpsSignatureManager> for ::windows::core::IUnknown {
fn from(value: IXpsSignatureManager) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsSignatureManager> for ::windows::core::IUnknown {
fn from(value: &IXpsSignatureManager) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsSignatureManager {
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 IXpsSignatureManager {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsSignatureManager_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, filename: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security_Cryptography"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signoptions: ::windows::core::RawPtr, x509certificate: *const super::super::Security::Cryptography::CERT_CONTEXT, signature: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Security_Cryptography")))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signatureoriginpartname: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signatureoriginpartname: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signatures: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, partname: ::windows::core::RawPtr, fixeddocumentindex: u32, signatureblock: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signatureblocks: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signingoptions: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Security"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, filename: super::super::Foundation::PWSTR, securityattributes: *const super::super::Security::SECURITY_ATTRIBUTES, flagsandattributes: u32) -> ::windows::core::HRESULT,
#[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Security")))] usize,
#[cfg(feature = "Win32_System_Com")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, stream: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_System_Com"))] usize,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsSignatureRequest(pub ::windows::core::IUnknown);
impl IXpsSignatureRequest {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetIntent(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR 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::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetIntent<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, intent: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), intent.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRequestedSigner(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetRequestedSigner<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, signername: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), signername.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRequestSignByDate(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetRequestSignByDate<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, datestring: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), datestring.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSigningLocale(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR 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::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetSigningLocale<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, place: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), place.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetSpotLocation(&self, pageindex: *mut i32, pagepartname: *mut ::core::option::Option<super::Packaging::Opc::IOpcPartUri>, x: *mut f32, y: *mut f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(pageindex), ::core::mem::transmute(pagepartname), ::core::mem::transmute(x), ::core::mem::transmute(y)).ok()
}
pub unsafe fn SetSpotLocation(&self, pageindex: i32, x: f32, y: f32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(pageindex), ::core::mem::transmute(x), ::core::mem::transmute(y)).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetRequestId(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
pub unsafe fn GetSignature(&self) -> ::windows::core::Result<IXpsSignature> {
let mut result__: <IXpsSignature as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), &mut result__).from_abi::<IXpsSignature>(result__)
}
}
unsafe impl ::windows::core::Interface for IXpsSignatureRequest {
type Vtable = IXpsSignatureRequest_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xac58950b_7208_4b2d_b2c4_951083d3b8eb);
}
impl ::core::convert::From<IXpsSignatureRequest> for ::windows::core::IUnknown {
fn from(value: IXpsSignatureRequest) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsSignatureRequest> for ::windows::core::IUnknown {
fn from(value: &IXpsSignatureRequest) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsSignatureRequest {
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 IXpsSignatureRequest {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsSignatureRequest_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, intent: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, intent: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signername: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signername: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, datestring: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, datestring: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, place: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, place: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pageindex: *mut i32, pagepartname: *mut ::windows::core::RawPtr, x: *mut f32, y: *mut f32) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pageindex: i32, x: f32, y: f32) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, requestid: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signature: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsSignatureRequestCollection(pub ::windows::core::IUnknown);
impl IXpsSignatureRequestCollection {
pub unsafe fn GetCount(&self) -> ::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), &mut result__).from_abi::<u32>(result__)
}
pub unsafe fn GetAt(&self, index: u32) -> ::windows::core::Result<IXpsSignatureRequest> {
let mut result__: <IXpsSignatureRequest 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::<IXpsSignatureRequest>(result__)
}
pub unsafe fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(index)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsSignatureRequestCollection {
type Vtable = IXpsSignatureRequestCollection_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xf0253e68_9f19_412e_9b4f_54d3b0ac6cd9);
}
impl ::core::convert::From<IXpsSignatureRequestCollection> for ::windows::core::IUnknown {
fn from(value: IXpsSignatureRequestCollection) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsSignatureRequestCollection> for ::windows::core::IUnknown {
fn from(value: &IXpsSignatureRequestCollection) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsSignatureRequestCollection {
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 IXpsSignatureRequestCollection {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsSignatureRequestCollection_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, count: *mut u32) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32, signaturerequest: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, index: u32) -> ::windows::core::HRESULT,
);
#[repr(transparent)]
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)]
pub struct IXpsSigningOptions(pub ::windows::core::IUnknown);
impl IXpsSigningOptions {
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSignatureId(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR 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::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetSignatureId<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, signatureid: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), signatureid.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetSignatureMethod(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetSignatureMethod<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, signaturemethod: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), signaturemethod.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn GetDigestMethod(&self) -> ::windows::core::Result<super::super::Foundation::PWSTR> {
let mut result__: <super::super::Foundation::PWSTR as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::super::Foundation::PWSTR>(result__)
}
#[cfg(feature = "Win32_Foundation")]
pub unsafe fn SetDigestMethod<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(&self, digestmethod: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), digestmethod.into_param().abi()).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetSignaturePartName(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcPartUri> {
let mut result__: <super::Packaging::Opc::IOpcPartUri as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcPartUri>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetSignaturePartName<'a, Param0: ::windows::core::IntoParam<'a, super::Packaging::Opc::IOpcPartUri>>(&self, signaturepartname: Param0) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), signaturepartname.into_param().abi()).ok()
}
pub unsafe fn GetPolicy(&self) -> ::windows::core::Result<XPS_SIGN_POLICY> {
let mut result__: <XPS_SIGN_POLICY as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_SIGN_POLICY>(result__)
}
pub unsafe fn SetPolicy(&self, policy: XPS_SIGN_POLICY) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(policy)).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetSigningTimeFormat(&self) -> ::windows::core::Result<super::Packaging::Opc::OPC_SIGNATURE_TIME_FORMAT> {
let mut result__: <super::Packaging::Opc::OPC_SIGNATURE_TIME_FORMAT as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::OPC_SIGNATURE_TIME_FORMAT>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn SetSigningTimeFormat(&self, timeformat: super::Packaging::Opc::OPC_SIGNATURE_TIME_FORMAT) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(timeformat)).ok()
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetCustomObjects(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcSignatureCustomObjectSet> {
let mut result__: <super::Packaging::Opc::IOpcSignatureCustomObjectSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcSignatureCustomObjectSet>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetCustomReferences(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcSignatureReferenceSet> {
let mut result__: <super::Packaging::Opc::IOpcSignatureReferenceSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcSignatureReferenceSet>(result__)
}
#[cfg(feature = "Win32_Storage_Packaging_Opc")]
pub unsafe fn GetCertificateSet(&self) -> ::windows::core::Result<super::Packaging::Opc::IOpcCertificateSet> {
let mut result__: <super::Packaging::Opc::IOpcCertificateSet as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), &mut result__).from_abi::<super::Packaging::Opc::IOpcCertificateSet>(result__)
}
pub unsafe fn GetFlags(&self) -> ::windows::core::Result<XPS_SIGN_FLAGS> {
let mut result__: <XPS_SIGN_FLAGS as ::windows::core::Abi>::Abi = ::core::mem::zeroed();
(::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), &mut result__).from_abi::<XPS_SIGN_FLAGS>(result__)
}
pub unsafe fn SetFlags(&self, flags: XPS_SIGN_FLAGS) -> ::windows::core::Result<()> {
(::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(flags)).ok()
}
}
unsafe impl ::windows::core::Interface for IXpsSigningOptions {
type Vtable = IXpsSigningOptions_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7718eae4_3215_49be_af5b_594fef7fcfa6);
}
impl ::core::convert::From<IXpsSigningOptions> for ::windows::core::IUnknown {
fn from(value: IXpsSigningOptions) -> Self {
value.0
}
}
impl ::core::convert::From<&IXpsSigningOptions> for ::windows::core::IUnknown {
fn from(value: &IXpsSigningOptions) -> Self {
value.0.clone()
}
}
impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IXpsSigningOptions {
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 IXpsSigningOptions {
fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> {
::windows::core::Param::Borrowed(&self.0)
}
}
#[repr(C)]
#[doc(hidden)]
pub struct IXpsSigningOptions_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, signatureid: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signatureid: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signaturemethod: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signaturemethod: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, digestmethod: *mut super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, digestmethod: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Foundation"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signaturepartname: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, signaturepartname: ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, policy: *mut XPS_SIGN_POLICY) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, policy: XPS_SIGN_POLICY) -> ::windows::core::HRESULT,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, timeformat: *mut super::Packaging::Opc::OPC_SIGNATURE_TIME_FORMAT) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, timeformat: super::Packaging::Opc::OPC_SIGNATURE_TIME_FORMAT) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, customobjectset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, customreferenceset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
#[cfg(feature = "Win32_Storage_Packaging_Opc")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, certificateset: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT,
#[cfg(not(feature = "Win32_Storage_Packaging_Opc"))] usize,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flags: *mut XPS_SIGN_FLAGS) -> ::windows::core::HRESULT,
pub unsafe extern "system" fn(this: ::windows::core::RawPtr, flags: XPS_SIGN_FLAGS) -> ::windows::core::HRESULT,
);
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct PRINT_WINDOW_FLAGS(pub u32);
pub const PW_CLIENTONLY: PRINT_WINDOW_FLAGS = PRINT_WINDOW_FLAGS(1u32);
impl ::core::convert::From<u32> for PRINT_WINDOW_FLAGS {
fn from(value: u32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for PRINT_WINDOW_FLAGS {
type Abi = Self;
}
impl ::core::ops::BitOr for PRINT_WINDOW_FLAGS {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl ::core::ops::BitAnd for PRINT_WINDOW_FLAGS {
type Output = Self;
fn bitand(self, rhs: Self) -> Self {
Self(self.0 & rhs.0)
}
}
impl ::core::ops::BitOrAssign for PRINT_WINDOW_FLAGS {
fn bitor_assign(&mut self, rhs: Self) {
self.0.bitor_assign(rhs.0)
}
}
impl ::core::ops::BitAndAssign for PRINT_WINDOW_FLAGS {
fn bitand_assign(&mut self, rhs: Self) {
self.0.bitand_assign(rhs.0)
}
}
impl ::core::ops::Not for PRINT_WINDOW_FLAGS {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct PSFEATURE_CUSTPAPER {
pub lOrientation: i32,
pub lWidth: i32,
pub lHeight: i32,
pub lWidthOffset: i32,
pub lHeightOffset: i32,
}
impl PSFEATURE_CUSTPAPER {}
impl ::core::default::Default for PSFEATURE_CUSTPAPER {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for PSFEATURE_CUSTPAPER {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("PSFEATURE_CUSTPAPER").field("lOrientation", &self.lOrientation).field("lWidth", &self.lWidth).field("lHeight", &self.lHeight).field("lWidthOffset", &self.lWidthOffset).field("lHeightOffset", &self.lHeightOffset).finish()
}
}
impl ::core::cmp::PartialEq for PSFEATURE_CUSTPAPER {
fn eq(&self, other: &Self) -> bool {
self.lOrientation == other.lOrientation && self.lWidth == other.lWidth && self.lHeight == other.lHeight && self.lWidthOffset == other.lWidthOffset && self.lHeightOffset == other.lHeightOffset
}
}
impl ::core::cmp::Eq for PSFEATURE_CUSTPAPER {}
unsafe impl ::windows::core::Abi for PSFEATURE_CUSTPAPER {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
#[cfg(feature = "Win32_Foundation")]
pub struct PSFEATURE_OUTPUT {
pub bPageIndependent: super::super::Foundation::BOOL,
pub bSetPageDevice: super::super::Foundation::BOOL,
}
#[cfg(feature = "Win32_Foundation")]
impl PSFEATURE_OUTPUT {}
#[cfg(feature = "Win32_Foundation")]
impl ::core::default::Default for PSFEATURE_OUTPUT {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::fmt::Debug for PSFEATURE_OUTPUT {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("PSFEATURE_OUTPUT").field("bPageIndependent", &self.bPageIndependent).field("bSetPageDevice", &self.bSetPageDevice).finish()
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::PartialEq for PSFEATURE_OUTPUT {
fn eq(&self, other: &Self) -> bool {
self.bPageIndependent == other.bPageIndependent && self.bSetPageDevice == other.bSetPageDevice
}
}
#[cfg(feature = "Win32_Foundation")]
impl ::core::cmp::Eq for PSFEATURE_OUTPUT {}
#[cfg(feature = "Win32_Foundation")]
unsafe impl ::windows::core::Abi for PSFEATURE_OUTPUT {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct PSINJECTDATA {
pub DataBytes: u32,
pub InjectionPoint: PSINJECT_POINT,
pub PageNumber: u16,
}
impl PSINJECTDATA {}
impl ::core::default::Default for PSINJECTDATA {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for PSINJECTDATA {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("PSINJECTDATA").field("DataBytes", &self.DataBytes).field("InjectionPoint", &self.InjectionPoint).field("PageNumber", &self.PageNumber).finish()
}
}
impl ::core::cmp::PartialEq for PSINJECTDATA {
fn eq(&self, other: &Self) -> bool {
self.DataBytes == other.DataBytes && self.InjectionPoint == other.InjectionPoint && self.PageNumber == other.PageNumber
}
}
impl ::core::cmp::Eq for PSINJECTDATA {}
unsafe impl ::windows::core::Abi for PSINJECTDATA {
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 PSINJECT_POINT(pub u16);
pub const PSINJECT_BEGINSTREAM: PSINJECT_POINT = PSINJECT_POINT(1u16);
pub const PSINJECT_PSADOBE: PSINJECT_POINT = PSINJECT_POINT(2u16);
pub const PSINJECT_PAGESATEND: PSINJECT_POINT = PSINJECT_POINT(3u16);
pub const PSINJECT_PAGES: PSINJECT_POINT = PSINJECT_POINT(4u16);
pub const PSINJECT_DOCNEEDEDRES: PSINJECT_POINT = PSINJECT_POINT(5u16);
pub const PSINJECT_DOCSUPPLIEDRES: PSINJECT_POINT = PSINJECT_POINT(6u16);
pub const PSINJECT_PAGEORDER: PSINJECT_POINT = PSINJECT_POINT(7u16);
pub const PSINJECT_ORIENTATION: PSINJECT_POINT = PSINJECT_POINT(8u16);
pub const PSINJECT_BOUNDINGBOX: PSINJECT_POINT = PSINJECT_POINT(9u16);
pub const PSINJECT_DOCUMENTPROCESSCOLORS: PSINJECT_POINT = PSINJECT_POINT(10u16);
pub const PSINJECT_COMMENTS: PSINJECT_POINT = PSINJECT_POINT(11u16);
pub const PSINJECT_BEGINDEFAULTS: PSINJECT_POINT = PSINJECT_POINT(12u16);
pub const PSINJECT_ENDDEFAULTS: PSINJECT_POINT = PSINJECT_POINT(13u16);
pub const PSINJECT_BEGINPROLOG: PSINJECT_POINT = PSINJECT_POINT(14u16);
pub const PSINJECT_ENDPROLOG: PSINJECT_POINT = PSINJECT_POINT(15u16);
pub const PSINJECT_BEGINSETUP: PSINJECT_POINT = PSINJECT_POINT(16u16);
pub const PSINJECT_ENDSETUP: PSINJECT_POINT = PSINJECT_POINT(17u16);
pub const PSINJECT_TRAILER: PSINJECT_POINT = PSINJECT_POINT(18u16);
pub const PSINJECT_EOF: PSINJECT_POINT = PSINJECT_POINT(19u16);
pub const PSINJECT_ENDSTREAM: PSINJECT_POINT = PSINJECT_POINT(20u16);
pub const PSINJECT_DOCUMENTPROCESSCOLORSATEND: PSINJECT_POINT = PSINJECT_POINT(21u16);
pub const PSINJECT_PAGENUMBER: PSINJECT_POINT = PSINJECT_POINT(100u16);
pub const PSINJECT_BEGINPAGESETUP: PSINJECT_POINT = PSINJECT_POINT(101u16);
pub const PSINJECT_ENDPAGESETUP: PSINJECT_POINT = PSINJECT_POINT(102u16);
pub const PSINJECT_PAGETRAILER: PSINJECT_POINT = PSINJECT_POINT(103u16);
pub const PSINJECT_PLATECOLOR: PSINJECT_POINT = PSINJECT_POINT(104u16);
pub const PSINJECT_SHOWPAGE: PSINJECT_POINT = PSINJECT_POINT(105u16);
pub const PSINJECT_PAGEBBOX: PSINJECT_POINT = PSINJECT_POINT(106u16);
pub const PSINJECT_ENDPAGECOMMENTS: PSINJECT_POINT = PSINJECT_POINT(107u16);
pub const PSINJECT_VMSAVE: PSINJECT_POINT = PSINJECT_POINT(200u16);
pub const PSINJECT_VMRESTORE: PSINJECT_POINT = PSINJECT_POINT(201u16);
impl ::core::convert::From<u16> for PSINJECT_POINT {
fn from(value: u16) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for PSINJECT_POINT {
type Abi = Self;
}
impl ::core::ops::BitOr for PSINJECT_POINT {
type Output = Self;
fn bitor(self, rhs: Self) -> Self {
Self(self.0 | rhs.0)
}
}
impl ::core::ops::BitAnd for PSINJECT_POINT {
type Output = Self;
fn bitand(self, rhs: Self) -> Self {
Self(self.0 & rhs.0)
}
}
impl ::core::ops::BitOrAssign for PSINJECT_POINT {
fn bitor_assign(&mut self, rhs: Self) {
self.0.bitor_assign(rhs.0)
}
}
impl ::core::ops::BitAndAssign for PSINJECT_POINT {
fn bitand_assign(&mut self, rhs: Self) {
self.0.bitand_assign(rhs.0)
}
}
impl ::core::ops::Not for PSINJECT_POINT {
type Output = Self;
fn not(self) -> Self {
Self(self.0.not())
}
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
#[inline]
pub unsafe fn PrintWindow<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hwnd: Param0, hdcblt: Param1, nflags: PRINT_WINDOW_FLAGS) -> super::super::Foundation::BOOL {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn PrintWindow(hwnd: super::super::Foundation::HWND, hdcblt: super::super::Graphics::Gdi::HDC, nflags: PRINT_WINDOW_FLAGS) -> super::super::Foundation::BOOL;
}
::core::mem::transmute(PrintWindow(hwnd.into_param().abi(), hdcblt.into_param().abi(), ::core::mem::transmute(nflags)))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
#[inline]
pub unsafe fn SetAbortProc<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hdc: Param0, proc: ::core::option::Option<ABORTPROC>) -> i32 {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn SetAbortProc(hdc: super::super::Graphics::Gdi::HDC, proc: ::windows::core::RawPtr) -> i32;
}
::core::mem::transmute(SetAbortProc(hdc.into_param().abi(), ::core::mem::transmute(proc)))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
#[inline]
pub unsafe fn StartDocA<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hdc: Param0, lpdi: *const DOCINFOA) -> i32 {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn StartDocA(hdc: super::super::Graphics::Gdi::HDC, lpdi: *const DOCINFOA) -> i32;
}
::core::mem::transmute(StartDocA(hdc.into_param().abi(), ::core::mem::transmute(lpdi)))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))]
#[inline]
pub unsafe fn StartDocW<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hdc: Param0, lpdi: *const DOCINFOW) -> i32 {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn StartDocW(hdc: super::super::Graphics::Gdi::HDC, lpdi: *const DOCINFOW) -> i32;
}
::core::mem::transmute(StartDocW(hdc.into_param().abi(), ::core::mem::transmute(lpdi)))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[cfg(feature = "Win32_Graphics_Gdi")]
#[inline]
pub unsafe fn StartPage<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hdc: Param0) -> i32 {
#[cfg(windows)]
{
#[link(name = "windows")]
extern "system" {
fn StartPage(hdc: super::super::Graphics::Gdi::HDC) -> i32;
}
::core::mem::transmute(StartPage(hdc.into_param().abi()))
}
#[cfg(not(windows))]
unimplemented!("Unsupported target OS");
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct XPS_COLOR {
pub colorType: XPS_COLOR_TYPE,
pub value: XPS_COLOR_0,
}
impl XPS_COLOR {}
impl ::core::default::Default for XPS_COLOR {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::cmp::PartialEq for XPS_COLOR {
fn eq(&self, _other: &Self) -> bool {
unimplemented!()
}
}
impl ::core::cmp::Eq for XPS_COLOR {}
unsafe impl ::windows::core::Abi for XPS_COLOR {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub union XPS_COLOR_0 {
pub sRGB: XPS_COLOR_0_1,
pub scRGB: XPS_COLOR_0_2,
pub context: XPS_COLOR_0_0,
}
impl XPS_COLOR_0 {}
impl ::core::default::Default for XPS_COLOR_0 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::cmp::PartialEq for XPS_COLOR_0 {
fn eq(&self, _other: &Self) -> bool {
unimplemented!()
}
}
impl ::core::cmp::Eq for XPS_COLOR_0 {}
unsafe impl ::windows::core::Abi for XPS_COLOR_0 {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct XPS_COLOR_0_0 {
pub channelCount: u8,
pub channels: [f32; 9],
}
impl XPS_COLOR_0_0 {}
impl ::core::default::Default for XPS_COLOR_0_0 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for XPS_COLOR_0_0 {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("_context_e__Struct").field("channelCount", &self.channelCount).field("channels", &self.channels).finish()
}
}
impl ::core::cmp::PartialEq for XPS_COLOR_0_0 {
fn eq(&self, other: &Self) -> bool {
self.channelCount == other.channelCount && self.channels == other.channels
}
}
impl ::core::cmp::Eq for XPS_COLOR_0_0 {}
unsafe impl ::windows::core::Abi for XPS_COLOR_0_0 {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct XPS_COLOR_0_1 {
pub alpha: u8,
pub red: u8,
pub green: u8,
pub blue: u8,
}
impl XPS_COLOR_0_1 {}
impl ::core::default::Default for XPS_COLOR_0_1 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for XPS_COLOR_0_1 {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("_sRGB_e__Struct").field("alpha", &self.alpha).field("red", &self.red).field("green", &self.green).field("blue", &self.blue).finish()
}
}
impl ::core::cmp::PartialEq for XPS_COLOR_0_1 {
fn eq(&self, other: &Self) -> bool {
self.alpha == other.alpha && self.red == other.red && self.green == other.green && self.blue == other.blue
}
}
impl ::core::cmp::Eq for XPS_COLOR_0_1 {}
unsafe impl ::windows::core::Abi for XPS_COLOR_0_1 {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct XPS_COLOR_0_2 {
pub alpha: f32,
pub red: f32,
pub green: f32,
pub blue: f32,
}
impl XPS_COLOR_0_2 {}
impl ::core::default::Default for XPS_COLOR_0_2 {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for XPS_COLOR_0_2 {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("_scRGB_e__Struct").field("alpha", &self.alpha).field("red", &self.red).field("green", &self.green).field("blue", &self.blue).finish()
}
}
impl ::core::cmp::PartialEq for XPS_COLOR_0_2 {
fn eq(&self, other: &Self) -> bool {
self.alpha == other.alpha && self.red == other.red && self.green == other.green && self.blue == other.blue
}
}
impl ::core::cmp::Eq for XPS_COLOR_0_2 {}
unsafe impl ::windows::core::Abi for XPS_COLOR_0_2 {
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 XPS_COLOR_INTERPOLATION(pub i32);
pub const XPS_COLOR_INTERPOLATION_SCRGBLINEAR: XPS_COLOR_INTERPOLATION = XPS_COLOR_INTERPOLATION(1i32);
pub const XPS_COLOR_INTERPOLATION_SRGBLINEAR: XPS_COLOR_INTERPOLATION = XPS_COLOR_INTERPOLATION(2i32);
impl ::core::convert::From<i32> for XPS_COLOR_INTERPOLATION {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_COLOR_INTERPOLATION {
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 XPS_COLOR_TYPE(pub i32);
pub const XPS_COLOR_TYPE_SRGB: XPS_COLOR_TYPE = XPS_COLOR_TYPE(1i32);
pub const XPS_COLOR_TYPE_SCRGB: XPS_COLOR_TYPE = XPS_COLOR_TYPE(2i32);
pub const XPS_COLOR_TYPE_CONTEXT: XPS_COLOR_TYPE = XPS_COLOR_TYPE(3i32);
impl ::core::convert::From<i32> for XPS_COLOR_TYPE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_COLOR_TYPE {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct XPS_DASH {
pub length: f32,
pub gap: f32,
}
impl XPS_DASH {}
impl ::core::default::Default for XPS_DASH {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for XPS_DASH {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("XPS_DASH").field("length", &self.length).field("gap", &self.gap).finish()
}
}
impl ::core::cmp::PartialEq for XPS_DASH {
fn eq(&self, other: &Self) -> bool {
self.length == other.length && self.gap == other.gap
}
}
impl ::core::cmp::Eq for XPS_DASH {}
unsafe impl ::windows::core::Abi for XPS_DASH {
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 XPS_DASH_CAP(pub i32);
pub const XPS_DASH_CAP_FLAT: XPS_DASH_CAP = XPS_DASH_CAP(1i32);
pub const XPS_DASH_CAP_ROUND: XPS_DASH_CAP = XPS_DASH_CAP(2i32);
pub const XPS_DASH_CAP_SQUARE: XPS_DASH_CAP = XPS_DASH_CAP(3i32);
pub const XPS_DASH_CAP_TRIANGLE: XPS_DASH_CAP = XPS_DASH_CAP(4i32);
impl ::core::convert::From<i32> for XPS_DASH_CAP {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_DASH_CAP {
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 XPS_DOCUMENT_TYPE(pub i32);
pub const XPS_DOCUMENT_TYPE_UNSPECIFIED: XPS_DOCUMENT_TYPE = XPS_DOCUMENT_TYPE(1i32);
pub const XPS_DOCUMENT_TYPE_XPS: XPS_DOCUMENT_TYPE = XPS_DOCUMENT_TYPE(2i32);
pub const XPS_DOCUMENT_TYPE_OPENXPS: XPS_DOCUMENT_TYPE = XPS_DOCUMENT_TYPE(3i32);
impl ::core::convert::From<i32> for XPS_DOCUMENT_TYPE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_DOCUMENT_TYPE {
type Abi = Self;
}
pub const XPS_E_ABSOLUTE_REFERENCE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108159i32 as _);
pub const XPS_E_ALREADY_OWNED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108413i32 as _);
pub const XPS_E_BLEED_BOX_PAGE_DIMENSIONS_NOT_IN_SYNC: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108407i32 as _);
pub const XPS_E_BOTH_PATHFIGURE_AND_ABBR_SYNTAX_PRESENT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108409i32 as _);
pub const XPS_E_BOTH_RESOURCE_AND_SOURCEATTR_PRESENT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108408i32 as _);
pub const XPS_E_CARET_OUTSIDE_STRING: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108923i32 as _);
pub const XPS_E_CARET_OUT_OF_ORDER: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108922i32 as _);
pub const XPS_E_COLOR_COMPONENT_OUT_OF_RANGE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108410i32 as _);
pub const XPS_E_DICTIONARY_ITEM_NAMED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108671i32 as _);
pub const XPS_E_DUPLICATE_NAMES: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109175i32 as _);
pub const XPS_E_DUPLICATE_RESOURCE_KEYS: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109184i32 as _);
pub const XPS_E_INDEX_OUT_OF_RANGE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108416i32 as _);
pub const XPS_E_INVALID_BLEED_BOX: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109692i32 as _);
pub const XPS_E_INVALID_CONTENT_BOX: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109685i32 as _);
pub const XPS_E_INVALID_CONTENT_TYPE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109682i32 as _);
pub const XPS_E_INVALID_FLOAT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109689i32 as _);
pub const XPS_E_INVALID_FONT_URI: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109686i32 as _);
pub const XPS_E_INVALID_LANGUAGE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109696i32 as _);
pub const XPS_E_INVALID_LOOKUP_TYPE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109690i32 as _);
pub const XPS_E_INVALID_MARKUP: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109684i32 as _);
pub const XPS_E_INVALID_NAME: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109695i32 as _);
pub const XPS_E_INVALID_NUMBER_OF_COLOR_CHANNELS: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108158i32 as _);
pub const XPS_E_INVALID_NUMBER_OF_POINTS_IN_CURVE_SEGMENTS: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108160i32 as _);
pub const XPS_E_INVALID_OBFUSCATED_FONT_URI: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109681i32 as _);
pub const XPS_E_INVALID_PAGE_SIZE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109693i32 as _);
pub const XPS_E_INVALID_RESOURCE_KEY: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109694i32 as _);
pub const XPS_E_INVALID_SIGNATUREBLOCK_MARKUP: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108789i32 as _);
pub const XPS_E_INVALID_THUMBNAIL_IMAGE_TYPE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109691i32 as _);
pub const XPS_E_INVALID_XML_ENCODING: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109683i32 as _);
pub const XPS_E_MAPPING_OUTSIDE_INDICES: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108924i32 as _);
pub const XPS_E_MAPPING_OUTSIDE_STRING: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108925i32 as _);
pub const XPS_E_MAPPING_OUT_OF_ORDER: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108926i32 as _);
pub const XPS_E_MARKUP_COMPATIBILITY_ELEMENTS: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108791i32 as _);
pub const XPS_E_MISSING_COLORPROFILE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109436i32 as _);
pub const XPS_E_MISSING_DISCARDCONTROL: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109422i32 as _);
pub const XPS_E_MISSING_DOCUMENT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109431i32 as _);
pub const XPS_E_MISSING_DOCUMENTSEQUENCE_RELATIONSHIP: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109432i32 as _);
pub const XPS_E_MISSING_FONTURI: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109433i32 as _);
pub const XPS_E_MISSING_GLYPHS: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109438i32 as _);
pub const XPS_E_MISSING_IMAGE_IN_IMAGEBRUSH: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109426i32 as _);
pub const XPS_E_MISSING_LOOKUP: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109439i32 as _);
pub const XPS_E_MISSING_NAME: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109440i32 as _);
pub const XPS_E_MISSING_PAGE_IN_DOCUMENT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109428i32 as _);
pub const XPS_E_MISSING_PAGE_IN_PAGEREFERENCE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109427i32 as _);
pub const XPS_E_MISSING_PART_REFERENCE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109424i32 as _);
pub const XPS_E_MISSING_PART_STREAM: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109421i32 as _);
pub const XPS_E_MISSING_REFERRED_DOCUMENT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109430i32 as _);
pub const XPS_E_MISSING_REFERRED_PAGE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109429i32 as _);
pub const XPS_E_MISSING_RELATIONSHIP_TARGET: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109435i32 as _);
pub const XPS_E_MISSING_RESOURCE_KEY: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109425i32 as _);
pub const XPS_E_MISSING_RESOURCE_RELATIONSHIP: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109434i32 as _);
pub const XPS_E_MISSING_RESTRICTED_FONT_RELATIONSHIP: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109423i32 as _);
pub const XPS_E_MISSING_SEGMENT_DATA: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109437i32 as _);
pub const XPS_E_MULTIPLE_DOCUMENTSEQUENCE_RELATIONSHIPS: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109182i32 as _);
pub const XPS_E_MULTIPLE_PRINTTICKETS_ON_DOCUMENT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109178i32 as _);
pub const XPS_E_MULTIPLE_PRINTTICKETS_ON_DOCUMENTSEQUENCE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109177i32 as _);
pub const XPS_E_MULTIPLE_PRINTTICKETS_ON_PAGE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109179i32 as _);
pub const XPS_E_MULTIPLE_REFERENCES_TO_PART: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109176i32 as _);
pub const XPS_E_MULTIPLE_RESOURCES: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109183i32 as _);
pub const XPS_E_MULTIPLE_THUMBNAILS_ON_PACKAGE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109180i32 as _);
pub const XPS_E_MULTIPLE_THUMBNAILS_ON_PAGE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109181i32 as _);
pub const XPS_E_NEGATIVE_FLOAT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108918i32 as _);
pub const XPS_E_NESTED_REMOTE_DICTIONARY: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108670i32 as _);
pub const XPS_E_NOT_ENOUGH_GRADIENT_STOPS: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108405i32 as _);
pub const XPS_E_NO_CUSTOM_OBJECTS: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108414i32 as _);
pub const XPS_E_OBJECT_DETACHED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108790i32 as _);
pub const XPS_E_ODD_BIDILEVEL: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108921i32 as _);
pub const XPS_E_ONE_TO_ONE_MAPPING_EXPECTED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108920i32 as _);
pub const XPS_E_PACKAGE_ALREADY_OPENED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108793i32 as _);
pub const XPS_E_PACKAGE_NOT_OPENED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108794i32 as _);
pub const XPS_E_PACKAGE_WRITER_NOT_CLOSED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108404i32 as _);
pub const XPS_E_RELATIONSHIP_EXTERNAL: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108406i32 as _);
pub const XPS_E_RESOURCE_NOT_OWNED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108412i32 as _);
pub const XPS_E_RESTRICTED_FONT_NOT_OBFUSCATED: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108919i32 as _);
pub const XPS_E_SIGNATUREID_DUP: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108792i32 as _);
pub const XPS_E_SIGREQUESTID_DUP: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108795i32 as _);
pub const XPS_E_STRING_TOO_LONG: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108928i32 as _);
pub const XPS_E_TOO_MANY_INDICES: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108927i32 as _);
pub const XPS_E_UNAVAILABLE_PACKAGE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109420i32 as _);
pub const XPS_E_UNEXPECTED_COLORPROFILE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108411i32 as _);
pub const XPS_E_UNEXPECTED_CONTENT_TYPE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109688i32 as _);
pub const XPS_E_UNEXPECTED_RELATIONSHIP_TYPE: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109680i32 as _);
pub const XPS_E_UNEXPECTED_RESTRICTED_FONT_RELATIONSHIP: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142109679i32 as _);
pub const XPS_E_VISUAL_CIRCULAR_REF: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108415i32 as _);
pub const XPS_E_XKEY_ATTR_PRESENT_OUTSIDE_RES_DICT: ::windows::core::HRESULT = ::windows::core::HRESULT(-2142108672i32 as _);
#[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)]
#[repr(transparent)]
pub struct XPS_FILL_RULE(pub i32);
pub const XPS_FILL_RULE_EVENODD: XPS_FILL_RULE = XPS_FILL_RULE(1i32);
pub const XPS_FILL_RULE_NONZERO: XPS_FILL_RULE = XPS_FILL_RULE(2i32);
impl ::core::convert::From<i32> for XPS_FILL_RULE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_FILL_RULE {
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 XPS_FONT_EMBEDDING(pub i32);
pub const XPS_FONT_EMBEDDING_NORMAL: XPS_FONT_EMBEDDING = XPS_FONT_EMBEDDING(1i32);
pub const XPS_FONT_EMBEDDING_OBFUSCATED: XPS_FONT_EMBEDDING = XPS_FONT_EMBEDDING(2i32);
pub const XPS_FONT_EMBEDDING_RESTRICTED: XPS_FONT_EMBEDDING = XPS_FONT_EMBEDDING(3i32);
pub const XPS_FONT_EMBEDDING_RESTRICTED_UNOBFUSCATED: XPS_FONT_EMBEDDING = XPS_FONT_EMBEDDING(4i32);
impl ::core::convert::From<i32> for XPS_FONT_EMBEDDING {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_FONT_EMBEDDING {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct XPS_GLYPH_INDEX {
pub index: i32,
pub advanceWidth: f32,
pub horizontalOffset: f32,
pub verticalOffset: f32,
}
impl XPS_GLYPH_INDEX {}
impl ::core::default::Default for XPS_GLYPH_INDEX {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for XPS_GLYPH_INDEX {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("XPS_GLYPH_INDEX").field("index", &self.index).field("advanceWidth", &self.advanceWidth).field("horizontalOffset", &self.horizontalOffset).field("verticalOffset", &self.verticalOffset).finish()
}
}
impl ::core::cmp::PartialEq for XPS_GLYPH_INDEX {
fn eq(&self, other: &Self) -> bool {
self.index == other.index && self.advanceWidth == other.advanceWidth && self.horizontalOffset == other.horizontalOffset && self.verticalOffset == other.verticalOffset
}
}
impl ::core::cmp::Eq for XPS_GLYPH_INDEX {}
unsafe impl ::windows::core::Abi for XPS_GLYPH_INDEX {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct XPS_GLYPH_MAPPING {
pub unicodeStringStart: u32,
pub unicodeStringLength: u16,
pub glyphIndicesStart: u32,
pub glyphIndicesLength: u16,
}
impl XPS_GLYPH_MAPPING {}
impl ::core::default::Default for XPS_GLYPH_MAPPING {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for XPS_GLYPH_MAPPING {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("XPS_GLYPH_MAPPING").field("unicodeStringStart", &self.unicodeStringStart).field("unicodeStringLength", &self.unicodeStringLength).field("glyphIndicesStart", &self.glyphIndicesStart).field("glyphIndicesLength", &self.glyphIndicesLength).finish()
}
}
impl ::core::cmp::PartialEq for XPS_GLYPH_MAPPING {
fn eq(&self, other: &Self) -> bool {
self.unicodeStringStart == other.unicodeStringStart && self.unicodeStringLength == other.unicodeStringLength && self.glyphIndicesStart == other.glyphIndicesStart && self.glyphIndicesLength == other.glyphIndicesLength
}
}
impl ::core::cmp::Eq for XPS_GLYPH_MAPPING {}
unsafe impl ::windows::core::Abi for XPS_GLYPH_MAPPING {
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 XPS_IMAGE_TYPE(pub i32);
pub const XPS_IMAGE_TYPE_JPEG: XPS_IMAGE_TYPE = XPS_IMAGE_TYPE(1i32);
pub const XPS_IMAGE_TYPE_PNG: XPS_IMAGE_TYPE = XPS_IMAGE_TYPE(2i32);
pub const XPS_IMAGE_TYPE_TIFF: XPS_IMAGE_TYPE = XPS_IMAGE_TYPE(3i32);
pub const XPS_IMAGE_TYPE_WDP: XPS_IMAGE_TYPE = XPS_IMAGE_TYPE(4i32);
pub const XPS_IMAGE_TYPE_JXR: XPS_IMAGE_TYPE = XPS_IMAGE_TYPE(5i32);
impl ::core::convert::From<i32> for XPS_IMAGE_TYPE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_IMAGE_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 XPS_INTERLEAVING(pub i32);
pub const XPS_INTERLEAVING_OFF: XPS_INTERLEAVING = XPS_INTERLEAVING(1i32);
pub const XPS_INTERLEAVING_ON: XPS_INTERLEAVING = XPS_INTERLEAVING(2i32);
impl ::core::convert::From<i32> for XPS_INTERLEAVING {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_INTERLEAVING {
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 XPS_LINE_CAP(pub i32);
pub const XPS_LINE_CAP_FLAT: XPS_LINE_CAP = XPS_LINE_CAP(1i32);
pub const XPS_LINE_CAP_ROUND: XPS_LINE_CAP = XPS_LINE_CAP(2i32);
pub const XPS_LINE_CAP_SQUARE: XPS_LINE_CAP = XPS_LINE_CAP(3i32);
pub const XPS_LINE_CAP_TRIANGLE: XPS_LINE_CAP = XPS_LINE_CAP(4i32);
impl ::core::convert::From<i32> for XPS_LINE_CAP {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_LINE_CAP {
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 XPS_LINE_JOIN(pub i32);
pub const XPS_LINE_JOIN_MITER: XPS_LINE_JOIN = XPS_LINE_JOIN(1i32);
pub const XPS_LINE_JOIN_BEVEL: XPS_LINE_JOIN = XPS_LINE_JOIN(2i32);
pub const XPS_LINE_JOIN_ROUND: XPS_LINE_JOIN = XPS_LINE_JOIN(3i32);
impl ::core::convert::From<i32> for XPS_LINE_JOIN {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_LINE_JOIN {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct XPS_MATRIX {
pub m11: f32,
pub m12: f32,
pub m21: f32,
pub m22: f32,
pub m31: f32,
pub m32: f32,
}
impl XPS_MATRIX {}
impl ::core::default::Default for XPS_MATRIX {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for XPS_MATRIX {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("XPS_MATRIX").field("m11", &self.m11).field("m12", &self.m12).field("m21", &self.m21).field("m22", &self.m22).field("m31", &self.m31).field("m32", &self.m32).finish()
}
}
impl ::core::cmp::PartialEq for XPS_MATRIX {
fn eq(&self, other: &Self) -> bool {
self.m11 == other.m11 && self.m12 == other.m12 && self.m21 == other.m21 && self.m22 == other.m22 && self.m31 == other.m31 && self.m32 == other.m32
}
}
impl ::core::cmp::Eq for XPS_MATRIX {}
unsafe impl ::windows::core::Abi for XPS_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 XPS_OBJECT_TYPE(pub i32);
pub const XPS_OBJECT_TYPE_CANVAS: XPS_OBJECT_TYPE = XPS_OBJECT_TYPE(1i32);
pub const XPS_OBJECT_TYPE_GLYPHS: XPS_OBJECT_TYPE = XPS_OBJECT_TYPE(2i32);
pub const XPS_OBJECT_TYPE_PATH: XPS_OBJECT_TYPE = XPS_OBJECT_TYPE(3i32);
pub const XPS_OBJECT_TYPE_MATRIX_TRANSFORM: XPS_OBJECT_TYPE = XPS_OBJECT_TYPE(4i32);
pub const XPS_OBJECT_TYPE_GEOMETRY: XPS_OBJECT_TYPE = XPS_OBJECT_TYPE(5i32);
pub const XPS_OBJECT_TYPE_SOLID_COLOR_BRUSH: XPS_OBJECT_TYPE = XPS_OBJECT_TYPE(6i32);
pub const XPS_OBJECT_TYPE_IMAGE_BRUSH: XPS_OBJECT_TYPE = XPS_OBJECT_TYPE(7i32);
pub const XPS_OBJECT_TYPE_LINEAR_GRADIENT_BRUSH: XPS_OBJECT_TYPE = XPS_OBJECT_TYPE(8i32);
pub const XPS_OBJECT_TYPE_RADIAL_GRADIENT_BRUSH: XPS_OBJECT_TYPE = XPS_OBJECT_TYPE(9i32);
pub const XPS_OBJECT_TYPE_VISUAL_BRUSH: XPS_OBJECT_TYPE = XPS_OBJECT_TYPE(10i32);
impl ::core::convert::From<i32> for XPS_OBJECT_TYPE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_OBJECT_TYPE {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct XPS_POINT {
pub x: f32,
pub y: f32,
}
impl XPS_POINT {}
impl ::core::default::Default for XPS_POINT {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for XPS_POINT {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("XPS_POINT").field("x", &self.x).field("y", &self.y).finish()
}
}
impl ::core::cmp::PartialEq for XPS_POINT {
fn eq(&self, other: &Self) -> bool {
self.x == other.x && self.y == other.y
}
}
impl ::core::cmp::Eq for XPS_POINT {}
unsafe impl ::windows::core::Abi for XPS_POINT {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct XPS_RECT {
pub x: f32,
pub y: f32,
pub width: f32,
pub height: f32,
}
impl XPS_RECT {}
impl ::core::default::Default for XPS_RECT {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for XPS_RECT {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("XPS_RECT").field("x", &self.x).field("y", &self.y).field("width", &self.width).field("height", &self.height).finish()
}
}
impl ::core::cmp::PartialEq for XPS_RECT {
fn eq(&self, other: &Self) -> bool {
self.x == other.x && self.y == other.y && self.width == other.width && self.height == other.height
}
}
impl ::core::cmp::Eq for XPS_RECT {}
unsafe impl ::windows::core::Abi for XPS_RECT {
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 XPS_SEGMENT_STROKE_PATTERN(pub i32);
pub const XPS_SEGMENT_STROKE_PATTERN_ALL: XPS_SEGMENT_STROKE_PATTERN = XPS_SEGMENT_STROKE_PATTERN(1i32);
pub const XPS_SEGMENT_STROKE_PATTERN_NONE: XPS_SEGMENT_STROKE_PATTERN = XPS_SEGMENT_STROKE_PATTERN(2i32);
pub const XPS_SEGMENT_STROKE_PATTERN_MIXED: XPS_SEGMENT_STROKE_PATTERN = XPS_SEGMENT_STROKE_PATTERN(3i32);
impl ::core::convert::From<i32> for XPS_SEGMENT_STROKE_PATTERN {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_SEGMENT_STROKE_PATTERN {
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 XPS_SEGMENT_TYPE(pub i32);
pub const XPS_SEGMENT_TYPE_ARC_LARGE_CLOCKWISE: XPS_SEGMENT_TYPE = XPS_SEGMENT_TYPE(1i32);
pub const XPS_SEGMENT_TYPE_ARC_LARGE_COUNTERCLOCKWISE: XPS_SEGMENT_TYPE = XPS_SEGMENT_TYPE(2i32);
pub const XPS_SEGMENT_TYPE_ARC_SMALL_CLOCKWISE: XPS_SEGMENT_TYPE = XPS_SEGMENT_TYPE(3i32);
pub const XPS_SEGMENT_TYPE_ARC_SMALL_COUNTERCLOCKWISE: XPS_SEGMENT_TYPE = XPS_SEGMENT_TYPE(4i32);
pub const XPS_SEGMENT_TYPE_BEZIER: XPS_SEGMENT_TYPE = XPS_SEGMENT_TYPE(5i32);
pub const XPS_SEGMENT_TYPE_LINE: XPS_SEGMENT_TYPE = XPS_SEGMENT_TYPE(6i32);
pub const XPS_SEGMENT_TYPE_QUADRATIC_BEZIER: XPS_SEGMENT_TYPE = XPS_SEGMENT_TYPE(7i32);
impl ::core::convert::From<i32> for XPS_SEGMENT_TYPE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_SEGMENT_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 XPS_SIGNATURE_STATUS(pub i32);
pub const XPS_SIGNATURE_STATUS_INCOMPLIANT: XPS_SIGNATURE_STATUS = XPS_SIGNATURE_STATUS(1i32);
pub const XPS_SIGNATURE_STATUS_INCOMPLETE: XPS_SIGNATURE_STATUS = XPS_SIGNATURE_STATUS(2i32);
pub const XPS_SIGNATURE_STATUS_BROKEN: XPS_SIGNATURE_STATUS = XPS_SIGNATURE_STATUS(3i32);
pub const XPS_SIGNATURE_STATUS_QUESTIONABLE: XPS_SIGNATURE_STATUS = XPS_SIGNATURE_STATUS(4i32);
pub const XPS_SIGNATURE_STATUS_VALID: XPS_SIGNATURE_STATUS = XPS_SIGNATURE_STATUS(5i32);
impl ::core::convert::From<i32> for XPS_SIGNATURE_STATUS {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_SIGNATURE_STATUS {
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 XPS_SIGN_FLAGS(pub i32);
pub const XPS_SIGN_FLAGS_NONE: XPS_SIGN_FLAGS = XPS_SIGN_FLAGS(0i32);
pub const XPS_SIGN_FLAGS_IGNORE_MARKUP_COMPATIBILITY: XPS_SIGN_FLAGS = XPS_SIGN_FLAGS(1i32);
impl ::core::convert::From<i32> for XPS_SIGN_FLAGS {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_SIGN_FLAGS {
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 XPS_SIGN_POLICY(pub i32);
pub const XPS_SIGN_POLICY_NONE: XPS_SIGN_POLICY = XPS_SIGN_POLICY(0i32);
pub const XPS_SIGN_POLICY_CORE_PROPERTIES: XPS_SIGN_POLICY = XPS_SIGN_POLICY(1i32);
pub const XPS_SIGN_POLICY_SIGNATURE_RELATIONSHIPS: XPS_SIGN_POLICY = XPS_SIGN_POLICY(2i32);
pub const XPS_SIGN_POLICY_PRINT_TICKET: XPS_SIGN_POLICY = XPS_SIGN_POLICY(4i32);
pub const XPS_SIGN_POLICY_DISCARD_CONTROL: XPS_SIGN_POLICY = XPS_SIGN_POLICY(8i32);
pub const XPS_SIGN_POLICY_ALL: XPS_SIGN_POLICY = XPS_SIGN_POLICY(15i32);
impl ::core::convert::From<i32> for XPS_SIGN_POLICY {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_SIGN_POLICY {
type Abi = Self;
}
#[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)]
#[repr(C)]
pub struct XPS_SIZE {
pub width: f32,
pub height: f32,
}
impl XPS_SIZE {}
impl ::core::default::Default for XPS_SIZE {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
impl ::core::fmt::Debug for XPS_SIZE {
fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
fmt.debug_struct("XPS_SIZE").field("width", &self.width).field("height", &self.height).finish()
}
}
impl ::core::cmp::PartialEq for XPS_SIZE {
fn eq(&self, other: &Self) -> bool {
self.width == other.width && self.height == other.height
}
}
impl ::core::cmp::Eq for XPS_SIZE {}
unsafe impl ::windows::core::Abi for XPS_SIZE {
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 XPS_SPREAD_METHOD(pub i32);
pub const XPS_SPREAD_METHOD_PAD: XPS_SPREAD_METHOD = XPS_SPREAD_METHOD(1i32);
pub const XPS_SPREAD_METHOD_REFLECT: XPS_SPREAD_METHOD = XPS_SPREAD_METHOD(2i32);
pub const XPS_SPREAD_METHOD_REPEAT: XPS_SPREAD_METHOD = XPS_SPREAD_METHOD(3i32);
impl ::core::convert::From<i32> for XPS_SPREAD_METHOD {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_SPREAD_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 XPS_STYLE_SIMULATION(pub i32);
pub const XPS_STYLE_SIMULATION_NONE: XPS_STYLE_SIMULATION = XPS_STYLE_SIMULATION(1i32);
pub const XPS_STYLE_SIMULATION_ITALIC: XPS_STYLE_SIMULATION = XPS_STYLE_SIMULATION(2i32);
pub const XPS_STYLE_SIMULATION_BOLD: XPS_STYLE_SIMULATION = XPS_STYLE_SIMULATION(3i32);
pub const XPS_STYLE_SIMULATION_BOLDITALIC: XPS_STYLE_SIMULATION = XPS_STYLE_SIMULATION(4i32);
impl ::core::convert::From<i32> for XPS_STYLE_SIMULATION {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_STYLE_SIMULATION {
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 XPS_THUMBNAIL_SIZE(pub i32);
pub const XPS_THUMBNAIL_SIZE_VERYSMALL: XPS_THUMBNAIL_SIZE = XPS_THUMBNAIL_SIZE(1i32);
pub const XPS_THUMBNAIL_SIZE_SMALL: XPS_THUMBNAIL_SIZE = XPS_THUMBNAIL_SIZE(2i32);
pub const XPS_THUMBNAIL_SIZE_MEDIUM: XPS_THUMBNAIL_SIZE = XPS_THUMBNAIL_SIZE(3i32);
pub const XPS_THUMBNAIL_SIZE_LARGE: XPS_THUMBNAIL_SIZE = XPS_THUMBNAIL_SIZE(4i32);
impl ::core::convert::From<i32> for XPS_THUMBNAIL_SIZE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_THUMBNAIL_SIZE {
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 XPS_TILE_MODE(pub i32);
pub const XPS_TILE_MODE_NONE: XPS_TILE_MODE = XPS_TILE_MODE(1i32);
pub const XPS_TILE_MODE_TILE: XPS_TILE_MODE = XPS_TILE_MODE(2i32);
pub const XPS_TILE_MODE_FLIPX: XPS_TILE_MODE = XPS_TILE_MODE(3i32);
pub const XPS_TILE_MODE_FLIPY: XPS_TILE_MODE = XPS_TILE_MODE(4i32);
pub const XPS_TILE_MODE_FLIPXY: XPS_TILE_MODE = XPS_TILE_MODE(5i32);
impl ::core::convert::From<i32> for XPS_TILE_MODE {
fn from(value: i32) -> Self {
Self(value)
}
}
unsafe impl ::windows::core::Abi for XPS_TILE_MODE {
type Abi = Self;
}
pub const XpsOMObjectFactory: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xe974d26d_3d9b_4d47_88cc_3872f2dc3585);
pub const XpsOMThumbnailGenerator: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7e4a23e2_b969_4761_be35_1a8ced58e323);
pub const XpsSignatureManager: ::windows::core::GUID = ::windows::core::GUID::from_u128(0xb0c43320_2315_44a2_b70a_0943a140a8ee);
|
pub mod groups;
|
// Copyright 2019. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
// products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#[cfg(feature = "base_node")]
mod config;
#[cfg(feature = "base_node")]
mod consts;
#[cfg(feature = "base_node")]
mod error;
#[allow(clippy::module_inception)]
#[cfg(feature = "base_node")]
mod mempool;
#[cfg(feature = "base_node")]
mod mempool_storage;
#[cfg(feature = "base_node")]
mod orphan_pool;
#[cfg(feature = "base_node")]
mod pending_pool;
#[cfg(feature = "base_node")]
mod priority;
#[cfg(feature = "base_node")]
mod reorg_pool;
#[cfg(feature = "base_node")]
mod unconfirmed_pool;
// public modules
#[cfg(feature = "base_node")]
pub mod async_mempool;
// Public re-exports
#[cfg(feature = "base_node")]
pub use self::config::{MempoolConfig, MempoolServiceConfig};
#[cfg(feature = "base_node")]
pub use error::MempoolError;
#[cfg(feature = "base_node")]
pub use mempool::{Mempool, MempoolValidators};
#[cfg(feature = "base_node")]
pub use service::{MempoolServiceError, MempoolServiceInitializer, OutboundMempoolServiceInterface};
#[cfg(any(feature = "base_node", feature = "mempool_proto"))]
pub mod proto;
#[cfg(any(feature = "base_node", feature = "mempool_proto"))]
pub mod service;
use crate::transactions::types::Signature;
use core::fmt::{Display, Error, Formatter};
use serde::{Deserialize, Serialize};
use tari_crypto::tari_utilities::hex::Hex;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct StatsResponse {
pub total_txs: usize,
pub unconfirmed_txs: usize,
pub orphan_txs: usize,
pub timelocked_txs: usize,
pub published_txs: usize,
pub total_weight: u64,
}
impl Display for StatsResponse {
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error> {
write!(
fmt,
"Mempool stats: Total transactions: {}, Unconfirmed: {}, Orphaned: {}, Time locked: {}, Published: {}, \
Total Weight: {}",
self.total_txs,
self.unconfirmed_txs,
self.orphan_txs,
self.timelocked_txs,
self.published_txs,
self.total_weight
)
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct StateResponse {
pub unconfirmed_pool: Vec<Signature>,
pub orphan_pool: Vec<Signature>,
pub pending_pool: Vec<Signature>,
pub reorg_pool: Vec<Signature>,
}
impl Display for StateResponse {
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error> {
fmt.write_str("----------------- Mempool -----------------\n")?;
fmt.write_str("--- Unconfirmed Pool ---\n")?;
for excess_sig in &self.unconfirmed_pool {
fmt.write_str(&format!(" {}\n", excess_sig.get_signature().to_hex()))?;
}
fmt.write_str("--- Orphan Pool ---\n")?;
for excess_sig in &self.orphan_pool {
fmt.write_str(&format!(" {}\n", excess_sig.get_signature().to_hex()))?;
}
fmt.write_str("--- Pending Pool ---\n")?;
for excess_sig in &self.pending_pool {
fmt.write_str(&format!(" {}\n", excess_sig.get_signature().to_hex()))?;
}
fmt.write_str("--- Reorg Pool ---\n")?;
for excess_sig in &self.reorg_pool {
fmt.write_str(&format!(" {}\n", excess_sig.get_signature().to_hex()))?;
}
Ok(())
}
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum TxStorageResponse {
UnconfirmedPool,
OrphanPool,
PendingPool,
ReorgPool,
NotStored,
}
impl Display for TxStorageResponse {
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error> {
let storage = match self {
TxStorageResponse::UnconfirmedPool => "Unconfirmed pool",
TxStorageResponse::OrphanPool => "Orphan pool",
TxStorageResponse::PendingPool => "Pending pool",
TxStorageResponse::ReorgPool => "Reorg pool",
TxStorageResponse::NotStored => "Not stored",
};
fmt.write_str(&storage.to_string())
}
}
|
#[macro_export]
macro_rules! compose {
( $last:expr ) => { $last };
( $head:expr, $($tail:expr), +) => {
compose_two($head, compose!($($tail),+))
};
}
pub fn compose_two<A, B, C, G, F>(f: F, g: G) -> impl Fn(A) -> C
where
F: Fn(A) -> B,
G: Fn(B) -> C,
{
move |x| g(f(x))
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_compose1() {
let add = |x| x + 2;
let multiply = |x| x * 2;
let divide = |x| x / 2;
let intermediate = compose!(add, multiply, divide);
let subtract = |x| x - 2;
let finally = compose!(intermediate, subtract);
println!("Result is {}", finally(10));
}
fn add(x: i32) -> i32 {
x + 2
}
fn multiply(x: i32) -> i32 {
x * 2
}
fn divide(x: i32) -> i32 {
x / 2
}
#[test]
fn test_compose2() {
let intermediate = compose!(add, multiply, divide);
let subtract = |x| x - 2;
let finally = compose!(intermediate, subtract);
println!("Result is {}", finally(10));
}
} |
//! Profiles are configurations that affect how an operation is applied.
//!
//! For instance, a `PublishProfile` might determine how unknown entities in the
//! target are handled when performing a `publish` operation.
use std::default::Default;
use std::fs::File;
use std::io::{BufReader, Read};
use std::path::Path;
use serde::{Deserialize, Serialize};
use crate::errors::PsqlpackErrorKind::*;
use crate::errors::{PsqlpackResult, PsqlpackResultExt};
use crate::semver::Semver;
#[derive(Deserialize, Serialize)]
pub struct PublishProfile {
pub version: Semver,
#[serde(alias = "generationOptions")]
pub generation_options: GenerationOptions,
}
#[derive(Deserialize, Serialize, Debug, PartialEq)]
pub enum Toggle {
Allow,
Ignore,
Error,
}
impl Toggle {
fn allow() -> Toggle {
Toggle::Allow
}
fn ignore() -> Toggle {
Toggle::Ignore
}
fn error() -> Toggle {
Toggle::Error
}
}
struct Bool;
impl Bool {
fn t() -> bool {
true
}
}
#[derive(Deserialize, Serialize)]
pub struct GenerationOptions {
/// If set to true, the database will always be recereated
#[serde(alias = "alwaysRecreateDatabase")]
pub always_recreate_database: bool,
/// Enum values are typically unsafe to delete. If set to Allow, psqlpack will attempt to delete.
/// Default: Error
#[serde(alias = "dropEnumValues", default = "Toggle::error")]
pub drop_enum_values: Toggle,
/// Tables may have data in them which may not be intended to be deleted. If set to Allow, psqlpack will drop the table.
/// Default: Error
#[serde(alias = "dropTables", default = "Toggle::error")]
pub drop_tables: Toggle,
/// Columns may have data in them which may not be intended to be deleted. If set to Allow, psqlpack will drop the column.
/// Default: Error
#[serde(alias = "dropColumns", default = "Toggle::error")]
pub drop_columns: Toggle,
/// Primary Keys define how a table is looked up on disk. If set to Allow, psqlpack will drop the primary key.
/// Default: Error
#[serde(alias = "dropPrimaryKeyConstraints", default = "Toggle::error")]
pub drop_primary_key_constraints: Toggle,
/// Foreign Keys define a constraint to another table. If set to Allow, psqlpack will drop the foreign key.
/// Default: Allow
#[serde(alias = "dropForeignKeyConstraints", default = "Toggle::allow")]
pub drop_foreign_key_constraints: Toggle,
/// Functions may not be intended to be deleted. If set to Allow, psqlpack will drop the function.
/// Default: Error
#[serde(alias = "dropFunctions", default = "Toggle::error")]
pub drop_functions: Toggle,
/// Indexes may not be intended to be deleted. If set to Allow, psqlpack will drop the index.
/// Default: Allow
#[serde(alias = "dropIndexes", default = "Toggle::allow")]
pub drop_indexes: Toggle,
/// Extensions may not be intended to be upgraded automatically. If set to Allow, psqlpack will upgrade the extension as necessary.
/// Default: Ignore
#[serde(alias = "upgradeExtensions", default = "Toggle::ignore")]
pub upgrade_extensions: Toggle,
/// Forces index changes to be made concurrently to avoid locking on table writes.
/// Default: true
#[serde(alias = "forceConcurrentIndexes", default = "Bool::t")]
pub force_concurrent_indexes: bool,
}
impl Default for PublishProfile {
fn default() -> Self {
PublishProfile {
version: "1.0".into(),
generation_options: GenerationOptions {
always_recreate_database: false,
drop_enum_values: Toggle::Error,
drop_tables: Toggle::Error,
drop_columns: Toggle::Error,
drop_primary_key_constraints: Toggle::Error,
drop_foreign_key_constraints: Toggle::Allow,
drop_functions: Toggle::Error,
drop_indexes: Toggle::Allow,
upgrade_extensions: Toggle::Ignore,
force_concurrent_indexes: true,
},
}
}
}
impl PublishProfile {
pub fn from_path(profile_path: &Path) -> PsqlpackResult<PublishProfile> {
File::open(profile_path)
.chain_err(|| PublishProfileReadError(profile_path.to_path_buf()))
.and_then(Self::from_reader)
}
fn from_reader<R>(reader: R) -> PsqlpackResult<PublishProfile>
where
R: Read,
{
let mut buffered_reader = BufReader::new(reader);
let mut contents = String::new();
if buffered_reader
.read_to_string(&mut contents)
.chain_err(|| PublishProfileParseError("Failed to read contents".into()))?
== 0
{
bail!(PublishProfileParseError("Data was empty".into()))
}
let trimmed = contents.trim_start();
if trimmed.starts_with('{') {
serde_json::from_str(&contents).chain_err(|| PublishProfileParseError("Failed to read JSON".into()))
} else {
toml::from_str(&contents).chain_err(|| PublishProfileParseError("Failed to read TOML".into()))
}
}
}
#[cfg(test)]
mod tests {
use crate::model::Toggle;
use crate::{PublishProfile, Semver};
#[test]
fn it_can_add_read_a_publish_profile_in_json_format() {
const DATA: &str = r#"
{
"version": "1.0",
"generationOptions": {
"alwaysRecreateDatabase": false,
"dropEnumValues": "Error",
"dropFunctions": "Error",
"dropTables": "Error",
"dropColumns": "Error",
"dropPrimaryKeyConstraints": "Error",
"dropForeignKeyConstraints": "Allow",
"dropIndexes": "Ignore",
"forceConcurrentIndexes": false
}
}
"#;
let publish_profile = PublishProfile::from_reader(DATA.as_bytes());
let publish_profile = publish_profile.unwrap();
assert_eq!(publish_profile.version, Semver::new(1, 0, None));
let options = publish_profile.generation_options;
assert!(!options.always_recreate_database);
assert_eq!(options.drop_enum_values, Toggle::Error);
assert_eq!(options.drop_functions, Toggle::Error);
assert_eq!(options.drop_tables, Toggle::Error);
assert_eq!(options.drop_columns, Toggle::Error);
assert_eq!(options.drop_primary_key_constraints, Toggle::Error);
assert_eq!(options.drop_foreign_key_constraints, Toggle::Allow);
assert_eq!(options.drop_indexes, Toggle::Ignore);
assert!(!options.force_concurrent_indexes);
}
#[test]
fn it_can_add_read_a_publish_profile_in_toml_format() {
const DATA: &str = r#"
version = "1.0"
[generationOptions]
always_recreate_database = false
drop_enum_values = "Error"
drop_functions = "Error"
drop_tables = "Error"
drop_columns = "Error"
drop_primary_key_constraints = "Error"
drop_foreign_key_constraints = "Allow"
drop_indexes = "Ignore"
force_concurrent_indexes = false
"#;
let publish_profile = PublishProfile::from_reader(DATA.as_bytes());
let publish_profile = publish_profile.unwrap();
assert_eq!(publish_profile.version, Semver::new(1, 0, None));
let options = publish_profile.generation_options;
assert!(!options.always_recreate_database);
assert_eq!(options.drop_enum_values, Toggle::Error);
assert_eq!(options.drop_functions, Toggle::Error);
assert_eq!(options.drop_tables, Toggle::Error);
assert_eq!(options.drop_columns, Toggle::Error);
assert_eq!(options.drop_primary_key_constraints, Toggle::Error);
assert_eq!(options.drop_foreign_key_constraints, Toggle::Allow);
assert_eq!(options.drop_indexes, Toggle::Ignore);
assert!(!options.force_concurrent_indexes);
}
}
|
mod parser;
use std::fmt;
use std::str::FromStr;
use std::ops::Deref;
pub use parser::ParseError;
#[derive(Debug, Clone)]
pub enum Term {
App(Box<Term>, Box<Term>),
Abs(u32, Box<Term>),
Var(u32),
}
impl PartialEq for Term {
fn eq(&self, other: &Term) -> bool {
match self {
Term::App(f_self, a_self) => {
if let Term::App(f_other, a_other) = other {
f_self == f_other && a_self == a_other
} else {
false
}
}
Term::Abs(v_self, f_self) => {
if let Term::Abs(v_other, f_other) = other {
if v_self == v_other {
f_self == f_other
} else {
*f_self.deref() == substitute(*v_other, &Term::Var(*v_self), f_other)
}
} else {
false
}
}
Term::Var(v_self) => {
if let Term::Var(v_other) = other {
v_other == v_self
} else {
false
}
}
}
}
}
impl Eq for Term {}
impl fmt::Display for Term {
fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
match self {
Term::App(f, a) => {
match f.deref() {
Term::Abs(_, _) => if let Term::App(_, _) = a.deref() {
write!(formatter, "({}) ({})", f, a)
} else {
write!(formatter, "({}) {}", f, a)
}
Term::App(_, _) => {
let mut args = vec![];
let mut current = f.deref();
while let Term::App(fun, arg) = current {
args.push(arg.deref());
current = fun.deref();
}
args.push(current);
while let Some(term) = args.pop() {
if let Term::Var(_) = term {
write!(formatter, "{} ", term)?
} else {
write!(formatter, "({}) ", term)?
}
}
if let Term::App(_, _) = a.deref() {
write!(formatter, "({})", a)
} else {
write!(formatter, "{}", a)
}
}
Term::Var(_) => if let Term::App(_, _) = a.deref() {
write!(formatter, "{} ({})", f, a)
} else {
write!(formatter, "{} {}", f, a)
}
}
}
Term::Abs(a, f) => write!(formatter, "\\{}. {}", a, f),
Term::Var(v) => write!(formatter, "{}", v)
}
}
}
impl FromStr for Term {
type Err = ParseError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
parser::parse(s)
}
}
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum Strategy {
Normal,
Applicative,
}
pub fn normal_form(term: &Term, strategy: Strategy) -> Term {
match reduce(term, strategy) {
Some(t) => normal_form(&t, strategy),
None => term.clone(),
}
}
fn reduce(term: &Term, strategy: Strategy) -> Option<Term> {
match term {
Term::App(f, a) => handle_app(f, a, strategy),
Term::Abs(v, f) => reduce(f, strategy).map(|t| Term::Abs(*v, Box::new(t))),
_ => None
}
}
fn handle_app(fun: &Term, arg: &Term, strategy: Strategy) -> Option<Term> {
match strategy {
Strategy::Normal => reduce(fun, strategy).map_or_else(|| {
if let Term::Abs(_, b) = fun {
Some(substitute(0, arg, b))
} else {
reduce(arg, strategy).map(|term| Term::App(Box::new(fun.clone()), Box::new(term)))
}
}, |term| { Some(Term::App(Box::new(term), Box::new(arg.clone()))) }),
Strategy::Applicative => reduce(arg, strategy).map_or_else(|| {
if let Term::Abs(_, b) = fun {
Some(substitute(0, arg, b))
} else {
None
}
}, |term| { Some(Term::App(Box::new(term), Box::new(arg.clone()))) })
}
}
fn substitute(var: u32, arg: &Term, function: &Term) -> Term {
match function {
Term::App(f, a) => Term::App(Box::new(substitute(var, arg, f)), Box::new(substitute(var, arg, a))),
Term::Abs(v, f) => Term::Abs(*v, Box::new(substitute(var + 1, &shift(1, 0, arg), f))),
Term::Var(v) if *v == var => arg.clone(),
Term::Var(_) => function.clone()
}
}
fn shift(d: u32, c: u32, term: &Term) -> Term {
match term {
Term::App(f, a) => Term::App(Box::new(shift(d, c, f)), Box::new(shift(d, c, a))),
Term::Abs(v, f) => Term::Abs(*v, Box::new(shift(d, c + 1, f))),
Term::Var(v) if *v < c => Term::Var(*v),
Term::Var(v) => Term::Var(v + d)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn reduce_var_normal() {
let var = Term::Var(0);
assert_eq!(var, normal_form(&var, Strategy::Normal));
}
#[test]
fn reduce_var_applicative() {
let var = Term::Var(0);
assert_eq!(var, normal_form(&var, Strategy::Applicative));
}
#[test]
fn reduce_id_normal() {
let id = Term::Abs(0, Box::new(Term::Var(0)));
assert_eq!(id, normal_form(&id, Strategy::Normal));
}
#[test]
fn reduce_id_applicative() {
let id = Term::Abs(0, Box::new(Term::Var(0)));
assert_eq!(id, normal_form(&id, Strategy::Applicative));
}
#[test]
fn reduce_application_id_normal() {
let term = Term::App(Box::new(Term::Abs(0, Box::new(Term::Var(0)))), Box::new(Term::Var(0)));
assert_eq!(Term::Var(0), normal_form(&term, Strategy::Normal));
}
#[test]
fn reduce_application_id_applicative() {
let term = Term::App(Box::new(Term::Abs(0, Box::new(Term::Var(0)))), Box::new(Term::Var(0)));
assert_eq!(Term::Var(0), normal_form(&term, Strategy::Applicative));
}
#[test]
fn reduce_application_to_omega_normal() {
let fst = Term::Abs(1, Box::new(Term::Abs(0, Box::new(Term::Var(1)))));
let id = Term::Abs(0, Box::new(Term::Var(0)));
let omega = Term::Abs(0, Box::new(Term::App(Box::new(Term::Var(0)), Box::new(Term::Var(0)))));
let big_omega = Term::App(Box::new(omega.clone()), Box::new(omega));
let term = Term::App(Box::new(Term::App(Box::new(fst), Box::new(id.clone()))), Box::new(big_omega));
assert_eq!(id, normal_form(&term, Strategy::Normal));
}
#[test]
#[ignore]
fn reduce_application_to_omega_applicative() {
let fst = Term::Abs(1, Box::new(Term::Abs(0, Box::new(Term::Var(1)))));
let id = Term::Abs(0, Box::new(Term::Var(0)));
let omega = Term::Abs(0, Box::new(Term::App(Box::new(Term::Var(0)), Box::new(Term::Var(0)))));
let big_omega = Term::App(Box::new(omega.clone()), Box::new(omega));
let term = Term::App(Box::new(Term::App(Box::new(fst), Box::new(id.clone()))), Box::new(big_omega));
assert_eq!(id, normal_form(&term, Strategy::Applicative));
}
#[test]
fn reduce_application_to_id() {
let x = Term::Abs(1, Box::new(Term::Abs(0, Box::new(Term::Var(1)))));
let id = Term::Abs(0, Box::new(Term::Var(0)));
let term = Term::App(Box::new(x), Box::new(id));
assert_eq!(Term::Abs(1, Box::new(Term::Abs(0, Box::new(Term::Var(0))))), normal_form(&term, Strategy::Normal));
}
#[test]
fn eq_id() {
let id0 = Term::Abs(0, Box::new(Term::Var(0)));
let id1 = Term::Abs(1, Box::new(Term::Var(1)));
assert_eq!(id0, id1);
}
#[test]
fn format_var() {
let var = Term::Var(0);
assert_eq!("0", format!("{}", var));
}
#[test]
fn format_id() {
let id = Term::Abs(0, Box::new(Term::Var(0)));
assert_eq!("\\0. 0", format!("{}", id));
}
#[test]
fn format_fst() {
let fst = Term::Abs(1, Box::new(Term::Abs(0, Box::new(Term::Var(1)))));
assert_eq!("\\1. \\0. 1", format!("{}", fst));
}
#[test]
fn format_app_to_abs_in_abs() {
let term = Term::from_str("\\1. 1 \\0. 0");
assert_eq!(true, term.is_ok());
assert_eq!("\\1. 1 \\0. 0", format!("{}", term.unwrap()));
}
#[test]
fn format_application_to_omega() {
let fst = Term::Abs(1, Box::new(Term::Abs(0, Box::new(Term::Var(1)))));
let id = Term::Abs(0, Box::new(Term::Var(0)));
let omega = Term::Abs(0, Box::new(Term::App(Box::new(Term::Var(0)), Box::new(Term::Var(0)))));
let big_omega = Term::App(Box::new(omega.clone()), Box::new(omega));
let term = Term::App(Box::new(Term::App(Box::new(fst), Box::new(id.clone()))), Box::new(big_omega));
assert_eq!("(\\1. \\0. 1) (\\0. 0) ((\\0. 0 0) \\0. 0 0)", format!("{}", term));
}
#[test]
fn format_app_in_abs_four_times() {
let term = Term::from_str("\\4. \\3. \\2. \\1. 1 2 3 4");
assert_eq!(true, term.is_ok());
assert_eq!("\\4. \\3. \\2. \\1. 1 2 3 4", format!("{}", term.unwrap()));
}
#[test]
fn from_str_var() {
let term = Term::from_str("0");
assert_eq!(true, term.is_ok());
assert_eq!(Term::Var(0), Term::from_str("0").unwrap())
}
#[test]
fn from_str_id() {
let term = Term::from_str("\\0.0");
let id = Term::Abs(0, Box::new(Term::Var(0)));
assert_eq!(true, term.is_ok());
assert_eq!(id, term.unwrap())
}
#[test]
fn from_str_id_whitespaced() {
let term = Term::from_str("\\0. 0");
let id = Term::Abs(0, Box::new(Term::Var(0)));
assert_eq!(true, term.is_ok());
assert_eq!(id, term.unwrap())
}
#[test]
fn from_str_fst() {
let term = Term::from_str("\\1.\\0.1");
let fst = Term::Abs(1, Box::new(Term::Abs(0, Box::new(Term::Var(1)))));
assert_eq!(true, term.is_ok());
assert_eq!(fst, term.unwrap())
}
#[test]
fn from_str_fst_whitespaced() {
let term = Term::from_str("\\1. \\0. 1");
let fst = Term::Abs(1, Box::new(Term::Abs(0, Box::new(Term::Var(1)))));
assert_eq!(true, term.is_ok());
assert_eq!(fst, term.unwrap())
}
#[test]
fn from_str_omega_redundant_parentheses() {
let fst = Term::Abs(1, Box::new(Term::Abs(0, Box::new(Term::Var(1)))));
let id = Term::Abs(0, Box::new(Term::Var(0)));
let omega = Term::Abs(0, Box::new(Term::App(Box::new(Term::Var(0)), Box::new(Term::Var(0)))));
let big_omega = Term::App(Box::new(omega.clone()), Box::new(omega));
let term = Term::App(Box::new(Term::App(Box::new(fst), Box::new(id.clone()))), Box::new(big_omega));
let converted = Term::from_str("((\\1.\\0.1) (\\0.0)) ((\\0.0 0) (\\0.0 0))");
assert_eq!(true, converted.is_ok());
assert_eq!(term, converted.unwrap());
}
#[test]
fn from_str_omega() {
let fst = Term::Abs(1, Box::new(Term::Abs(0, Box::new(Term::Var(1)))));
let id = Term::Abs(0, Box::new(Term::Var(0)));
let omega = Term::Abs(0, Box::new(Term::App(Box::new(Term::Var(0)), Box::new(Term::Var(0)))));
let big_omega = Term::App(Box::new(omega.clone()), Box::new(omega));
let term = Term::App(Box::new(Term::App(Box::new(fst), Box::new(id.clone()))), Box::new(big_omega));
let converted = Term::from_str("(\\1. \\0. 1) (\\0. 0) ((\\0. 0 0) \\0. 0 0)");
assert_eq!(true, converted.is_ok());
assert_eq!(term, converted.unwrap());
}
#[test]
fn from_str_abs_in_abs_without_parentheses() {
let id = Term::Abs(0, Box::new(Term::Var(0)));
let term = Term::Abs(1, Box::new(Term::App(Box::new(Term::Var(1)), Box::new(id))));
let converted = Term::from_str("\\1. 1 \\0. 0");
assert_eq!(true, converted.is_ok());
assert_eq!(term, converted.unwrap());
}
#[test]
fn from_str_app_three_times() {
let term = Term::Abs(0, Box::new(Term::App(Box::new(Term::App(Box::new(Term::Var(0)), Box::new(Term::Var(0)))), Box::new(Term::Var(0)))));
let converted = Term::from_str("\\0. 0 0 0");
assert_eq!(true, converted.is_ok());
assert_eq!(term, converted.unwrap());
}
#[test]
fn from_str_app_four_times() {
let term = Term::Abs(0, Box::new(Term::App(Box::new(Term::App(Box::new(Term::App(Box::new(Term::Var(0)), Box::new(Term::Var(0)))), Box::new(Term::Var(0)))), Box::new(Term::Var(0)))));
let converted = Term::from_str("\\0. 0 0 0 0");
assert_eq!(true, converted.is_ok());
assert_eq!(term, converted.unwrap());
}
#[test]
fn from_str_abs_app_four_times() {
let term = Term::Abs(
4, Box::new(Term::Abs(
3, Box::new(Term::Abs(
2, Box::new(Term::Abs(
1, Box::new(Term::App(
Box::new(Term::App(
Box::new(Term::App(
Box::new(Term::Var(1)), Box::new(Term::Var(2)),
)), Box::new(Term::Var(3)),
)), Box::new(Term::Var(4)),
)),
)),
)),
)),
);
let converted = Term::from_str("\\4. \\3. \\2. \\1. 1 2 3 4");
assert_eq!(true, converted.is_ok());
assert_eq!(term, converted.unwrap());
}
#[test]
fn from_str_outer_parentheses() {
let id = Term::Abs(0, Box::new(Term::Var(0)));
let converted = Term::from_str("(\\0. 0)");
assert_eq!(true, converted.is_ok());
assert_eq!(id, converted.unwrap());
}
#[test]
fn from_str_many_outer_parentheses() {
let id = Term::Abs(0, Box::new(Term::Var(0)));
let converted = Term::from_str("((\\0. 0))");
assert_eq!(true, converted.is_ok());
assert_eq!(id, converted.unwrap());
}
#[test]
fn from_str_redundant_parentheses() {
let id = Term::Abs(0, Box::new(Term::Var(0)));
let converted = Term::from_str("\\0. (0)");
assert_eq!(true, converted.is_ok());
assert_eq!(id, converted.unwrap());
}
}
|
// Proverb Programming
// "Time is money"
// Count duration time, convert it to money, and display.
use std::time;
use std::io;
fn main() {
println!("Please input your hourly wage:");
let mut hourly_wage_string = String::new();
io::stdin().read_line(&mut hourly_wage_string)
.expect("Failed to read line");
println!("Your hourly wage is :{}",hourly_wage_string);
hourly_wage_string = hourly_wage_string.trim_right().to_string(); // trim_right is important
let hourly_wage: f32 = hourly_wage_string.parse().unwrap();
//let second_wage: f32 = hourly_wage/60/60 // does not work;
let second_wage: f32 = hourly_wage/60.0/60.0;
println!("second_wage :{:?}",second_wage);
// Count time in second
let start_time = time::Instant::now();
let mut count_second:u64 = 0;
loop {
if count_second <= start_time.elapsed().as_secs() {
count_second += 1;
println!("You have wasted {:.0} secs. = {:.3} Yen",count_second,second_wage* (count_second as f32) );
}
}
} |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use fidl_fuchsia_sys2::{ComponentDecl, ExposeDecl, OfferDecl, OfferTarget, Relation, RelativeId};
use lazy_static::lazy_static;
use regex::Regex;
use std::collections::{HashMap, HashSet};
use std::error;
use std::fmt;
lazy_static! {
static ref PATH_RE: Regex = Regex::new(r"^/.+$").unwrap();
static ref NAME_RE: Regex = Regex::new(r"^[0-9a-z_\-\.]+$").unwrap();
static ref URI_RE: Regex = Regex::new(r"^[0-9a-z\+\-\.]+://.+$").unwrap();
}
const PATH_MAX_LEN: usize = 1024;
const NAME_MAX_LEN: usize = 100;
const URI_MAX_LEN: usize = 4096;
/// Enum type that can represent any error encountered during validation.
#[derive(Debug)]
pub enum Error {
MissingField(String, String),
EmptyField(String, String),
DuplicateField(String, String, String),
InvalidField(String, String),
FieldTooLong(String, String),
InvalidChild(String, String),
RelativeIdMissingChild(),
RelativeIdExtraneousChild(String),
}
impl Error {
pub fn missing_field(decl_type: impl Into<String>, keyword: impl Into<String>) -> Self {
Error::MissingField(decl_type.into(), keyword.into())
}
pub fn empty_field(decl_type: impl Into<String>, keyword: impl Into<String>) -> Self {
Error::EmptyField(decl_type.into(), keyword.into())
}
pub fn duplicate_field(
decl_type: impl Into<String>,
keyword: impl Into<String>,
value: impl Into<String>,
) -> Self {
Error::DuplicateField(decl_type.into(), keyword.into(), value.into())
}
pub fn invalid_field(decl_type: impl Into<String>, keyword: impl Into<String>) -> Self {
Error::InvalidField(decl_type.into(), keyword.into())
}
pub fn field_too_long(decl_type: impl Into<String>, keyword: impl Into<String>) -> Self {
Error::FieldTooLong(decl_type.into(), keyword.into())
}
pub fn invalid_child(decl_type: impl Into<String>, child: impl Into<String>) -> Self {
Error::InvalidChild(decl_type.into(), child.into())
}
pub fn relative_id_missing_child() -> Self {
Error::RelativeIdMissingChild()
}
pub fn relative_id_extraneous_child(child: impl Into<String>) -> Self {
Error::RelativeIdExtraneousChild(child.into())
}
}
impl error::Error for Error {}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match &self {
Error::MissingField(d, k) => write!(f, "{} missing {}", d, k),
Error::EmptyField(d, k) => write!(f, "{} has empty {}", d, k),
Error::DuplicateField(d, k, v) => write!(f, "\"{}\" is a duplicate {} {}", v, d, k),
Error::InvalidField(d, k) => write!(f, "{} has invalid {}", d, k),
Error::FieldTooLong(d, k) => write!(f, "{}'s {} is too long", d, k),
Error::InvalidChild(d, c) => {
write!(f, "\"{}\" is referenced in {} but it does not appear in children", c, d)
}
Error::RelativeIdMissingChild() => {
write!(f, "RelativeId is CHILD but missing child_name")
}
Error::RelativeIdExtraneousChild(c) => {
write!(f, "RelativeId is not CHILD but has child_name \"{}\"", c)
}
}
}
}
/// Validates a ComponentDecl.
/// The ComponentDecl may ultimately originate from a CM file, or be directly constructed by the
/// caller. Either way, a ComponentDecl should always be validated before it's used. Examples
/// of what is validated (which may evolve in the future):
/// - That all semantically required fields are present
/// - That a child_name referenced in a RelativeId actually exists in the list of children
/// - That there are no duplicate target ptahs
pub fn validate(decl: &ComponentDecl) -> Result<(), Vec<Error>> {
let ctx = ValidationContext { decl, all_children: HashSet::new(), errors: vec![] };
ctx.validate()
}
struct ValidationContext<'a> {
decl: &'a ComponentDecl,
all_children: HashSet<&'a str>,
errors: Vec<Error>,
}
type PathMap<'a> = HashMap<String, HashSet<&'a str>>;
impl<'a> ValidationContext<'a> {
fn validate(mut self) -> Result<(), Vec<Error>> {
// Validate "children" and get the set of all children.
if let Some(children) = self.decl.children.as_ref() {
for child in children.iter() {
let name = child.name.as_ref();
if self.check_identifier(&NAME_RE, NAME_MAX_LEN, name, "ChildDecl", "name") {
let name: &str = name.unwrap();
if !self.all_children.insert(name) {
self.errors.push(Error::duplicate_field("ChildDecl", "name", name));
}
}
self.check_identifier(&URI_RE, URI_MAX_LEN, child.uri.as_ref(), "ChildDecl", "uri");
}
}
// Validate "uses".
if let Some(uses) = self.decl.uses.as_ref() {
for use_ in uses.iter() {
if use_.type_.is_none() {
self.errors.push(Error::missing_field("UseDecl", "type"));
}
self.check_identifier(
&PATH_RE,
PATH_MAX_LEN,
use_.source_path.as_ref(),
"UseDecl",
"source_path",
);
self.check_identifier(
&PATH_RE,
PATH_MAX_LEN,
use_.target_path.as_ref(),
"UseDecl",
"target_path",
);
}
}
// Validate "exposes".
if let Some(exposes) = self.decl.exposes.as_ref() {
let mut target_paths = HashSet::new();
for expose in exposes.iter() {
self.validate_expose(&expose, &mut target_paths);
}
}
// Validate "offers".
if let Some(offers) = self.decl.offers.as_ref() {
let mut target_paths = HashMap::new();
for offer in offers.iter() {
self.validate_offer(&offer, &mut target_paths);
}
}
if self.errors.is_empty() {
Ok(())
} else {
Err(self.errors)
}
}
fn validate_expose(
&mut self,
expose: &'a ExposeDecl,
prev_target_paths: &mut HashSet<&'a str>,
) {
if expose.type_.is_none() {
self.errors.push(Error::missing_field("ExposeDecl", "type"));
}
self.check_identifier(
&PATH_RE,
PATH_MAX_LEN,
expose.source_path.as_ref(),
"ExposeDecl",
"source_path",
);
if expose.source.is_none() {
self.errors.push(Error::missing_field("ExposeDecl", "source"));
} else if let Ok((relation, child_name)) =
self.extract_relative_id(expose.source.as_ref().unwrap())
{
match relation {
Relation::Myself => {}
Relation::Child => {}
_ => {
self.errors.push(Error::invalid_field("ExposeDecl source", "relative_id"));
}
};
if let Some(child) = child_name {
let child: &str = child;
if !self.all_children.contains(child) {
self.errors.push(Error::invalid_child("ExposeDecl source", child));
}
}
}
let target_path = expose.target_path.as_ref();
if self.check_identifier(&PATH_RE, PATH_MAX_LEN, target_path, "ExposeDecl", "target_path") {
let target_path: &str = target_path.unwrap();
if !prev_target_paths.insert(target_path) {
self.errors.push(Error::duplicate_field("ExposeDecl", "target_path", target_path));
}
}
}
fn validate_offer(&mut self, offer: &'a OfferDecl, prev_target_paths: &mut PathMap<'a>) {
if offer.type_.is_none() {
self.errors.push(Error::missing_field("OfferDecl", "type"));
}
self.check_identifier(
&PATH_RE,
PATH_MAX_LEN,
offer.source_path.as_ref(),
"OfferDecl",
"source_path",
);
if offer.source.is_none() {
self.errors.push(Error::missing_field("OfferDecl", "source"));
} else if let Ok((_, child_name)) = self.extract_relative_id(offer.source.as_ref().unwrap())
{
if let Some(child) = child_name {
let child: &str = child;
if !self.all_children.contains(child) {
self.errors.push(Error::invalid_child("OfferDecl source", child));
}
}
}
if offer.targets.is_none() {
self.errors.push(Error::missing_field("OfferDecl", "targets"));
} else {
let targets = offer.targets.as_ref().unwrap();
self.validate_targets(targets, prev_target_paths);
}
}
fn validate_targets(
&mut self,
targets: &'a Vec<OfferTarget>,
prev_target_paths: &mut PathMap<'a>,
) {
if targets.is_empty() {
self.errors.push(Error::empty_field("OfferDecl", "targets"));
}
for target in targets.iter() {
let mut valid = true;
valid &= self.check_identifier(
&PATH_RE,
PATH_MAX_LEN,
target.target_path.as_ref(),
"OfferTarget",
"target_path",
);
valid &= self.check_identifier(
&NAME_RE,
NAME_MAX_LEN,
target.child_name.as_ref(),
"OfferTarget",
"child_name",
);
if valid {
let target_path: &str = target.target_path.as_ref().unwrap();
let child_name: &str = target.child_name.as_ref().unwrap();
if !self.all_children.contains(child_name) {
self.errors.push(Error::invalid_child("OfferTarget", child_name));
}
let paths_for_target =
prev_target_paths.entry(child_name.to_string()).or_insert(HashSet::new());
if !paths_for_target.insert(target_path) {
self.errors.push(Error::duplicate_field(
"OfferDecl",
"target_path",
target_path,
));
}
}
}
}
/// extract_relative_id() returns Err(()) and pushes any errors onto |self.errors| on failure.
fn extract_relative_id(
&mut self,
relative_id: &'a RelativeId,
) -> Result<(Relation, Option<&'a String>), ()> {
if relative_id.relation.is_none() {
self.errors.push(Error::missing_field("RelativeId", "relation"));
return Err(());
}
match relative_id.relation.unwrap() {
Relation::Child => {
if relative_id.child_name.is_none() {
self.errors.push(Error::relative_id_missing_child());
return Err(());
} else {
if !self.check_identifier(
&NAME_RE,
NAME_MAX_LEN,
relative_id.child_name.as_ref(),
"RelativeId",
"child_name",
) {
return Err(());
}
}
Ok((Relation::Child, Some(relative_id.child_name.as_ref().unwrap())))
}
r => {
if relative_id.child_name.is_some() {
let child_name: &str = relative_id.child_name.as_ref().unwrap();
self.errors.push(Error::relative_id_extraneous_child(child_name));
return Err(());
}
Ok((r, None))
}
}
}
fn check_identifier(
&mut self,
re: &Regex,
max_len: usize,
prop: Option<&String>,
decl_type: &str,
keyword: &str,
) -> bool {
let mut valid = true;
if prop.is_none() {
self.errors.push(Error::missing_field(decl_type, keyword));
valid = false;
} else {
if !re.is_match(prop.unwrap()) {
self.errors.push(Error::invalid_field(decl_type, keyword));
valid = false;
}
if prop.unwrap().len() > max_len {
self.errors.push(Error::field_too_long(decl_type, keyword));
valid = false;
}
}
valid
}
}
#[cfg(test)]
mod tests {
use super::*;
use fidl_fuchsia_sys2::{
CapabilityType, ChildDecl, ComponentDecl, ExposeDecl, OfferDecl, OfferTarget, Relation,
RelativeId, UseDecl,
};
fn validate_test(input: ComponentDecl, expected_res: Result<(), Vec<Error>>) {
let res = validate(&input);
assert_eq!(format!("{:?}", res), format!("{:?}", expected_res));
}
fn new_component_decl() -> ComponentDecl {
ComponentDecl {
program: None,
uses: None,
exposes: None,
offers: None,
facets: None,
children: None,
}
}
#[test]
fn test_errors() {
assert_eq!(format!("{}", Error::missing_field("Decl", "keyword")), "Decl missing keyword");
assert_eq!(format!("{}", Error::empty_field("Decl", "keyword")), "Decl has empty keyword");
assert_eq!(
format!("{}", Error::duplicate_field("Decl", "keyword", "foo")),
"\"foo\" is a duplicate Decl keyword"
);
assert_eq!(
format!("{}", Error::invalid_field("Decl", "keyword")),
"Decl has invalid keyword"
);
assert_eq!(
format!("{}", Error::field_too_long("Decl", "keyword")),
"Decl's keyword is too long"
);
assert_eq!(
format!("{}", Error::invalid_child("Decl", "child")),
"\"child\" is referenced in Decl but it does not appear in children"
);
assert_eq!(
format!("{}", Error::relative_id_missing_child()),
"RelativeId is CHILD but missing child_name"
);
assert_eq!(
format!("{}", Error::relative_id_extraneous_child("child")),
"RelativeId is not CHILD but has child_name \"child\""
);
}
macro_rules! test_validate {
(
$(
$test_name:ident => {
input = $input:expr,
result = $result:expr,
},
)+
) => {
$(
#[test]
fn $test_name() {
validate_test($input, $result);
}
)+
}
}
test_validate! {
// uses
test_validate_uses_empty => {
input = {
let mut decl = new_component_decl();
decl.uses = Some(vec![UseDecl{
type_: None,
source_path: None,
target_path: None,
}]);
decl
},
result = Err(vec![
Error::missing_field("UseDecl", "type"),
Error::missing_field("UseDecl", "source_path"),
Error::missing_field("UseDecl", "target_path"),
]),
},
test_validate_uses_invalid_identifiers => {
input = {
let mut decl = new_component_decl();
decl.uses = Some(vec![UseDecl{
type_: Some(CapabilityType::Service),
source_path: Some("foo/".to_string()),
target_path: Some("/".to_string()),
}]);
decl
},
result = Err(vec![
Error::invalid_field("UseDecl", "source_path"),
Error::invalid_field("UseDecl", "target_path"),
]),
},
test_validate_uses_long_identifiers => {
input = {
let mut decl = new_component_decl();
decl.uses = Some(vec![UseDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/".repeat(1025)),
target_path: Some("/".repeat(1025)),
}]);
decl
},
result = Err(vec![
Error::field_too_long("UseDecl", "source_path"),
Error::field_too_long("UseDecl", "target_path"),
]),
},
// exposes
test_validate_exposes_empty => {
input = {
let mut decl = new_component_decl();
decl.exposes = Some(vec![ExposeDecl{
type_: None,
source_path: None,
source: None,
target_path: None,
}]);
decl
},
result = Err(vec![
Error::missing_field("ExposeDecl", "type"),
Error::missing_field("ExposeDecl", "source_path"),
Error::missing_field("ExposeDecl", "source"),
Error::missing_field("ExposeDecl", "target_path"),
]),
},
test_validate_exposes_invalid_identifiers => {
input = {
let mut decl = new_component_decl();
decl.exposes = Some(vec![ExposeDecl{
type_: Some(CapabilityType::Service),
source_path: Some("foo/".to_string()),
source: Some(RelativeId{
relation: Some(Relation::Child),
child_name: Some("^bad".to_string()),
}),
target_path: Some("/".to_string()),
}]);
decl
},
result = Err(vec![
Error::invalid_field("ExposeDecl", "source_path"),
Error::invalid_field("RelativeId", "child_name"),
Error::invalid_field("ExposeDecl", "target_path"),
]),
},
test_validate_exposes_long_identifiers => {
input = {
let mut decl = new_component_decl();
decl.exposes = Some(vec![ExposeDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/".repeat(1025)),
source: Some(RelativeId{
relation: Some(Relation::Child),
child_name: Some("b".repeat(101)),
}),
target_path: Some("/".repeat(1025)),
}]);
decl
},
result = Err(vec![
Error::field_too_long("ExposeDecl", "source_path"),
Error::field_too_long("RelativeId", "child_name"),
Error::field_too_long("ExposeDecl", "target_path"),
]),
},
test_validate_exposes_invalid_relation => {
input = {
let mut decl = new_component_decl();
decl.exposes = Some(vec![
ExposeDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/loggers/fuchsia.logger.Log".to_string()),
source: Some(RelativeId{
relation: Some(Relation::Realm),
child_name: None,
}),
target_path: Some("/svc/fuchsia.logger.Log".to_string()),
},
]);
decl
},
result = Err(vec![
Error::invalid_field("ExposeDecl source", "relative_id"),
]),
},
test_validate_exposes_invalid_child => {
input = {
let mut decl = new_component_decl();
decl.exposes = Some(vec![
ExposeDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/loggers/fuchsia.logger.Log".to_string()),
source: Some(RelativeId{
relation: Some(Relation::Child),
child_name: Some("netstack".to_string()),
}),
target_path: Some("/svc/fuchsia.logger.Log".to_string()),
},
]);
decl
},
result = Err(vec![
Error::invalid_child("ExposeDecl source", "netstack"),
]),
},
test_validate_exposes_duplicate_target => {
input = {
let mut decl = new_component_decl();
decl.exposes = Some(vec![
ExposeDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/svc/logger".to_string()),
source: Some(RelativeId{
relation: Some(Relation::Myself),
child_name: None,
}),
target_path: Some("/svc/fuchsia.logger.Log".to_string()),
},
ExposeDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/svc/logger2".to_string()),
source: Some(RelativeId{
relation: Some(Relation::Myself),
child_name: None,
}),
target_path: Some("/svc/fuchsia.logger.Log".to_string()),
},
]);
decl
},
result = Err(vec![
Error::duplicate_field("ExposeDecl", "target_path", "/svc/fuchsia.logger.Log"),
]),
},
// offers
test_validate_offers_empty => {
input = {
let mut decl = new_component_decl();
decl.offers = Some(vec![OfferDecl{
type_: None,
source_path: None,
source: None,
targets: None,
}]);
decl
},
result = Err(vec![
Error::missing_field("OfferDecl", "type"),
Error::missing_field("OfferDecl", "source_path"),
Error::missing_field("OfferDecl", "source"),
Error::missing_field("OfferDecl", "targets"),
]),
},
test_validate_offers_long_identifiers => {
input = {
let mut decl = new_component_decl();
decl.offers = Some(vec![OfferDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/".repeat(1025)),
source: Some(RelativeId{
relation: Some(Relation::Child),
child_name: Some("a".repeat(101)),
}),
targets: Some(vec![
OfferTarget{
target_path: Some("/".repeat(1025)),
child_name: Some("b".repeat(101)),
},
]),
}]);
decl
},
result = Err(vec![
Error::field_too_long("OfferDecl", "source_path"),
Error::field_too_long("RelativeId", "child_name"),
Error::field_too_long("OfferTarget", "target_path"),
Error::field_too_long("OfferTarget", "child_name"),
]),
},
test_validate_offers_invalid_child => {
input = {
let mut decl = new_component_decl();
decl.offers = Some(vec![
OfferDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/loggers/fuchsia.logger.Log".to_string()),
source: Some(RelativeId{
relation: Some(Relation::Child),
child_name: Some("logger".to_string()),
}),
targets: Some(vec![
OfferTarget{
target_path: Some("/data/realm_assets".to_string()),
child_name: Some("netstack".to_string()),
},
]),
},
]);
decl.children = Some(vec![
ChildDecl{
name: Some("netstack".to_string()),
uri: Some("fuchsia-pkg://fuchsia.com/netstack/stable#meta/netstack.cm".to_string()),
},
]);
decl
},
result = Err(vec![
Error::invalid_child("OfferDecl source", "logger"),
]),
},
test_validate_offer_target_empty => {
input = {
let mut decl = new_component_decl();
decl.offers = Some(vec![OfferDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/svc/logger".to_string()),
source: Some(RelativeId{
relation: Some(Relation::Myself),
child_name: None,
}),
targets: Some(vec![OfferTarget{target_path: None, child_name: None}]),
}]);
decl
},
result = Err(vec![
Error::missing_field("OfferTarget", "target_path"),
Error::missing_field("OfferTarget", "child_name"),
]),
},
test_validate_offer_targets_empty => {
input = {
let mut decl = new_component_decl();
decl.offers = Some(vec![OfferDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/svc/logger".to_string()),
source: Some(RelativeId{
relation: Some(Relation::Myself),
child_name: None,
}),
targets: Some(vec![]),
}]);
decl
},
result = Err(vec![
Error::empty_field("OfferDecl", "targets"),
]),
},
test_validate_offer_target_duplicate_path => {
input = {
let mut decl = new_component_decl();
decl.offers = Some(vec![OfferDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/svc/logger".to_string()),
source: Some(RelativeId{
relation: Some(Relation::Myself),
child_name: None,
}),
targets: Some(vec![
OfferTarget{
target_path: Some("/svc/fuchsia.logger.Log".to_string()),
child_name: Some("netstack".to_string()),
},
OfferTarget{
target_path: Some("/svc/fuchsia.logger.Log".to_string()),
child_name: Some("netstack".to_string()),
},
]),
}]);
decl.children = Some(vec![
ChildDecl{
name: Some("netstack".to_string()),
uri: Some("fuchsia-pkg://fuchsia.com/netstack/stable#meta/netstack.cm".to_string()),
},
]);
decl
},
result = Err(vec![
Error::duplicate_field("OfferDecl", "target_path", "/svc/fuchsia.logger.Log"),
]),
},
test_validate_offer_target_invalid_child => {
input = {
let mut decl = new_component_decl();
decl.offers = Some(vec![OfferDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/svc/logger".to_string()),
source: Some(RelativeId{
relation: Some(Relation::Myself),
child_name: None,
}),
targets: Some(vec![
OfferTarget{
target_path: Some("/svc/fuchsia.logger.Log".to_string()),
child_name: Some("netstack".to_string()),
},
]),
}]);
decl
},
result = Err(vec![
Error::invalid_child("OfferTarget", "netstack"),
]),
},
test_validate_relative_id_relation_empty => {
input = {
let mut decl = new_component_decl();
decl.exposes = Some(vec![
ExposeDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/loggers/fuchsia.logger.Log".to_string()),
source: Some(RelativeId{
relation: None,
child_name: None,
}),
target_path: Some("/svc/fuchsia.logger.Log".to_string()),
},
]);
decl
},
result = Err(vec![
Error::missing_field("RelativeId", "relation"),
]),
},
test_validate_relative_id_child_name_empty => {
input = {
let mut decl = new_component_decl();
decl.exposes = Some(vec![
ExposeDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/loggers/fuchsia.logger.Log".to_string()),
source: Some(RelativeId{
relation: Some(Relation::Child),
child_name: None,
}),
target_path: Some("/svc/fuchsia.logger.Log".to_string()),
},
]);
decl
},
result = Err(vec![
Error::relative_id_missing_child(),
]),
},
// children
test_validate_children_empty => {
input = {
let mut decl = new_component_decl();
decl.children = Some(vec![ChildDecl{
name: None,
uri: None,
}]);
decl
},
result = Err(vec![
Error::missing_field("ChildDecl", "name"),
Error::missing_field("ChildDecl", "uri"),
]),
},
test_validate_children_invalid_identifiers => {
input = {
let mut decl = new_component_decl();
decl.children = Some(vec![ChildDecl{
name: Some("^bad".to_string()),
uri: Some("bad-scheme&://blah".to_string()),
}]);
decl
},
result = Err(vec![
Error::invalid_field("ChildDecl", "name"),
Error::invalid_field("ChildDecl", "uri"),
]),
},
test_validate_children_long_identifiers => {
input = {
let mut decl = new_component_decl();
decl.children = Some(vec![ChildDecl{
name: Some("a".repeat(1025)),
uri: Some(format!("fuchsia-pkg://{}", "a".repeat(4083))),
}]);
decl
},
result = Err(vec![
Error::field_too_long("ChildDecl", "name"),
Error::field_too_long("ChildDecl", "uri"),
]),
},
// valid patterns
test_validate_patterns => {
input = {
let mut decl = new_component_decl();
decl.uses = Some(vec![
UseDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/foo/?!@#$%/Bar".to_string()),
target_path: Some("/bar".to_string()),
},
]);
decl.children = Some(vec![
ChildDecl{
name: Some("abcdefghijklmnopqrstuvwxyz0123456789_-.".to_string()),
uri: Some("my+awesome-scheme.2://abc123!@#$%.com".to_string()),
},
]);
decl
},
result = Ok(()),
},
test_validate_pattern_lengths => {
input = {
let mut decl = new_component_decl();
decl.uses = Some(vec![
UseDecl{
type_: Some(CapabilityType::Service),
source_path: Some("/".repeat(1024)),
target_path: Some("/".repeat(1024)),
},
]);
decl.children = Some(vec![
ChildDecl{
name: Some("a".repeat(100)),
uri: Some(format!("fuchsia-pkg://{}", "b".repeat(4082))),
},
]);
decl
},
result = Ok(()),
},
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.