text
stringlengths
8
4.13M
#[doc = r"Value read from the register"] pub struct R { bits: u32, } #[doc = r"Value to write to the register"] pub struct W { bits: u32, } impl super::TPSTAT { #[doc = r"Modifies the contents of the register"] #[inline(always)] pub fn modify<F>(&self, f: F) where for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W, { let bits = self.register.get(); self.register.set(f(&R { bits }, &mut W { bits }).bits); } #[doc = r"Reads the contents of the register"] #[inline(always)] pub fn read(&self) -> R { R { bits: self.register.get(), } } #[doc = r"Writes to the register"] #[inline(always)] pub fn write<F>(&self, f: F) where F: FnOnce(&mut W) -> &mut W, { self.register.set( f(&mut W { bits: Self::reset_value(), }) .bits, ); } #[doc = r"Reset value of the register"] #[inline(always)] pub const fn reset_value() -> u32 { 0 } #[doc = r"Writes the reset value to the register"] #[inline(always)] pub fn reset(&self) { self.register.set(Self::reset_value()) } } #[doc = r"Value of the field"] pub struct HIB_TPSTAT_XOSCFAILR { bits: bool, } impl HIB_TPSTAT_XOSCFAILR { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _HIB_TPSTAT_XOSCFAILW<'a> { w: &'a mut W, } impl<'a> _HIB_TPSTAT_XOSCFAILW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 0); self.w.bits |= ((value as u32) & 1) << 0; self.w } } #[doc = r"Value of the field"] pub struct HIB_TPSTAT_XOSCSTR { bits: bool, } impl HIB_TPSTAT_XOSCSTR { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bit(&self) -> bool { self.bits } #[doc = r"Returns `true` if the bit is clear (0)"] #[inline(always)] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r"Returns `true` if the bit is set (1)"] #[inline(always)] pub fn bit_is_set(&self) -> bool { self.bit() } } #[doc = r"Proxy"] pub struct _HIB_TPSTAT_XOSCSTW<'a> { w: &'a mut W, } impl<'a> _HIB_TPSTAT_XOSCSTW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 1); self.w.bits |= ((value as u32) & 1) << 1; self.w } } #[doc = "Possible values of the field `HIB_TPSTAT_STATE`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum HIB_TPSTAT_STATER { #[doc = "Tamper disabled"] HIB_TPSTAT_STATE_DISABLED, #[doc = "Tamper configured"] HIB_TPSTAT_STATE_CONFIGED, #[doc = "Tamper pin event occurred"] HIB_TPSTAT_STATE_ERROR, #[doc = r"Reserved"] _Reserved(u8), } impl HIB_TPSTAT_STATER { #[doc = r"Value of the field as raw bits"] #[inline(always)] pub fn bits(&self) -> u8 { match *self { HIB_TPSTAT_STATER::HIB_TPSTAT_STATE_DISABLED => 0, HIB_TPSTAT_STATER::HIB_TPSTAT_STATE_CONFIGED => 1, HIB_TPSTAT_STATER::HIB_TPSTAT_STATE_ERROR => 2, HIB_TPSTAT_STATER::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline(always)] pub fn _from(value: u8) -> HIB_TPSTAT_STATER { match value { 0 => HIB_TPSTAT_STATER::HIB_TPSTAT_STATE_DISABLED, 1 => HIB_TPSTAT_STATER::HIB_TPSTAT_STATE_CONFIGED, 2 => HIB_TPSTAT_STATER::HIB_TPSTAT_STATE_ERROR, i => HIB_TPSTAT_STATER::_Reserved(i), } } #[doc = "Checks if the value of the field is `HIB_TPSTAT_STATE_DISABLED`"] #[inline(always)] pub fn is_hib_tpstat_state_disabled(&self) -> bool { *self == HIB_TPSTAT_STATER::HIB_TPSTAT_STATE_DISABLED } #[doc = "Checks if the value of the field is `HIB_TPSTAT_STATE_CONFIGED`"] #[inline(always)] pub fn is_hib_tpstat_state_configed(&self) -> bool { *self == HIB_TPSTAT_STATER::HIB_TPSTAT_STATE_CONFIGED } #[doc = "Checks if the value of the field is `HIB_TPSTAT_STATE_ERROR`"] #[inline(always)] pub fn is_hib_tpstat_state_error(&self) -> bool { *self == HIB_TPSTAT_STATER::HIB_TPSTAT_STATE_ERROR } } #[doc = "Values that can be written to the field `HIB_TPSTAT_STATE`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum HIB_TPSTAT_STATEW { #[doc = "Tamper disabled"] HIB_TPSTAT_STATE_DISABLED, #[doc = "Tamper configured"] HIB_TPSTAT_STATE_CONFIGED, #[doc = "Tamper pin event occurred"] HIB_TPSTAT_STATE_ERROR, } impl HIB_TPSTAT_STATEW { #[allow(missing_docs)] #[doc(hidden)] #[inline(always)] pub fn _bits(&self) -> u8 { match *self { HIB_TPSTAT_STATEW::HIB_TPSTAT_STATE_DISABLED => 0, HIB_TPSTAT_STATEW::HIB_TPSTAT_STATE_CONFIGED => 1, HIB_TPSTAT_STATEW::HIB_TPSTAT_STATE_ERROR => 2, } } } #[doc = r"Proxy"] pub struct _HIB_TPSTAT_STATEW<'a> { w: &'a mut W, } impl<'a> _HIB_TPSTAT_STATEW<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HIB_TPSTAT_STATEW) -> &'a mut W { unsafe { self.bits(variant._bits()) } } #[doc = "Tamper disabled"] #[inline(always)] pub fn hib_tpstat_state_disabled(self) -> &'a mut W { self.variant(HIB_TPSTAT_STATEW::HIB_TPSTAT_STATE_DISABLED) } #[doc = "Tamper configured"] #[inline(always)] pub fn hib_tpstat_state_configed(self) -> &'a mut W { self.variant(HIB_TPSTAT_STATEW::HIB_TPSTAT_STATE_CONFIGED) } #[doc = "Tamper pin event occurred"] #[inline(always)] pub fn hib_tpstat_state_error(self) -> &'a mut W { self.variant(HIB_TPSTAT_STATEW::HIB_TPSTAT_STATE_ERROR) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits &= !(3 << 2); self.w.bits |= ((value as u32) & 3) << 2; self.w } } impl R { #[doc = r"Value of the register as raw bits"] #[inline(always)] pub fn bits(&self) -> u32 { self.bits } #[doc = "Bit 0 - External Oscillator Failure"] #[inline(always)] pub fn hib_tpstat_xoscfail(&self) -> HIB_TPSTAT_XOSCFAILR { let bits = ((self.bits >> 0) & 1) != 0; HIB_TPSTAT_XOSCFAILR { bits } } #[doc = "Bit 1 - External Oscillator Status"] #[inline(always)] pub fn hib_tpstat_xoscst(&self) -> HIB_TPSTAT_XOSCSTR { let bits = ((self.bits >> 1) & 1) != 0; HIB_TPSTAT_XOSCSTR { bits } } #[doc = "Bits 2:3 - Tamper Module Status"] #[inline(always)] pub fn hib_tpstat_state(&self) -> HIB_TPSTAT_STATER { HIB_TPSTAT_STATER::_from(((self.bits >> 2) & 3) as u8) } } impl W { #[doc = r"Writes raw bits to the register"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.bits = bits; self } #[doc = "Bit 0 - External Oscillator Failure"] #[inline(always)] pub fn hib_tpstat_xoscfail(&mut self) -> _HIB_TPSTAT_XOSCFAILW { _HIB_TPSTAT_XOSCFAILW { w: self } } #[doc = "Bit 1 - External Oscillator Status"] #[inline(always)] pub fn hib_tpstat_xoscst(&mut self) -> _HIB_TPSTAT_XOSCSTW { _HIB_TPSTAT_XOSCSTW { w: self } } #[doc = "Bits 2:3 - Tamper Module Status"] #[inline(always)] pub fn hib_tpstat_state(&mut self) -> _HIB_TPSTAT_STATEW { _HIB_TPSTAT_STATEW { w: self } } }
// Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 use anyhow::bail; use anyhow::{ensure, Error, Result}; use logger::prelude::*; use mirai_annotations::*; use serde::{Deserialize, Serialize}; use starcoin_crypto::HashValue; #[cfg(test)] mod accumulator_test; pub mod node; pub mod node_index; use crate::node::{InternalNode, ACCUMULATOR_PLACEHOLDER_HASH}; use crate::node_index::{FrozenSubTreeIterator, NodeIndex}; pub use node::AccumulatorNode; use std::cell::RefCell; use std::collections::HashMap; use std::ops::DerefMut; use std::sync::{Arc, Mutex}; pub type LeafCount = u64; pub type NodeCount = u64; pub const MAX_ACCUMULATOR_PROOF_DEPTH: usize = 63; pub const MAX_ACCUMULATOR_LEAVES: LeafCount = 1 << MAX_ACCUMULATOR_PROOF_DEPTH; #[derive(Default, Clone, Debug, Hash, Eq, PartialEq, Serialize, Deserialize)] pub struct AccumulatorProof { /// All siblings in this proof, including the default ones. Siblings are ordered from the bottom /// level to the root level. siblings: Vec<HashValue>, } impl AccumulatorProof { /// Constructs a new `AccumulatorProof` using a list of siblings. pub fn new(siblings: Vec<HashValue>) -> Self { AccumulatorProof { siblings } } /// Returns the list of siblings in this proof. pub fn siblings(&self) -> &[HashValue] { &self.siblings } /// Verifies an element whose hash is `element_hash` exists in /// the accumulator whose root hash is `expected_root_hash` using the provided proof. pub fn verify( &self, expected_root_hash: HashValue, element_hash: HashValue, element_index: u64, ) -> Result<()> { ensure!( self.siblings.len() <= MAX_ACCUMULATOR_PROOF_DEPTH, "Accumulator proof has more than {} ({}) siblings.", MAX_ACCUMULATOR_PROOF_DEPTH, self.siblings.len() ); let actual_root_hash = self .siblings .iter() .fold( (element_hash, element_index), // `index` denotes the index of the ancestor of the element at the current level. |(hash, index), sibling_hash| { ( if index % 2 == 0 { // the current node is a left child. InternalNode::new(NodeIndex::new(index), hash, *sibling_hash).hash() } else { // the current node is a right child. InternalNode::new(NodeIndex::new(index), *sibling_hash, hash).hash() }, // The index of the parent at its level. index / 2, ) }, ) .0; ensure!( actual_root_hash == expected_root_hash, "Root hashes do not match. Actual root hash: {:x}. Expected root hash: {:x}.", actual_root_hash, expected_root_hash ); Ok(()) } } /// accumulator method define pub trait Accumulator { /// Append leaves and return new root fn append(&self, leaves: &[HashValue]) -> Result<(HashValue, u64), Error>; /// Append leaves and return new root, but not persistence fn append_only_cache(&self, leaves: &[HashValue]) -> Result<(HashValue, u64), Error>; /// Get leaf hash by leaf index. fn get_leaf(&self, leaf_index: u64) -> Result<Option<HashValue>>; /// Get proof by leaf index. fn get_proof(&self, leaf_index: u64) -> Result<Option<AccumulatorProof>>; /// Get current accumulator tree root hash. fn root_hash(&self) -> HashValue; /// Get current accumulator tree number of leaves. fn num_leaves(&self) -> u64; /// Get current accumulator tree number of nodes. fn num_nodes(&self) -> u64; /// Update current accumulator tree for rollback fn update(&self, leaf_index: u64, leaves: &[HashValue]) -> Result<(HashValue, u64), Error>; fn get_frozen_subtree_roots(&self) -> Result<Vec<HashValue>>; } pub trait AccumulatorReader { ///get node by node hash fn get_node(&self, hash: HashValue) -> Result<Option<AccumulatorNode>>; /// multiple get nodes fn multiple_get(&self, hash_vec: Vec<HashValue>) -> Result<Vec<AccumulatorNode>>; } pub trait AccumulatorWriter { /// save node fn save_node(&self, node: AccumulatorNode) -> Result<()>; ///delete node fn delete_nodes(&self, node_hash_vec: Vec<HashValue>) -> Result<()>; } pub trait AccumulatorTreeStore: AccumulatorReader + AccumulatorWriter + std::marker::Send + std::marker::Sync { } /// MerkleAccumulator is a accumulator algorithm implement and it is stateless. pub struct MerkleAccumulator { cache: Mutex<AccumulatorCache>, #[allow(dead_code)] node_store: Arc<dyn AccumulatorTreeStore>, } pub struct AccumulatorCache { /// Accumulator id id: HashValue, /// forzen subtree roots hashes. frozen_subtree_roots: RefCell<Vec<HashValue>>, /// index cache for node_index map to hash value. index_cache: RefCell<HashMap<NodeIndex, HashValue>>, /// The total number of leaves in this accumulator. num_leaves: LeafCount, /// The total number of nodes in this accumulator. num_nodes: NodeCount, /// The root hash of this accumulator. root_hash: HashValue, node_store: Arc<dyn AccumulatorTreeStore>, } impl AccumulatorCache { pub fn new( accumulator_id: HashValue, frozen_subtree_roots: Vec<HashValue>, num_leaves: LeafCount, num_nodes: NodeCount, root_hash: HashValue, node_store: Arc<dyn AccumulatorTreeStore>, ) -> Self { trace!("accumulator cache new: {:?}", accumulator_id.short_str()); Self { id: accumulator_id, frozen_subtree_roots: RefCell::new(frozen_subtree_roots.clone()), index_cache: RefCell::new( Self::aggregate_cache(root_hash, frozen_subtree_roots, node_store.clone()).unwrap(), ), num_leaves, num_nodes, root_hash, node_store, } } ///append from multiple leaves fn append_leaves( &mut self, new_leaves: &[HashValue], ) -> Result<(HashValue, Vec<AccumulatorNode>)> { // Deal with the case where new_leaves is empty if new_leaves.is_empty() { if self.num_leaves == 0 { return Ok((*ACCUMULATOR_PLACEHOLDER_HASH, Vec::new())); } else { return Ok((self.root_hash, Vec::new())); } } let num_new_leaves = new_leaves.len(); let last_new_leaf_count = self.num_leaves + num_new_leaves as LeafCount; let mut new_num_nodes = self.num_nodes; let root_level = NodeIndex::root_level_from_leaf_count(last_new_leaf_count); let mut to_freeze = Vec::with_capacity(Self::max_to_freeze(num_new_leaves, root_level)); // Iterate over the new leaves, adding them to to_freeze and then adding any frozen parents // when right children are encountered. This has the effect of creating frozen nodes in // perfect post-order, which can be used as a strictly increasing append only index for // the underlying storage. // // We will track newly created left siblings while iterating so we can pair them with their // right sibling, if and when it becomes frozen. If the frozen left sibling is not created // in this iteration, it must already exist in storage. let mut left_siblings: Vec<(_, _)> = Vec::new(); for (leaf_offset, leaf) in new_leaves.iter().enumerate() { let leaf_pos = NodeIndex::from_leaf_index(self.num_leaves + leaf_offset as LeafCount); let mut hash = *leaf; to_freeze.push(AccumulatorNode::new_leaf(leaf_pos, hash)); debug!( "{:?} insert leaf cache: {:?}", self.id.short_str(), leaf_pos ); self.index_cache.borrow_mut().insert(leaf_pos, hash); new_num_nodes += 1; let mut pos = leaf_pos; while pos.is_right_child() { #[allow(unused_assignments)] let mut internal_node = AccumulatorNode::Empty; let sibling = pos.sibling(); hash = match left_siblings.pop() { Some((x, left_hash)) => { assert_eq!(x, sibling); internal_node = AccumulatorNode::new_internal(pos.parent(), left_hash, hash); internal_node.hash() // Self::hash_internal_node(left_hash, hash) } None => { internal_node = AccumulatorNode::new_internal( pos.parent(), self.get_index(sibling).unwrap(), hash, ); internal_node.hash() } }; pos = pos.parent(); to_freeze.push(internal_node); debug!("{:?} insert internal cache: {:?}", self.id.short_str(), pos); self.index_cache.borrow_mut().insert(pos, hash); new_num_nodes += 1; } // The node remaining must be a left child, possibly the root of a complete binary tree. left_siblings.push((pos, hash)); } // Now reconstruct the final root hash by walking up to root level and adding // placeholder hash nodes as needed on the right, and left siblings that have either // been newly created or read from storage. let (mut pos, mut hash) = left_siblings.pop().expect("Must have at least one node"); for _ in pos.level()..root_level as u32 { hash = if pos.is_left_child() { AccumulatorNode::new_internal(pos.parent(), hash, *ACCUMULATOR_PLACEHOLDER_HASH) .hash() } else { let sibling = pos.sibling(); match left_siblings.pop() { Some((x, left_hash)) => { assert_eq!(x, sibling); AccumulatorNode::new_internal(pos.parent(), left_hash, hash).hash() } None => AccumulatorNode::new_internal( pos.parent(), self.get_index(sibling).unwrap(), hash, ) .hash(), } }; pos = pos.parent(); } assert!(left_siblings.is_empty()); self.root_hash = hash; self.frozen_subtree_roots = RefCell::new(Self::get_vec_hash(to_freeze.clone()).unwrap()); self.num_leaves = last_new_leaf_count; self.num_nodes = new_num_nodes; Ok((hash, to_freeze)) } fn _get_frozen_subtree_roots(&self) -> Result<Vec<HashValue>> { Ok(self.frozen_subtree_roots.borrow().to_vec()) } fn get_index(&self, index: NodeIndex) -> Result<HashValue> { match self.index_cache.borrow().get(&index) { Some(hash) => Ok(*hash), None => bail!( "{:?} get index from cache error: {:?}", self.id.short_str(), index ), } } fn aggregate_cache( root_hash: HashValue, frozen_node_vec: Vec<HashValue>, store: Arc<dyn AccumulatorTreeStore>, ) -> Result<HashMap<NodeIndex, HashValue>> { let mut cache_map = HashMap::new(); // get root hash let root_map = Self::restore_index_cache(root_hash, store.clone()).unwrap(); cache_map.extend(root_map.iter()); // restore from frozen node for hash in frozen_node_vec { if hash != root_hash { let tmp_map = Self::restore_index_cache(hash, store.clone()).unwrap(); cache_map.extend(tmp_map.iter()); } } Ok(cache_map) } fn restore_index_cache( root_hash: HashValue, store: Arc<dyn AccumulatorTreeStore>, ) -> Result<HashMap<NodeIndex, HashValue>> { let mut cache_map = HashMap::new(); trace!("restore index cache, root:{:?}", root_hash.short_str()); if root_hash != *ACCUMULATOR_PLACEHOLDER_HASH { //get node from storage match store.get_node(root_hash) { Ok(Some(node)) => { //save index to cache cache_map.insert(node.index(), node.hash()); match node { AccumulatorNode::Internal(inter) => { let right_map = Self::restore_index_cache(inter.right(), store.clone()).unwrap(); cache_map.extend(right_map.iter()); let left_map = Self::restore_index_cache(inter.left(), store.clone()).unwrap(); cache_map.extend(left_map.iter()); } _ => {} } } Err(e) => { error!("{:?} get node error: {:?}", root_hash, e); } _ => {} } } else { debug!("{:?} root hash is placeholder!", root_hash); } Ok(cache_map) } ///delete node from leaf_index fn delete(&mut self, leaf_index: u64) -> Result<()> { ensure!( leaf_index < self.num_leaves as u64, "invalid leaf_index {}, num_leaves {}", leaf_index, self.num_leaves ); let new_num_leaves = NodeIndex::leaves_count_end_from_index(leaf_index); //find deleting node by leaf_index let little_index = FrozenSubTreeIterator::new(new_num_leaves).collect::<Vec<_>>(); //merge update node and index let update_nodes = self .get_all_update_nodes_from_index(leaf_index, little_index) .unwrap(); let node_index = NodeIndex::new(leaf_index); //delete node and index let vec_update_nodes = update_nodes .values() .map(|v| v.clone()) .collect::<Vec<HashValue>>(); let vec_update_nodes_index = update_nodes .keys() .map(|v| v.clone()) .collect::<Vec<NodeIndex>>(); self.node_store.delete_nodes(vec_update_nodes.clone())?; // update self frozen_subtree_roots let mut frozen_subtree_roots = self.frozen_subtree_roots.borrow_mut().to_vec(); for hash in vec_update_nodes.clone() { let pos = frozen_subtree_roots .iter() .position(|x| *x == hash) .unwrap(); frozen_subtree_roots.remove(pos); } self.frozen_subtree_roots = RefCell::from(frozen_subtree_roots); // update index cache for index in vec_update_nodes_index.clone() { self.index_cache.borrow_mut().remove(&index); } //update node number if node_index.is_left_child() { self.num_nodes = leaf_index - 1; } else { self.num_nodes = node_index.sibling().to_inorder_index(); } //update self leaves number self.num_leaves = new_num_leaves; //update root hash let new_root_index = NodeIndex::root_from_leaf_count(self.num_leaves); if node_index.is_left_child() { //if index is left, update root hash self.root_hash = *self.index_cache.borrow().get(&new_root_index).unwrap(); } else { self.root_hash = self .get_new_root_and_update_node(node_index, new_root_index) .unwrap(); }; Ok(()) } /// filter function can be applied to filter out certain siblings. fn get_siblings( &self, leaf_index: u64, filter: impl Fn(NodeIndex) -> bool, ) -> Result<Vec<HashValue>> { let root_pos = NodeIndex::root_from_leaf_count(self.num_leaves); let siblings = NodeIndex::from_leaf_index(leaf_index) .iter_ancestor_sibling() .take(root_pos.level() as usize) .filter_map(|p| { if filter(p) { Some(self.get_node_hash(p)) } else { None } }) .collect::<Result<Vec<_>>>()?; Ok(siblings) } ///get all nodes larger than index of leaf_node and little update nodes fn get_all_update_nodes_from_index( &self, leaf_index: u64, little_index: Vec<NodeIndex>, ) -> Result<HashMap<NodeIndex, HashValue>> { let mut node_map = HashMap::new(); //find larger nodes for index in leaf_index..self.num_nodes { let node_index = NodeIndex::new(index); match self.index_cache.borrow().get(&node_index) { Some(node) => { node_map.insert(node_index, *node); } _ => { error!( "get larger nodes from leaf index: {:?}, node:{:?}", leaf_index, node_index ); } } } //find little nodes for index in little_index { let parent_index = index.parent(); match self.index_cache.borrow().get(&parent_index) { Some(node) => { node_map.insert(parent_index, *node); } _ => { bail!( "get little nodes from index: {:?}, parent: {:?}", index, parent_index ); } } } Ok(node_map) } /// save frozen nodes fn save_frozen_nodes(&self, frozen_nodes: Vec<AccumulatorNode>) -> Result<()> { ensure!(frozen_nodes.len() > 0, "invalid frozen nodes length"); for node in frozen_nodes { self.save_index_and_node(node.index(), node.hash(), node)?; } Ok(()) } /// save node index and node object fn save_index_and_node( &self, _index: NodeIndex, _node_hash: HashValue, node: AccumulatorNode, ) -> Result<()> { // self.node_store // .save(NodeStoreIndex::new(self.id, index), node_hash)?; self.node_store.save_node(node) } ///get new root by leaf index and update fn get_new_root_and_update_node( &self, leaf_index: NodeIndex, root_index: NodeIndex, ) -> Result<HashValue> { let mut right_hash = *ACCUMULATOR_PLACEHOLDER_HASH; let mut right_index = leaf_index.clone(); #[allow(unused_assignments)] let mut new_root = right_hash; loop { //get sibling let sibling_index = right_index.sibling(); if sibling_index.to_inorder_index() > leaf_index.to_inorder_index() { //right left replace node let left_hash = right_hash; right_hash = *ACCUMULATOR_PLACEHOLDER_HASH; let parent_index = right_index.parent(); //set new root hash to parent node hash let parent_node = AccumulatorNode::new_internal(parent_index, left_hash, right_hash); new_root = parent_node.hash(); self.update_node(parent_index, new_root, parent_node.clone())?; if parent_index == root_index { //get root node break; } //for next loop right_index = parent_node.index(); right_hash = new_root; } else { let sibling_hash = self.get_index(sibling_index).unwrap(); match self.node_store.get_node(sibling_hash) { Ok(Some(node)) => { let left_hash = node.hash(); let parent_index = right_index.parent(); //set new root hash to parent node hash let parent_node = AccumulatorNode::new_internal(parent_index, left_hash, right_hash); new_root = parent_node.hash(); self.update_node(parent_index, new_root, parent_node.clone())?; if parent_index == root_index { //get root node break; } //for next loop right_index = parent_node.index(); right_hash = new_root; } _ => { warn!("get leaf node error: {:?}", sibling_index); } } } } Ok(new_root) } /// Update node storage,and index cache fn update_node(&self, index: NodeIndex, hash: HashValue, node: AccumulatorNode) -> Result<()> { self.node_store.save_node(node.clone())?; self.index_cache.borrow_mut().insert(index, hash); Ok(()) } fn rightmost_leaf_index(&self) -> u64 { (self.num_leaves - 1) as u64 } fn get_node_hash(&self, node_index: NodeIndex) -> Result<HashValue> { let idx = self.rightmost_leaf_index(); if node_index.is_placeholder(idx) { Ok(*ACCUMULATOR_PLACEHOLDER_HASH) } else if node_index.is_freezable(idx) { // first read from cache Ok(self.get_index(node_index).unwrap()) } else { // non-frozen non-placeholder node Ok(AccumulatorNode::new_internal( node_index, self.get_node_hash(node_index.left_child())?, self.get_node_hash(node_index.right_child())?, ) .hash()) } } /// upper bound of num of frozen nodes: /// new leaves and resulting frozen internal nodes forming a complete binary subtree /// num_new_leaves * 2 - 1 < num_new_leaves * 2 /// and the full route from root of that subtree to the accumulator root turns frozen /// height - (log2(num_new_leaves) + 1) < height - 1 = root_level fn max_to_freeze(num_new_leaves: usize, root_level: u32) -> usize { precondition!(root_level as usize <= MAX_ACCUMULATOR_PROOF_DEPTH); precondition!(num_new_leaves < (usize::max_value() / 2)); precondition!(num_new_leaves * 2 <= usize::max_value() - root_level as usize); num_new_leaves * 2 + root_level as usize } fn get_vec_hash(node_vec: Vec<AccumulatorNode>) -> Result<Vec<HashValue>> { let mut hash_vec = vec![]; for node in node_vec { hash_vec.push(node.hash()); } Ok(hash_vec) } } impl MerkleAccumulator { pub fn new( accumulator_id: HashValue, root_hash: HashValue, frozen_subtree_roots: Vec<HashValue>, num_leaves: LeafCount, num_notes: NodeCount, node_store: Arc<dyn AccumulatorTreeStore>, ) -> Result<Self> { Ok(Self { cache: Mutex::new(AccumulatorCache::new( accumulator_id, frozen_subtree_roots, num_leaves, num_notes, root_hash, node_store.clone(), )), node_store: node_store.clone(), }) } } impl Accumulator for MerkleAccumulator { fn append(&self, new_leaves: &[HashValue]) -> Result<(HashValue, u64), Error> { let mut cache_guard = self.cache.lock().unwrap(); let cache = cache_guard.deref_mut(); let first_index_leaf = cache.num_leaves; let (root_hash, frozen_nodes) = cache.append_leaves(new_leaves).unwrap(); cache.save_frozen_nodes(frozen_nodes)?; Ok((root_hash, first_index_leaf)) } fn append_only_cache(&self, leaves: &[HashValue]) -> Result<(HashValue, u64), Error> { let mut cache_guard = self.cache.lock().unwrap(); let cache = cache_guard.deref_mut(); let first_index_leaf = cache.num_leaves; let (root_hash, _frozen_nodes) = cache.append_leaves(leaves).unwrap(); Ok((root_hash, first_index_leaf)) } fn get_leaf(&self, leaf_index: u64) -> Result<Option<HashValue>, Error> { Ok(Some( self.cache .lock() .unwrap() .get_node_hash(NodeIndex::new(leaf_index)) .unwrap(), )) } fn get_proof(&self, leaf_index: u64) -> Result<Option<AccumulatorProof>, Error> { let cache = self.cache.lock().unwrap(); ensure!( leaf_index < cache.num_leaves as u64, "get proof invalid leaf_index {}, num_leaves {}", leaf_index, cache.num_leaves ); let siblings = cache.get_siblings(leaf_index, |_p| true)?; Ok(Some(AccumulatorProof::new(siblings))) } fn root_hash(&self) -> HashValue { self.cache.lock().unwrap().root_hash } fn num_leaves(&self) -> u64 { self.cache.lock().unwrap().num_leaves } fn num_nodes(&self) -> u64 { self.cache.lock().unwrap().num_nodes } fn update(&self, leaf_index: u64, leaves: &[HashValue]) -> Result<(HashValue, u64), Error> { let mut cache_guard = self.cache.lock().unwrap(); let cache = cache_guard.deref_mut(); //ensure leaves is null ensure!(leaves.len() > 0, "invalid leaves len: {}", leaves.len()); ensure!( leaf_index < cache.num_leaves as u64, "update invalid leaf_index {}, num_leaves {}", leaf_index, cache.num_leaves ); // delete larger nodes from index cache.delete(leaf_index)?; // append new notes let (root, _) = cache.append_leaves(leaves).unwrap(); Ok((root, leaf_index)) } fn get_frozen_subtree_roots(&self) -> Result<Vec<HashValue>, Error> { let cache = self.cache.lock().unwrap(); let result = FrozenSubTreeIterator::new(cache.num_leaves) .map(|p| cache.get_index(p).unwrap()) .collect::<Vec<_>>(); Ok(result) } } pub struct MockAccumulatorStore { node_store: Mutex<HashMap<HashValue, AccumulatorNode>>, } impl MockAccumulatorStore { pub fn new() -> Self { Self { node_store: Mutex::new(HashMap::new()), } } } impl AccumulatorTreeStore for MockAccumulatorStore {} impl AccumulatorReader for MockAccumulatorStore { fn get_node(&self, hash: HashValue) -> Result<Option<AccumulatorNode>> { match self.node_store.lock().unwrap().get(&hash) { Some(node) => Ok(Some(node.clone())), None => bail!("get node is null: {}", hash), } } fn multiple_get(&self, _hash_vec: Vec<HashValue>) -> Result<Vec<AccumulatorNode>, Error> { unimplemented!() } } impl AccumulatorWriter for MockAccumulatorStore { fn save_node(&self, node: AccumulatorNode) -> Result<()> { self.node_store.lock().unwrap().insert(node.hash(), node); Ok(()) } fn delete_nodes(&self, node_hash_vec: Vec<HashValue>) -> Result<(), Error> { for hash in node_hash_vec { self.node_store.lock().unwrap().remove(&hash); } Ok(()) } }
use std::{ fmt::Display, task::{ Context, Poll, }, time::{ Duration, Instant }, str }; use futures::future::BoxFuture; use axum::{ body::Body, response::Response, http::{ Request, HeaderValue }, }; use tower::{ Layer, Service }; #[derive(Debug, Default)] struct LoggerMessage { method: String, request_id: String, host: String, uri: String, user_agent: String, status_code: u16, version: String, latency: Duration, } impl Display for LoggerMessage { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "status_code: {}, method: {}, uri: {}, host: {}, request_id: {}, user_agent: {}, version: {}, latency: {:?}", self.status_code, self.method, self.uri, self.host, self.request_id, self.user_agent, self.version, self.latency, ) } } #[derive(Clone)] pub struct LoggerLayer; impl LoggerLayer { pub fn new() -> Self { Self {} } } impl<S> Layer<S> for LoggerLayer { type Service = LoggerMiddleware<S>; fn layer(&self, inner: S) -> Self::Service { LoggerMiddleware { inner } } } #[derive(Clone)] pub struct LoggerMiddleware<S> { inner: S, } impl<S> Service<Request<Body>> for LoggerMiddleware<S> where S: Service<Request<Body>, Response = Response> + Send + 'static, S::Future: Send + 'static, { type Response = S::Response; type Error = S::Error; // `BoxFuture` is a type alias for `Pin<Box<dyn Future + Send + 'a>>` type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>; fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> { self.inner.poll_ready(cx) } fn call(&mut self, request: Request<Body>) -> Self::Future { let now = Instant::now(); let resquest_headers = request.headers(); let mut message = LoggerMessage { method: request.method().to_string(), uri: request.uri().to_string(), host: header_value_to_str(resquest_headers.get("host")).to_string(), user_agent: header_value_to_str(resquest_headers.get("user-agent")).to_string(), ..Default::default() }; let future = self.inner.call(request); Box::pin(async move { let response: Response = future.await?; message.status_code = response.status().as_u16(); message.version = format!("{:?}", response.version()); message.latency = now.elapsed(); console_info!("{}", message); Ok(response) }) } } fn header_value_to_str(value: Option<&HeaderValue>) -> &str { match value { Some(value) => str::from_utf8(value.as_bytes()).unwrap_or_default(), None => "", } }
// 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. use crate::{ blocks::{blockheader::BlockHash, Block, BlockHeader, NewBlockTemplate}, chain_storage::{ consts::BLOCKCHAIN_DATABASE_ORPHAN_STORAGE_CAPACITY, db_transaction::{DbKey, DbKeyValuePair, DbTransaction, DbValue, MetadataKey, MetadataValue, MmrTree}, error::ChainStorageError, ChainMetadata, HistoricalBlock, }, consensus::ConsensusManager, proof_of_work::{Difficulty, PowAlgorithm, ProofOfWork}, transactions::{ transaction::{TransactionInput, TransactionKernel, TransactionOutput}, types::{Commitment, HashOutput}, }, validation::{StatelessValidation, StatelessValidator, Validation, ValidationError, Validator}, }; use croaring::Bitmap; use log::*; use serde::{Deserialize, Serialize}; use std::{ collections::VecDeque, sync::{Arc, RwLock, RwLockReadGuard, RwLockWriteGuard}, }; use strum_macros::Display; use tari_crypto::tari_utilities::{epoch_time::EpochTime, hex::Hex, Hashable}; use tari_mmr::{Hash, MerkleCheckPoint, MerkleProof, MutableMmrLeafNodes}; const LOG_TARGET: &str = "c::cs::database"; /// Configuration for the BlockchainDatabase. #[derive(Clone, Copy)] pub struct BlockchainDatabaseConfig { pub orphan_storage_capacity: usize, } impl Default for BlockchainDatabaseConfig { fn default() -> Self { Self { orphan_storage_capacity: BLOCKCHAIN_DATABASE_ORPHAN_STORAGE_CAPACITY, } } } #[derive(Clone, Debug, PartialEq, Display)] pub enum BlockAddResult { Ok, BlockExists, OrphanBlock, ChainReorg((Box<Vec<Block>>, Box<Vec<Block>>)), // Set of removed blocks and set of added blocks } /// MutableMmrState provides the total number of leaf nodes in the base MMR and the requested leaf nodes. #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct MutableMmrState { pub total_leaf_count: usize, pub leaf_nodes: MutableMmrLeafNodes, } /// A placeholder struct that contains the two validators that the database uses to decide whether or not a block is /// eligible to be added to the database. The `block` validator should perform a full consensus check. The `orphan` /// validator needs to check that the block is internally consistent, but can't know whether the PoW is sufficient, /// for example. /// The `GenesisBlockValidator` is used to check that the chain builds on the correct genesis block. /// The `ChainTipValidator` is used to check that the accounting balance and MMR states of the chain state is valid. pub struct Validators<B: BlockchainBackend> { block: Arc<Validator<Block, B>>, orphan: Arc<StatelessValidator<Block>>, accum_difficulty: Arc<Validator<Difficulty, B>>, } impl<B: BlockchainBackend> Validators<B> { pub fn new( block: impl Validation<Block, B> + 'static, orphan: impl StatelessValidation<Block> + 'static, accum_difficulty: impl Validation<Difficulty, B> + 'static, ) -> Self { Self { block: Arc::new(Box::new(block)), orphan: Arc::new(Box::new(orphan)), accum_difficulty: Arc::new(Box::new(accum_difficulty)), } } } impl<B: BlockchainBackend> Clone for Validators<B> { fn clone(&self) -> Self { Validators { block: Arc::clone(&self.block), orphan: Arc::clone(&self.orphan), accum_difficulty: Arc::clone(&self.accum_difficulty), } } } /// Identify behaviour for Blockchain database back ends. Implementations must support `Send` and `Sync` so that /// `BlockchainDatabase` can be thread-safe. The backend *must* also execute transactions atomically; i.e., every /// operation within it must succeed, or they all fail. Failure to support this contract could lead to /// synchronisation issues in your database backend. /// /// Data is passed to and from the backend via the [DbKey], [DbValue], and [DbValueKey] enums. This strategy allows /// us to keep the reading and writing API extremely simple. Extending the types of data that the back ends can handle /// will entail adding to those enums, and the back ends, while this trait can remain unchanged. pub trait BlockchainBackend: Send + Sync { /// Commit the transaction given to the backend. If there is an error, the transaction must be rolled back, and /// the error condition returned. On success, every operation in the transaction will have been committed, and /// the function will return `Ok(())`. fn write(&mut self, tx: DbTransaction) -> Result<(), ChainStorageError>; /// Fetch a value from the back end corresponding to the given key. If the value is not found, `get` must return /// `Ok(None)`. It should only error if there is an access or integrity issue with the underlying back end. fn fetch(&self, key: &DbKey) -> Result<Option<DbValue>, ChainStorageError>; /// Checks to see whether the given key exists in the back end. This function should only fail if there is an /// access or integrity issue with the back end. fn contains(&self, key: &DbKey) -> Result<bool, ChainStorageError>; /// Fetches the merklish root for the MMR tree identified by the key. This function should only fail if there is an /// access or integrity issue with the back end. fn fetch_mmr_root(&self, tree: MmrTree) -> Result<HashOutput, ChainStorageError>; /// Returns only the MMR merkle root without the state of the roaring bitmap. fn fetch_mmr_only_root(&self, tree: MmrTree) -> Result<HashOutput, ChainStorageError>; /// Fetches the merklish root for the MMR tree identified by the key after the current additions and deletions have /// temporarily been applied. Deletions of hashes from the MMR can only be applied for UTXOs. fn calculate_mmr_root( &self, tree: MmrTree, additions: Vec<HashOutput>, deletions: Vec<HashOutput>, ) -> Result<HashOutput, ChainStorageError>; /// Constructs a merkle proof for the specified merkle mountain range and the given leaf position. fn fetch_mmr_proof(&self, tree: MmrTree, pos: usize) -> Result<MerkleProof, ChainStorageError>; /// Fetches the checkpoint corresponding to the provided height, the checkpoint consist of the list of nodes /// added & deleted for the given Merkle tree. fn fetch_checkpoint(&self, tree: MmrTree, height: u64) -> Result<MerkleCheckPoint, ChainStorageError>; /// Fetches the leaf node hash and its deletion status for the nth leaf node in the given MMR tree. fn fetch_mmr_node(&self, tree: MmrTree, pos: u32) -> Result<(Hash, bool), ChainStorageError>; /// Performs the function F for each orphan block in the orphan pool. fn for_each_orphan<F>(&self, f: F) -> Result<(), ChainStorageError> where Self: Sized, F: FnMut(Result<(HashOutput, Block), ChainStorageError>); /// Returns the number of blocks in the block orphan pool. fn get_orphan_count(&self) -> Result<usize, ChainStorageError>; /// Performs the function F for each transaction kernel. fn for_each_kernel<F>(&self, f: F) -> Result<(), ChainStorageError> where Self: Sized, F: FnMut(Result<(HashOutput, TransactionKernel), ChainStorageError>); /// Performs the function F for each block header. fn for_each_header<F>(&self, f: F) -> Result<(), ChainStorageError> where Self: Sized, F: FnMut(Result<(u64, BlockHeader), ChainStorageError>); /// Performs the function F for each UTXO. fn for_each_utxo<F>(&self, f: F) -> Result<(), ChainStorageError> where Self: Sized, F: FnMut(Result<(HashOutput, TransactionOutput), ChainStorageError>); /// Returns the stored header with the highest corresponding height. fn fetch_last_header(&self) -> Result<Option<BlockHeader>, ChainStorageError>; /// Returns the stored chain metadata. fn fetch_metadata(&self) -> Result<ChainMetadata, ChainStorageError>; /// Returns the set of target difficulties for the specified proof of work algorithm. fn fetch_target_difficulties( &self, pow_algo: PowAlgorithm, height: u64, block_window: usize, ) -> Result<Vec<(EpochTime, Difficulty)>, ChainStorageError>; } // Private macro that pulls out all the boiler plate of extracting a DB query result from its variants macro_rules! fetch { ($db:ident, $key_val:expr, $key_var:ident) => {{ let key = DbKey::$key_var($key_val); match $db.fetch(&key) { Ok(None) => Err(ChainStorageError::ValueNotFound(key)), Ok(Some(DbValue::$key_var(k))) => Ok(*k), Ok(Some(other)) => unexpected_result(key, other), Err(e) => log_error(key, e), } }}; } /// A generic blockchain storage mechanism. This struct defines the API for storing and retrieving Tari blockchain /// components without being opinionated about the actual backend used. /// /// `BlockChainDatabase` is thread-safe, since the backend must implement `Sync` and `Send`. /// /// You typically don't interact with `BlockChainDatabase` directly, since it doesn't enforce any consensus rules; it /// only really stores and fetches blockchain components. To create an instance of `BlockchainDatabase', you must /// provide it with the backend it is going to use; for example, for a memory-backed DB: /// /// ``` /// use tari_core::{ /// chain_storage::{BlockchainDatabase, BlockchainDatabaseConfig, MemoryDatabase, Validators}, /// consensus::{ConsensusManagerBuilder, Network}, /// transactions::types::HashDigest, /// validation::{accum_difficulty_validators::AccumDifficultyValidator, mocks::MockValidator, Validation}, /// }; /// let db_backend = MemoryDatabase::<HashDigest>::default(); /// let validators = Validators::new( /// MockValidator::new(true), /// MockValidator::new(true), /// AccumDifficultyValidator {}, /// ); /// let db = MemoryDatabase::<HashDigest>::default(); /// let network = Network::LocalNet; /// let rules = ConsensusManagerBuilder::new(network).build(); /// let db = BlockchainDatabase::new(db_backend, &rules, validators, BlockchainDatabaseConfig::default()).unwrap(); /// // Do stuff with db /// ``` pub struct BlockchainDatabase<T> where T: BlockchainBackend { db: Arc<RwLock<T>>, validators: Validators<T>, config: BlockchainDatabaseConfig, } impl<T> BlockchainDatabase<T> where T: BlockchainBackend { /// Creates a new `BlockchainDatabase` using the provided backend. pub fn new( db: T, consensus_manager: &ConsensusManager, validators: Validators<T>, config: BlockchainDatabaseConfig, ) -> Result<Self, ChainStorageError> { let blockchain_db = BlockchainDatabase { db: Arc::new(RwLock::new(db)), validators, config, }; if blockchain_db.get_height()?.is_none() { let genesis_block = consensus_manager.get_genesis_block(); blockchain_db.store_new_block(genesis_block)?; } Ok(blockchain_db) } // Be careful about making this method public. Rather use `db_and_metadata_read_access` // so that metadata and db are read in the correct order so that deadlocks don't occur pub fn db_read_access(&self) -> Result<RwLockReadGuard<T>, ChainStorageError> { self.db.read().map_err(|e| { error!( target: LOG_TARGET, "An attempt to get a read lock on the blockchain backend failed. {:?}", e ); ChainStorageError::AccessError("Read lock on blockchain backend failed".into()) }) } pub fn db_write_access(&self) -> Result<RwLockWriteGuard<T>, ChainStorageError> { self.db.write().map_err(|e| { error!( target: LOG_TARGET, "An attempt to get a write lock on the blockchain backend failed. {:?}", e ); ChainStorageError::AccessError("Write lock on blockchain backend failed".into()) }) } /// Returns the height of the current longest chain. This method will only fail if there's a fairly serious /// synchronisation problem on the database. You can try calling [BlockchainDatabase::try_recover_metadata] in /// that case to re-sync the metadata; or else just exit the program. /// /// If the chain is empty (the genesis block hasn't been added yet), this function returns `None` pub fn get_height(&self) -> Result<Option<u64>, ChainStorageError> { let db = self.db_read_access()?; Ok(db.fetch_metadata()?.height_of_longest_chain) } /// Return the geometric mean of the proof of work of the longest chain. /// The proof of work is returned as the geometric mean of all difficulties pub fn get_accumulated_difficulty(&self) -> Result<Option<Difficulty>, ChainStorageError> { let db = self.db_read_access()?; Ok(db.fetch_metadata()?.accumulated_difficulty) } /// Returns a copy of the current blockchain database metadata pub fn get_metadata(&self) -> Result<ChainMetadata, ChainStorageError> { let db = self.db_read_access()?; Ok(db.fetch_metadata()?.clone()) } /// Returns the transaction kernel with the given hash. pub fn fetch_kernel(&self, hash: HashOutput) -> Result<TransactionKernel, ChainStorageError> { let db = self.db_read_access()?; fetch_kernel(&*db, hash) } /// Returns the block header at the given block height. pub fn fetch_header(&self, block_num: u64) -> Result<BlockHeader, ChainStorageError> { let db = self.db_read_access()?; fetch_header(&*db, block_num) } /// Returns the set of block headers specified by the block numbers. pub fn fetch_headers(&self, block_nums: Vec<u64>) -> Result<Vec<BlockHeader>, ChainStorageError> { let db = self.db_read_access()?; fetch_headers(&*db, block_nums) } /// Returns the block header corresponding` to the provided BlockHash pub fn fetch_header_with_block_hash(&self, hash: HashOutput) -> Result<BlockHeader, ChainStorageError> { let db = self.db_read_access()?; fetch_header_with_block_hash(&*db, hash) } pub fn fetch_tip_header(&self) -> Result<BlockHeader, ChainStorageError> { let db = self.db_read_access()?; fetch_tip_header(&*db) } /// Returns the UTXO with the given hash. pub fn fetch_utxo(&self, hash: HashOutput) -> Result<TransactionOutput, ChainStorageError> { let db = self.db_read_access()?; fetch_utxo(&*db, hash) } /// Returns the STXO with the given hash. pub fn fetch_stxo(&self, hash: HashOutput) -> Result<TransactionOutput, ChainStorageError> { let db = self.db_read_access()?; fetch_stxo(&*db, hash) } /// Returns the STXO with the given hash. pub fn is_stxo(&self, hash: HashOutput) -> Result<bool, ChainStorageError> { let db = self.db_read_access()?; is_stxo(&*db, hash) } /// Returns the orphan block with the given hash. pub fn fetch_orphan(&self, hash: HashOutput) -> Result<Block, ChainStorageError> { let db = self.db_read_access()?; fetch_orphan(&*db, hash) } /// Returns the set of target difficulties for the specified proof of work algorithm. pub fn fetch_target_difficulties( &self, pow_algo: PowAlgorithm, height: u64, block_window: usize, ) -> Result<Vec<(EpochTime, Difficulty)>, ChainStorageError> { let db = self.db_read_access()?; fetch_target_difficulties(&*db, pow_algo, height, block_window) } /// Returns true if the given UTXO, represented by its hash exists in the UTXO set. pub fn is_utxo(&self, hash: HashOutput) -> Result<bool, ChainStorageError> { let db = self.db_read_access()?; is_utxo(&*db, hash) } /// Calculate the Merklish root of the specified merkle mountain range. pub fn fetch_mmr_root(&self, tree: MmrTree) -> Result<HashOutput, ChainStorageError> { let db = self.db_read_access()?; fetch_mmr_root(&*db, tree) } /// Returns only the MMR merkle root without the state of the roaring bitmap. pub fn fetch_mmr_only_root(&self, tree: MmrTree) -> Result<HashOutput, ChainStorageError> { let db = self.db_read_access()?; fetch_mmr_only_root(&*db, tree) } /// Apply the current change set to a pruned copy of the merkle mountain range and calculate the resulting Merklish /// root of the specified merkle mountain range. Deletions of hashes from the MMR can only be applied for UTXOs. pub fn calculate_mmr_root( &self, tree: MmrTree, additions: Vec<HashOutput>, deletions: Vec<HashOutput>, ) -> Result<HashOutput, ChainStorageError> { let db = self.db_read_access()?; db.calculate_mmr_root(tree, additions, deletions) } /// `calculate_mmr_roots` takes a block template and calculates the MMR roots for a hypothetical new block that /// would be built onto the chain tip. Note that _no checks_ are made to determine whether the template would /// actually be a valid extension to the chain; only the new MMR roots are calculated pub fn calculate_mmr_roots(&self, template: NewBlockTemplate) -> Result<Block, ChainStorageError> { let db = self.db_read_access()?; calculate_mmr_roots(&*db, template) } /// Fetch a Merklish proof for the given hash, tree and position in the MMR pub fn fetch_mmr_proof(&self, tree: MmrTree, pos: usize) -> Result<MerkleProof, ChainStorageError> { let db = self.db_read_access()?; fetch_mmr_proof(&*db, tree, pos) } /// Tries to add a block to the longest chain. /// /// The block is added to the longest chain if and only if /// * Block block is not already in the database, AND /// * The block is next in the chain, AND /// * The Validator passes /// * There are no problems with the database backend (e.g. disk full) /// /// If the block is _not_ next in the chain, the block will be added to the orphan pool if the orphan validator /// passes, and then the database is checked for whether there has been a chain re-organisation. /// /// # Returns /// /// An error is returned if /// * there was a problem accessing the database, /// * the validation fails /// /// Otherwise the function returns successfully. /// A successful return value can be one of /// * `BlockExists`: the block has already been added; No action was taken. /// * `Ok`: The block was added and all validation checks passed /// * `OrphanBlock`: The block did not form part of the main chain and was added as an orphan. /// * `ChainReorg`: The block was added, which resulted in a chain-reorg. /// /// If an error does occur while writing the new block parts, all changes are reverted before returning. pub fn add_block(&self, block: Block) -> Result<BlockAddResult, ChainStorageError> { // Perform orphan block validation. self.validators.orphan.validate(&block)?; let mut db = self.db_write_access()?; add_block( &mut db, &self.validators.block, &self.validators.accum_difficulty, block, self.config.orphan_storage_capacity, ) } fn store_new_block(&self, block: Block) -> Result<(), ChainStorageError> { let mut db = self.db_write_access()?; store_new_block(&mut db, block) } /// Fetch a block from the blockchain database. /// /// # Returns /// This function returns an [HistoricalBlock] instance, which can be converted into a standard [Block], but also /// contains some additional information given its retrospective perspective that will be of interest to block /// explorers. For example, we know whether the outputs of this block have subsequently been spent or not and how /// many blocks have been mined on top of this block. /// /// `fetch_block` can return a `ChainStorageError` in the following cases: /// * There is an access problem on the back end. /// * The height is beyond the current chain tip. /// * The height is lower than the block at the pruning horizon. pub fn fetch_block(&self, height: u64) -> Result<HistoricalBlock, ChainStorageError> { let db = self.db_read_access()?; fetch_block(&*db, height) } /// Attempt to fetch the block corresponding to the provided hash from the main chain, if it cannot be found then /// the block will be searched in the orphan block pool. pub fn fetch_block_with_hash(&self, hash: HashOutput) -> Result<Option<HistoricalBlock>, ChainStorageError> { let db = self.db_read_access()?; fetch_block_with_hash(&*db, hash) } /// Atomically commit the provided transaction to the database backend. This function does not update the metadata. pub fn commit(&self, txn: DbTransaction) -> Result<(), ChainStorageError> { let mut db = self.db_write_access()?; commit(&mut db, txn) } /// Rewind the blockchain state to the block height given and return the blocks that were removed and orphaned. /// /// The operation will fail if /// * The block height is in the future /// * The block height is before pruning horizon pub fn rewind_to_height(&self, height: u64) -> Result<Vec<Block>, ChainStorageError> { let mut db = self.db_write_access()?; rewind_to_height(&mut db, height) } } fn unexpected_result<T>(req: DbKey, res: DbValue) -> Result<T, ChainStorageError> { let msg = format!("Unexpected result for database query {}. Response: {}", req, res); error!(target: LOG_TARGET, "{}", msg); Err(ChainStorageError::UnexpectedResult(msg)) } fn fetch_kernel<T: BlockchainBackend>(db: &T, hash: HashOutput) -> Result<TransactionKernel, ChainStorageError> { fetch!(db, hash, TransactionKernel) } pub fn fetch_header<T: BlockchainBackend>(db: &T, block_num: u64) -> Result<BlockHeader, ChainStorageError> { fetch!(db, block_num, BlockHeader) } pub fn fetch_headers<T: BlockchainBackend>( db: &T, block_nums: Vec<u64>, ) -> Result<Vec<BlockHeader>, ChainStorageError> { let mut headers = Vec::<BlockHeader>::with_capacity(block_nums.len()); for block_num in block_nums { headers.push(fetch_header(db, block_num)?); } Ok(headers) } fn fetch_header_with_block_hash<T: BlockchainBackend>( db: &T, hash: HashOutput, ) -> Result<BlockHeader, ChainStorageError> { fetch!(db, hash, BlockHash) } fn fetch_tip_header<T: BlockchainBackend>(db: &T) -> Result<BlockHeader, ChainStorageError> { db.fetch_last_header() .or_else(|e| { error!(target: LOG_TARGET, "Could not fetch the tip header of the db. {:?}", e); Err(e) })? .ok_or_else(|| ChainStorageError::InvalidQuery("Cannot retrieve header. Blockchain DB is empty".into())) } fn fetch_utxo<T: BlockchainBackend>(db: &T, hash: HashOutput) -> Result<TransactionOutput, ChainStorageError> { fetch!(db, hash, UnspentOutput) } fn fetch_stxo<T: BlockchainBackend>(db: &T, hash: HashOutput) -> Result<TransactionOutput, ChainStorageError> { fetch!(db, hash, SpentOutput) } fn fetch_orphan<T: BlockchainBackend>(db: &T, hash: HashOutput) -> Result<Block, ChainStorageError> { fetch!(db, hash, OrphanBlock) } pub fn fetch_target_difficulties<T: BlockchainBackend>( db: &T, pow_algo: PowAlgorithm, height: u64, block_window: usize, ) -> Result<Vec<(EpochTime, Difficulty)>, ChainStorageError> { db.fetch_target_difficulties(pow_algo, height, block_window) } pub fn is_utxo<T: BlockchainBackend>(db: &T, hash: HashOutput) -> Result<bool, ChainStorageError> { let key = DbKey::UnspentOutput(hash); db.contains(&key) } pub fn is_stxo<T: BlockchainBackend>(db: &T, hash: HashOutput) -> Result<bool, ChainStorageError> { let key = DbKey::SpentOutput(hash); db.contains(&key) } fn fetch_mmr_root<T: BlockchainBackend>(db: &T, tree: MmrTree) -> Result<HashOutput, ChainStorageError> { db.fetch_mmr_root(tree) } fn fetch_mmr_only_root<T: BlockchainBackend>(db: &T, tree: MmrTree) -> Result<HashOutput, ChainStorageError> { db.fetch_mmr_only_root(tree) } pub fn calculate_mmr_roots<T: BlockchainBackend>( db: &T, template: NewBlockTemplate, ) -> Result<Block, ChainStorageError> { let NewBlockTemplate { header, mut body } = template; // Make sure the body components are sorted. If they already are, this is a very cheap call. body.sort(); let kernel_hashes: Vec<HashOutput> = body.kernels().iter().map(|k| k.hash()).collect(); let out_hashes: Vec<HashOutput> = body.outputs().iter().map(|out| out.hash()).collect(); let rp_hashes: Vec<HashOutput> = body.outputs().iter().map(|out| out.proof().hash()).collect(); let inp_hashes: Vec<HashOutput> = body.inputs().iter().map(|inp| inp.hash()).collect(); let mut header = BlockHeader::from(header); header.kernel_mr = db.calculate_mmr_root(MmrTree::Kernel, kernel_hashes, vec![])?; header.output_mr = db.calculate_mmr_root(MmrTree::Utxo, out_hashes, inp_hashes)?; header.range_proof_mr = db.calculate_mmr_root(MmrTree::RangeProof, rp_hashes, vec![])?; Ok(Block { header, body }) } /// Fetch a Merklish proof for the given hash, tree and position in the MMR fn fetch_mmr_proof<T: BlockchainBackend>(db: &T, tree: MmrTree, pos: usize) -> Result<MerkleProof, ChainStorageError> { db.fetch_mmr_proof(tree, pos) } fn add_block<T: BlockchainBackend>( db: &mut RwLockWriteGuard<T>, block_validator: &Arc<Validator<Block, T>>, accum_difficulty_validator: &Arc<Validator<Difficulty, T>>, block: Block, orphan_storage_capacity: usize, ) -> Result<BlockAddResult, ChainStorageError> { let block_hash = block.hash(); if db.contains(&DbKey::BlockHash(block_hash))? { return Ok(BlockAddResult::BlockExists); } let block_add_result = handle_possible_reorg(db, block_validator, accum_difficulty_validator, block)?; // Cleanup orphan block pool match block_add_result { BlockAddResult::Ok => {}, BlockAddResult::BlockExists => {}, BlockAddResult::OrphanBlock => cleanup_orphans_single(db, orphan_storage_capacity)?, BlockAddResult::ChainReorg(_) => cleanup_orphans_comprehensive(db, orphan_storage_capacity)?, } Ok(block_add_result) } // Adds a new block onto the chain tip. fn store_new_block<T: BlockchainBackend>(db: &mut RwLockWriteGuard<T>, block: Block) -> Result<(), ChainStorageError> { let (header, inputs, outputs, kernels) = block.dissolve(); let height = header.height; let best_block = header.hash(); let accumulated_difficulty = ProofOfWork::new_from_difficulty(&header.pow, ProofOfWork::achieved_difficulty(&header)) .total_accumulated_difficulty(); // Build all the DB queries needed to add the block and the add it atomically let mut txn = DbTransaction::new(); // Update metadata txn.insert(DbKeyValuePair::Metadata( MetadataKey::ChainHeight, MetadataValue::ChainHeight(Some(height)), )); txn.insert(DbKeyValuePair::Metadata( MetadataKey::BestBlock, MetadataValue::BestBlock(Some(best_block.clone())), )); txn.insert(DbKeyValuePair::Metadata( MetadataKey::AccumulatedWork, MetadataValue::AccumulatedWork(Some(accumulated_difficulty)), )); // Insert block txn.insert_header(header); txn.spend_inputs(&inputs); outputs.iter().for_each(|utxo| txn.insert_utxo(utxo.clone(), true)); kernels.iter().for_each(|k| txn.insert_kernel(k.clone(), true)); txn.commit_block(); commit(db, txn)?; Ok(()) } fn fetch_block<T: BlockchainBackend>(db: &T, height: u64) -> Result<HistoricalBlock, ChainStorageError> { let tip_height = check_for_valid_height(&*db, height)?; let header = fetch_header(db, height)?; let kernel_cp = fetch_checkpoint(db, MmrTree::Kernel, height)?; let (kernel_hashes, _) = kernel_cp.into_parts(); let kernels = fetch_kernels(db, kernel_hashes)?; let utxo_cp = fetch_checkpoint(db, MmrTree::Utxo, height)?; let (utxo_hashes, deleted_nodes) = utxo_cp.into_parts(); let inputs = fetch_inputs(db, deleted_nodes)?; let (outputs, spent) = fetch_outputs(db, utxo_hashes)?; let block = header .into_builder() .add_inputs(inputs) .add_outputs(outputs) .add_kernels(kernels) .build(); Ok(HistoricalBlock::new(block, tip_height - height + 1, spent)) } fn fetch_block_with_hash<T: BlockchainBackend>( db: &T, hash: HashOutput, ) -> Result<Option<HistoricalBlock>, ChainStorageError> { if let Ok(header) = fetch_header_with_block_hash(db, hash.clone()) { return Ok(Some(fetch_block(db, header.height)?)); } if let Ok(block) = fetch_orphan(db, hash) { return Ok(Some(HistoricalBlock::new(block, 0, vec![]))); } Ok(None) } fn check_for_valid_height<T: BlockchainBackend>(db: &T, height: u64) -> Result<u64, ChainStorageError> { let db_height = db.fetch_metadata()?.height_of_longest_chain.unwrap_or(0); if height > db_height { return Err(ChainStorageError::InvalidQuery(format!( "Cannot get block at height {}. Chain tip is at {}", height, db_height ))); } Ok(db_height) } fn fetch_kernels<T: BlockchainBackend>(db: &T, hashes: Vec<Hash>) -> Result<Vec<TransactionKernel>, ChainStorageError> { hashes.into_iter().map(|hash| fetch_kernel(db, hash)).collect() } fn fetch_inputs<T: BlockchainBackend>( db: &T, deleted_nodes: Bitmap, ) -> Result<Vec<TransactionInput>, ChainStorageError> { // The inputs must all be in the current STXO set let inputs: Result<Vec<TransactionInput>, ChainStorageError> = deleted_nodes .iter() .map(|pos| { db.fetch_mmr_node(MmrTree::Utxo, pos) .and_then(|(hash, deleted)| { assert!(deleted); fetch_stxo(db, hash) }) .and_then(|stxo| Ok(TransactionInput::from(stxo))) }) .collect(); inputs } fn fetch_outputs<T: BlockchainBackend>( db: &T, hashes: Vec<Hash>, ) -> Result<(Vec<TransactionOutput>, Vec<Commitment>), ChainStorageError> { let mut outputs = Vec::with_capacity(hashes.len()); let mut spent = Vec::with_capacity(hashes.len()); for hash in hashes.into_iter() { // The outputs could come from either the UTXO or STXO set match fetch_utxo(db, hash.clone()) { Ok(utxo) => { outputs.push(utxo); continue; }, Err(ChainStorageError::ValueNotFound(_)) => {}, // Check STXO set below Err(e) => return Err(e), // Something bad happened. Abort. } // Check the STXO set let stxo = fetch_stxo(db, hash)?; spent.push(stxo.commitment.clone()); outputs.push(stxo); } Ok((outputs, spent)) } fn fetch_checkpoint<T: BlockchainBackend>( db: &T, tree: MmrTree, height: u64, ) -> Result<MerkleCheckPoint, ChainStorageError> { db.fetch_checkpoint(tree, height) } pub fn commit<T: BlockchainBackend>(db: &mut RwLockWriteGuard<T>, txn: DbTransaction) -> Result<(), ChainStorageError> { db.write(txn) } fn rewind_to_height<T: BlockchainBackend>( db: &mut RwLockWriteGuard<T>, height: u64, ) -> Result<Vec<Block>, ChainStorageError> { let chain_height = check_for_valid_height(&**db, height)?; let mut removed_blocks = Vec::<Block>::new(); if height == chain_height { return Ok(removed_blocks); // Rewind unnecessary, already on correct height } let steps_back = (chain_height - height) as usize; let mut txn = DbTransaction::new(); // Rewind operation must be performed in reverse from tip to height+1. for rewind_height in ((height + 1)..=chain_height).rev() { // Reconstruct block at height and add to orphan block pool let orphaned_block = fetch_block(&**db, rewind_height)?.block().clone(); removed_blocks.push(orphaned_block.clone()); txn.insert_orphan(orphaned_block); // Remove Header and block hash txn.delete(DbKey::BlockHeader(rewind_height)); // Will also delete the blockhash // Remove Kernels fetch_checkpoint(&**db, MmrTree::Kernel, rewind_height)? .nodes_added() .iter() .for_each(|hash_output| { txn.delete(DbKey::TransactionKernel(hash_output.clone())); }); // Remove UTXOs and move STXOs back to UTXO set let (nodes_added, nodes_deleted) = fetch_checkpoint(&**db, MmrTree::Utxo, rewind_height)?.into_parts(); nodes_added.iter().for_each(|hash_output| { txn.delete(DbKey::UnspentOutput(hash_output.clone())); }); for pos in nodes_deleted.iter() { db.fetch_mmr_node(MmrTree::Utxo, pos).and_then(|(stxo_hash, deleted)| { assert!(deleted); txn.unspend_stxo(stxo_hash); Ok(()) })?; } } // Rewind MMRs txn.rewind_kernel_mmr(steps_back); txn.rewind_utxo_mmr(steps_back); txn.rewind_rp_mmr(steps_back); // Update metadata let last_header = fetch_header(&**db, height)?; let accumulated_work = ProofOfWork::new_from_difficulty(&last_header.pow, ProofOfWork::achieved_difficulty(&last_header)) .total_accumulated_difficulty(); txn.insert(DbKeyValuePair::Metadata( MetadataKey::ChainHeight, MetadataValue::ChainHeight(Some(last_header.height)), )); txn.insert(DbKeyValuePair::Metadata( MetadataKey::BestBlock, MetadataValue::BestBlock(Some(last_header.hash())), )); txn.insert(DbKeyValuePair::Metadata( MetadataKey::AccumulatedWork, MetadataValue::AccumulatedWork(Some(accumulated_work)), )); commit(db, txn)?; Ok(removed_blocks) } // Checks whether we should add the block as an orphan. If it is the case, the orphan block is added and the chain // is reorganised if necessary. fn handle_possible_reorg<T: BlockchainBackend>( db: &mut RwLockWriteGuard<T>, block_validator: &Arc<Validator<Block, T>>, accum_difficulty_validator: &Arc<Validator<Difficulty, T>>, block: Block, ) -> Result<BlockAddResult, ChainStorageError> { let db_height = db .fetch_metadata()? .height_of_longest_chain .ok_or_else(|| ChainStorageError::InvalidQuery("Cannot retrieve block. Blockchain DB is empty".into())) .or_else(|e| { error!( target: LOG_TARGET, "Could not retrieve block, block chain is empty {:?}", e ); Err(e) })?; insert_orphan(db, block.clone())?; info!( target: LOG_TARGET, "Added new orphan block to the database. Current best height is {}. Orphan block height is {}", db_height, block.header.height ); trace!(target: LOG_TARGET, "{}", block); // Trigger a reorg check for all blocks in the orphan block pool debug!(target: LOG_TARGET, "Checking for chain re-org."); handle_reorg(db, block_validator, accum_difficulty_validator, block) } // The handle_reorg function is triggered by the adding of orphaned blocks. Reorg chains are constructed by // finding the orphan chain tip with the highest accumulated difficulty that can be linked to the newly added // orphan block and then building a chain from the strongest orphan tip back to the main chain. The newly added // orphan block is considered to be a orphan tip if no better tips can be found that link to it. When a valid // reorg chain is constructed with a higher accumulated difficulty, then the main chain is rewound and updated // with the newly un-orphaned blocks from the reorg chain. fn handle_reorg<T: BlockchainBackend>( db: &mut RwLockWriteGuard<T>, block_validator: &Arc<Validator<Block, T>>, accum_difficulty_validator: &Arc<Validator<Difficulty, T>>, new_block: Block, ) -> Result<BlockAddResult, ChainStorageError> { // We can assume that the new block is part of the re-org chain if it exists, otherwise the re-org would have // happened on the previous call to this function. // Try and construct a path from `new_block` to the main chain: let mut reorg_chain = try_construct_fork(db, new_block.clone())?; if reorg_chain.is_empty() { trace!( target: LOG_TARGET, "Could not find complete chain to orphan. No need to reorg at this time" ); return Ok(BlockAddResult::OrphanBlock); } // Try and find all orphaned chain tips that can be linked to the new orphan block, if no better orphan chain // tips can be found then the new_block is a tip. let new_block_hash = new_block.hash(); let orphan_chain_tips = find_orphan_chain_tips(&**db, new_block.header.height, new_block_hash.clone()); // Check the accumulated difficulty of the best fork chain compared to the main chain. let (fork_accum_difficulty, fork_tip_hash) = find_strongest_orphan_tip(&**db, orphan_chain_tips)?; let tip_header = db .fetch_last_header()? .ok_or_else(|| ChainStorageError::InvalidQuery("Cannot retrieve header. Blockchain DB is empty".into()))?; trace!( target: LOG_TARGET, "Comparing fork diff: ({}) with hash ({}) to main chain diff: ({}) with hash ({}) for possible reorg", fork_accum_difficulty, fork_tip_hash.to_hex(), tip_header.total_accumulated_difficulty_inclusive(), tip_header.hash().to_hex() ); if accum_difficulty_validator.validate(&fork_accum_difficulty, db).is_ok() { // We've built the strongest orphan chain we can by going backwards and forwards from the new orphan block // that is linked with the main chain. let fork_tip_block = fetch_orphan(&**db, fork_tip_hash.clone())?; let fork_tip_header = fork_tip_block.header.clone(); if fork_tip_hash != new_block_hash { // New block is not the tip, find complete chain from tip to main chain. reorg_chain = try_construct_fork(db, fork_tip_block)?; } let added_blocks: Vec<Block> = reorg_chain.iter().map(Clone::clone).collect(); let fork_height = reorg_chain .front() .expect("The new orphan block should be in the queue") .header .height - 1; let removed_blocks = reorganize_chain(db, block_validator, fork_height, reorg_chain)?; if removed_blocks.is_empty() { return Ok(BlockAddResult::Ok); } else { warn!( target: LOG_TARGET, "Chain reorg happened from difficulty: ({}) to difficulty: ({})", tip_header.pow, fork_tip_header.pow ); debug!( target: LOG_TARGET, "Reorg from ({}) to ({})", tip_header, fork_tip_header ); return Ok(BlockAddResult::ChainReorg(( Box::new(removed_blocks), Box::new(added_blocks), ))); } } debug!(target: LOG_TARGET, "Orphan block received: {}", new_block); Ok(BlockAddResult::OrphanBlock) } // Reorganize the main chain with the provided fork chain, starting at the specified height. fn reorganize_chain<T: BlockchainBackend>( db: &mut RwLockWriteGuard<T>, block_validator: &Arc<Validator<Block, T>>, height: u64, chain: VecDeque<Block>, ) -> Result<Vec<Block>, ChainStorageError> { let removed_blocks = rewind_to_height(db, height)?; trace!(target: LOG_TARGET, "Validate and add chain blocks.",); let mut validation_result: Result<(), ValidationError> = Ok(()); let mut orphan_hashes = Vec::<BlockHash>::with_capacity(chain.len()); for block in chain { let block_hash = block.hash(); orphan_hashes.push(block_hash.clone()); validation_result = block_validator.validate(&block, db); if validation_result.is_err() { debug!( target: LOG_TARGET, "Orphan block {} failed validation during chain reorganization", block_hash.to_hex(), ); remove_orphan(db, block.hash())?; break; } store_new_block(db, block)?; } match validation_result { Ok(_) => { trace!(target: LOG_TARGET, "Removing reorged orphan blocks.",); if !orphan_hashes.is_empty() { let mut txn = DbTransaction::new(); for orphan_hash in orphan_hashes { txn.delete(DbKey::OrphanBlock(orphan_hash)); } commit(db, txn)?; } Ok(removed_blocks) }, Err(e) => { trace!(target: LOG_TARGET, "Restoring previous chain after failed reorg.",); let invalid_chain = rewind_to_height(db, height)?; debug!( target: LOG_TARGET, "Removed incomplete chain of blocks during chain restore: {:?}.", invalid_chain .iter() .map(|block| block.hash().to_hex()) .collect::<Vec<_>>(), ); let mut txn = DbTransaction::new(); for block in removed_blocks { txn.delete(DbKey::OrphanBlock(block.hash())); store_new_block(db, block)?; } commit(db, txn)?; Err(e.into()) }, } } // Insert the provided block into the orphan pool. fn insert_orphan<T: BlockchainBackend>(db: &mut RwLockWriteGuard<T>, block: Block) -> Result<(), ChainStorageError> { let mut txn = DbTransaction::new(); txn.insert_orphan(block); commit(db, txn) } // Discard the the orphan block from the orphan pool that corresponds to the provided block hash. fn remove_orphan<T: BlockchainBackend>( db: &mut RwLockWriteGuard<T>, hash: HashOutput, ) -> Result<(), ChainStorageError> { let mut txn = DbTransaction::new(); txn.delete(DbKey::OrphanBlock(hash)); commit(db, txn) } /// We try and build a chain from this block to the main chain. If we can't do that we can stop. /// We start with the current, newly received block, and look for a blockchain sequence (via `prev_hash`). /// Each successful link is pushed to the front of the queue. An empty queue is returned if the fork chain did not /// link to the main chain. fn try_construct_fork<T: BlockchainBackend>( db: &mut RwLockWriteGuard<T>, new_block: Block, ) -> Result<VecDeque<Block>, ChainStorageError> { let mut fork_chain = VecDeque::new(); let mut hash = new_block.header.prev_hash.clone(); let mut height = new_block.header.height; fork_chain.push_front(new_block); loop { let fork_start_header = fork_chain .front() .expect("The new orphan block should be in the queue") .header .clone(); trace!( target: LOG_TARGET, "Checking if block {} ({}) is connected to the main chain.", fork_start_header.height, fork_start_header.hash().to_hex(), ); if let Ok(header) = fetch_header_with_block_hash(&**db, fork_start_header.prev_hash) { if header.height + 1 == fork_start_header.height { trace!( target: LOG_TARGET, "Connection with main chain found at block {} ({}).", header.height, header.hash().to_hex(), ); return Ok(fork_chain); } } trace!( target: LOG_TARGET, "Not connected, checking if fork chain can be extended.", ); match fetch_orphan(&**db, hash.clone()) { Ok(prev_block) => { trace!( target: LOG_TARGET, "Checking if block {} ({}) forms a sequence with next block.", prev_block.header.height, hash.to_hex(), ); if prev_block.header.height + 1 != height { // Well now. The block heights don't form a sequence, which means that we should not only stop now, // but remove one or both of these orphans from the pool because the blockchain is broken at this // point. info!( target: LOG_TARGET, "A broken blockchain sequence was detected, removing block {} ({}).", prev_block.header.height, hash.to_hex() ); remove_orphan(db, hash)?; return Err(ChainStorageError::InvalidBlock); } trace!( target: LOG_TARGET, "Fork chain extended with block {} ({}).", prev_block.header.height, hash.to_hex(), ); hash = prev_block.header.prev_hash.clone(); height -= 1; fork_chain.push_front(prev_block); }, Err(ChainStorageError::ValueNotFound(_)) => { trace!( target: LOG_TARGET, "Fork chain extension not found and it isn't connected to the main chain.", ); break; }, Err(e) => return Err(e), } } Ok(VecDeque::new()) } /// Try to find all orphan chain tips that originate from the current orphan parent block. fn find_orphan_chain_tips<T: BlockchainBackend>(db: &T, parent_height: u64, parent_hash: BlockHash) -> Vec<BlockHash> { let mut tip_hashes = Vec::<BlockHash>::new(); let mut parents = Vec::<(BlockHash, u64)>::new(); db.for_each_orphan(|pair| { let (_, block) = pair.unwrap(); if (block.header.prev_hash == parent_hash) && (block.header.height == parent_height + 1) { // we found a match, let save to call later parents.push((block.hash(), block.header.height)); } }) .expect("Unexpected result for database query"); // we need two for loops so that we ensure we release the db read lock as this iterative call can saturate all db // read locks. This ensures the call only uses one read lock. for (parent_hash, parent_height) in parents { let mut orphan_chain_tips = find_orphan_chain_tips(db, parent_height, parent_hash.clone()); if !orphan_chain_tips.is_empty() { tip_hashes.append(&mut orphan_chain_tips); } else { tip_hashes.push(parent_hash); } } if tip_hashes.is_empty() { // No chain tips found, then parent must be the tip. tip_hashes.push(parent_hash); } tip_hashes } /// Find and return the orphan chain tip with the highest accumulated difficulty. fn find_strongest_orphan_tip<T: BlockchainBackend>( db: &T, orphan_chain_tips: Vec<BlockHash>, ) -> Result<(Difficulty, BlockHash), ChainStorageError> { let mut best_accum_difficulty = Difficulty::min(); let mut best_tip_hash: Vec<u8> = vec![0; 32]; for tip_hash in orphan_chain_tips { let header = fetch_orphan(db, tip_hash.clone())?.header; let accum_difficulty = header.total_accumulated_difficulty_inclusive(); if accum_difficulty >= best_accum_difficulty { best_tip_hash = tip_hash; best_accum_difficulty = accum_difficulty; } } Ok((best_accum_difficulty, best_tip_hash)) } // Discards the orphan block with the minimum height from the block orphan pool to maintain the configured orphan pool // storage limit. fn cleanup_orphans_single<T: BlockchainBackend>( db: &mut RwLockWriteGuard<T>, orphan_storage_capacity: usize, ) -> Result<(), ChainStorageError> { if db.get_orphan_count()? > orphan_storage_capacity { trace!( target: LOG_TARGET, "Orphan block storage limit reached, performing simple cleanup.", ); let mut min_height: u64 = u64::max_value(); let mut remove_hash: Option<BlockHash> = None; db.for_each_orphan(|pair| { let (_, block) = pair.unwrap(); if block.header.height < min_height { min_height = block.header.height; remove_hash = Some(block.hash()); } }) .expect("Unexpected result for database query"); if let Some(hash) = remove_hash { trace!(target: LOG_TARGET, "Discarding orphan block ({}).", hash.to_hex()); remove_orphan(db, hash)?; } } Ok(()) } // Perform a comprehensive search to remove all the minimum height orphans to maintain the configured orphan pool // storage limit. fn cleanup_orphans_comprehensive<T: BlockchainBackend>( db: &mut RwLockWriteGuard<T>, orphan_storage_capacity: usize, ) -> Result<(), ChainStorageError> { let orphan_count = db.get_orphan_count()?; if orphan_count > orphan_storage_capacity { trace!( target: LOG_TARGET, "Orphan block storage limit reached, performing comprehensive cleanup.", ); let remove_count = orphan_count - orphan_storage_capacity; let mut orphans = Vec::<(u64, BlockHash)>::with_capacity(orphan_count); db.for_each_orphan(|pair| { let (_, block) = pair.unwrap(); orphans.push((block.header.height, block.hash())); }) .expect("Unexpected result for database query"); orphans.sort_by(|a, b| a.0.cmp(&b.0)); let mut txn = DbTransaction::new(); for i in 0..remove_count { trace!( target: LOG_TARGET, "Discarding orphan block ({}).", orphans[i].1.to_hex() ); txn.delete(DbKey::OrphanBlock(orphans[i].1.clone())); } commit(db, txn)?; } Ok(()) } fn log_error<T>(req: DbKey, err: ChainStorageError) -> Result<T, ChainStorageError> { error!( target: LOG_TARGET, "Database access error on request: {}: {}", req, err.to_string() ); Err(err) } impl<T> Clone for BlockchainDatabase<T> where T: BlockchainBackend { fn clone(&self) -> Self { BlockchainDatabase { db: self.db.clone(), validators: self.validators.clone(), config: self.config.clone(), } } }
use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct Error { pub code: usize, pub message: String, } impl std::fmt::Display for Error { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { write!(f, "{}", self.message) } } impl std::error::Error for Error { fn description(&self) -> &str { &self.message } }
use std::collections::HashMap; use std::hash::Hash; pub trait ToHashMap<T,K,V, FK, FV> where K:Hash, K:Eq, FK:Fn(&T)->K, FV:Fn(&T)->V { fn to_hash_map(self, key_func: FK, value_func: FV) -> HashMap<K, V>; } impl<T, K, V, FK, FV, I> ToHashMap<T, K, V, FK, FV> for I where K: Hash, K: Eq, FK: Fn(&T) -> K, FV: Fn(&T) -> V, I: IntoIterator<Item = T> { fn to_hash_map(self, key_func: FK, value_func: FV) -> HashMap<K, V> { let mut hm: HashMap<K, V> = HashMap::new(); for x in self { hm.insert(key_func(&x), value_func(&x)); } hm } }
pub mod imperative_base; pub mod javascript;
pub mod math; pub use math::WrenVec3; pub mod light; pub use light::*; use glam::vec3; use ruwren::{get_slot_checked, send_foreign, Class, VM}; pub struct Graphics; // todo properly raise runtime exception in foreign method impl Class for Graphics { fn initialize(_: &VM) -> Self { panic!("Graphics is a purely static class"); } } impl Graphics { // create a vector3 // accepts 3 numbers as params pub fn new_vec3(vm: &VM) { let x = get_slot_checked!(vm => num 1); let y = get_slot_checked!(vm => num 2); let z = get_slot_checked!(vm => num 3); let vec = WrenVec3(vec3(x as f32, y as f32, z as f32)); send_foreign!(vm, "graphics", "Vec3", vec => 0); } // create a point light in current scene // accepts 2 vec3 as params pub fn new_light(vm: &VM) { let position = *get_slot_checked!(vm => foreign WrenVec3 => 1); let color = *get_slot_checked!(vm => foreign WrenVec3 => 2); send_foreign!(vm, "graphics", "Light", Light { position, color } => 0); } // pub fn new_point_light(_vm: &VM) { // // get wgpu device // let lock = crate::application::GLOB.lock(); // let glob = lock.as_ref().unwrap(); // // println!("{:?}", glob) // } }
use oxygengine_composite_renderer::{component::CompositeTransform, math::Vec2}; use oxygengine_core::{ app::AppBuilder, ecs::{Component, Join, NullStorage, ReadStorage, System, Write, WriteStorage}, hierarchy::Parent, prefab::{Prefab, PrefabComponent, PrefabManager}, Ignite, }; use oxygengine_physics_2d::{component::RigidBody2d, resource::Physics2dWorld}; use serde::{Deserialize, Serialize}; pub mod prelude { pub use crate::*; } pub fn bundle_installer(builder: &mut AppBuilder, _: ()) { builder.install_system( ApplyPhysics2dToCompositeTransformSystem, "apply-physics-2d-to-composite-transform-renderer", &[], ); } #[derive(Ignite, Debug, Default, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Physics2dSyncCompositeTransform; impl Component for Physics2dSyncCompositeTransform { type Storage = NullStorage<Self>; } impl Prefab for Physics2dSyncCompositeTransform {} impl PrefabComponent for Physics2dSyncCompositeTransform {} #[derive(Debug, Default)] pub struct ApplyPhysics2dToCompositeTransformSystem; impl<'s> System<'s> for ApplyPhysics2dToCompositeTransformSystem { #[allow(clippy::type_complexity)] type SystemData = ( Option<Write<'s, Physics2dWorld>>, ReadStorage<'s, RigidBody2d>, WriteStorage<'s, CompositeTransform>, ReadStorage<'s, Parent>, ReadStorage<'s, Physics2dSyncCompositeTransform>, ); fn run(&mut self, (world, bodies, mut transforms, parents, syncs): Self::SystemData) { if world.is_none() { return; } let world: &mut Physics2dWorld = &mut world.unwrap(); for (body, transform, _, _) in (&bodies, &mut transforms, !&parents, &syncs).join() { if let Some(handle) = body.handle() { if let Some(body) = world.body(handle) { let isometry = body.position(); let p = isometry.translation; let r = isometry.rotation.angle(); let s = transform.get_scale(); transform.apply(Vec2::new(p.x, p.y), r, s); } } } } } pub fn prefabs_installer(prefabs: &mut PrefabManager) { prefabs.register_component_factory::<Physics2dSyncCompositeTransform>( "Physics2dSyncCompositeTransform", ); }
use super::conf::{CConf, Rc33M}; use super::nav::CursorNav; use node::Node; use traits::{Leaf, PathInfo, SubOrd}; use mines::SliceExt; // for boom_get use arrayvec::ArrayVec; use std::fmt; /// An object that can be used to traverse a `Node`. /// /// `Cursor` is very lightweight. All operations are done entirely using stack memory -- no /// heap allocations are made at any point. /// /// Note: `Cursor` takes more than 200B on stack (exact size mainly depends on the size of `PI`) pub struct Cursor<'a, L, PI, CONF = Rc33M> where L: Leaf + 'a, CONF: CConf<'a, L, PI>, CONF::Ptr: 'a, { root: &'a Node<L, CONF::Ptr>, steps: ArrayVec<CONF::StepsBuf>, } pub struct CStep<'a, L, PI, CONF> where L: Leaf + 'a, CONF: CConf<'a, L, PI>, CONF::Ptr: 'a, { nodes: &'a [Node<L, CONF::Ptr>], idx: usize, // index at which cursor descended path_info: PI, } impl<'a, L, PI, CONF> Clone for Cursor<'a, L, PI, CONF> where L: Leaf + Clone + 'a, PI: PathInfo<L::Info>, CONF: CConf<'a, L, PI>, CONF::Ptr: 'a, { fn clone(&self) -> Self { Cursor { root: self.root, steps: self.steps.clone(), } } } impl<'a, L, PI, CONF> Clone for CStep<'a, L, PI, CONF> where L: Leaf + Clone + 'a, PI: PathInfo<L::Info>, CONF: CConf<'a, L, PI>, CONF::Ptr: 'a, { fn clone(&self) -> Self { CStep { nodes: self.nodes, idx: self.idx, path_info: self.path_info.clone(), } } } impl<'a, L, PI, CONF> fmt::Debug for CStep<'a, L, PI, CONF> where L: Leaf + 'a, PI: fmt::Debug, CONF: CConf<'a, L, PI>, CONF::Ptr: 'a, { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "CStep {{ nodes.len: {}, idx: {}, path_info: {:?} }}", self.nodes.len(), self.idx, self.path_info) } } impl<'a, L, PI, CONF> fmt::Debug for Cursor<'a, L, PI, CONF> where L: Leaf + 'a, L::Info: fmt::Debug, PI: PathInfo<L::Info>, CONF: CConf<'a, L, PI>, CONF::Ptr: 'a, { /// Prints the tree under the current node. fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut cursor = Self::new(self.current()); let mut height = cursor.height(); loop { while cursor.height() > height { let _res = cursor.descend_first(); debug_assert!(_res.is_some()); } write!(f, "{}: ", height)?; loop { write!(f, "{:?} ", cursor.current().children().len())?; if cursor.right_sibling().is_none() { if cursor.next_node().is_some() { write!(f, "// ")?; } else { break; } } } if height == 0 { break; } else { writeln!(f)?; height -= 1; } cursor.reset(); } Ok(()) } } impl<'a, L, PI, CONF> Cursor<'a, L, PI, CONF> where L: Leaf + 'a, PI: PathInfo<L::Info>, CONF: CConf<'a, L, PI>, CONF::Ptr: 'a, { /// Create a new cursor from a root node. pub fn new(node: &'a Node<L, CONF::Ptr>) -> Self { Cursor { root: node, steps: ArrayVec::new(), } } /// Returns a reference to the root node. pub fn root(&self) -> &'a Node<L, CONF::Ptr> { self.root } /// Returns a reference to the current node, where the cursor is at. pub fn current(&self) -> &'a Node<L, CONF::Ptr> { match self.steps.last() { Some(cstep) => unsafe { &cstep.nodes.boom_get(cstep.idx) }, None => self.root, } } /// Returns a reference to the leaf's value if the current node is a leaf. pub fn leaf(&self) -> Option<&'a L> { self.current().leaf() } /// Height of the current node from leaves. pub fn height(&self) -> usize { self.current().height() } /// Returns whether the cursor is currently at the root of the tree. pub fn is_root(&self) -> bool { self.steps.len() == 0 } /// The cumulative info along the path from root to this node. Returns `PathInfo::identity()` /// if the current node is root or cursor is empty. pub fn path_info(&self) -> PI { match self.steps.last() { Some(cstep) => cstep.path_info, None => PI::identity(), } } pub fn reset(&mut self) { self.steps.clear(); } pub fn ascend(&mut self) -> Option<&'a Node<L, CONF::Ptr>> { self.steps.pop().map(|cstep| &cstep.nodes[cstep.idx]) } pub fn descend_first(&mut self) -> Option<&'a Node<L, CONF::Ptr>> { let cur_node = self.current(); let path_info = self.path_info(); let nodes = cur_node.children(); if nodes.len() > 0 { let ret_node = &nodes[0]; self.descend_raw(nodes, 0, path_info); Some(ret_node) } else { None } } pub fn descend_last(&mut self) -> Option<&'a Node<L, CONF::Ptr>> { let cur_node = self.current(); let path_info = self.path_info().extend(cur_node.info()); let nodes = cur_node.children(); if nodes.len() > 0 { let lastidx = nodes.len() - 1; let ret_node = &nodes[lastidx]; self.descend_raw(nodes, lastidx, path_info.extend_inv(ret_node.info())); Some(ret_node) } else { None } } fn descend_raw(&mut self, nodes: &'a [Node<L, CONF::Ptr>], idx: usize, path_info: PI) { // ArrayVec::push(e) returns Some(e) on overflow! assert!(self.steps.push(CStep { nodes, idx, path_info }).is_none()); } pub fn left_sibling(&mut self) -> Option<&'a Node<L, CONF::Ptr>> { let &mut Cursor { ref root, ref mut steps } = self; match steps.last_mut() { Some(&mut CStep { nodes, ref mut idx, ref mut path_info }) => { if *idx > 0 { *idx -= 1; *path_info = path_info.extend_inv(nodes[*idx].info()); Some(root) } else { None } } None => None, // at the root } } pub fn right_sibling(&mut self) -> Option<&'a Node<L, CONF::Ptr>> { let &mut Cursor { ref root, ref mut steps } = self; match steps.last_mut() { Some(&mut CStep { nodes, ref mut idx, ref mut path_info }) => { if *idx + 1 < nodes.len() { *path_info = path_info.extend(nodes[*idx].info()); *idx += 1; Some(root) } else { None } } None => None, // at the root } } pub fn first_leaf(&mut self) -> Option<&'a L> { let short_lived: Option<&L> = <Self as CursorNav>::first_leaf(self); unsafe { ::std::mem::transmute(short_lived) } } pub fn last_leaf(&mut self) -> Option<&'a L> { let short_lived: Option<&L> = <Self as CursorNav>::last_leaf(self); unsafe { ::std::mem::transmute(short_lived) } } pub fn next_node(&mut self) -> Option<&'a Node<L, CONF::Ptr>> { let short_lived: Option<&Node<_, _>> = <Self as CursorNav>::next_node(self); unsafe { ::std::mem::transmute(short_lived) } } pub fn prev_node(&mut self) -> Option<&'a Node<L, CONF::Ptr>> { let short_lived: Option<&Node<_, _>> = <Self as CursorNav>::prev_node(self); unsafe { ::std::mem::transmute(short_lived) } } pub fn next_leaf(&mut self) -> Option<&'a L> { let short_lived: Option<&L> = <Self as CursorNav>::next_leaf(self); unsafe { ::std::mem::transmute(short_lived) } } pub fn prev_leaf(&mut self) -> Option<&'a L> { let short_lived: Option<&L> = <Self as CursorNav>::prev_leaf(self); unsafe { ::std::mem::transmute(short_lived) } } pub fn left_maybe_ascend(&mut self) -> Option<&'a Node<L, CONF::Ptr>> { let short_lived: Option<&Node<_, _>> = <Self as CursorNav>::left_maybe_ascend(self); unsafe { ::std::mem::transmute(short_lived) } } pub fn right_maybe_ascend(&mut self) -> Option<&'a Node<L, CONF::Ptr>> { let short_lived: Option<&Node<_, _>> = <Self as CursorNav>::right_maybe_ascend(self); unsafe { ::std::mem::transmute(short_lived) } } /// See [`CursorMut::find_min`] for more details. /// /// [`CursorMut::find_min`]: struct.CursorMut.html#method.find_min pub fn find_min<IS>(&mut self, info_sub: IS) -> Option<&'a L> where IS: SubOrd<L::Info>, { let short_lived: Option<&L> = <Self as CursorNav>::find_min(self, info_sub); unsafe { ::std::mem::transmute(short_lived) } } /// See [`CursorMut::find_max`] for more details. /// /// [`CursorMut::find_max`]: struct.CursorMut.html#method.find_max pub fn find_max<IS>(&mut self, info_sub: IS) -> Option<&'a L> where IS: SubOrd<L::Info>, { let short_lived: Option<&L> = <Self as CursorNav>::find_max(self, info_sub); unsafe { ::std::mem::transmute(short_lived) } } /// See [`CursorMut::goto_min`] for more details. /// /// [`CursorMut::goto_min`]: struct.CursorMut.html#method.goto_min pub fn goto_min<PS: SubOrd<PI>>(&mut self, path_info_sub: PS) -> Option<&'a L> { let short_lived: Option<&L> = <Self as CursorNav>::goto_min(self, path_info_sub); unsafe { ::std::mem::transmute(short_lived) } } /// See [`CursorMut::goto_max`] for more details. /// /// [`CursorMut::goto_max`]: struct.CursorMut.html#method.goto_max pub fn goto_max<PS: SubOrd<PI>>(&mut self, path_info_sub: PS) -> Option<&'a L> { let short_lived: Option<&L> = <Self as CursorNav>::goto_max(self, path_info_sub); unsafe { ::std::mem::transmute(short_lived) } } } impl<'a, L, PI, CONF> CursorNav for Cursor<'a, L, PI, CONF> where L: Leaf + 'a, PI: PathInfo<L::Info>, CONF: CConf<'a, L, PI>, CONF::Ptr: 'a, { type Leaf = L; type NodesPtr = CONF::Ptr; type PathInfo = PI; fn _is_root(&self) -> bool { self.is_root() } fn _path_info(&self) -> PI { self.path_info() } fn _leaf(&self) -> Option<&L> { self.leaf() } fn _height(&self) -> Option<usize> { Some(self.height()) } fn _current(&self) -> Option<&Node<L, CONF::Ptr>> { Some(self.current()) } fn _current_must(&self) -> &Node<L, CONF::Ptr> { self.current() } fn _reset(&mut self) { self.reset(); } fn _ascend(&mut self) -> Option<&Node<L, CONF::Ptr>> { self.ascend() } fn _descend_first(&mut self) -> Option<&Node<L, CONF::Ptr>> { self.descend_first() } fn _descend_last(&mut self) -> Option<&Node<L, CONF::Ptr>> { self.descend_last() } fn _left_sibling(&mut self) -> Option<&Node<L, CONF::Ptr>> { self.left_sibling() } fn _right_sibling(&mut self) -> Option<&Node<L, CONF::Ptr>> { self.right_sibling() } } impl<'a, L, PI, CONF> IntoIterator for Cursor<'a, L, PI, CONF> where L: Leaf + 'a, PI: PathInfo<L::Info>, CONF: CConf<'a, L, PI>, CONF::Ptr: 'a, { type IntoIter = LeafIter<'a, L, PI, CONF>; type Item = &'a L; fn into_iter(mut self) -> Self::IntoIter { self.reset(); LeafIter { inner: self, init_done: false, } } } pub struct LeafIter<'a, L, PI, CONF> where L: Leaf + 'a, CONF: CConf<'a, L, PI>, CONF::Ptr: 'a, { inner: Cursor<'a, L, PI, CONF>, init_done: bool, } impl<'a, L, PI, CONF> Iterator for LeafIter<'a, L, PI, CONF> where L: Leaf + 'a, PI: PathInfo<L::Info>, CONF: CConf<'a, L, PI>, CONF::Ptr: 'a, { type Item = &'a L; fn next(&mut self) -> Option<&'a L> { if !self.init_done { self.init_done = true; self.inner.first_leaf() } else { self.inner.next_leaf() } } } #[cfg(test)] mod tests { use cursor::Cursor; use test_help::*; #[test] fn leaf_traversal() { let tree: NodeRc<_> = (1..21).map(|i| ListLeaf(i)).collect(); let mut leaf_iter = CursorT::new(&tree).into_iter(); for i in 1..21 { assert_eq!(leaf_iter.next(), Some(&ListLeaf(i))); } assert_eq!(leaf_iter.next(), None); let mut cursor = CursorT::new(&tree); assert_eq!(cursor.last_leaf(), Some(&ListLeaf(20))); for i in (1..20).rev() { assert_eq!(cursor.prev_leaf(), Some(&ListLeaf(i))); } assert_eq!(cursor.prev_leaf(), None); } #[test] fn path_extend() { let tree: NodeRc<_> = (1..21).map(|i| ListLeaf(i)).collect(); let mut cursor = Cursor::<_, ListPath>::new(&tree); assert_eq!(cursor.first_leaf().unwrap(), &ListLeaf(1)); assert_eq!(cursor.path_info(), ListPath { index: 0, run: 0 }); cursor.reset(); assert_eq!(cursor.last_leaf().unwrap(), &ListLeaf(20)); assert_eq!(cursor.path_info(), ListPath { index: 19, run: 19*20/2 }); } // FIXME need more tests }
use std::cmp::Ordering; use std::collections::BTreeMap; use std::fmt::Display; use std::ops::Add; use crate::cost::{DVValue, Cost}; use std::slice::Iter; use std::io::Write; use std::fs::File; use std::path::Path; use std::error::Error; use std::process::Command; use std::fs; impl<W: Ord + Clone + Add<Output=W> + Display> DVValue<W> { pub fn write_html_long(&self, names: &BTreeMap<usize, String>) -> String { match self { DVValue::Infinity => String::from("&infin;"), DVValue::Distance(v, id) => format!( "{}({})", v, names.get(id).unwrap() ), DVValue::DirectDistance(v) => format!("{}", v), DVValue::SameNode => String::from("0") } } } impl<W: Ord + Clone + Add<Output=W> + Display> Cost<W> { pub fn write_html(&self) -> String { match self { Cost::Infinity => String::from("&infin;"), Cost::Value(v) => format!("{}", v), Cost::Zero => String::from("0") } } } pub trait DistanceCalculationRepr : Clone { fn to_string(&self, names: &BTreeMap<usize, String>) -> String; } #[derive(Debug, Clone)] pub enum DistanceCalculationElement { DirectDistance(usize, usize), DistanceVector(usize, usize), } impl DistanceCalculationRepr for DistanceCalculationElement { fn to_string(&self, names: &BTreeMap<usize, String>) -> String { match self { DistanceCalculationElement::DirectDistance(target, source) => format!( "C({},{})", names.get(&source).unwrap(), names.get(&target).unwrap() ), DistanceCalculationElement::DistanceVector(target, source) => format!( "d<sub>{}</sub>({})", names.get(&source).unwrap(), names.get(&target).unwrap() ) } } } #[derive(Debug, Clone)] pub struct DistanceCalculationTuple<W: Ord + Clone + Add<Output=W> + Display, R: DistanceCalculationRepr> { description: Vec<R>, result: Vec<Cost<W>>, through: usize, direct: bool } impl<W: Ord + Clone + Add<Output=W> + Display, R: DistanceCalculationRepr> DistanceCalculationTuple<W, R> { pub fn sum(&self) -> Cost<W> { let mut sum:Cost<W> = Cost::Zero; for item in &self.result { sum = sum + item.to_owned(); } sum } pub fn sum_dv(&self) -> DVValue<W> { self.sum().to_dv_value(self.through, self.direct) } } impl<W: Ord + Clone + Add<Output=W> + Display, R: DistanceCalculationRepr> PartialEq for DistanceCalculationTuple<W, R>{ fn eq(&self, other: &Self) -> bool { self.sum().eq(&other.sum()) } } impl<W: Ord + Clone + Add<Output=W> + Display, R: DistanceCalculationRepr> Eq for DistanceCalculationTuple<W, R>{ } impl<W: Ord + Clone + Add<Output=W> + Display, R: DistanceCalculationRepr> PartialOrd for DistanceCalculationTuple<W, R>{ fn partial_cmp(&self, other: &Self) -> Option<Ordering> { self.sum().partial_cmp(&other.sum()) } } impl<W: Ord + Clone + Add<Output=W> + Display, R: DistanceCalculationRepr> Ord for DistanceCalculationTuple<W, R> { fn cmp(&self, other: &Self) -> Ordering { self.sum().cmp(&other.sum()) } } pub trait DistanceCalculationLine <W: Ord + Clone + Add<Output=W> + Display, R: DistanceCalculationRepr> { fn draw_direct(target: usize, src: usize) -> R; fn draw_distance(target: usize, src: usize) -> R; fn get_target(&self) -> usize; fn get_source(&self) -> usize; fn get_members(&self) -> Iter<DistanceCalculationTuple<W, R>>; fn render(&self, names: &BTreeMap<usize, String>) -> String { let mut result = Self::draw_distance(self.get_target(), self.get_source()) .to_string(names); result += "=min("; let mut first = true; for desc in self.get_members() { if first { first = false; } else { result += ", "; } let mut first2 = true; for item in &desc.description { if first2 { first2 = false; } else { result += "+"; } result += item.to_string(names).as_str(); } } result += ")=min("; first = true; for desc in self.get_members() { if first { first = false; } else { result += ", "; } let mut first2 = true; for item in &desc.result { if first2 { first2 = false; } else { result += "+"; } result += item.write_html().as_str(); } } result += ")="; result += self.min_cost().write_html().as_str(); result } fn add(&mut self, tuple: DistanceCalculationTuple<W,R>); fn add_indirect( &mut self, direct_target: usize, direct_src: usize, direct_cost: W, distance_target: usize, distance_src: usize, distance_cost: Cost<W>, ) { self.add(DistanceCalculationTuple { description: vec!( Self::draw_direct(direct_target, direct_src), Self::draw_distance(distance_target, distance_src) ), result: vec!( Cost::Value(direct_cost), distance_cost ), through: direct_target, direct: false }) } fn add_direct( &mut self, direct_target: usize, direct_src: usize, direct_cost: W ) { self.add(DistanceCalculationTuple { description: vec!(Self::draw_direct(direct_target, direct_src)), result: vec!(Cost::Value(direct_cost)), through: direct_target, direct: true }); } fn min_vector(&self) -> DVValue<W>; fn min_cost(&self) -> Cost<W>; } pub struct HtmlFormula<W: Ord + Clone + Add<Output=W> + Display>{ target: usize, source: usize, members: Vec<DistanceCalculationTuple<W, DistanceCalculationElement>> } impl<W: Ord + Clone + Add<Output=W> + Display> DistanceCalculationLine<W, DistanceCalculationElement> for HtmlFormula<W>{ fn draw_direct(target: usize, src: usize) -> DistanceCalculationElement { DistanceCalculationElement::DirectDistance(target, src) } fn draw_distance(target: usize, src: usize) -> DistanceCalculationElement { DistanceCalculationElement::DistanceVector(target, src) } fn get_target(&self) -> usize { self.target } fn get_source(&self) -> usize { self.source } fn get_members(&self) -> Iter<DistanceCalculationTuple<W, DistanceCalculationElement>> { self.members.iter() } fn add(&mut self, tuple: DistanceCalculationTuple<W, DistanceCalculationElement>) { self.members.push(tuple) } fn min_vector(&self) -> DVValue<W> { self.members .iter() .min() .unwrap() .sum_dv() } fn min_cost(&self) -> Cost<W> { self.members .iter() .min() .unwrap() .sum() } } impl<W: Ord + Clone + Add<Output=W> + Display> HtmlFormula<W>{ pub fn new(target:usize, source:usize) -> Self { HtmlFormula{ target, source, members: Vec::new() } } } /*pub struct HtmlFile{ internal: Box<dyn Write> } impl Write for HtmlFile { fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> { self.internal.write(buf) } fn flush(&mut self) -> std::io::Result<()> { self.internal.flush() } } impl Drop for HtmlFile { fn drop(&mut self) { writeln!(self.internal, "</div>\n</body>\n</html>").unwrap(); } } impl HtmlFile { pub fn new<P:AsRef<Path>>(path: P) -> std::io::Result<Self> { let mut file = File::create(path)?; writeln!(file, "<!DOCTYPE html>")?; writeln!(file, "<html>\n<head>")?; writeln!(file, "<link rel=\"stylesheet\" href=\"styles.css\">")?; writeln!(file, "</head>\n<body>")?; writeln!(file, "<div class=\"wrapper\">")?; Ok(HtmlFile{ internal: Box::new(file) }) } }*/ pub struct HtmlFiles { folder: String, prefix: String, index: u32 } impl HtmlFiles { pub fn new(path: &str, prefix:&str) -> Self { HtmlFiles{ folder: path.to_string(), prefix: prefix.to_string(), index: 0 } } pub fn create<F>(&mut self, cb: F) -> Result<(), Box<dyn Error>> where F : Fn(&mut File) -> Result<(), Box<dyn Error>> { let path = Path::new(self.folder.as_str()); let styles_filename = Path::new("styles.css"); if self.index == 0 { if !path.exists() { fs::create_dir_all(path)?; } fs::copy(styles_filename, path.join(styles_filename))?; } let file_name = format!("{}_{}.html", self.prefix.as_str(), self.index); let pdf_file_name = format!("{}_{}.pdf", self.prefix.as_str(), self.index); self.index += 1; { let mut file = File::create(path.join(file_name.as_str()))?; writeln!(file, "<!DOCTYPE html>")?; writeln!(file, "<html>\n<head>")?; writeln!(file, "<link rel=\"stylesheet\" href=\"styles.css\">")?; writeln!(file, "</head>\n<body>")?; writeln!(file, "<div class=\"wrapper\">")?; (cb)(&mut file)?; writeln!(file, "</div>\n</body>\n</html>")?; } Command::new("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome") .current_dir(path) .arg("--headless") .arg(format!("--print-to-pdf={}",pdf_file_name.as_str())) .arg("--disable-gpu") .arg("--no-margins") .arg("--print-to-pdf-no-header") .arg(file_name.as_str()) .output()?; Ok(()) } }
#[derive(Default, Debug)] struct Node { children: Vec<Node>, metadata: Vec<usize>, } impl Node { fn part1_total(&self) -> usize { let mut total = 0; for metadata in &self.metadata { total += metadata; } for node in &self.children { total += node.part1_total(); } total } fn part2_total(&self) -> usize { if self.children.is_empty() { self.metadata.iter().sum() } else { self.metadata .iter() .map(|m| { self.children .get(m - 1) .map(|node| node.part2_total()) .unwrap_or_default() }) .sum() } } } fn as_node(entries: &mut impl Iterator<Item = usize>) -> Node { let n_children = entries.next().unwrap(); let n_metadata = entries.next().unwrap(); let children = (0..n_children).map(|_| as_node(entries)).collect(); let metadata = entries.take(n_metadata).collect(); Node { children, metadata } } pub fn part1(input: &str) -> usize { let mut entries = input.trim().split(' ').map(|x| x.parse::<usize>().unwrap()); let node = as_node(&mut entries); node.part1_total() } pub fn part2(input: &str) -> usize { let mut entries = input.trim().split(' ').map(|x| x.parse::<usize>().unwrap()); let node = as_node(&mut entries); node.part2_total() } #[cfg(test)] mod tests { use super::{part1, part2}; #[test] fn test_part1() { let input = "2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2"; assert_eq!(part1(input), 138); } #[test] fn test_part2() { let input = "2 3 0 3 10 11 12 1 1 0 1 99 2 1 1 2"; assert_eq!(part2(input), 66); } }
use std::{fmt, str}; #[derive(Debug, Clone)] pub enum Error { InvalidAppEui, InvalidAppKey, InvalidDevEui, InvalidApiKey, InvalidUuid, NewDevice422, NewDeviceApi, NewLabel422, NewLabelApi, NewDeviceLabelApi, UnauthorizedApi, HttpErrorApi, } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let msg = match self { Error::InvalidAppEui => { "Invalid AppEui input. Must be 8 bytes represented in hex (\"0123456789ABCDEF\")" } Error::InvalidAppKey => { "Invalid AppKey input. Must be 16 bytes represented in hex (\"0123456789ABCDEF0123456789ABCDEF\")" } Error::InvalidDevEui => { "Invalid DevEui input. Must be 8 bytes represented in hex (\"0123456789ABCDEF\")" } Error::InvalidApiKey => { "Invalid Api Key. Must be 32 bytes represented in base64" } Error::InvalidUuid => { "Invalid UUID input. Expected in hyphenated form \"00000000-0000-0000-0000-000000000000\"" } Error::NewDevice422 => { "Failed Creating Device! Device with identical credentials already exists" } Error::NewDeviceApi => { "Failed Creating Device! Unknown server error" } Error::NewLabel422 => { "Failed Creating Label! Label with same name already exists under organization" } Error::NewLabelApi => { "Failed Creating Label! Unknown server error" } Error::NewDeviceLabelApi => { "Failed Creating Device Label! Unknown server error" } Error::UnauthorizedApi => { "Failed to connect to Helium API server. Unauthorized" } Error::HttpErrorApi => { "Failed to connect to Helium API server. Unexpected response" } }; write!(f, "{}", msg) } } impl ::std::error::Error for Error { fn description(&self) -> &str { match self { Error::InvalidAppEui => "Invalid AppEui input. Must be 8 bytes represented in hex (\"0123456789ABCDEF\")", Error::InvalidAppKey => "Invalid AppKey input. Must be 16 bytes represented in hex (\"0123456789ABCDEF0123456789ABCDEF\")", Error::InvalidDevEui => "Invalid DevEui input. Must be 8 bytes represented in hex (\"0123456789ABCDEF\")", Error::InvalidApiKey => "Invalid Api Key. Must be 32 bytes represented in base64", Error::InvalidUuid => "Invalid UUID input. Expected in hyphenated form \"00000000-0000-0000-0000-000000000000\"", Error::NewDevice422 => "Failed Creating Device! Device with identical credentials already exists", Error::NewDeviceApi => "Failed Creating Device! Unknown server error", Error::NewLabel422 => "Failed Creating Label! Label with same name already exists under organization", Error::NewLabelApi => "Failed Creating Label! Unknown server error", Error::NewDeviceLabelApi => "Failed Creating Device Label! Unknown server error", Error::UnauthorizedApi => "Failed to connect to Helium API server. Unauthorized", Error::HttpErrorApi => "Failed to connect to Helium API server. Unexpected response", } } }
// Copyright 2017 rust-ipfs-api Developers // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://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. // use ipfs_api_examples::ipfs_api::{IpfsApi, IpfsClient}; // Creates an Ipfs client, and gets information about your local address, and // connected peers. // #[ipfs_api_examples::main] async fn main() { tracing_subscriber::fmt::init(); eprintln!("connecting to localhost:5001..."); let client = IpfsClient::default(); match client.swarm_addrs_local().await { Ok(local) => { eprintln!("your addrs:"); for addr in local.strings { eprintln!(" {}", addr); } eprintln!(); } Err(e) => eprintln!("error getting local swarm addresses: {}", e), } match client.swarm_peers().await { Ok(connected) => { eprintln!("connected:"); for peer in connected.peers { let streams: Vec<&str> = peer.streams.iter().map(|s| &s.protocol[..]).collect(); eprintln!(" addr: {}", peer.addr); eprintln!(" peer: {}", peer.peer); eprintln!(" latency: {}", peer.latency); eprintln!(" muxer: {}", peer.muxer); eprintln!(" streams: {}", streams.join(", ")); eprintln!(); } } Err(e) => eprintln!("error getting swarm peers: {}", e), } }
use crate::grid_builder::*; use std::fmt::*; use std::marker::PhantomData; /// A builder used to create plain-text table from row values. /// /// Generate a table using the columns defined by [`CellsFormatter`]. /// /// # Examples /// /// ``` /// use text_grid::*; /// struct RowData { /// a: u32, /// b: u32, /// } /// impl CellsSource for RowData { /// fn fmt(f: &mut CellsFormatter<&Self>) { /// f.column("a", |s| s.a); /// f.column("b", |s| s.b); /// } /// } /// /// let mut g = Grid::new(); /// g.push(&RowData { a: 300, b: 1 }); /// g.push(&RowData { a: 2, b: 200 }); /// /// assert_eq!(format!("\n{g}"), r#" /// a | b | /// -----|-----| /// 300 | 1 | /// 2 | 200 | /// "#); /// ``` pub struct Grid<R: ?Sized, S = DefaultGridSchema<R>> { b: GridBuilder, schema: S, _phantom: PhantomData<fn(&R)>, } impl<R: CellsSource + ?Sized> Default for Grid<R, DefaultGridSchema<R>> { fn default() -> Self { Self::new() } } impl<R: CellsSource + ?Sized> Grid<R, DefaultGridSchema<R>> { /// Create a new `Grid` with [`DefaultGridSchema`] and prepare header rows. pub fn new() -> Self { Self::new_with_schema(DefaultGridSchema::default()) } } impl<R: ?Sized, S: GridSchema<Source = R>> Grid<S::Source, S> { /// Create a new `Grid` with specified schema and prepare header rows. pub fn new_with_schema(schema: S) -> Self { let b = GridBuilder::new_with_header(&schema); Grid { b, schema, _phantom: PhantomData, } } } impl<R: ?Sized, S: GridSchema<Source = R>> Grid<R, S> { /// Append a row to the bottom of the grid. pub fn push(&mut self, source: &R) { self.b.push(|b| b.extend_with_schema(source, &self.schema)); } /// Append a row separator to the bottom of the grid. pub fn push_separator(&mut self) { self.b.push_separator(); } } impl<R, S: GridSchema<Source = R>> Extend<R> for Grid<R, S> { fn extend<T: IntoIterator<Item = R>>(&mut self, iter: T) { for i in iter { self.push(&i); } } } impl<'a, R, S: GridSchema<Source = R>> Extend<&'a R> for Grid<R, S> { fn extend<T: IntoIterator<Item = &'a R>>(&mut self, iter: T) { for i in iter { self.push(i); } } } impl<R: CellsSource> FromIterator<R> for Grid<R> { fn from_iter<T: IntoIterator<Item = R>>(iter: T) -> Self { let mut g = Self::new(); g.extend(iter); g } } impl<'a, R: CellsSource> FromIterator<&'a R> for Grid<R> { fn from_iter<T: IntoIterator<Item = &'a R>>(iter: T) -> Self { let mut g = Self::new(); g.extend(iter); g } } impl<R: ?Sized, S> Display for Grid<R, S> { fn fmt(&self, f: &mut Formatter) -> Result { Display::fmt(&self.b, f) } } impl<R: ?Sized, S> Debug for Grid<R, S> { fn fmt(&self, f: &mut Formatter) -> Result { Debug::fmt(&self.b, f) } }
pub mod mesh; #[macro_use] pub mod prim; #[macro_use] pub mod util; pub mod examples; pub mod xform; //pub use crate::examples; //pub use crate::openmesh::test_thing; #[cfg(test)] mod tests { use super::*; use nalgebra::*; use std::rc::Rc; use std::time::Instant; #[test] fn xform_order() { let geom = prim::cube(); let y = &Vector3::y_axis(); let dx = 4.0; let r = -0.5; let trans = xform::Transform::new().translate(dx, 0.0, 0.0); let rot = xform::Transform::new().rotate(y, r); let xf1 = trans.rotate(y, r); let xf2 = rot.translate(dx, 0.0, 0.0); // Rotate entire space, *then* translate in that rotated plane: geom.transform(&trans) .transform(&rot) .write_stl_file("xform_apply_trans_rot.stl") .unwrap(); geom.transform(&(rot * trans)) .write_stl_file("xform_mul_rot_trans.stl") .unwrap(); geom.transform(&xf2) .write_stl_file("xform_rot_trans.stl") .unwrap(); // Translate cube, *then* rotate it: geom.transform(&rot) .transform(&trans) .write_stl_file("xform_apply_rot_trans.stl") .unwrap(); geom.transform(&(trans * rot)) .write_stl_file("xform_mul_trans_rot.stl") .unwrap(); geom.transform(&xf1) .write_stl_file("xform_trans_rot.stl") .unwrap(); } // TODO: These tests don't test any conditions, so this is useful // short-hand to run, but not very meaningful as a test. #[test] fn barbs() { let name = "barbs"; println!("---------------------------------------------------"); let b = examples::Barbs::new(); let m = b.run(100); println!("Got {} verts...", m.verts.len()); let fname = format!("{}.stl", name); println!("Writing {}...", fname); m.write_stl_file(&fname).unwrap(); } #[test] fn tree_thing1() { let name = "tree_thing"; println!("---------------------------------------------------"); let b = examples::TreeThing::new(0.6, 10); let m = b.run(); println!("Got {} verts...", m.verts.len()); let fname = format!("{}.stl", name); println!("Writing {}...", fname); m.write_stl_file(&fname).unwrap(); } #[test] fn tree_thing2() { let name = "tree_thing2"; println!("---------------------------------------------------"); let b = examples::TreeThing::new(0.6, 10); let m = b.run2(); println!("Got {} verts...", m.verts.len()); let fname = format!("{}.stl", name); println!("Writing {}...", fname); m.write_stl_file(&fname).unwrap(); } #[test] fn sierpinski() { let name = "sierpinski"; println!("---------------------------------------------------"); let b = examples::Sierpinski::new(0.50, 0.10, 0.0); //let b = examples::Sierpinski::new(0.51, 0.10, 0.1); let m = b.run(); println!("Got {} verts...", m.verts.len()); let fname = format!("{}.stl", name); println!("Writing {}...", fname); m.write_stl_file(&fname).unwrap(); } #[test] fn nested_spiral() { let name = "nested_spiral"; println!("---------------------------------------------------"); let b = examples::NestedSpiral::new(); //let b = examples::Sierpinski::new(0.51, 0.10, 0.1); let m = b.run(); println!("Got {} verts...", m.verts.len()); let fname = format!("{}.stl", name); println!("Writing {}...", fname); m.write_stl_file(&fname).unwrap(); } } // need this for now: // cargo test -- --nocapture // or: cargo test cube_thing -- --nocapture
// Copyright 2022 Datafuse Labs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use std::collections::HashMap; use common_ast::ast::TableReference; use common_ast::ast::UpdateStmt; use common_exception::ErrorCode; use common_exception::Result; use crate::binder::Binder; use crate::binder::ScalarBinder; use crate::normalize_identifier; use crate::plans::Plan; use crate::plans::ScalarExpr; use crate::plans::UpdatePlan; use crate::BindContext; impl Binder { pub(in crate::planner::binder) async fn bind_update( &mut self, bind_context: &mut BindContext, stmt: &UpdateStmt, ) -> Result<Plan> { let UpdateStmt { table, update_list, selection, } = stmt; let (catalog_name, database_name, table_name) = if let TableReference::Table { catalog, database, table, .. } = table { ( catalog .as_ref() .map_or_else(|| self.ctx.get_current_catalog(), |i| i.name.clone()), database .as_ref() .map_or_else(|| self.ctx.get_current_database(), |i| i.name.clone()), table.name.clone(), ) } else { // we do not support USING clause yet return Err(ErrorCode::Internal( "should not happen, parser should have report error already", )); }; let (_, mut context) = self.bind_table_reference(bind_context, table).await?; let table = self .ctx .get_table(&catalog_name, &database_name, &table_name) .await?; let mut scalar_binder = ScalarBinder::new( &mut context, self.ctx.clone(), &self.name_resolution_ctx, self.metadata.clone(), &[], ); let schema = table.schema(); let mut update_columns = HashMap::with_capacity(update_list.len()); for update_expr in update_list { let col_name = normalize_identifier(&update_expr.name, &self.name_resolution_ctx).name; let index = schema.index_of(&col_name)?; if update_columns.contains_key(&index) { return Err(ErrorCode::BadArguments(format!( "Multiple assignments in the single statement to column `{}`", col_name ))); } // TODO(zhyass): selection and update_list support subquery. let (scalar, _) = scalar_binder.bind(&update_expr.expr).await?; if matches!(scalar, ScalarExpr::SubqueryExpr(_)) { return Err(ErrorCode::Internal( "Update does not support subquery temporarily", )); } update_columns.insert(index, scalar); } let push_downs = if let Some(expr) = selection { let (scalar, _) = scalar_binder.bind(expr).await?; if matches!(scalar, ScalarExpr::SubqueryExpr(_)) { return Err(ErrorCode::Internal( "Update does not support subquery temporarily", )); } Some(scalar) } else { None }; let plan = UpdatePlan { catalog: catalog_name, database: database_name, table: table_name, update_list: update_columns, selection: push_downs, bind_context: Box::new(context.clone()), }; Ok(Plan::Update(Box::new(plan))) } }
//! Metrics instrumentation for [`Cache`]s. use std::{fmt::Debug, sync::Arc}; use async_trait::async_trait; use iox_time::{Time, TimeProvider}; use metric::{Attributes, DurationHistogram, U64Counter}; use observability_deps::tracing::warn; use trace::span::{Span, SpanRecorder}; use super::{Cache, CacheGetStatus, CachePeekStatus}; /// Struct containing all the metrics #[derive(Debug)] struct Metrics { time_provider: Arc<dyn TimeProvider>, metric_get_hit: DurationHistogram, metric_get_miss: DurationHistogram, metric_get_miss_already_loading: DurationHistogram, metric_get_cancelled: DurationHistogram, metric_peek_hit: DurationHistogram, metric_peek_miss: DurationHistogram, metric_peek_miss_already_loading: DurationHistogram, metric_peek_cancelled: DurationHistogram, metric_set: U64Counter, } impl Metrics { fn new( name: &'static str, time_provider: Arc<dyn TimeProvider>, metric_registry: &metric::Registry, ) -> Self { let attributes = Attributes::from(&[("name", name)]); let mut attributes_get = attributes.clone(); let metric_get = metric_registry .register_metric::<DurationHistogram>("iox_cache_get", "Cache GET requests"); attributes_get.insert("status", "hit"); let metric_get_hit = metric_get.recorder(attributes_get.clone()); attributes_get.insert("status", "miss"); let metric_get_miss = metric_get.recorder(attributes_get.clone()); attributes_get.insert("status", "miss_already_loading"); let metric_get_miss_already_loading = metric_get.recorder(attributes_get.clone()); attributes_get.insert("status", "cancelled"); let metric_get_cancelled = metric_get.recorder(attributes_get); let mut attributes_peek = attributes.clone(); let metric_peek = metric_registry .register_metric::<DurationHistogram>("iox_cache_peek", "Cache PEEK requests"); attributes_peek.insert("status", "hit"); let metric_peek_hit = metric_peek.recorder(attributes_peek.clone()); attributes_peek.insert("status", "miss"); let metric_peek_miss = metric_peek.recorder(attributes_peek.clone()); attributes_peek.insert("status", "miss_already_loading"); let metric_peek_miss_already_loading = metric_peek.recorder(attributes_peek.clone()); attributes_peek.insert("status", "cancelled"); let metric_peek_cancelled = metric_peek.recorder(attributes_peek); let metric_set = metric_registry .register_metric::<U64Counter>("iox_cache_set", "Cache SET requests.") .recorder(attributes); Self { time_provider, metric_get_hit, metric_get_miss, metric_get_miss_already_loading, metric_get_cancelled, metric_peek_hit, metric_peek_miss, metric_peek_miss_already_loading, metric_peek_cancelled, metric_set, } } } /// Wraps given cache with metrics. #[derive(Debug)] pub struct CacheWithMetrics<C> where C: Cache, { inner: C, metrics: Metrics, } impl<C> CacheWithMetrics<C> where C: Cache, { /// Create new metrics wrapper around given cache. pub fn new( inner: C, name: &'static str, time_provider: Arc<dyn TimeProvider>, metric_registry: &metric::Registry, ) -> Self { Self { inner, metrics: Metrics::new(name, time_provider, metric_registry), } } } #[async_trait] impl<C> Cache for CacheWithMetrics<C> where C: Cache, { type K = C::K; type V = C::V; type GetExtra = (C::GetExtra, Option<Span>); type PeekExtra = (C::PeekExtra, Option<Span>); async fn get_with_status( &self, k: Self::K, extra: Self::GetExtra, ) -> (Self::V, CacheGetStatus) { let (extra, span) = extra; let mut set_on_drop = SetGetMetricOnDrop::new(&self.metrics, span); let (v, status) = self.inner.get_with_status(k, extra).await; set_on_drop.status = Some(status); (v, status) } async fn peek_with_status( &self, k: Self::K, extra: Self::PeekExtra, ) -> Option<(Self::V, CachePeekStatus)> { let (extra, span) = extra; let mut set_on_drop = SetPeekMetricOnDrop::new(&self.metrics, span); let res = self.inner.peek_with_status(k, extra).await; set_on_drop.status = Some(res.as_ref().map(|(_v, status)| *status)); res } async fn set(&self, k: Self::K, v: Self::V) { self.inner.set(k, v).await; self.metrics.metric_set.inc(1); } } /// Helper that set's GET metrics on drop depending on the `status`. /// /// A drop might happen due to completion (in which case the `status` should be set) or if the future is cancelled (in /// which case the `status` is `None`). struct SetGetMetricOnDrop<'a> { metrics: &'a Metrics, t_start: Time, status: Option<CacheGetStatus>, span_recorder: SpanRecorder, } impl<'a> SetGetMetricOnDrop<'a> { fn new(metrics: &'a Metrics, span: Option<Span>) -> Self { let t_start = metrics.time_provider.now(); Self { metrics, t_start, status: None, span_recorder: SpanRecorder::new(span), } } } impl<'a> Drop for SetGetMetricOnDrop<'a> { fn drop(&mut self) { let t_end = self.metrics.time_provider.now(); match t_end.checked_duration_since(self.t_start) { Some(duration) => { match self.status { Some(CacheGetStatus::Hit) => &self.metrics.metric_get_hit, Some(CacheGetStatus::Miss) => &self.metrics.metric_get_miss, Some(CacheGetStatus::MissAlreadyLoading) => { &self.metrics.metric_get_miss_already_loading } None => &self.metrics.metric_get_cancelled, } .record(duration); } None => { warn!("Clock went backwards, not recording cache GET duration"); } } if let Some(status) = self.status { self.span_recorder.ok(status.name()); } } } /// Helper that set's PEEK metrics on drop depending on the `status`. /// /// A drop might happen due to completion (in which case the `status` should be set) or if the future is cancelled (in /// which case the `status` is `None`). struct SetPeekMetricOnDrop<'a> { metrics: &'a Metrics, t_start: Time, status: Option<Option<CachePeekStatus>>, span_recorder: SpanRecorder, } impl<'a> SetPeekMetricOnDrop<'a> { fn new(metrics: &'a Metrics, span: Option<Span>) -> Self { let t_start = metrics.time_provider.now(); Self { metrics, t_start, status: None, span_recorder: SpanRecorder::new(span), } } } impl<'a> Drop for SetPeekMetricOnDrop<'a> { fn drop(&mut self) { let t_end = self.metrics.time_provider.now(); match t_end.checked_duration_since(self.t_start) { Some(duration) => { match self.status { Some(Some(CachePeekStatus::Hit)) => &self.metrics.metric_peek_hit, Some(Some(CachePeekStatus::MissAlreadyLoading)) => { &self.metrics.metric_peek_miss_already_loading } Some(None) => &self.metrics.metric_peek_miss, None => &self.metrics.metric_peek_cancelled, } .record(duration); } None => { warn!("Clock went backwards, not recording cache PEEK duration"); } } if let Some(status) = self.status { self.span_recorder .ok(status.map(|status| status.name()).unwrap_or("miss")); } } } #[cfg(test)] mod tests { use std::{collections::HashMap, time::Duration}; use futures::{stream::FuturesUnordered, StreamExt}; use iox_time::{MockProvider, Time}; use metric::{HistogramObservation, Observation, RawReporter}; use tokio::sync::Barrier; use trace::{span::SpanStatus, RingBufferTraceCollector}; use crate::{ cache::{ driver::CacheDriver, test_util::{run_test_generic, TestAdapter}, }, loader::test_util::TestLoader, test_util::{AbortAndWaitExt, EnsurePendingExt}, }; use super::*; #[tokio::test] async fn test_generic() { run_test_generic(MyTestAdapter).await; } struct MyTestAdapter; impl TestAdapter for MyTestAdapter { type GetExtra = (bool, Option<Span>); type PeekExtra = ((), Option<Span>); type Cache = CacheWithMetrics<CacheDriver<HashMap<u8, String>, TestLoader>>; fn construct(&self, loader: Arc<TestLoader>) -> Arc<Self::Cache> { TestMetricsCache::new_with_loader(loader).cache } fn get_extra(&self, inner: bool) -> Self::GetExtra { (inner, None) } fn peek_extra(&self) -> Self::PeekExtra { ((), None) } } #[tokio::test] async fn test_get() { let test_cache = TestMetricsCache::new(); let traces = Arc::new(RingBufferTraceCollector::new(1_000)); let mut reporter = RawReporter::default(); test_cache.metric_registry.report(&mut reporter); for status in ["hit", "miss", "miss_already_loading", "cancelled"] { let hist = get_metric_cache_get(&reporter, status); assert_eq!(hist.sample_count(), 0); assert_eq!(hist.total, Duration::from_secs(0)); } test_cache.loader.block_global(); let barrier_pending_1 = Arc::new(Barrier::new(2)); let barrier_pending_1_captured = Arc::clone(&barrier_pending_1); let traces_captured = Arc::clone(&traces); let cache_captured = Arc::clone(&test_cache.cache); let join_handle_1 = tokio::task::spawn(async move { cache_captured .get( 1, ( true, Some(Span::root("miss", Arc::clone(&traces_captured) as _)), ), ) .ensure_pending(barrier_pending_1_captured) .await }); barrier_pending_1.wait().await; let d1 = Duration::from_secs(1); test_cache.time_provider.inc(d1); let barrier_pending_2 = Arc::new(Barrier::new(2)); let barrier_pending_2_captured = Arc::clone(&barrier_pending_2); let traces_captured = Arc::clone(&traces); let cache_captured = Arc::clone(&test_cache.cache); let n_miss_already_loading = 10; let join_handle_2 = tokio::task::spawn(async move { (0..n_miss_already_loading) .map(|_| { cache_captured.get( 1, ( true, Some(Span::root( "miss_already_loading", Arc::clone(&traces_captured) as _, )), ), ) }) .collect::<FuturesUnordered<_>>() .collect::<Vec<_>>() .ensure_pending(barrier_pending_2_captured) .await }); barrier_pending_2.wait().await; let d2 = Duration::from_secs(3); test_cache.time_provider.inc(d2); test_cache.loader.mock_next(1, "v".into()); test_cache.loader.unblock_global(); join_handle_1.await.unwrap(); join_handle_2.await.unwrap(); test_cache.loader.block_global(); test_cache.time_provider.inc(Duration::from_secs(10)); let n_hit = 100; for _ in 0..n_hit { test_cache .cache .get(1, (true, Some(Span::root("hit", Arc::clone(&traces) as _)))) .await; } let n_cancelled = 200; let barrier_pending_3 = Arc::new(Barrier::new(2)); let barrier_pending_3_captured = Arc::clone(&barrier_pending_3); let traces_captured = Arc::clone(&traces); let cache_captured = Arc::clone(&test_cache.cache); let join_handle_3 = tokio::task::spawn(async move { (0..n_cancelled) .map(|_| { cache_captured.get( 2, ( true, Some(Span::root("cancelled", Arc::clone(&traces_captured) as _)), ), ) }) .collect::<FuturesUnordered<_>>() .collect::<Vec<_>>() .ensure_pending(barrier_pending_3_captured) .await }); barrier_pending_3.wait().await; let d3 = Duration::from_secs(20); test_cache.time_provider.inc(d3); join_handle_3.abort_and_wait().await; let mut reporter = RawReporter::default(); test_cache.metric_registry.report(&mut reporter); let hist = get_metric_cache_get(&reporter, "hit"); assert_eq!(hist.sample_count(), n_hit); // "hit"s are instant because there's no lock contention assert_eq!(hist.total, Duration::from_secs(0)); let hist = get_metric_cache_get(&reporter, "miss"); let n = 1; assert_eq!(hist.sample_count(), n); assert_eq!(hist.total, (n as u32) * (d1 + d2)); let hist = get_metric_cache_get(&reporter, "miss_already_loading"); assert_eq!(hist.sample_count(), n_miss_already_loading); assert_eq!(hist.total, (n_miss_already_loading as u32) * d2); let hist = get_metric_cache_get(&reporter, "cancelled"); assert_eq!(hist.sample_count(), n_cancelled); assert_eq!(hist.total, (n_cancelled as u32) * d3); // check spans assert_n_spans(&traces, "hit", SpanStatus::Ok, n_hit as usize); assert_n_spans(&traces, "miss", SpanStatus::Ok, 1); assert_n_spans( &traces, "miss_already_loading", SpanStatus::Ok, n_miss_already_loading as usize, ); assert_n_spans( &traces, "cancelled", SpanStatus::Unknown, n_cancelled as usize, ); } #[tokio::test] async fn test_peek() { let test_cache = TestMetricsCache::new(); let traces = Arc::new(RingBufferTraceCollector::new(1_000)); let mut reporter = RawReporter::default(); test_cache.metric_registry.report(&mut reporter); for status in ["hit", "miss", "miss_already_loading", "cancelled"] { let hist = get_metric_cache_peek(&reporter, status); assert_eq!(hist.sample_count(), 0); assert_eq!(hist.total, Duration::from_secs(0)); } test_cache.loader.block_global(); test_cache .cache .peek(1, ((), Some(Span::root("miss", Arc::clone(&traces) as _)))) .await; let barrier_pending_1 = Arc::new(Barrier::new(2)); let barrier_pending_1_captured = Arc::clone(&barrier_pending_1); let cache_captured = Arc::clone(&test_cache.cache); let join_handle_1 = tokio::task::spawn(async move { cache_captured .get(1, (true, None)) .ensure_pending(barrier_pending_1_captured) .await }); barrier_pending_1.wait().await; let d1 = Duration::from_secs(1); test_cache.time_provider.inc(d1); let barrier_pending_2 = Arc::new(Barrier::new(2)); let barrier_pending_2_captured = Arc::clone(&barrier_pending_2); let traces_captured = Arc::clone(&traces); let cache_captured = Arc::clone(&test_cache.cache); let n_miss_already_loading = 10; let join_handle_2 = tokio::task::spawn(async move { (0..n_miss_already_loading) .map(|_| { cache_captured.peek( 1, ( (), Some(Span::root( "miss_already_loading", Arc::clone(&traces_captured) as _, )), ), ) }) .collect::<FuturesUnordered<_>>() .collect::<Vec<_>>() .ensure_pending(barrier_pending_2_captured) .await }); barrier_pending_2.wait().await; let d2 = Duration::from_secs(3); test_cache.time_provider.inc(d2); test_cache.loader.mock_next(1, "v".into()); test_cache.loader.unblock_global(); join_handle_1.await.unwrap(); join_handle_2.await.unwrap(); test_cache.loader.block_global(); test_cache.time_provider.inc(Duration::from_secs(10)); let n_hit = 100; for _ in 0..n_hit { test_cache .cache .peek(1, ((), Some(Span::root("hit", Arc::clone(&traces) as _)))) .await; } let n_cancelled = 200; let barrier_pending_3 = Arc::new(Barrier::new(2)); let barrier_pending_3_captured = Arc::clone(&barrier_pending_3); let cache_captured = Arc::clone(&test_cache.cache); tokio::task::spawn(async move { cache_captured .get(2, (true, None)) .ensure_pending(barrier_pending_3_captured) .await }); barrier_pending_3.wait().await; let barrier_pending_4 = Arc::new(Barrier::new(2)); let barrier_pending_4_captured = Arc::clone(&barrier_pending_4); let traces_captured = Arc::clone(&traces); let cache_captured = Arc::clone(&test_cache.cache); let join_handle_3 = tokio::task::spawn(async move { (0..n_cancelled) .map(|_| { cache_captured.peek( 2, ( (), Some(Span::root("cancelled", Arc::clone(&traces_captured) as _)), ), ) }) .collect::<FuturesUnordered<_>>() .collect::<Vec<_>>() .ensure_pending(barrier_pending_4_captured) .await }); barrier_pending_4.wait().await; let d3 = Duration::from_secs(20); test_cache.time_provider.inc(d3); join_handle_3.abort_and_wait().await; let mut reporter = RawReporter::default(); test_cache.metric_registry.report(&mut reporter); let hist = get_metric_cache_peek(&reporter, "hit"); assert_eq!(hist.sample_count(), n_hit); // "hit"s are instant because there's no lock contention assert_eq!(hist.total, Duration::from_secs(0)); let hist = get_metric_cache_peek(&reporter, "miss"); let n = 1; assert_eq!(hist.sample_count(), n); // "miss"es are instant assert_eq!(hist.total, Duration::from_secs(0)); let hist = get_metric_cache_peek(&reporter, "miss_already_loading"); assert_eq!(hist.sample_count(), n_miss_already_loading); assert_eq!(hist.total, (n_miss_already_loading as u32) * d2); let hist = get_metric_cache_peek(&reporter, "cancelled"); assert_eq!(hist.sample_count(), n_cancelled); assert_eq!(hist.total, (n_cancelled as u32) * d3); // check spans assert_n_spans(&traces, "hit", SpanStatus::Ok, n_hit as usize); assert_n_spans(&traces, "miss", SpanStatus::Ok, 1); assert_n_spans( &traces, "miss_already_loading", SpanStatus::Ok, n_miss_already_loading as usize, ); assert_n_spans( &traces, "cancelled", SpanStatus::Unknown, n_cancelled as usize, ); } #[tokio::test] async fn test_set() { let test_cache = TestMetricsCache::new(); let mut reporter = RawReporter::default(); test_cache.metric_registry.report(&mut reporter); assert_eq!( reporter .metric("iox_cache_set") .unwrap() .observation(&[("name", "test")]) .unwrap(), &Observation::U64Counter(0) ); test_cache.cache.set(1, String::from("foo")).await; let mut reporter = RawReporter::default(); test_cache.metric_registry.report(&mut reporter); assert_eq!( reporter .metric("iox_cache_set") .unwrap() .observation(&[("name", "test")]) .unwrap(), &Observation::U64Counter(1) ); } struct TestMetricsCache { loader: Arc<TestLoader>, time_provider: Arc<MockProvider>, metric_registry: metric::Registry, cache: Arc<CacheWithMetrics<CacheDriver<HashMap<u8, String>, TestLoader>>>, } impl TestMetricsCache { fn new() -> Self { Self::new_with_loader(Arc::new(TestLoader::default())) } fn new_with_loader(loader: Arc<TestLoader>) -> Self { let inner = CacheDriver::new(Arc::clone(&loader) as _, HashMap::new()); let time_provider = Arc::new(MockProvider::new(Time::from_timestamp_millis(0).unwrap())); let metric_registry = metric::Registry::new(); let cache = Arc::new(CacheWithMetrics::new( inner, "test", Arc::clone(&time_provider) as _, &metric_registry, )); Self { loader, time_provider, metric_registry, cache, } } } fn get_metric_cache_get( reporter: &RawReporter, status: &'static str, ) -> HistogramObservation<Duration> { if let Observation::DurationHistogram(hist) = reporter .metric("iox_cache_get") .unwrap() .observation(&[("name", "test"), ("status", status)]) .unwrap() { hist.clone() } else { panic!("Wrong observation type"); } } fn get_metric_cache_peek( reporter: &RawReporter, status: &'static str, ) -> HistogramObservation<Duration> { if let Observation::DurationHistogram(hist) = reporter .metric("iox_cache_peek") .unwrap() .observation(&[("name", "test"), ("status", status)]) .unwrap() { hist.clone() } else { panic!("Wrong observation type"); } } fn assert_n_spans( traces: &RingBufferTraceCollector, name: &'static str, status: SpanStatus, expected: usize, ) { let actual = traces .spans() .into_iter() .filter(|span| (span.name == name) && (span.status == status)) .count(); assert_eq!(actual, expected); } }
#![feature(inclusive_range_syntax)] #![feature(box_syntax)] #![feature(test)] extern crate test; extern crate bincode; extern crate serde; mod move_; mod cube; mod coordinate; mod solver; use std::env; use move_::UserMove; use cube::Cube; use coordinate::Coordinate; use solver::Solver; fn main() { let first_arg = env::args().nth(1); match first_arg { None => { println!("Usage") } Some(arg) => { if let Ok(shuffle_sequence) = UserMove::sequence_from_str(&arg) { let cube = Cube::from_shuffle_sequence(shuffle_sequence); let mut coordinate = Coordinate::from_cube(&cube); coordinate.init_pruning(); let solver = Solver::new(cube); solver.solve(); } } } }
use std::convert::{TryFrom, TryInto}; use std::fmt; use std::mem; use std::sync::Arc; use anyhow::*; use thiserror::Error; use crate::borrow::CloneToProcess; use crate::erts::exception::ErlangException; use crate::erts::process::alloc::TermAlloc; use crate::erts::process::trace::Trace; use crate::erts::term::prelude::*; use super::ArcError; #[derive(Error, Clone)] pub struct Throw { reason: Term, stacktrace: Arc<Trace>, source: Option<ArcError>, } impl Throw { pub fn new(reason: Term, stacktrace: Arc<Trace>, source: Option<ArcError>) -> Self { Self { reason, stacktrace, source, } } pub fn as_error_tuple<A>(&self, heap: &mut A) -> super::AllocResult<Term> where A: TermAlloc, { let class = Atom::THROW.as_term(); // NOTE: The trace is allocated in a fragment, so this is a single word always let trace = self.stacktrace.as_term()?; let tuple = if self.reason.is_immediate() { let mut tuple = heap.mut_tuple(3)?; tuple.set_element(0, class).unwrap(); tuple.set_element(1, self.reason).unwrap(); tuple.set_element(2, trace).unwrap(); tuple } else { let reason = self.reason.clone_to_heap(heap)?; let mut tuple = heap.mut_tuple(1 + self.reason.size_in_words() * mem::size_of::<Term>())?; tuple.set_element(0, class).unwrap(); tuple.set_element(1, reason).unwrap(); tuple.set_element(2, trace).unwrap(); tuple }; Ok(tuple.into()) } pub fn as_erlang_exception(&self) -> Box<ErlangException> { let class = Atom::THROW.as_term(); ErlangException::new(class, self.reason, self.stacktrace.clone()) } pub fn class(&self) -> Class { Class::Throw } pub fn reason(&self) -> Term { self.reason } pub fn stacktrace(&self) -> Arc<Trace> { self.stacktrace.clone() } pub fn source(&self) -> Option<ArcError> { self.source.clone() } } impl PartialEq for Throw { fn eq(&self, other: &Self) -> bool { self.reason == other.reason } } impl fmt::Debug for Throw { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Throw") .field("reason", &self.reason.decode()) .field("source", &self.source) .finish() } } impl fmt::Display for Throw { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.stacktrace .format( f, None, Atom::str_to_term("throw"), self.reason, self.source.clone(), ) .map_err(|_| fmt::Error) } } #[derive(Error, Clone)] pub struct Error { reason: Term, arguments: Option<Term>, stacktrace: Arc<Trace>, source: Option<ArcError>, } impl Error { pub fn new( reason: Term, arguments: Option<Term>, stacktrace: Arc<Trace>, source: Option<ArcError>, ) -> Self { Self { reason, arguments, stacktrace, source, } } pub fn as_error_tuple<A>(&self, heap: &mut A) -> super::AllocResult<Term> where A: TermAlloc, { let class = Atom::ERROR.as_term(); // NOTE: The trace is allocated in a fragment, so this is a single word always let trace = self.stacktrace.as_term()?; let tuple = if self.reason.is_immediate() { let mut tuple = heap.mut_tuple(3)?; tuple.set_element(0, class).unwrap(); tuple.set_element(1, self.reason).unwrap(); tuple.set_element(2, trace).unwrap(); tuple } else { let reason = self.reason.clone_to_heap(heap)?; let mut tuple = heap.mut_tuple(1 + self.reason.size_in_words() * mem::size_of::<Term>())?; tuple.set_element(0, class).unwrap(); tuple.set_element(1, reason).unwrap(); tuple.set_element(2, trace).unwrap(); tuple }; Ok(tuple.into()) } pub fn as_erlang_exception(&self) -> Box<ErlangException> { let class = Atom::ERROR.as_term(); ErlangException::new(class, self.reason, self.stacktrace.clone()) } pub fn arguments(&self) -> Option<Term> { self.arguments } pub fn class(&self) -> Class { Class::Error { arguments: self.arguments, } } pub fn reason(&self) -> Term { self.reason } pub fn stacktrace(&self) -> Arc<Trace> { self.stacktrace.clone() } pub fn source(&self) -> Option<ArcError> { self.source.clone() } } impl PartialEq for Error { fn eq(&self, other: &Self) -> bool { self.reason == other.reason } } impl fmt::Debug for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Error") .field("reason", &self.reason.decode()) .field("arguments", &self.arguments.map(|t| t.decode())) .field("source", &self.source) .finish() } } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.stacktrace .format( f, None, Atom::str_to_term("error"), self.reason, self.source.clone(), ) .map_err(|_| fmt::Error) } } #[derive(Error, Clone)] pub struct Exit { reason: Term, stacktrace: Arc<Trace>, source: Option<ArcError>, } impl Exit { pub fn new(reason: Term, stacktrace: Arc<Trace>, source: Option<ArcError>) -> Self { Self { reason, stacktrace, source, } } pub fn as_error_tuple<A>(&self, heap: &mut A) -> super::AllocResult<Term> where A: TermAlloc, { let class = Atom::EXIT.as_term(); // NOTE: The trace is allocated in a fragment, so this is a single word always let trace = self.stacktrace.as_term()?; let tuple = if self.reason.is_immediate() { let mut tuple = heap.mut_tuple(3)?; tuple.set_element(0, class).unwrap(); tuple.set_element(1, self.reason).unwrap(); tuple.set_element(2, trace).unwrap(); tuple } else { let reason = self.reason.clone_to_heap(heap)?; let mut tuple = heap.mut_tuple(1 + self.reason.size_in_words() * mem::size_of::<Term>())?; tuple.set_element(0, class).unwrap(); tuple.set_element(1, reason).unwrap(); tuple.set_element(2, trace).unwrap(); tuple }; Ok(tuple.into()) } pub fn as_erlang_exception(&self) -> Box<ErlangException> { let class = Atom::EXIT.as_term(); ErlangException::new(class, self.reason, self.stacktrace.clone()) } pub fn class(&self) -> Class { Class::Exit } pub fn reason(&self) -> Term { self.reason } pub fn stacktrace(&self) -> Arc<Trace> { self.stacktrace.clone() } pub fn source(&self) -> Option<ArcError> { self.source.clone() } } impl PartialEq for Exit { fn eq(&self, other: &Self) -> bool { self.reason == other.reason } } impl fmt::Debug for Exit { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Exit") .field("reason", &self.reason.decode()) .field("source", &self.source) .finish() } } impl fmt::Display for Exit { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.stacktrace .format( f, None, Atom::str_to_term("exit"), self.reason, self.source.clone(), ) .map_err(|_| fmt::Error) } } #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord)] pub enum Class { Error { arguments: Option<Term> }, Exit, Throw, } impl Class { pub fn as_atom(&self) -> Atom { match self { Self::Error { .. } => Atom::ERROR, Self::Exit => Atom::EXIT, Self::Throw => Atom::THROW, } } pub fn as_term(&self) -> Term { self.as_atom().as_term() } } impl fmt::Display for Class { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { Class::Error { .. } => f.write_str("error"), Class::Exit => f.write_str("exit"), Class::Throw => f.write_str("throw"), } } } impl TryFrom<Term> for Class { type Error = anyhow::Error; fn try_from(term: Term) -> anyhow::Result<Class> { use self::Class::*; let atom: Atom = term .try_into() .with_context(|| format!("class ({}) is not an atom", term))?; match atom.name() { "error" => Ok(Error { arguments: None }), "exit" => Ok(Exit), "throw" => Ok(Throw), name => Err(TryAtomFromTermError(name)) .context("supported exception classes are error, exit, or throw"), } } }
use std::collections::VecDeque; use std::net::TcpListener; use std::os::unix::io::{AsRawFd, RawFd}; use std::ptr; use std::sync::Mutex; use io_uring::opcode::types; use io_uring_callback::{Builder, IoHandle, IoUring}; use lazy_static::lazy_static; lazy_static! { static ref TOKEN_QUEUE: Mutex<VecDeque<(Token, i32)>> = Mutex::new(VecDeque::new()); static ref HANDLE_SLAB: Mutex<slab::Slab<IoHandle>> = Mutex::new(slab::Slab::new()); } #[derive(Clone, Debug)] enum Token { Accept, Poll { fd: RawFd, }, Read { fd: RawFd, buf_index: usize, }, Write { fd: RawFd, buf_index: usize, offset: usize, len: usize, }, } pub struct AcceptCount { fd: types::Fd, count: usize, } impl AcceptCount { fn new(fd: RawFd, count: usize) -> AcceptCount { AcceptCount { fd: types::Fd(fd), count: count, } } pub fn try_push_accept(&mut self, ring: &IoUring) { while self.count > 0 { let to_complete_token = Token::Accept; let mut handle_slab = HANDLE_SLAB.lock().unwrap(); let slab_entry = handle_slab.vacant_entry(); let slab_key = slab_entry.key(); let complete_fn = move |retval: i32| { let mut queue = TOKEN_QUEUE.lock().unwrap(); queue.push_back((to_complete_token, retval)); HANDLE_SLAB.lock().unwrap().remove(slab_key); }; let handle = unsafe { ring.accept(self.fd, ptr::null_mut(), ptr::null_mut(), 0, complete_fn) }; slab_entry.insert(handle); self.count -= 1; } } } fn main() { let ring = Builder::new().build(256).unwrap(); unsafe { ring.start_enter_syscall_thread(); } let listener = TcpListener::bind(("127.0.0.1", 3456)).unwrap(); let mut bufpool = Vec::with_capacity(64); let mut buf_alloc = slab::Slab::with_capacity(64); println!("listen {}", listener.local_addr().unwrap()); let mut accept = AcceptCount::new(listener.as_raw_fd(), 3); loop { accept.try_push_accept(&ring); ring.poll_completions(); let mut queue = TOKEN_QUEUE.lock().unwrap(); while !queue.is_empty() { let (token, ret) = queue.pop_front().unwrap(); match token { Token::Accept => { println!("accept"); accept.count += 1; let fd = ret; let to_complete_token = Token::Poll { fd }; let mut handle_slab = HANDLE_SLAB.lock().unwrap(); let slab_entry = handle_slab.vacant_entry(); let slab_key = slab_entry.key(); let complete_fn = move |retval: i32| { let mut queue = TOKEN_QUEUE.lock().unwrap(); queue.push_back((to_complete_token, retval)); HANDLE_SLAB.lock().unwrap().remove(slab_key); }; let handle = unsafe { ring.poll(types::Fd(fd), libc::POLLIN as _, complete_fn) }; slab_entry.insert(handle); } Token::Poll { fd } => { let (buf_index, buf) = match bufpool.pop() { Some(buf_index) => (buf_index, &mut buf_alloc[buf_index]), None => { let buf = vec![0u8; 2048].into_boxed_slice(); let buf_entry = buf_alloc.vacant_entry(); let buf_index = buf_entry.key(); (buf_index, buf_entry.insert(buf)) } }; let to_complete_token = Token::Read { fd, buf_index }; let mut handle_slab = HANDLE_SLAB.lock().unwrap(); let slab_entry = handle_slab.vacant_entry(); let slab_key = slab_entry.key(); let complete_fn = move |retval: i32| { let mut queue = TOKEN_QUEUE.lock().unwrap(); queue.push_back((to_complete_token, retval)); HANDLE_SLAB.lock().unwrap().remove(slab_key); }; let handle = unsafe { ring.read( types::Fd(fd), buf.as_mut_ptr(), buf.len() as _, 0, 0, complete_fn, ) }; slab_entry.insert(handle); } Token::Read { fd, buf_index } => { if ret == 0 { bufpool.push(buf_index); println!("shutdown"); unsafe { libc::close(fd); } } else { let len = ret as usize; let buf = &buf_alloc[buf_index]; let to_complete_token = Token::Write { fd, buf_index, len, offset: 0, }; let mut handle_slab = HANDLE_SLAB.lock().unwrap(); let slab_entry = handle_slab.vacant_entry(); let slab_key = slab_entry.key(); let complete_fn = move |retval: i32| { let mut queue = TOKEN_QUEUE.lock().unwrap(); queue.push_back((to_complete_token, retval)); HANDLE_SLAB.lock().unwrap().remove(slab_key); }; let handle = unsafe { ring.write(types::Fd(fd), buf.as_ptr(), len as _, 0, 0, complete_fn) }; slab_entry.insert(handle); } } Token::Write { fd, buf_index, offset, len, } => { let write_len = ret as usize; if offset + write_len >= len { bufpool.push(buf_index); let to_complete_token = Token::Poll { fd }; let mut handle_slab = HANDLE_SLAB.lock().unwrap(); let slab_entry = handle_slab.vacant_entry(); let slab_key = slab_entry.key(); let complete_fn = move |retval: i32| { let mut queue = TOKEN_QUEUE.lock().unwrap(); queue.push_back((to_complete_token, retval)); HANDLE_SLAB.lock().unwrap().remove(slab_key); }; let handle = unsafe { ring.poll(types::Fd(fd), libc::POLLIN as _, complete_fn) }; slab_entry.insert(handle); } else { let offset = offset + write_len; let len = len - offset; let buf = &buf_alloc[buf_index][offset..]; let to_complete_token = Token::Write { fd, buf_index, offset, len, }; let mut handle_slab = HANDLE_SLAB.lock().unwrap(); let slab_entry = handle_slab.vacant_entry(); let slab_key = slab_entry.key(); let complete_fn = move |retval: i32| { let mut queue = TOKEN_QUEUE.lock().unwrap(); queue.push_back((to_complete_token, retval)); HANDLE_SLAB.lock().unwrap().remove(slab_key); }; let handle = unsafe { ring.write(types::Fd(fd), buf.as_ptr(), len as _, 0, 0, complete_fn) }; slab_entry.insert(handle); }; } } } } }
use std::fs::File; use std::io::{BufRead, BufReader, Write}; use std::path::Path; use std::env; use std::borrow::Cow; pub mod snowball; use snowball::SnowballEnv; fn usage(name: &str) { println!("{} -l <language> [-i <input file>] [-o <output file>] The input file consists of a list of words to be stemmed, one per line. Words should be in lower case, but (for English) A-Z letters are mapped to their a-z equivalents anyway. If omitted, stdin is used.", name); } fn main() { let args: Vec<String> = env::args().collect(); if args.len() < 3 { usage(&args[0]); } else { let mut language = None; let mut input_arg = None; let mut output_arg = None; let mut i = 1; while i < args.len() { match args[i].as_str() { "-l" => { language = Some(args[i+1].clone()); i += 2; }, "-i" => { input_arg = Some(args[i+1].clone()); i += 2; }, "-o" => { output_arg = Some(args[i+1].clone()); i += 2; }, x => { println!("Unrecognized option '{}'", x); usage(&args[0]); return } } } if language.is_none() { println!("Please specify a language!"); usage(&args[0]); return; } let stemmer = Stemmer::create(language.unwrap()); let mut output = if let Some(output_file) = output_arg { Box::new(File::create(Path::new(&output_file)).unwrap()) as Box<dyn Write> } else { Box::new(std::io::stdout()) as Box<dyn Write> }; if let Some(input_file) = input_arg { for line in BufReader::new(File::open(Path::new(&input_file)).unwrap()).lines() { writeln!(&mut output, "{}", stemmer.stem(&line.unwrap())).unwrap(); } } else { let stdin = std::io::stdin(); for line in stdin.lock().lines() { writeln!(&mut output, "{}", stemmer.stem(&line.unwrap())).unwrap(); } } } } /// Wraps a usable interface around the actual stemmer implementation pub struct Stemmer { stemmer: fn(&mut SnowballEnv) -> bool, } impl Stemmer { /// Create a new stemmer from an algorithm pub fn create(lang: String) -> Self { // Have a look at ../build.rs // There we generate a file that is rust code for a closure that returns a stemmer. // We match against all the algorithms in src/snowball/algoritms/ folder. // Alas, this cannot be included as a match statement or function because of Rust's // hygenic macros. let match_language = include!(concat!(env!("OUT_DIR"), "/lang_matches.rs")); match_language(lang) } /// Stem a single word /// Please note, that the input is expected to be all lowercase (if that is applicable). pub fn stem<'a>(&self, input: &'a str) -> Cow<'a, str> { let mut env = SnowballEnv::create(input); (self.stemmer)(&mut env); env.get_current() } }
use std::{sync::Arc, time::Duration}; use tokio::sync::Barrier; use crate::{ cache::{CacheGetStatus, CachePeekStatus}, loader::test_util::TestLoader, test_util::{AbortAndWaitExt, EnsurePendingExt}, }; use super::Cache; /// Interface between generic tests and a concrete cache type. pub trait TestAdapter: Send + Sync + 'static { /// Extra information for GET. type GetExtra: Send; /// Extra information for PEEK. type PeekExtra: Send; /// Cache type. type Cache: Cache<K = u8, V = String, GetExtra = Self::GetExtra, PeekExtra = Self::PeekExtra>; /// Create new cache with given loader. fn construct(&self, loader: Arc<TestLoader>) -> Arc<Self::Cache>; /// Build [`GetExtra`](Self::GetExtra). /// /// Must contain a [`bool`] payload that is later included into the value string for testing purposes. fn get_extra(&self, inner: bool) -> Self::GetExtra; /// Build [`PeekExtra`](Self::PeekExtra). fn peek_extra(&self) -> Self::PeekExtra; } /// Setup test. fn setup<T>(adapter: &T) -> (Arc<T::Cache>, Arc<TestLoader>) where T: TestAdapter, { let loader = Arc::new(TestLoader::default()); let cache = adapter.construct(Arc::clone(&loader)); (cache, loader) } pub async fn run_test_generic<T>(adapter: T) where T: TestAdapter, { let adapter = Arc::new(adapter); test_answers_are_correct(Arc::clone(&adapter)).await; test_linear_memory(Arc::clone(&adapter)).await; test_concurrent_query_loads_once(Arc::clone(&adapter)).await; test_queries_are_parallelized(Arc::clone(&adapter)).await; test_cancel_request(Arc::clone(&adapter)).await; test_panic_request(Arc::clone(&adapter)).await; test_drop_cancels_loader(Arc::clone(&adapter)).await; test_set_before_request(Arc::clone(&adapter)).await; test_set_during_request(Arc::clone(&adapter)).await; } async fn test_answers_are_correct<T>(adapter: Arc<T>) where T: TestAdapter, { let (cache, loader) = setup(adapter.as_ref()); loader.mock_next(1, "res_1".to_owned()); loader.mock_next(2, "res_2".to_owned()); assert_eq!( cache.get(1, adapter.get_extra(true)).await, String::from("res_1") ); assert_eq!( cache.peek(1, adapter.peek_extra()).await, Some(String::from("res_1")) ); assert_eq!( cache.get(2, adapter.get_extra(false)).await, String::from("res_2") ); assert_eq!( cache.peek(2, adapter.peek_extra()).await, Some(String::from("res_2")) ); } async fn test_linear_memory<T>(adapter: Arc<T>) where T: TestAdapter, { let (cache, loader) = setup(adapter.as_ref()); loader.mock_next(1, "res_1".to_owned()); loader.mock_next(2, "res_2".to_owned()); assert_eq!(cache.peek_with_status(1, adapter.peek_extra()).await, None,); assert_eq!( cache.get_with_status(1, adapter.get_extra(true)).await, (String::from("res_1"), CacheGetStatus::Miss), ); assert_eq!( cache.get_with_status(1, adapter.get_extra(false)).await, (String::from("res_1"), CacheGetStatus::Hit), ); assert_eq!( cache.peek_with_status(1, adapter.peek_extra()).await, Some((String::from("res_1"), CachePeekStatus::Hit)), ); assert_eq!( cache.get_with_status(2, adapter.get_extra(false)).await, (String::from("res_2"), CacheGetStatus::Miss), ); assert_eq!( cache.get_with_status(2, adapter.get_extra(false)).await, (String::from("res_2"), CacheGetStatus::Hit), ); assert_eq!( cache.get_with_status(1, adapter.get_extra(true)).await, (String::from("res_1"), CacheGetStatus::Hit), ); assert_eq!( cache.peek_with_status(1, adapter.peek_extra()).await, Some((String::from("res_1"), CachePeekStatus::Hit)), ); assert_eq!(loader.loaded(), vec![(1, true), (2, false)]); } async fn test_concurrent_query_loads_once<T>(adapter: Arc<T>) where T: TestAdapter, { let (cache, loader) = setup(adapter.as_ref()); loader.block_global(); let adapter_captured = Arc::clone(&adapter); let cache_captured = Arc::clone(&cache); let barrier_pending_1 = Arc::new(Barrier::new(2)); let barrier_pending_1_captured = Arc::clone(&barrier_pending_1); let handle_1 = tokio::spawn(async move { cache_captured .get_with_status(1, adapter_captured.get_extra(true)) .ensure_pending(barrier_pending_1_captured) .await }); barrier_pending_1.wait().await; let barrier_pending_2 = Arc::new(Barrier::new(3)); let adapter_captured = Arc::clone(&adapter); let cache_captured = Arc::clone(&cache); let barrier_pending_2_captured = Arc::clone(&barrier_pending_2); let handle_2 = tokio::spawn(async move { // use a different `extra` here to proof that the first one was used cache_captured .get_with_status(1, adapter_captured.get_extra(false)) .ensure_pending(barrier_pending_2_captured) .await }); let barrier_pending_2_captured = Arc::clone(&barrier_pending_2); let handle_3 = tokio::spawn(async move { // use a different `extra` here to proof that the first one was used cache .peek_with_status(1, adapter.peek_extra()) .ensure_pending(barrier_pending_2_captured) .await }); barrier_pending_2.wait().await; loader.mock_next(1, "res_1".to_owned()); // Shouldn't issue concurrent load requests for the same key let n_blocked = loader.unblock_global(); assert_eq!(n_blocked, 1); assert_eq!( handle_1.await.unwrap(), (String::from("res_1"), CacheGetStatus::Miss), ); assert_eq!( handle_2.await.unwrap(), (String::from("res_1"), CacheGetStatus::MissAlreadyLoading), ); assert_eq!( handle_3.await.unwrap(), Some((String::from("res_1"), CachePeekStatus::MissAlreadyLoading)), ); assert_eq!(loader.loaded(), vec![(1, true)]); } async fn test_queries_are_parallelized<T>(adapter: Arc<T>) where T: TestAdapter, { let (cache, loader) = setup(adapter.as_ref()); loader.block_global(); let barrier = Arc::new(Barrier::new(4)); let adapter_captured = Arc::clone(&adapter); let cache_captured = Arc::clone(&cache); let barrier_captured = Arc::clone(&barrier); let handle_1 = tokio::spawn(async move { cache_captured .get(1, adapter_captured.get_extra(true)) .ensure_pending(barrier_captured) .await }); let adapter_captured = Arc::clone(&adapter); let cache_captured = Arc::clone(&cache); let barrier_captured = Arc::clone(&barrier); let handle_2 = tokio::spawn(async move { cache_captured .get(1, adapter_captured.get_extra(true)) .ensure_pending(barrier_captured) .await }); let barrier_captured = Arc::clone(&barrier); let handle_3 = tokio::spawn(async move { cache .get(2, adapter.get_extra(false)) .ensure_pending(barrier_captured) .await }); barrier.wait().await; loader.mock_next(1, "res_1".to_owned()); loader.mock_next(2, "res_2".to_owned()); let n_blocked = loader.unblock_global(); assert_eq!(n_blocked, 2); assert_eq!(handle_1.await.unwrap(), String::from("res_1")); assert_eq!(handle_2.await.unwrap(), String::from("res_1")); assert_eq!(handle_3.await.unwrap(), String::from("res_2")); assert_eq!(loader.loaded(), vec![(1, true), (2, false)]); } async fn test_cancel_request<T>(adapter: Arc<T>) where T: TestAdapter, { let (cache, loader) = setup(adapter.as_ref()); loader.block_global(); let barrier_pending_1 = Arc::new(Barrier::new(2)); let barrier_pending_1_captured = Arc::clone(&barrier_pending_1); let adapter_captured = Arc::clone(&adapter); let cache_captured = Arc::clone(&cache); let handle_1 = tokio::spawn(async move { cache_captured .get(1, adapter_captured.get_extra(true)) .ensure_pending(barrier_pending_1_captured) .await }); barrier_pending_1.wait().await; let barrier_pending_2 = Arc::new(Barrier::new(2)); let barrier_pending_2_captured = Arc::clone(&barrier_pending_2); let handle_2 = tokio::spawn(async move { cache .get(1, adapter.get_extra(false)) .ensure_pending(barrier_pending_2_captured) .await }); barrier_pending_2.wait().await; // abort first handle handle_1.abort_and_wait().await; loader.mock_next(1, "res_1".to_owned()); let n_blocked = loader.unblock_global(); assert_eq!(n_blocked, 1); assert_eq!(handle_2.await.unwrap(), String::from("res_1")); assert_eq!(loader.loaded(), vec![(1, true)]); } async fn test_panic_request<T>(adapter: Arc<T>) where T: TestAdapter, { let (cache, loader) = setup(adapter.as_ref()); loader.block_global(); // set up initial panicking request let barrier_pending_get_panic = Arc::new(Barrier::new(2)); let barrier_pending_get_panic_captured = Arc::clone(&barrier_pending_get_panic); let adapter_captured = Arc::clone(&adapter); let cache_captured = Arc::clone(&cache); let handle_get_panic = tokio::spawn(async move { cache_captured .get(1, adapter_captured.get_extra(true)) .ensure_pending(barrier_pending_get_panic_captured) .await }); barrier_pending_get_panic.wait().await; // set up other requests let barrier_pending_others = Arc::new(Barrier::new(4)); let barrier_pending_others_captured = Arc::clone(&barrier_pending_others); let adapter_captured = Arc::clone(&adapter); let cache_captured = Arc::clone(&cache); let handle_get_while_loading_panic = tokio::spawn(async move { cache_captured .get(1, adapter_captured.get_extra(false)) .ensure_pending(barrier_pending_others_captured) .await }); let barrier_pending_others_captured = Arc::clone(&barrier_pending_others); let adapter_captured = Arc::clone(&adapter); let cache_captured = Arc::clone(&cache); let handle_peek_while_loading_panic = tokio::spawn(async move { cache_captured .peek(1, adapter_captured.peek_extra()) .ensure_pending(barrier_pending_others_captured) .await }); let barrier_pending_others_captured = Arc::clone(&barrier_pending_others); let adapter_captured = Arc::clone(&adapter); let cache_captured = Arc::clone(&cache); let handle_get_other_key = tokio::spawn(async move { cache_captured .get(2, adapter_captured.get_extra(false)) .ensure_pending(barrier_pending_others_captured) .await }); barrier_pending_others.wait().await; loader.panic_next(1); loader.mock_next(1, "res_1".to_owned()); loader.mock_next(2, "res_2".to_owned()); let n_blocked = loader.unblock_global(); assert_eq!(n_blocked, 2); // panic of initial request handle_get_panic.await.unwrap_err(); // requests that use the same loading status also panic handle_get_while_loading_panic.await.unwrap_err(); handle_peek_while_loading_panic.await.unwrap_err(); // unrelated request should succeed assert_eq!(handle_get_other_key.await.unwrap(), String::from("res_2")); // failing key was tried exactly once (and the other unrelated key as well) assert_eq!(loader.loaded(), vec![(1, true), (2, false)]); // loading after panic just works (no poisoning) assert_eq!( cache.get(1, adapter.get_extra(false)).await, String::from("res_1") ); assert_eq!(loader.loaded(), vec![(1, true), (2, false), (1, false)]); } async fn test_drop_cancels_loader<T>(adapter: Arc<T>) where T: TestAdapter, { let (cache, loader) = setup(adapter.as_ref()); loader.block_global(); let barrier_pending = Arc::new(Barrier::new(2)); let barrier_pending_captured = Arc::clone(&barrier_pending); let handle = tokio::spawn(async move { cache .get(1, adapter.get_extra(true)) .ensure_pending(barrier_pending_captured) .await }); barrier_pending.wait().await; handle.abort_and_wait().await; assert_eq!(Arc::strong_count(&loader), 1); } async fn test_set_before_request<T>(adapter: Arc<T>) where T: TestAdapter, { let (cache, loader) = setup(adapter.as_ref()); loader.block_global(); cache.set(1, String::from("foo")).await; // blocked loader is not used let res = tokio::time::timeout( Duration::from_millis(10), cache.get(1, adapter.get_extra(false)), ) .await .unwrap(); assert_eq!(res, String::from("foo")); assert_eq!(loader.loaded(), Vec::<(u8, bool)>::new()); } async fn test_set_during_request<T>(adapter: Arc<T>) where T: TestAdapter, { let (cache, loader) = setup(adapter.as_ref()); loader.block_global(); let adapter_captured = Arc::clone(&adapter); let cache_captured = Arc::clone(&cache); let barrier_pending = Arc::new(Barrier::new(2)); let barrier_pending_captured = Arc::clone(&barrier_pending); let handle = tokio::spawn(async move { cache_captured .get(1, adapter_captured.get_extra(true)) .ensure_pending(barrier_pending_captured) .await }); barrier_pending.wait().await; cache.set(1, String::from("foo")).await; // request succeeds even though the loader is blocked let res = tokio::time::timeout(Duration::from_millis(10), handle) .await .unwrap() .unwrap(); assert_eq!(res, String::from("foo")); assert_eq!(loader.loaded(), vec![(1, true)]); // still cached let res = tokio::time::timeout( Duration::from_millis(10), cache.get(1, adapter.get_extra(false)), ) .await .unwrap(); assert_eq!(res, String::from("foo")); assert_eq!(loader.loaded(), vec![(1, true)]); }
use lsp_text::RopeExt; pub fn diagnostics(tree: &tree_sitter::Tree, content: &ropey::Rope) -> Vec<lsp::Diagnostic> { let mut diagnostics = vec![]; let mut work = vec![tree.root_node()]; let mut cursor = tree.root_node().walk(); while let Some(node) = work.pop() { let range = { let start = content.byte_to_lsp_position(node.start_byte() as usize); let end = content.byte_to_lsp_position(node.end_byte() as usize); lsp::Range { start, end } }; if node.is_error() { let message = String::from("ERROR node"); let severity = Some(lsp::DiagnosticSeverity::Error); diagnostics.push(lsp::Diagnostic { message, range, severity, ..Default::default() }); continue; } if node.is_missing() { let message = String::from("MISSING node"); let severity = Some(lsp::DiagnosticSeverity::Error); diagnostics.push(lsp::Diagnostic { message, range, severity, ..Default::default() }); continue; } if node.has_error() { cursor.reset(node.clone()); work.extend(node.named_children(&mut cursor)); } } diagnostics }
use axum_lib as axum; use axum::{body::Body, http::Response, response::IntoResponse}; use http::{header, StatusCode}; use crate::binding::http::builder::adapter::to_response; use crate::event::Event; impl IntoResponse for Event { type Body = Body; type BodyError = <Self::Body as axum::body::HttpBody>::Error; fn into_response(self) -> Response<Body> { match to_response(self) { Ok(resp) => resp, Err(err) => Response::builder() .status(StatusCode::INTERNAL_SERVER_ERROR) .header(header::CONTENT_TYPE, "text/plain") .body(err.to_string().into()) .unwrap(), } } } #[cfg(test)] mod tests { use super::*; use crate::test::fixtures; #[test] fn axum_test_response() { let input = fixtures::v10::minimal_string_extension(); let resp = input.into_response(); assert_eq!( resp.headers() .get("ce-specversion") .unwrap() .to_str() .unwrap(), "1.0" ); assert_eq!( resp.headers().get("ce-id").unwrap().to_str().unwrap(), "0001" ); assert_eq!( resp.headers().get("ce-type").unwrap().to_str().unwrap(), "test_event.test_application" ); assert_eq!( resp.headers().get("ce-source").unwrap().to_str().unwrap(), "http://localhost/" ); assert_eq!( resp.headers().get("ce-someint").unwrap().to_str().unwrap(), "10" ); } #[tokio::test] async fn axum_test_response_with_full_data() { let input = fixtures::v10::full_binary_json_data_string_extension(); let resp = input.into_response(); assert_eq!( resp.headers() .get("ce-specversion") .unwrap() .to_str() .unwrap(), "1.0" ); assert_eq!( resp.headers().get("ce-id").unwrap().to_str().unwrap(), "0001" ); assert_eq!( resp.headers().get("ce-type").unwrap().to_str().unwrap(), "test_event.test_application" ); assert_eq!( resp.headers().get("ce-source").unwrap().to_str().unwrap(), "http://localhost/" ); assert_eq!( resp.headers() .get("content-type") .unwrap() .to_str() .unwrap(), "application/json" ); assert_eq!( resp.headers().get("ce-int_ex").unwrap().to_str().unwrap(), "10" ); let (_, body) = resp.into_parts(); let body = hyper::body::to_bytes(body).await.unwrap(); assert_eq!(fixtures::json_data_binary(), body); } }
pub mod redis_pool;
use std::collections::HashMap; struct NucleotideMap(HashMap<char, usize>); impl NucleotideMap { fn new() -> Self { let mut map = HashMap::new(); for c in ['A', 'T', 'C', 'G'].into_iter() { map.insert(*c, 0); } NucleotideMap(map) } } pub fn count(nucleotide: char, dna_string: &str) -> usize { let mut count = 0; for c in dna_string.chars() { if c == nucleotide { count += 1; } } count } pub fn nucleotide_counts(dna_string: &str) -> HashMap<char, usize> { let NucleotideMap(mut counts) = NucleotideMap::new(); for c in dna_string.chars() { if let Some(mut count) = counts.get_mut(&c) { *count += 1; } } counts }
use fake::Dummy; use stark_hash::Felt; use crate::{ToProtobuf, TryFromProtobuf}; use super::common::{BlockBody, BlockHeader}; use super::proto; #[derive(Debug, Clone, PartialEq, Eq)] pub enum Message { NewBlockHeader(NewBlockHeader), NewBlockBody(NewBlockBody), NewBlockState(NewBlockState), } impl Message { pub fn from_protobuf_encoding(bytes: &[u8]) -> std::io::Result<Self> { use prost::Message; let message = proto::propagation::Message::decode(bytes)?; TryFromProtobuf::try_from_protobuf(message, "message") } pub fn into_protobuf_encoding(self) -> Vec<u8> { use prost::Message; let message: proto::propagation::Message = self.to_protobuf(); let mut buf = Vec::with_capacity(message.encoded_len()); message .encode(&mut buf) .expect("Buffer provides enough capacity"); buf } } impl TryFromProtobuf<proto::propagation::Message> for Message { fn try_from_protobuf( value: proto::propagation::Message, field_name: &'static str, ) -> Result<Self, std::io::Error> { match value.message { Some(m) => match m { proto::propagation::message::Message::NewBlockHeader(m) => Ok( Message::NewBlockHeader(TryFromProtobuf::try_from_protobuf(m, field_name)?), ), proto::propagation::message::Message::NewBlockBody(m) => Ok(Message::NewBlockBody( TryFromProtobuf::try_from_protobuf(m, field_name)?, )), proto::propagation::message::Message::NewBlockState(m) => Ok( Message::NewBlockState(TryFromProtobuf::try_from_protobuf(m, field_name)?), ), }, None => Err(std::io::Error::new( std::io::ErrorKind::InvalidData, format!("Missing field {field_name}"), )), } } } impl ToProtobuf<proto::propagation::Message> for Message { fn to_protobuf(self) -> proto::propagation::Message { let message = match self { Message::NewBlockHeader(h) => proto::propagation::message::Message::NewBlockHeader( proto::propagation::NewBlockHeader { header: Some(h.header.to_protobuf()), }, ), Message::NewBlockBody(h) => proto::propagation::message::Message::NewBlockBody( proto::propagation::NewBlockBody { block_hash: Some(h.block_hash.to_protobuf()), body: Some(h.body.to_protobuf()), }, ), Message::NewBlockState(h) => proto::propagation::message::Message::NewBlockState( proto::propagation::NewBlockState { block_hash: Some(h.block_hash.to_protobuf()), state_update: Some(h.state_update.to_protobuf()), }, ), }; proto::propagation::Message { message: Some(message), } } } #[derive(Debug, Clone, PartialEq, Eq, ToProtobuf, TryFromProtobuf, Dummy)] #[protobuf(name = "crate::proto::propagation::NewBlockHeader")] pub struct NewBlockHeader { pub header: BlockHeader, } #[derive(Debug, Clone, PartialEq, Eq, ToProtobuf, TryFromProtobuf, Dummy)] #[protobuf(name = "crate::proto::propagation::NewBlockBody")] pub struct NewBlockBody { pub block_hash: Felt, pub body: BlockBody, } #[derive(Debug, Clone, PartialEq, Eq, ToProtobuf, TryFromProtobuf, Dummy)] #[protobuf(name = "crate::proto::propagation::NewBlockState")] pub struct NewBlockState { pub block_hash: Felt, pub state_update: BlockStateUpdate, } #[derive(Debug, Clone, PartialEq, Eq, ToProtobuf, TryFromProtobuf, Dummy)] #[protobuf(name = "crate::proto::propagation::BlockStateUpdate")] pub struct BlockStateUpdate { pub contract_diffs: Vec<ContractDiff>, pub deployed_contracts: Vec<DeployedContract>, pub declared_cairo_classes: Vec<Felt>, pub declared_classes: Vec<DeclaredClass>, pub replaced_classes: Vec<ReplacedClass>, } #[derive(Debug, Clone, PartialEq, Eq, ToProtobuf, TryFromProtobuf, Dummy)] #[protobuf(name = "crate::proto::propagation::block_state_update::ContractDiff")] pub struct ContractDiff { pub contract_address: Felt, pub nonce: Felt, pub storage_diffs: Vec<StorageDiff>, } #[derive(Debug, Clone, PartialEq, Eq, ToProtobuf, TryFromProtobuf, Dummy)] #[protobuf(name = "crate::proto::propagation::block_state_update::StorageDiff")] pub struct StorageDiff { pub key: Felt, pub value: Felt, } #[derive(Debug, Clone, PartialEq, Eq, ToProtobuf, TryFromProtobuf, Dummy)] #[protobuf(name = "crate::proto::propagation::block_state_update::DeployedContract")] pub struct DeployedContract { pub contract_address: Felt, pub class_hash: Felt, } #[derive(Debug, Clone, PartialEq, Eq, ToProtobuf, TryFromProtobuf, Dummy)] #[protobuf(name = "crate::proto::propagation::block_state_update::DeclaredClass")] pub struct DeclaredClass { pub sierra_hash: Felt, pub casm_hash: Felt, } #[derive(Debug, Clone, PartialEq, Eq, ToProtobuf, TryFromProtobuf, Dummy)] #[protobuf(name = "crate::proto::propagation::block_state_update::ReplacedClass")] pub struct ReplacedClass { pub contract_address: Felt, pub class_hash: Felt, }
use crate::{InputType, InputValueError}; pub fn chars_min_length<T: AsRef<str> + InputType>( value: &T, len: usize, ) -> Result<(), InputValueError<T>> { if value.as_ref().chars().count() >= len { Ok(()) } else { Err(format!( "the chars length is {}, must be greater than or equal to {}", value.as_ref().len(), len ) .into()) } } #[cfg(test)] mod tests { use super::*; #[test] fn test_chars_min_length() { assert!(chars_min_length(&"你好".to_string(), 3).is_err()); assert!(chars_min_length(&"你好啊".to_string(), 3).is_ok()); assert!(chars_min_length(&"嗨你好啊".to_string(), 3).is_ok()); } }
use gl::types::*; use super::{ShaderExt, Shader}; use anyhow::Result; pub type GeometryShader = Shader<Geometry>; pub struct Geometry(); impl ShaderExt for Geometry { fn new() -> Geometry { Geometry{} } fn ty() -> GLenum { gl::GEOMETRY_SHADER } fn name() -> &'static str { "geometry" } } impl GeometryShader { pub fn from_source(source: &str) -> Result<GeometryShader> { let mut shader = GeometryShader::new(); shader.set_source(source); shader.compile()?; Ok(shader) } }
#[macro_use] extern crate nom; mod client; mod dispatcher; mod message; mod parser; mod event_listener; use std::net::{TcpListener, TcpStream}; use std::io; use std::thread; use std::sync::mpsc; fn spawn_client(conn: TcpStream, notify: mpsc::Sender<dispatcher::Message>) -> thread::JoinHandle<Result<(), client::ClientError>> { thread::spawn(move || { let (tx, rx) = mpsc::channel(); let client = try!(client::Client::<TcpStream>::new(conn, rx)); let id = client.id; try!(notify.send(dispatcher::Message::ClientConnected(tx, id)).or(Err(client::ClientError::Other))); client.run() }) } pub fn main() { let dispatcher = dispatcher::Dispatcher::new(); let server_tx = dispatcher.tx.clone(); thread::spawn(move ||{ let server_listener = TcpListener::bind("127.0.0.1:9090").unwrap(); let (stream, _) = server_listener.accept().unwrap(); let event_listener = event_listener::EventListener::new(io::BufReader::new(stream), server_tx); event_listener.run(); }); let clients_tx = dispatcher.tx.clone(); thread::spawn(move || { let client_listener = TcpListener::bind("127.0.0.1:9099").unwrap(); for client_conn in client_listener.incoming() { if let Ok(conn) = client_conn { spawn_client(conn, clients_tx.clone()); } else { println!("ERROR accepting connection {:?}", client_conn); } } }); dispatcher.run(); }
use serde::ser; use super::{ error::{Error, Result}, eth::Fixed, }; pub struct BasicEthSerializer { /// offset keeps track of the current position offset: i8, /// offset_sign is the sign to move the offset forward. /// Use -1 for big endian arrays and 1 for little endian arrays offset_sign: i8, /// serializer_type is the type of serializer to do serializer_type: Fixed, /// content that the serializer aggregates. Call `serialize` to /// have the hex serialization of the data content: [u8; 32], } impl BasicEthSerializer { /// new_hash creates a new serializer for ethereum /// hash types. These are stored as u8 arrays with /// little endian byte order pub fn new_hash(len: usize) -> Self { if len != 20 && len != 32 { panic!("BasicEthSerializer only supports H160, H256") } BasicEthSerializer { offset: 32 - (len as i8), offset_sign: 1, serializer_type: if len == 20 { Fixed::H160 } else { Fixed::H256 }, content: [0; 32], } } /// new_uint creates a new serializer for ethereum /// unsigned types. These are stored as u64 arrays with /// big endian byte order pub fn new_uint(len: usize) -> Self { if len != 32 { panic!("BasicEthSerializer only supports U256") } BasicEthSerializer { offset: 31, content: [0; 32], serializer_type: Fixed::U256, offset_sign: -1, } } pub fn serialize(&self) -> String { hex::encode(self.content) } } impl<'a> ser::Serializer for &'a mut BasicEthSerializer { type Ok = (); type Error = Error; type SerializeSeq = Self; type SerializeTuple = Self; type SerializeTupleStruct = Self; type SerializeTupleVariant = Self; type SerializeMap = Self; type SerializeStruct = Self; type SerializeStructVariant = Self; fn serialize_bool(self, _value: bool) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_i8(self, value: i8) -> Result<Self::Ok> { match self.serializer_type { Fixed::U256 => panic!("received i8 when serializing U256"), Fixed::H256 | Fixed::H160 => { self.content[self.offset as usize] = value as u8; self.offset += self.offset_sign; Ok(()) } } } fn serialize_i16(self, _value: i16) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_i32(self, _value: i32) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_i64(self, _value: i64) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_u8(self, value: u8) -> Result<Self::Ok> { match self.serializer_type { Fixed::U256 => panic!("received u8 when serializing U256"), Fixed::H256 | Fixed::H160 => { self.content[self.offset as usize] = value; self.offset += self.offset_sign; Ok(()) } } } fn serialize_u16(self, _value: u16) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_u32(self, value: u32) -> Result<Self::Ok> { match self.serializer_type { Fixed::H256 | Fixed::H160 => panic!("received u32 when serializing H256,H160"), Fixed::U256 => { for byte_index in 0..4 { let index = (self.offset + byte_index * self.offset_sign) as usize; self.content[index] = ((value >> (8 * byte_index)) & 0x00ff) as u8; } self.offset += 4 * self.offset_sign; Ok(()) } } } fn serialize_u64(self, value: u64) -> Result<Self::Ok> { match self.serializer_type { Fixed::H256 | Fixed::H160 => panic!("received u64 when serializing H256,H160"), Fixed::U256 => { for byte_index in 0..8 { let index = (self.offset + byte_index * self.offset_sign) as usize; self.content[index] = ((value >> (8 * byte_index)) & 0x00ff) as u8; } self.offset += 8 * self.offset_sign; Ok(()) } } } fn serialize_f32(self, __value: f32) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_f64(self, __value: f64) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_char(self, _value: char) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_str(self, _value: &str) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_bytes(self, _value: &[u8]) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_none(self) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_some<T: ?Sized + ser::Serialize>(self, _value: &T) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_unit(self) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_unit_struct(self, _name: &'static str) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_unit_variant( self, _name: &'static str, _variant_index: u32, _variant: &'static str, ) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_newtype_struct<T: ?Sized + ser::Serialize>( self, _name: &'static str, _value: &T, ) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_newtype_variant<T: ?Sized + ser::Serialize>( self, _name: &'static str, _variant_index: u32, _variant: &'static str, _value: &T, ) -> Result<Self::Ok> { Err(Error::not_implemented()) } fn serialize_seq(self, _len: Option<usize>) -> Result<Self::SerializeSeq> { Err(Error::not_implemented()) } fn serialize_tuple(self, _len: usize) -> Result<Self::SerializeTuple> { Err(Error::not_implemented()) } fn serialize_tuple_struct( self, _name: &'static str, _len: usize, ) -> Result<Self::SerializeTupleStruct> { Err(Error::not_implemented()) } fn serialize_tuple_variant( self, _name: &'static str, _variant_index: u32, _variant: &'static str, _len: usize, ) -> Result<Self::SerializeTupleVariant> { Err(Error::not_implemented()) } fn serialize_map(self, _len: Option<usize>) -> Result<Self::SerializeMap> { Err(Error::not_implemented()) } fn serialize_struct(self, _name: &'static str, _len: usize) -> Result<Self::SerializeStruct> { Err(Error::not_implemented()) } fn serialize_struct_variant( self, _name: &'static str, _variant_index: u32, _variant: &'static str, _len: usize, ) -> Result<Self::SerializeStruct> { Err(Error::not_implemented()) } } impl<'a> ser::SerializeSeq for &'a mut BasicEthSerializer { type Ok = (); type Error = Error; fn serialize_element<T: ?Sized + ser::Serialize>(&mut self, _value: &T) -> Result<()> { Err(Error::not_implemented()) } fn end(self) -> Result<()> { Err(Error::not_implemented()) } } impl<'a> ser::SerializeTuple for &'a mut BasicEthSerializer { type Ok = (); type Error = Error; fn serialize_element<T: ?Sized + ser::Serialize>(&mut self, _value: &T) -> Result<()> { Err(Error::not_implemented()) } fn end(self) -> Result<()> { Err(Error::not_implemented()) } } impl<'a> ser::SerializeTupleStruct for &'a mut BasicEthSerializer { type Ok = (); type Error = Error; fn serialize_field<T: ?Sized + ser::Serialize>(&mut self, _value: &T) -> Result<()> { Err(Error::not_implemented()) } fn end(self) -> Result<()> { Err(Error::not_implemented()) } } impl<'a> ser::SerializeTupleVariant for &'a mut BasicEthSerializer { type Ok = (); type Error = Error; fn serialize_field<T: ?Sized + ser::Serialize>(&mut self, _value: &T) -> Result<()> { Err(Error::not_implemented()) } fn end(self) -> Result<()> { Err(Error::not_implemented()) } } impl<'a> ser::SerializeMap for &'a mut BasicEthSerializer { type Ok = (); type Error = Error; fn serialize_key<T: ?Sized + ser::Serialize>(&mut self, _key: &T) -> Result<()> { Err(Error::not_implemented()) } fn serialize_value<T: ?Sized + ser::Serialize>(&mut self, _value: &T) -> Result<()> { Err(Error::not_implemented()) } fn end(self) -> Result<()> { Err(Error::not_implemented()) } } impl<'a> ser::SerializeStruct for &'a mut BasicEthSerializer { type Ok = (); type Error = Error; fn serialize_field<T: ?Sized + ser::Serialize>( &mut self, _key: &'static str, value: &T, ) -> Result<()> { ser::SerializeSeq::serialize_element(self, value) } fn end(self) -> Result<()> { ser::SerializeSeq::end(self) } } impl<'a> ser::SerializeStructVariant for &'a mut BasicEthSerializer { type Ok = (); type Error = Error; fn serialize_field<T: ?Sized + ser::Serialize>( &mut self, _key: &'static str, value: &T, ) -> Result<()> { ser::SerializeSeq::serialize_element(self, value) } fn end(self) -> Result<()> { ser::SerializeSeq::end(self) } }
use std::rc::Rc; use std::fmt; use std::ops::Deref; use std::collections::VecDeque; #[derive(Debug, Clone)] enum Operator { Add, Subtract, Multiply, Divide } const NUM_OPERATORS: usize = 4; impl fmt::Display for Operator { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { &Operator::Add => write!(f, "+"), &Operator::Subtract => write!(f, "-"), &Operator::Multiply => write!(f, "*"), &Operator::Divide => write!(f, "/") } } } #[derive(Debug, Clone)] enum Operation { Push(i32), Pop(Operator) } impl fmt::Display for Operation { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { &Operation::Push(number) => write!(f, "{}", number), &Operation::Pop(ref operator) => write!(f, "{}", operator) } } } #[derive(Debug)] pub struct NodeData { parent: Option<Node>, op: Operation, stack: Vec<i32>, numbers: Vec<i32> } #[derive(Clone, Debug)] pub struct Node(Rc<NodeData>); impl Deref for Node { type Target = NodeData; fn deref(&self) -> &Self::Target { &self.0 } } impl fmt::Display for Node { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self.parent { Some(ref parent) => { write!(f, "{} ", parent)?; write!(f, "{}", self.op) } None => write!(f, "") } } } impl Node { fn new(numbers: Vec<i32>) -> Node { // TODO How to represent the root node? Node(Rc::new(NodeData { parent: Option::None, op: Operation::Push(0), stack: Vec::new(), numbers: numbers })) } pub fn has_value(&self) -> bool { self.stack.len() == 1 } pub fn value(&self) -> i32 { assert!(self.has_value()); self.stack[0] } fn push(&self, number_index: usize) -> Node { let mut numbers = self.numbers.clone(); let number = numbers.remove(number_index); let mut stack = self.stack.clone(); stack.push(number); Node(Rc::new(NodeData { parent: Option::Some(self.clone()), op: Operation::Push(number), stack: stack, numbers: numbers })) } fn pop(&self, operator: Operator, stack: &Vec<i32>, result: i32) -> Node { let mut new_stack = stack.clone(); new_stack.push(result); Node(Rc::new(NodeData { parent: Option::Some(self.clone()), op: Operation::Pop(operator), stack: new_stack, numbers: self.numbers.clone() })) } fn expand(&self) -> Vec<Node> { let mut children: Vec<Node> = Vec::with_capacity(NUM_OPERATORS + self.numbers.len()); // Pop if self.stack.len() >= 2 { let mut stack = self.stack.clone(); let right = stack.pop().unwrap(); let left = stack.pop().unwrap(); // Break symmetry: add is commutative if left <= right { // TODO Check overflow? children.push(self.pop(Operator::Add, &stack, left + right)); } // Disallow negative intermediate results // Positive solution can always be reached with only positive intermediates if left - right >= 0 { children.push(self.pop(Operator::Subtract, &stack, left - right)); } // Break symmetry: multiply is commutative if left <= right { // TODO Check overflow? children.push(self.pop(Operator::Multiply, &stack, left * right)); } // Disallow fractional temporary results // Integer solution can always be reached with only integer intermediates if right != 0 && left % right == 0 { children.push(self.pop(Operator::Divide, &stack, left / right)); } } // Push for (i, _) in self.numbers.iter().enumerate() { children.push(self.push(i)); } children } } pub struct SolveStats { expanded: usize, visited: usize } impl SolveStats { pub fn new() -> SolveStats { SolveStats { expanded: 0, visited: 0 } } pub fn expanded(&self) -> usize { self.expanded } pub fn visited(&self) -> usize { self.visited } } pub fn solve(numbers: Vec<i32>, target: i32, stats: &mut SolveStats) -> Node { let root = Node::new(numbers); let mut best_node = root.clone(); let mut best_value = -1; // Breadth-first search let mut queue: VecDeque<Node> = VecDeque::new(); queue.push_back(root); stats.expanded += 1; while let Some(node) = queue.pop_front() { stats.visited += 1; if node.has_value() { let value = node.value(); if best_value == -1 || (value - target).abs() < (best_value - target).abs() { // First or better value best_node = node.clone(); best_value = value; if best_value == target { // Exact match break; } } } // Expand children for child in node.expand() { queue.push_back(child); stats.expanded += 1; } } best_node }
use irust_api::GlobalVariables; use rscript::{scripting::Scripter, Hook, ScriptType, VersionReq}; struct Prompt; impl Scripter for Prompt { fn script_type() -> ScriptType { ScriptType::OneShot } fn name() -> &'static str { "prompt" } fn hooks() -> &'static [&'static str] { &[ irust_api::SetInputPrompt::NAME, irust_api::SetOutputPrompt::NAME, irust_api::Shutdown::NAME, ] } fn version_requirement() -> VersionReq { VersionReq::parse(">=1.50.0").expect("correct version requirement") } } enum PType { In, Out, } impl std::fmt::Display for PType { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { PType::In => write!(f, "In"), PType::Out => write!(f, "Out"), } } } impl Prompt { fn prompt(global: GlobalVariables, ptype: PType) -> String { format!("{} [{}]: ", ptype, global.operation_number) } fn run(hook_name: &str) { match hook_name { irust_api::SetInputPrompt::NAME => { let irust_api::SetInputPrompt(global) = Self::read(); let output = Self::prompt(global, PType::In); Self::write::<irust_api::SetInputPrompt>(&output); } irust_api::SetOutputPrompt::NAME => { let irust_api::SetOutputPrompt(global) = Self::read(); let output = Self::prompt(global, PType::Out); Self::write::<irust_api::SetOutputPrompt>(&output); } irust_api::Shutdown::NAME => { let _hook: irust_api::Shutdown = Self::read(); let output = Self::clean_up(); Self::write::<irust_api::Shutdown>(&output); } _ => unreachable!(), } } fn clean_up() -> Option<irust_api::Command> { Some(irust_api::Command::ResetPrompt) } } fn main() { let _ = Prompt::execute(&mut Prompt::run); }
#![allow(clippy::many_single_char_names)] use super::*; // TODO: move tool-specific code gen into the tool itself to avoid carrying this extra code in the shared crates? pub fn gen_sys(tree: &TypeTree, gen: &Gen) -> TokenStream { let functions = gen_functions(tree, gen); let types = gen_types(tree, gen); quote! { #functions #types } } fn gen_types(tree: &TypeTree, gen: &Gen) -> TokenStream { let mut tokens = TokenStream::new(); for entry in tree.types.values() { for def in &entry.def { tokens.combine(&gen_type(def, gen)); } } tokens } fn gen_type(entry: &ElementType, gen: &Gen) -> TokenStream { match entry { ElementType::Field(def) => gen_constant(def, gen), ElementType::TypeDef(def) => gen_type_def(&def.clone().with_generics(), gen), _ => quote! {}, } } fn gen_type_def(def: &TypeDef, gen: &Gen) -> TokenStream { match def.kind() { TypeKind::Interface => gen_interface(def), TypeKind::Class => gen_class(def), TypeKind::Enum => gen_enum(def, gen), TypeKind::Struct => gen_struct(def, gen), TypeKind::Delegate => { if def.is_winrt() { gen_interface(def) } else { gen_callback(def, gen) } } } } fn gen_interface(def: &TypeDef) -> TokenStream { if def.is_exclusive() { quote! {} } else { let name: TokenStream = if def.generics.is_empty() { def.name().into() } else { let name = def.name(); name[..name.len() - 2].into() }; quote! { pub type #name = *mut ::core::ffi::c_void; } } } fn gen_class(def: &TypeDef) -> TokenStream { let has_default = def.interface_impls().any(|interface| interface.is_default()); if has_default { gen_interface(def) } else { quote! {} } } fn gen_enum(def: &TypeDef, gen: &Gen) -> TokenStream { let name = gen_type_name(def, gen); let underlying_type = def.underlying_type(); let underlying_type = gen_name(&underlying_type, gen); if def.is_scoped() { let fields = def.fields().filter_map(|field| { if field.is_literal() { let field_name = to_ident(field.name()); let constant = field.constant().unwrap(); let value = gen_constant_value(&constant.value()); Some(quote! { pub const #field_name: Self = Self(#value); }) } else { None } }); quote! { #[repr(transparent)] pub struct #name(pub #underlying_type); impl #name { #(#fields)* } impl ::core::marker::Copy for #name {} impl ::core::clone::Clone for #name { fn clone(&self) -> Self { *self } } } } else { let fields = def.fields().filter_map(|field| { if field.is_literal() { let field_name = to_ident(field.name()); let constant = field.constant().unwrap(); let value = gen_constant_value(&constant.value()); Some(quote! { pub const #field_name: #name = #value; }) } else { None } }); quote! { pub type #name = #underlying_type; #(#fields)* } } } fn gen_struct(def: &TypeDef, gen: &Gen) -> TokenStream { if def.is_api_contract() { return quote! {}; } gen_struct_with_name(def, def.name(), gen, &TokenStream::new()) } fn gen_struct_with_name(def: &TypeDef, struct_name: &str, gen: &Gen, cfg: &TokenStream) -> TokenStream { let name = to_ident(struct_name); if def.is_handle() { let signature = if def.type_name() == TypeName::HANDLE { quote! { *mut ::core::ffi::c_void } } else { let signature = def.fields().next().map(|field| field.signature(Some(def))).unwrap(); gen_sys_sig(&signature, gen) }; return quote! { pub type #name = #signature; }; } let is_union = def.is_explicit(); let (doc, cfg) = if cfg.is_empty() { let features = features(def, gen); let cfg = gen.gen_struct_cfg(def, &features); let doc = gen.gen_cfg_doc(&features); (doc, cfg) } else { (TokenStream::new(), cfg.clone()) }; let fields: Vec<(Field, Signature, TokenStream)> = def .fields() .filter_map(move |f| { if f.is_literal() { None } else { let signature = f.signature(Some(def)); let name = f.name(); Some((f, signature, to_ident(name))) } }) .collect(); if fields.is_empty() { if let Some(guid) = GUID::from_attributes(def.attributes()) { let guid = gen_sys_guid(&guid); return quote! { pub const #name: ::windows_sys::core::GUID = #guid; }; } else { return quote! { #[repr(C)] pub struct #name(pub u8); }; } } let repr = if let Some(layout) = def.class_layout() { let packing = Literal::u32_unsuffixed(layout.packing_size()); quote! { #[repr(C, packed(#packing))] } } else { quote! { #[repr(C)] } }; let fields = fields.iter().map(|(_, signature, name)| { let kind = gen_sys_sig(signature, gen); quote! { pub #name: #kind } }); let struct_or_union = if is_union { quote! { union } } else { quote! { struct } }; let nested_structs = gen_nested_structs(struct_name, def, gen, &cfg); let constants = gen_struct_constants(def, &name, &cfg); quote! { #repr #cfg #doc pub #struct_or_union #name {#(#fields),*} #constants #cfg impl ::core::marker::Copy for #name {} #cfg impl ::core::clone::Clone for #name { fn clone(&self) -> Self { *self } } #nested_structs } } fn gen_struct_constants(def: &TypeDef, struct_name: &TokenStream, cfg: &TokenStream) -> TokenStream { let constants = def.fields().filter_map(|f| { if f.is_literal() { if let Some(constant) = f.constant() { let name = to_ident(f.name()); let value = gen_constant_type_value(&constant.value()); return Some(quote! { pub const #name: #value; }); } } None }); let mut tokens = quote! { #(#constants)* }; if !tokens.is_empty() { tokens = quote! { #cfg impl #struct_name { #tokens } }; } tokens } fn gen_nested_structs<'a>(enclosing_name: &'a str, enclosing_type: &'a TypeDef, gen: &Gen, cfg: &TokenStream) -> TokenStream { if let Some(nested_types) = enclosing_type.nested_types() { nested_types .iter() .enumerate() .map(|(index, (_, nested_type))| { let nested_name = format!("{}_{}", enclosing_name, index); gen_struct_with_name(nested_type, &nested_name, gen, cfg) }) .collect() } else { TokenStream::new() } } fn gen_constant(def: &Field, gen: &Gen) -> TokenStream { let name = def.name(); let name = to_ident(name); let signature = def.signature(None); let features = signature_features(&signature, gen); let cfg = gen.gen_cfg(&features); let doc = gen.gen_cfg_doc(&features); if let Some(constant) = def.constant() { if signature.kind == constant.value_type() { let value = gen_constant_type_value(&constant.value()); quote! { pub const #name: #value; } } else { let kind = gen_sys_sig(&signature, gen); let value = gen_constant_value(&constant.value()); let value = if signature.kind.underlying_type() == constant.value_type() { value } else { quote! { #value as _ } }; if signature.kind == constant.value_type() || signature.kind.is_handle() || signature.kind == ElementType::HRESULT { quote! { #cfg #doc pub const #name: #kind = #value; } } else { quote! { #cfg #doc pub const #name: #kind = #kind(#value); } } } } else if let Some(guid) = GUID::from_attributes(def.attributes()) { let guid = gen_sys_guid(&guid); quote! { pub const #name: ::windows_sys::core::GUID = #guid; } } else if let Some(pkey) = PropertyKey::from_attributes(def.attributes()) { let kind = gen_sys_sig(&signature, gen); let fmtid = gen_sys_guid(&pkey.fmtid); let pid = pkey.pid; quote! { #cfg #doc pub const #name: #kind = #kind { fmtid: #fmtid, pid: #pid, }; } } else { quote! {} } } fn gen_functions(tree: &TypeTree, gen: &Gen) -> TokenStream { let mut functions = tree.types.values().map(|entry| gen_function_if(entry, gen)).peekable(); if functions.peek().is_some() { quote! { #[link(name = "windows")] extern "system" { #(#functions)* } } } else { quote! {} } } fn gen_function_if(entry: &TypeEntry, gen: &Gen) -> TokenStream { let mut tokens = TokenStream::new(); for def in &entry.def { if let ElementType::MethodDef(def) = def { tokens.combine(&gen_function(def, gen)); } } tokens } fn gen_function(def: &MethodDef, gen: &Gen) -> TokenStream { let name = to_ident(def.name()); let signature = def.signature(&[]); let return_type = gen_sys_return_sig(&signature, gen); let cfg = gen.gen_function_cfg(def.attributes(), &signature); let params = signature.params.iter().map(|p| { let name = gen_param_name(&p.param); let tokens = gen_sys_param(p, gen); quote! { #name: #tokens } }); quote! { #cfg pub fn #name(#(#params),*) #return_type; } } fn gen_callback(def: &TypeDef, gen: &Gen) -> TokenStream { let name = gen_type_name(def, gen); let signature = def.invoke_method().signature(&[]); let return_sig = gen_sys_return_sig(&signature, gen); let cfg = gen.gen_function_cfg(def.attributes(), &signature); let params = signature.params.iter().map(|p| { let name = gen_param_name(&p.param); let tokens = gen_sys_param(p, gen); quote! { #name: #tokens } }); quote! { #cfg pub type #name = ::core::option::Option<unsafe extern "system" fn(#(#params),*) #return_sig>; } } fn gen_sys_guid(guid: &GUID) -> TokenStream { let a = Literal::u32_unsuffixed(guid.0); let b = Literal::u16_unsuffixed(guid.1); let c = Literal::u16_unsuffixed(guid.2); let d = Literal::u8_unsuffixed(guid.3); let e = Literal::u8_unsuffixed(guid.4); let f = Literal::u8_unsuffixed(guid.5); let g = Literal::u8_unsuffixed(guid.6); let h = Literal::u8_unsuffixed(guid.7); let i = Literal::u8_unsuffixed(guid.8); let j = Literal::u8_unsuffixed(guid.9); let k = Literal::u8_unsuffixed(guid.10); // TODO: once code complete measure how much longer it takes if-any to use from_u128 to produce a more compact package quote! { ::windows_sys::core::GUID { data1:#a, data2:#b, data3:#c, data4:[#d, #e, #f, #g, #h, #i, #j, #k] } } } fn gen_sys_return_sig(signature: &MethodSignature, gen: &Gen) -> TokenStream { if let Some(return_sig) = &signature.return_sig { let tokens = gen_sys_sig(return_sig, gen); quote! { -> #tokens } } else { quote! {} } } fn gen_sys_sig(sig: &Signature, gen: &Gen) -> TokenStream { gen_sys_param_with_const(sig, gen, sig.is_const) } fn gen_sys_param(param: &MethodParam, gen: &Gen) -> TokenStream { gen_sys_param_with_const(&param.signature, gen, !param.param.flags().output()) } fn gen_sys_param_with_const(sig: &Signature, gen: &Gen, is_const: bool) -> TokenStream { let mut tokens = TokenStream::with_capacity(); for _ in 0..sig.pointers { if is_const { tokens.combine(&quote! { *const }); } else { tokens.combine(&quote! { *mut }); } } tokens.combine(&gen_sys_name(&sig.kind, gen)); tokens } fn gen_sys_name(def: &ElementType, gen: &Gen) -> TokenStream { match def { ElementType::Void => quote! { ::core::ffi::c_void }, ElementType::Bool => quote! { bool }, ElementType::Char => quote! { u16 }, ElementType::I8 => quote! { i8 }, ElementType::U8 => quote! { u8 }, ElementType::I16 => quote! { i16 }, ElementType::U16 => quote! { u16 }, ElementType::I32 => quote! { i32 }, ElementType::U32 => quote! { u32 }, ElementType::I64 => quote! { i64 }, ElementType::U64 => quote! { u64 }, ElementType::F32 => quote! { f32 }, ElementType::F64 => quote! { f64 }, ElementType::ISize => quote! { isize }, ElementType::USize => quote! { usize }, ElementType::String => { quote! { ::windows_sys::core::HSTRING } } ElementType::IInspectable => { quote! { ::windows_sys::core::IInspectable } } ElementType::GUID => { quote! { ::windows_sys::core::GUID } } ElementType::IUnknown => { quote! { ::windows_sys::core::IUnknown } } ElementType::HRESULT => { quote! { ::windows_sys::core::HRESULT } } ElementType::Array((kind, len)) => { let name = gen_sys_sig(kind, gen); let len = Literal::u32_unsuffixed(*len); quote! { [#name; #len] } } ElementType::TypeDef(def) => { let mut def = def.clone(); def.generics.clear(); gen_type_name(&def, gen) } ElementType::GenericParam(generic) => generic.into(), ElementType::MethodDef(def) => def.name().into(), ElementType::Field(field) => field.name().into(), _ => unimplemented!(), } }
#![feature(core_intrinsics)] extern crate core; extern crate ahci; extern crate uio; extern crate mmap; extern crate driverkit; use mmap::*; use ahci::*; use ahci::fis::*; use std::mem; use driverkit::mem::DevMem; use std::thread; // sleep() use std::time::Duration; // sleep() use driverkit::Volatile; use driverkit::bitops::*; use driverkit::timedops::wait_until; const ATA_CMD_READ_DMA_EXT: u8 = 0x25; const ATA_CMD_WRITE_DMA_EXT: u8 = 0x35; const ATA_CMD_IDENTIFY: u8 = 0xEC; const ATA_DEV_BUSY: u8 = 0x80; const ATA_DEV_DRQ: u8 = 0x08; pub fn round_up(val: usize, target: usize) -> usize { return (val + target - 1) / target * target; } pub struct AhciDisk { pub bar5: MemoryMap, pub dev: uio::UioDevice, } impl AhciDisk { pub fn from_uio(uio_num: usize) -> AhciDisk { let dev = uio::UioDevice::new(uio_num).unwrap(); let bar = dev.map_resource(5).unwrap(); AhciDisk { bar5: bar, dev: dev, } } pub fn get_hba_mut<'a>(&'a mut self) -> &'a mut HbaRaw { unsafe { mem::transmute::<*mut u8, &mut HbaRaw>(self.bar5.data()) } } pub fn get_hba(&self) -> &HbaRaw { unsafe { mem::transmute::<*mut u8, &HbaRaw>(self.bar5.data()) } } } #[repr(packed)] pub struct HbaRaw { /// Host capability (0x00) pub cap: Volatile<u32>, /// Global host control (0x04) pub ghc: Volatile<u32>, /// Interrupt status (0x08) pub is: Volatile<u32>, /// Port implemented (0x0C) pub pi: Volatile<u32>, /// Version (0x10) pub vs: Volatile<u32>, /// Command completion coalescing control (0x14) pub ccc_ctl: Volatile<u32>, /// Command completion coalescing ports (0x18) pub ccc_pts: Volatile<u32>, /// Enclosure management location (0x1C) pub em_loc: Volatile<u32>, /// Enclosure management control (0x20) pub em_ctl: Volatile<u32>, /// Host capabilities extended (0x24) pub cap2: Volatile<u32>, /// BIOS/OS handoff control and status (0x28) pub bohc: Volatile<u32>, /// Reserved (0x2C - 0x9F) pub rsv: [u8; 116], /// Vendor specific registers (0xA0 - 0xFF) pub vendor: [u8; 96], /// Port control registers (0x100 - 0x10FF) ports: [HbaPortRaw; 32], } #[repr(packed)] pub struct HbaPortRaw { /// command list base address, 1K-byte aligned (0x00) pub clb: Volatile<u64>, /// FIS base address, 256-byte aligned (0x08) pub fb: Volatile<u64>, /// interrupt status (0x10) pub is: Volatile<u32>, /// interrupt enable (0x14) pub ie: Volatile<u32>, /// command and status (0x18) pub cmd: Volatile<u32>, /// Reserved (0x1C) pub rsv0: Volatile<u32>, /// task file data (0x20) pub tfd: Volatile<u32>, /// signature (0x24) pub sig: Volatile<u32>, /// SATA status (SCR0:SStatus) (0x28) pub ssts: Volatile<u32>, /// SATA control (SCR2:SControl) (0x2C) pub sctl: Volatile<u32>, /// SATA error (SCR1:SError) (0x30) pub serr: Volatile<u32>, /// SATA active (SCR3:SActive) (0x34) pub sact: Volatile<u32>, /// command issue (0x38) pub ci: Volatile<u32>, /// SATA notification (SCR4:SNotification) (0x3C) pub sntf: Volatile<u32>, /// FIS-based switch control (0x40) pub fbs: Volatile<u32>, /// Port x Device Sleep (0x44) pub devslp: Volatile<u32>, /// Reserved (0x48 - 0x6F) pub rsv1: [Volatile<u32>; 10], /// Vendor specific (0x70 - 0x7F) pub vendor: [Volatile<u32>; 4], } const HOST_RESET: u32 = (1 << 0); /* reset controller; self-clear */ const HOST_AHCI_EN: u32 = (1 << 31); /* AHCI enabled */ const HOST_IRQ_EN: u32 = (1 << 1); /* global IRQ enable */ const PORT_CMD_LIST_ON: u32 = (1 << 15); /* cmd list DMA engine running */ const PORT_CMD_FIS_ON: u32 = (1 << 14); /* FIS DMA engine running */ const PORT_CMD_FIS_RX: u32 = (1 << 4); /* Enable FIS receive DMA engine */ const PORT_CMD_CLO: u32 = (1 << 3); /* Command list override */ const PORT_CMD_POWER_ON: u32= (1 << 2); /* Power up device */ const PORT_CMD_SPIN_UP: u32 = (1 << 1); /* Spin up device */ const PORT_CMD_START: u32 = (1 << 0); /* Enable port DMA engine */ const PORT_CMD_ICC_ACTIVE: u32 = (0x1 << 28); /* Put i/f in active state */ pub fn main() { println!("Hello from AHCI"); let mut disk = AhciDisk::from_uio(0); let mut hba: &mut HbaRaw = disk.get_hba_mut(); hba.ghc.set(hba.ghc.get() | HOST_RESET); let mut tmp = hba.ghc.get(); while tmp & HOST_RESET != 0 { tmp = hba.ghc.get(); println!("reset..."); } //hba.ghc.set(HOST_AHCI_EN); //hba.ghc.get(); // write_with_flish //println!("ghc is: 0b{:x}", hba.ghc.get()); let mut port = &hba.ports[0]; println!("hba ptr: {:?}", hba as *const _); println!("hba ghc: {:?}", &hba.ghc as *const _); println!("port ptr: {:?}", port as *const _); println!("port serr: {:?}", &port.serr as *const _); println!("port cmd: {:?}", &port.cmd as *const _); //println!("port tfd: {:?}", &port.tfd as *const _); port.serr.set(port.serr.get()); port.serr.set(0xffffffff); let fis_rec = (port.cmd.get() | 0x1 << 4); port.cmd.set(fis_rec); //std::thread::sleep(Duration::from_millis(1000)); while (port.tfd.get() & 0x89) != 0 { println!("port[0].tfd: 0b{:b}", port.tfd.get()); std::thread::sleep(Duration::from_millis(500)); } }
#[derive(Debug)] pub struct MailHeader<'a> { pub key: &'a [u8], pub value: &'a [u8], } impl<'a> Default for MailHeader<'a> { fn default() -> Self { Self { key: &[], value: &[], } } } pub trait MailHeaderMap { fn get_all_headers(&self, key: &[u8]) -> Vec<&MailHeader>; fn get_all_values(&self, key: &[u8]) -> Vec<&[u8]>; fn get_first_header(&self, key: &[u8]) -> Option<&MailHeader>; fn get_first_value(&self, key: &[u8]) -> Option<&[u8]>; } impl<'a> MailHeaderMap for [MailHeader<'a>] { fn get_all_headers(&self, key: &[u8]) -> Vec<&MailHeader> { let mut headers: Vec<&MailHeader> = Vec::new(); for h in self { if h.key.eq_ignore_ascii_case(key) { headers.push(h); } } headers } fn get_all_values(&self, key: &[u8]) -> Vec<&[u8]> { let mut values = vec![]; for h in self { if h.key.eq_ignore_ascii_case(key) { values.push(h.value); } } values } fn get_first_header(&self, key: &[u8]) -> Option<&MailHeader> { for h in self { if h.key.eq_ignore_ascii_case(key) { return Some(h); } } None } fn get_first_value(&self, key: &[u8]) -> Option<&[u8]> { for h in self { if h.key.eq_ignore_ascii_case(key) { return Some(h.value); } } None } }
use crate::prelude::*; #[derive(NativeClass)] #[inherit(Node)] pub struct RPopsInstance { engine: RPopsEngine<Model>, } #[methods] impl RPopsInstance { fn _init(owner: Node) -> Self { let mut instance = RPopsInstance { engine: RPopsEngine::<Model>::new(owner) }; // Add systems instance.engine.set_systems(create_systems()); // Add resources let models = Models::<Model>::default(); instance.engine.resources.insert(add_models(models)); instance } #[export] fn _ready(&mut self, _owner: Node) { // Call engine _ready self.engine._ready(_owner); use CreatureModels::*; let models = self.engine.resources.get::<Models<Model>>().unwrap(); let slime = models.data_from_t(&Model::Creatures(Slime)).unwrap(); let zombie = models.data_from_t(&Model::Creatures(Zombie)).unwrap(); self.engine.world.insert( (), (0..1).map(|_| (Renderable { index: slime.1, template: slime.0 }, GDSpatial, Position { x: 0f32, y: 0f32, rotation: euclid::Angle::radians(0f32) }, )) ); self.engine.world.insert( (), (0..1).map(|_| (Renderable { index: zombie.1, template: zombie.0 }, GDSpatial, Position { x: -10f32, y: 0f32, rotation: euclid::Angle::radians(0f32) }, )) ); self.engine.world.insert( (), (0..1).map(|_| (Position { x: -10f32, y: 0f32, rotation: euclid::Angle::radians(0f32) }, )) ); } #[export] fn _physics_process(&mut self, owner: Node, delta: f64) { self.engine._physics_process(owner, delta); } } // Function that registers all exposed classes to Godot fn init(handle: gdnative::init::InitHandle) { handle.add_class::<RPopsInstance>(); } // macros that create the entry-points of the dynamic library. godot_gdnative_init!(); godot_nativescript_init!(init); godot_gdnative_terminate!();
#![feature(proc_macro_hygiene, decl_macro)] #[macro_use] extern crate rocket; mod routes; mod subprocess_control; mod types; mod utils; use crate::subprocess_control::SubProcessControl; use rocket_cors::CorsOptions; fn rocket() -> rocket::Rocket { rocket::ignite() .mount("/", routes![routes::hello, routes::bash, routes::project]) .attach(CorsOptions::default().to_cors().unwrap()) .manage(SubProcessControl::new(utils::read_config())) } fn main() { rocket().launch(); }
//! Way Cooler exists in one of several different "Modes" //! The current mode defines what Way Cooler does in each callback. //! //! The central use of this is to define different commands that the user can //! run. //! //! For example, when the lock screen mode is active the user can't do anything //! other than send input to the lock screen program. //! //! We also allow users to define their own custom modes, which allows them to //! hook into the callbacks from Lua. In the `CustomLua` mode, callbacks do //! the same thing as they do in the `Default` mode, but at the end of will //! always execute some custom Lua code. use std::ops::{Deref, DerefMut}; use std::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard}; mod mode; mod default; mod custom_lua; mod lock_screen; pub mod commands; pub use self::mode::Mode; pub use self::default::Default; pub use self::custom_lua::CustomLua; pub use self::lock_screen::{LockScreen, lock_screen, unlock_screen}; /// If the event is handled by way-cooler pub const EVENT_BLOCKED: bool = true; /// If the event should be passed through to clients pub const EVENT_PASS_THROUGH: bool = false; /// Left click constant, used in `on_pointer_button` pub const LEFT_CLICK: u32 = 0x110; /// Right click constant, used in `on_pointer_button` pub const RIGHT_CLICK: u32 = 0x111; /// The different modes that Way Cooler can be in /// * `Default`: The default mode for Way Cooler, this is the standard mode /// that it starts out in /// * `CustomLua`: Same as `Default`, except it calls any custom defined /// callbacks in the Lua configuration file at the end of the call back. #[derive(Clone, Debug, Eq, PartialEq)] pub enum Modes { Default(Default), CustomLua(CustomLua), LockScreen(LockScreen) } impl From<Default> for Modes { fn from(mode: Default) -> Modes { Modes::Default(mode) } } impl From<CustomLua> for Modes { fn from(mode: CustomLua) -> Modes { Modes::CustomLua(mode) } } impl From<LockScreen> for Modes { fn from(mode: LockScreen) -> Modes { Modes::LockScreen(mode) } } lazy_static! { pub static ref CURRENT_MODE: RwLock<Modes> = RwLock::new(Modes::Default(Default)); } pub fn write_current_mode<'a>() -> RwLockWriteGuard<'a, Modes> { CURRENT_MODE.try_write() .expect("Unable to write current mode") } pub fn read_current_mode<'a>() -> RwLockReadGuard<'a, Modes> { CURRENT_MODE.try_read() .expect("Unable to read current mode") } impl Deref for Modes { type Target = Mode; fn deref(&self) -> &(Mode + 'static) { match *self { Modes::Default(ref mode) => mode as &Mode, Modes::CustomLua(ref mode) => mode as &Mode, Modes::LockScreen(ref mode) => mode as &Mode } } } impl DerefMut for Modes { fn deref_mut(&mut self) -> &mut (Mode + 'static) { match *self { Modes::Default(ref mut mode) => mode as &mut Mode, Modes::CustomLua(ref mut mode) => mode as &mut Mode, Modes::LockScreen(ref mut mode) => mode as &mut Mode } } }
// Copyright 2017 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. type A = [u8; 4]::AssocTy; //~^ ERROR missing angle brackets in associated item path //~| ERROR ambiguous associated type type B = [u8]::AssocTy; //~^ ERROR missing angle brackets in associated item path //~| ERROR ambiguous associated type type C = (u8)::AssocTy; //~^ ERROR missing angle brackets in associated item path //~| ERROR ambiguous associated type type D = (u8, u8)::AssocTy; //~^ ERROR missing angle brackets in associated item path //~| ERROR ambiguous associated type type E = _::AssocTy; //~^ ERROR missing angle brackets in associated item path //~| ERROR the type placeholder `_` is not allowed within types on item signatures fn main() {}
use super::heuristics::*; use super::types::*; use crate::game::*; pub fn alphabeta( game: &Game, depth: usize, alpha: f32, beta: f32, maximizing_player: Player, ai_config: &AIConfig ) -> AlgorithmRes { if depth == ai_config.tree_depth || game.game_over() { let eval = evaluate_game_state(&game, maximizing_player, &ai_config); return AlgorithmRes { best_move: None, eval, nodes_visited: 0 } } if game.current_player() == maximizing_player { let mut max_eval = -f32::INFINITY; let mut max_eval_move = 0usize; let mut max_alpha = alpha; let mut nodes_visited = 0usize; for player_move in 1..7 { let mut game_clone = game.clone(); if game_clone.should_skip_next_move() { game_clone.skip_turn() } else if game_clone.turn(player_move) == None { // invalid move continue; } let res = alphabeta(&game_clone, depth + 1, max_alpha, beta, maximizing_player, ai_config); nodes_visited += res.nodes_visited + 1; if res.eval > max_eval { max_eval = res.eval; max_eval_move = player_move; }; if res.eval >= beta { break; } if res.eval > max_alpha { max_alpha = res.eval; } } return if depth == 0 { AlgorithmRes { best_move: Some(max_eval_move), eval: max_eval, nodes_visited } } else { AlgorithmRes { best_move: None, eval: max_eval, nodes_visited } }; } let mut min_eval = f32::INFINITY; let mut min_beta = beta; let mut nodes_visited = 0usize; for player_move in 1..7 { let mut game_clone = game.clone(); if game_clone.should_skip_next_move() { game_clone.skip_turn() } else if game_clone.turn(player_move) == None { // invalid move continue; } let res = alphabeta(&game_clone, depth + 1, alpha, min_beta, maximizing_player, ai_config); nodes_visited += res.nodes_visited + 1; if res.eval < min_eval { min_eval = res.eval; } if res.eval <= alpha { break; } if res.eval < min_beta { min_beta = res.eval; } } return AlgorithmRes { best_move: None, eval: min_eval, nodes_visited } }
// Copyright 2021 Datafuse Labs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use common_exception::Result; use super::AggregateExpand; use super::AggregateFinal; use super::AggregatePartial; use super::DistributedInsertSelect; use super::EvalScalar; use super::Exchange; use super::ExchangeSink; use super::ExchangeSource; use super::Filter; use super::HashJoin; use super::Limit; use super::PhysicalPlan; use super::Project; use super::ProjectSet; use super::Sort; use super::TableScan; use crate::executor::RuntimeFilterSource; use crate::executor::UnionAll; pub trait PhysicalPlanReplacer { fn replace(&mut self, plan: &PhysicalPlan) -> Result<PhysicalPlan> { match plan { PhysicalPlan::TableScan(plan) => self.replace_table_scan(plan), PhysicalPlan::Filter(plan) => self.replace_filter(plan), PhysicalPlan::Project(plan) => self.replace_project(plan), PhysicalPlan::EvalScalar(plan) => self.replace_eval_scalar(plan), PhysicalPlan::AggregateExpand(plan) => self.replace_aggregate_expand(plan), PhysicalPlan::AggregatePartial(plan) => self.replace_aggregate_partial(plan), PhysicalPlan::AggregateFinal(plan) => self.replace_aggregate_final(plan), PhysicalPlan::Sort(plan) => self.replace_sort(plan), PhysicalPlan::Limit(plan) => self.replace_limit(plan), PhysicalPlan::HashJoin(plan) => self.replace_hash_join(plan), PhysicalPlan::Exchange(plan) => self.replace_exchange(plan), PhysicalPlan::ExchangeSource(plan) => self.replace_exchange_source(plan), PhysicalPlan::ExchangeSink(plan) => self.replace_exchange_sink(plan), PhysicalPlan::UnionAll(plan) => self.replace_union(plan), PhysicalPlan::DistributedInsertSelect(plan) => self.replace_insert_select(plan), PhysicalPlan::ProjectSet(plan) => self.replace_project_set(plan), PhysicalPlan::RuntimeFilterSource(plan) => self.replace_runtime_filter_source(plan), } } fn replace_table_scan(&mut self, plan: &TableScan) -> Result<PhysicalPlan> { Ok(PhysicalPlan::TableScan(plan.clone())) } fn replace_filter(&mut self, plan: &Filter) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::Filter(Filter { plan_id: plan.plan_id, input: Box::new(input), predicates: plan.predicates.clone(), stat_info: plan.stat_info.clone(), })) } fn replace_project(&mut self, plan: &Project) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::Project(Project { plan_id: plan.plan_id, input: Box::new(input), projections: plan.projections.clone(), columns: plan.columns.clone(), stat_info: plan.stat_info.clone(), })) } fn replace_eval_scalar(&mut self, plan: &EvalScalar) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::EvalScalar(EvalScalar { plan_id: plan.plan_id, input: Box::new(input), exprs: plan.exprs.clone(), stat_info: plan.stat_info.clone(), })) } fn replace_aggregate_expand(&mut self, plan: &AggregateExpand) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::AggregateExpand(AggregateExpand { plan_id: plan.plan_id, input: Box::new(input), group_bys: plan.group_bys.clone(), grouping_id_index: plan.grouping_id_index, grouping_sets: plan.grouping_sets.clone(), stat_info: plan.stat_info.clone(), })) } fn replace_aggregate_partial(&mut self, plan: &AggregatePartial) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::AggregatePartial(AggregatePartial { plan_id: plan.plan_id, input: Box::new(input), group_by: plan.group_by.clone(), agg_funcs: plan.agg_funcs.clone(), stat_info: plan.stat_info.clone(), })) } fn replace_aggregate_final(&mut self, plan: &AggregateFinal) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::AggregateFinal(AggregateFinal { plan_id: plan.plan_id, input: Box::new(input), before_group_by_schema: plan.before_group_by_schema.clone(), group_by: plan.group_by.clone(), agg_funcs: plan.agg_funcs.clone(), stat_info: plan.stat_info.clone(), limit: plan.limit, })) } fn replace_hash_join(&mut self, plan: &HashJoin) -> Result<PhysicalPlan> { let build = self.replace(&plan.build)?; let probe = self.replace(&plan.probe)?; Ok(PhysicalPlan::HashJoin(HashJoin { plan_id: plan.plan_id, build: Box::new(build), probe: Box::new(probe), build_keys: plan.build_keys.clone(), probe_keys: plan.probe_keys.clone(), non_equi_conditions: plan.non_equi_conditions.clone(), join_type: plan.join_type.clone(), marker_index: plan.marker_index, from_correlated_subquery: plan.from_correlated_subquery, contain_runtime_filter: plan.contain_runtime_filter, stat_info: plan.stat_info.clone(), })) } fn replace_sort(&mut self, plan: &Sort) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::Sort(Sort { plan_id: plan.plan_id, input: Box::new(input), order_by: plan.order_by.clone(), limit: plan.limit, stat_info: plan.stat_info.clone(), })) } fn replace_limit(&mut self, plan: &Limit) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::Limit(Limit { plan_id: plan.plan_id, input: Box::new(input), limit: plan.limit, offset: plan.offset, stat_info: plan.stat_info.clone(), })) } fn replace_exchange(&mut self, plan: &Exchange) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::Exchange(Exchange { input: Box::new(input), kind: plan.kind.clone(), keys: plan.keys.clone(), })) } fn replace_exchange_source(&mut self, plan: &ExchangeSource) -> Result<PhysicalPlan> { Ok(PhysicalPlan::ExchangeSource(plan.clone())) } fn replace_exchange_sink(&mut self, plan: &ExchangeSink) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::ExchangeSink(ExchangeSink { input: Box::new(input), schema: plan.schema.clone(), kind: plan.kind.clone(), keys: plan.keys.clone(), destination_fragment_id: plan.destination_fragment_id, destinations: plan.destinations.clone(), query_id: plan.query_id.clone(), })) } fn replace_union(&mut self, plan: &UnionAll) -> Result<PhysicalPlan> { let left = self.replace(&plan.left)?; let right = self.replace(&plan.right)?; Ok(PhysicalPlan::UnionAll(UnionAll { plan_id: plan.plan_id, left: Box::new(left), right: Box::new(right), schema: plan.schema.clone(), pairs: plan.pairs.clone(), stat_info: plan.stat_info.clone(), })) } fn replace_insert_select(&mut self, plan: &DistributedInsertSelect) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::DistributedInsertSelect(Box::new( DistributedInsertSelect { input: Box::new(input), catalog: plan.catalog.clone(), table_info: plan.table_info.clone(), select_schema: plan.select_schema.clone(), insert_schema: plan.insert_schema.clone(), select_column_bindings: plan.select_column_bindings.clone(), cast_needed: plan.cast_needed, }, ))) } fn replace_project_set(&mut self, plan: &ProjectSet) -> Result<PhysicalPlan> { let input = self.replace(&plan.input)?; Ok(PhysicalPlan::ProjectSet(ProjectSet { plan_id: plan.plan_id, input: Box::new(input), srf_exprs: plan.srf_exprs.clone(), stat_info: plan.stat_info.clone(), })) } fn replace_runtime_filter_source( &mut self, plan: &RuntimeFilterSource, ) -> Result<PhysicalPlan> { let left_side = self.replace(&plan.left_side)?; let right_side = self.replace(&plan.right_side)?; Ok(PhysicalPlan::RuntimeFilterSource(RuntimeFilterSource { plan_id: plan.plan_id, left_side: Box::new(left_side), right_side: Box::new(right_side), left_runtime_filters: plan.left_runtime_filters.clone(), right_runtime_filters: plan.right_runtime_filters.clone(), })) } } impl PhysicalPlan { pub fn traverse<'a, 'b>( plan: &'a PhysicalPlan, pre_visit: &'b mut dyn FnMut(&'a PhysicalPlan) -> bool, visit: &'b mut dyn FnMut(&'a PhysicalPlan), post_visit: &'b mut dyn FnMut(&'a PhysicalPlan), ) { if pre_visit(plan) { visit(plan); match plan { PhysicalPlan::TableScan(_) => {} PhysicalPlan::Filter(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit); } PhysicalPlan::Project(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit); } PhysicalPlan::EvalScalar(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit); } PhysicalPlan::AggregateExpand(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit); } PhysicalPlan::AggregatePartial(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit); } PhysicalPlan::AggregateFinal(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit); } PhysicalPlan::Sort(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit); } PhysicalPlan::Limit(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit); } PhysicalPlan::HashJoin(plan) => { Self::traverse(&plan.build, pre_visit, visit, post_visit); Self::traverse(&plan.probe, pre_visit, visit, post_visit); } PhysicalPlan::Exchange(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit); } PhysicalPlan::ExchangeSource(_) => {} PhysicalPlan::ExchangeSink(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit); } PhysicalPlan::UnionAll(plan) => { Self::traverse(&plan.left, pre_visit, visit, post_visit); Self::traverse(&plan.right, pre_visit, visit, post_visit); } PhysicalPlan::DistributedInsertSelect(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit); } PhysicalPlan::ProjectSet(plan) => { Self::traverse(&plan.input, pre_visit, visit, post_visit) } PhysicalPlan::RuntimeFilterSource(plan) => { Self::traverse(&plan.left_side, pre_visit, visit, post_visit); Self::traverse(&plan.right_side, pre_visit, visit, post_visit); } } post_visit(plan); } } }
// 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. //! Represents one node in the mesh. Usually the root of a process. use { crate::{ coding::decode_fidl, labels::{NodeId, NodeLinkId}, node_table::{LinkDescription, NodeDescription, NodeStateCallback, NodeTable}, router::{ LinkId, MessageReceiver, Router, RouterOptions, RouterTime, SendHandle, StreamId, }, stream_framer::{StreamDeframer, StreamFramer}, }, failure::{Error, ResultExt}, fidl::{ endpoints::{ClientEnd, RequestStream, ServiceMarker}, AsyncChannel, Channel, Handle, HandleBased, }, fidl_fuchsia_overnet::{ Peer, ServiceProviderMarker, ServiceProviderProxy, ServiceProviderRequest, ServiceProviderRequestStream, }, fidl_fuchsia_overnet_protocol::{ DiagnosticMarker, DiagnosticRequest, DiagnosticRequestStream, PeerDescription, ProbeResult, ProbeSelector, StreamSocketGreeting, }, futures::prelude::*, rand::seq::SliceRandom, salt_slab::{SaltSlab, SaltedID, ShadowSlab}, std::{ cell::RefCell, collections::{BTreeMap, HashMap}, fmt::Debug, path::Path, rc::Rc, }, }; /// The runtime facilities needed to manage a node. /// For portability these are injected from above. pub trait NodeRuntime { /// Something representing an instant of time type Time: RouterTime + std::fmt::Debug; /// Application local identifier for a link type LinkId: Copy + Debug; /// The implementation tag for this runtime. const IMPLEMENTATION: fidl_fuchsia_overnet_protocol::Implementation; /// Determine the type of a handle fn handle_type(hdl: &Handle) -> Result<SendHandle, Error>; /// Spawn a future on the current thread fn spawn_local<F>(&mut self, future: F) where F: Future<Output = ()> + 'static; /// Execute `f` at time `t` fn at(&mut self, t: Self::Time, f: impl FnOnce() + 'static); /// Convert an application link id to a router link id fn router_link_id(&self, id: Self::LinkId) -> LinkId<PhysLinkId<Self::LinkId>>; /// Send `packet` on application link `id` fn send_on_link(&mut self, id: Self::LinkId, packet: &mut [u8]) -> Result<(), Error>; } /// Binding of a stream to some communications structure. enum StreamBinding { Channel(Rc<AsyncChannel>), } /// Implementation of core::MessageReceiver for overnetstack. /// Maintains a small list of borrows from the App instance that creates it. struct Receiver<'a, Runtime: NodeRuntime + 'static> { service_map: &'a HashMap<String, ServiceProviderProxy>, streams: &'a mut ShadowSlab< <StreamId<PhysLinkId<Runtime::LinkId>> as salt_slab::ElemType>::Elem, StreamBinding, >, node_table: &'a mut NodeTable, runtime: &'a mut Runtime, update_routing: bool, node: Node<Runtime>, } impl<'a, Runtime: NodeRuntime + 'static> Receiver<'a, Runtime> { /// Given a stream_id create a channel to pass to an application as the outward facing /// interface. fn make_channel( &mut self, stream_id: StreamId<PhysLinkId<Runtime::LinkId>>, ) -> Result<Channel, Error> { let (overnet_channel, app_channel) = Channel::create()?; let overnet_channel = Rc::new(AsyncChannel::from_channel(overnet_channel)?); self.streams.init(stream_id, StreamBinding::Channel(overnet_channel.clone())); self.runtime.spawn_local(self.node.clone().channel_reader(overnet_channel, stream_id)); Ok(app_channel) } } impl<'a, Runtime: NodeRuntime + 'static> MessageReceiver<PhysLinkId<Runtime::LinkId>> for Receiver<'a, Runtime> { type Handle = Handle; fn connect_channel( &mut self, stream_id: StreamId<PhysLinkId<Runtime::LinkId>>, service_name: &str, connection_info: fidl_fuchsia_overnet::ConnectionInfo, ) -> Result<(), Error> { let app_channel = self.make_channel(stream_id)?; self.service_map .get(service_name) .ok_or_else(|| failure::format_err!("Unknown service {}", service_name))? .connect_to_service(app_channel, connection_info)?; Ok(()) } fn bind_channel( &mut self, stream_id: StreamId<PhysLinkId<Runtime::LinkId>>, ) -> Result<Self::Handle, Error> { Ok(self.make_channel(stream_id)?.into_handle()) } fn channel_recv( &mut self, stream_id: StreamId<PhysLinkId<Runtime::LinkId>>, bytes: &mut Vec<u8>, handles: &mut Vec<Self::Handle>, ) -> Result<(), Error> { let stream = self.streams.get(stream_id).ok_or_else(|| { failure::format_err!("Stream {:?} not found for datagram {:?}", stream_id, bytes) })?; match stream { StreamBinding::Channel(ref chan) => { chan.write(bytes, handles)?; Ok(()) } } } fn close(&mut self, stream_id: StreamId<PhysLinkId<Runtime::LinkId>>) { self.streams.remove(stream_id); } fn update_node(&mut self, node_id: NodeId, desc: NodeDescription) { self.node_table.update_node(node_id, desc); } fn update_link(&mut self, from: NodeId, to: NodeId, link: NodeLinkId, desc: LinkDescription) { self.node_table.update_link(from, to, link, desc); log::trace!("Schedule routing update"); self.update_routing = true; } fn established_connection(&mut self, node_id: NodeId) { self.node_table.mark_established(node_id); } } struct ListPeersState { last_seen_version: u64, in_query: bool, } type ListPeersResponderChannel = futures::channel::oneshot::Sender<Result<Vec<Peer>, Error>>; /// NodeStateCallback implementation for a list_peers request from the main app. struct ListPeersResponse { own_node_id: NodeId, responder: Option<ListPeersResponderChannel>, list_peers_state: Rc<RefCell<ListPeersState>>, } impl ListPeersResponse { fn new( own_node_id: NodeId, responder: ListPeersResponderChannel, list_peers_state: Rc<RefCell<ListPeersState>>, ) -> Box<ListPeersResponse> { Box::new(ListPeersResponse { own_node_id, responder: Some(responder), list_peers_state }) } } impl NodeStateCallback for ListPeersResponse { fn trigger(&mut self, new_version: u64, node_table: &NodeTable) -> Result<(), Error> { let mut peers: Vec<_> = node_table .nodes() .filter(|node_id| node_table.is_established(*node_id)) .map(|node_id| Peer { id: node_id.into(), is_self: node_id == self.own_node_id, description: PeerDescription { services: Some(node_table.node_services(node_id).to_vec()), }, }) .collect(); peers.shuffle(&mut rand::thread_rng()); log::info!("Respond to list_peers: {:?}", peers); { let list_peers_state = &mut *self.list_peers_state.borrow_mut(); assert!(list_peers_state.in_query); assert!(list_peers_state.last_seen_version < new_version); list_peers_state.in_query = false; list_peers_state.last_seen_version = new_version; } match self .responder .take() .ok_or_else(|| failure::format_err!("State callback called twice"))? .send(Ok(peers)) { Ok(_) => Ok(()), // Listener gone: response send ignored, but it already was. Err(_) => Ok(()), } } } #[derive(Debug)] pub struct SocketLink<UpLinkID: Copy + Debug> { router_id: LinkId<PhysLinkId<UpLinkID>>, framer: StreamFramer, writes: Option<futures::io::WriteHalf<fidl::AsyncSocket>>, } /// Intermediate link identifier #[derive(Clone, Copy, Debug)] pub enum PhysLinkId<UpLinkID: Copy + Debug> { /// A link allocated by attaching a socket to this overnet node SocketLink(SaltedID<SocketLink<UpLinkID>>), /// A link allocated by the containing code UpLink(UpLinkID), } // Helper: if a bit is set in a probe selector, return Some(make()), else return None fn if_probe_has_bit<R>( probe: ProbeSelector, bit: ProbeSelector, make: impl FnOnce() -> R, ) -> Option<R> { if probe & bit == bit { Some(make()) } else { None } } /// Configuration options for a new Node pub struct NodeOptions { router_options: RouterOptions, diagnostics: bool, } impl NodeOptions { /// Create with defaults. pub fn new() -> Self { Self::from_router_options(RouterOptions::new()) } /// Create with defaults from router options. pub fn from_router_options(router_options: RouterOptions) -> Self { Self { router_options, diagnostics: true } } /// Set whether to enable diagnostics services pub fn export_diagnostics(mut self, diagnostics: bool) -> Self { self.diagnostics = diagnostics; self } /// Request a specific node id (if unset, one will be generated). pub fn set_node_id(mut self, node_id: NodeId) -> Self { self.router_options = self.router_options.set_node_id(node_id); self } /// Set which file to load the server private key from. pub fn set_quic_server_key_file(mut self, key_file: Box<dyn AsRef<Path>>) -> Self { self.router_options = self.router_options.set_quic_server_key_file(key_file); self } /// Set which file to load the server cert from. pub fn set_quic_server_cert_file(mut self, pem_file: Box<dyn AsRef<Path>>) -> Self { self.router_options = self.router_options.set_quic_server_cert_file(pem_file); self } } struct NodeInner<Runtime: NodeRuntime> { /// Map of service name to provider. service_map: HashMap<String, ServiceProviderProxy>, /// Overnet router implementation. router: Router<PhysLinkId<Runtime::LinkId>, Runtime::Time>, /// overnetstack state for each active stream. streams: ShadowSlab< <StreamId<PhysLinkId<Runtime::LinkId>> as salt_slab::ElemType>::Elem, StreamBinding, >, /// Table of known nodes and links in the mesh (generates routing data, /// and provides service discovery). node_table: NodeTable, /// Is a global state flush queued? flush_queued: bool, /// Is a routing update queued? routing_update_queued: bool, /// Generation counter for timeouts. timeout_key: u64, /// Map our externally visible link ids to real link ids. node_to_app_link_ids: BTreeMap<NodeLinkId, PhysLinkId<Runtime::LinkId>>, /// Attached socket links socket_links: SaltSlab<SocketLink<Runtime::LinkId>>, /// Local node link ids next_node_link_id: u64, /// State for list_peers call list_peers_state: Rc<RefCell<ListPeersState>>, /// Our runtime runtime: Runtime, } /// Represents an Overnet node managed by this process pub struct Node<Runtime: NodeRuntime + 'static> { inner: Rc<RefCell<NodeInner<Runtime>>>, } impl<Runtime: NodeRuntime + 'static> Node<Runtime> { /// Create a new instance of App pub fn new(runtime: Runtime, options: NodeOptions) -> Result<Self, Error> { let router = Router::new_with_options(options.router_options); let mut node = Self { inner: Rc::new(RefCell::new(NodeInner { service_map: HashMap::new(), node_table: NodeTable::new(router.node_id()), streams: router.shadow_streams(), router, timeout_key: 0, next_node_link_id: 1, flush_queued: false, routing_update_queued: false, node_to_app_link_ids: BTreeMap::new(), socket_links: SaltSlab::new(), list_peers_state: Rc::new(RefCell::new(ListPeersState { in_query: false, last_seen_version: 0, })), runtime, })), }; // Spawn a future to service diagnostic requests if options.diagnostics { let (s, p) = fidl::Channel::create().context("failed to create zx channel")?; let chan = fidl::AsyncChannel::from_channel(s).context("failed to make async channel")?; node.register_service(DiagnosticMarker::NAME.to_string(), ClientEnd::new(p))?; let node_clone = node.clone(); node.with_runtime_mut(move |runtime| { runtime.spawn_local(node_clone.handle_diagnostic_service_requests( ServiceProviderRequestStream::from_channel(chan), )); }); } Ok(node) } /// Clone this node pub fn clone(&self) -> Self { Self { inner: self.inner.clone() } } /// Returns the globally unique identifier for this node pub fn id(&self) -> NodeId { self.inner.borrow().router.node_id() } /// Access the runtime pub fn with_runtime_mut<R>(&mut self, f: impl FnOnce(&mut Runtime) -> R) -> R { f(&mut self.inner.borrow_mut().runtime) } async fn handle_diagnostic_service_requests(self, stream: ServiceProviderRequestStream) { if let Err(e) = self.handle_diagnostic_service_requests_inner(stream).await { log::warn!("Failed handling diagnostics requests: {:?}", e); } } async fn handle_diagnostic_service_requests_inner( self, mut stream: ServiceProviderRequestStream, ) -> Result<(), Error> { while let Some(ServiceProviderRequest::ConnectToService { chan, info: _, control_handle: _, }) = stream.try_next().await.context("awaiting next diagnostic stream request")? { let node = self.clone(); let stream = DiagnosticRequestStream::from_channel(fidl::AsyncChannel::from_channel(chan)?); self.inner.borrow_mut().runtime.spawn_local(node.handle_diagnostic_requests(stream)); } Ok(()) } async fn handle_diagnostic_requests(self, stream: DiagnosticRequestStream) { if let Err(e) = self.handle_diagnostic_requests_inner(stream).await { log::warn!("Failed handling diagnostics requests: {:?}", e); } } async fn handle_diagnostic_requests_inner( self, mut stream: DiagnosticRequestStream, ) -> Result<(), Error> { while let Some(req) = stream.try_next().await.context("awaiting next diagnostic request")? { match req { DiagnosticRequest::Probe { selector, responder } => { let this = &*self.inner.borrow(); let res = responder.send(ProbeResult { node_description: if_probe_has_bit( selector, ProbeSelector::NodeDescription, || fidl_fuchsia_overnet_protocol::NodeDescription { #[cfg(target_os = "fuchsia")] operating_system: Some( fidl_fuchsia_overnet_protocol::OperatingSystem::Fuchsia, ), #[cfg(target_os = "linux")] operating_system: Some( fidl_fuchsia_overnet_protocol::OperatingSystem::Linux, ), #[cfg(target_os = "macos")] operating_system: Some( fidl_fuchsia_overnet_protocol::OperatingSystem::Mac, ), implementation: Some(Runtime::IMPLEMENTATION), }, ), links: if_probe_has_bit(selector, ProbeSelector::Links, || { this.router.link_diagnostics() }), peer_connections: if_probe_has_bit( selector, ProbeSelector::PeerConnections, || this.router.peer_diagnostics(), ), }); if let Err(e) = res { log::warn!("Failed handling probe: {:?}", e); } } } } Ok(()) } /// Await connection to a specific node id pub async fn require_connection(self, node: NodeId) -> Result<(), Error> { struct AwaitConnectionCallback( Option<futures::channel::oneshot::Sender<(bool, u64)>>, NodeId, ); impl NodeStateCallback for AwaitConnectionCallback { fn trigger(&mut self, new_version: u64, node_table: &NodeTable) -> Result<(), Error> { let _ = self.0.take().unwrap().send((node_table.is_established(self.1), new_version)); Ok(()) } } let mut version = 0; loop { let (tx, rx) = futures::channel::oneshot::channel(); self.inner .borrow_mut() .node_table .post_query(version, Box::new(AwaitConnectionCallback(Some(tx), node))); let (done, new_version) = rx.await?; if done { return Ok(()); } version = new_version; } } /// Implementation of ListPeers fidl method. pub async fn list_peers(self) -> Result<Vec<Peer>, Error> { let rx = { let this = &mut *self.inner.borrow_mut(); if this.list_peers_state.borrow().in_query { failure::bail!("Already querying peers"); } this.list_peers_state.borrow_mut().in_query = true; let (tx, rx) = futures::channel::oneshot::channel(); log::trace!( "Request list_peers last_seen_version={}", this.list_peers_state.borrow().last_seen_version ); this.node_table.post_query( this.list_peers_state.borrow().last_seen_version, ListPeersResponse::new(this.router.node_id(), tx, this.list_peers_state.clone()), ); self.clone().need_flush(this); rx }; Ok(rx.await??) } /// Implementation of RegisterService fidl method. pub fn register_service( &self, service_name: String, provider: ClientEnd<ServiceProviderMarker>, ) -> Result<(), Error> { let this = &mut *self.inner.borrow_mut(); log::info!("Request register_service '{}'", service_name); if this.service_map.insert(service_name.clone(), provider.into_proxy()?).is_none() { log::info!("Publish new service '{}'", service_name); // This is a new service let services: Vec<String> = this.service_map.keys().cloned().collect(); if let Err(e) = this.router.publish_node_description(services.clone()) { this.service_map.remove(&service_name); failure::bail!(e) } this.node_table.update_node(this.router.node_id(), NodeDescription { services }); self.clone().need_flush(this); } Ok(()) } /// Implementation of ConnectToService fidl method. pub fn connect_to_service( &self, node_id: NodeId, service_name: &str, chan: Channel, ) -> Result<(), Error> { let this = &mut *self.inner.borrow_mut(); let is_local = node_id == this.router.node_id(); log::info!( "Request connect_to_service '{}' on {:?}{}", service_name, node_id, if is_local { " [local]" } else { " [remote]" } ); if is_local { this.service_map .get(service_name) .ok_or_else(|| failure::format_err!("Unknown service {}", service_name))? .connect_to_service( chan, fidl_fuchsia_overnet::ConnectionInfo { peer: Some(node_id.into()) }, )?; } else { let chan = Rc::new(AsyncChannel::from_channel(chan)?); let stream_id = this.router.new_stream(node_id, service_name)?; this.streams.init(stream_id, StreamBinding::Channel(chan.clone())); this.runtime.spawn_local(self.clone().channel_reader(chan, stream_id)); self.clone().need_flush(this); } Ok(()) } /// Implementation of AttachToSocket fidl method. pub fn attach_socket_link( &self, connection_label: Option<String>, socket: fidl::Socket, ) -> Result<(), Error> { let this = &mut *self.inner.borrow_mut(); let node_link_id = this.next_node_link_id.into(); this.next_node_link_id += 1; this.runtime.spawn_local(self.clone().handshake_socket( node_link_id, connection_label, socket, )); Ok(()) } async fn handshake_socket( self, node_link_id: NodeLinkId, connection_label: Option<String>, socket: fidl::Socket, ) { if let Err(e) = self.handshake_socket_inner(node_link_id, connection_label, socket).await { log::warn!("Socket handshake failed: {}", e); } } async fn handshake_socket_inner( self, node_link_id: NodeLinkId, connection_label: Option<String>, socket: fidl::Socket, ) -> Result<(), Error> { const GREETING_STRING: &str = "OVERNET SOCKET LINK"; // Send first frame let mut framer = StreamFramer::new(); let mut greeting = StreamSocketGreeting { magic_string: Some(GREETING_STRING.to_string()), node_id: Some(self.id().into()), connection_label, }; let mut bytes = Vec::new(); let mut handles = Vec::new(); fidl::encoding::Encoder::encode(&mut bytes, &mut handles, &mut greeting)?; assert_eq!(handles.len(), 0); framer.queue_send(bytes.as_slice())?; let send = framer.take_sends(); assert_eq!(send.len(), socket.write(&send)?); // Wait for first frame let (mut rx, tx) = futures::io::AsyncReadExt::split(fidl::AsyncSocket::from_socket(socket)?); let mut deframer = StreamDeframer::new(); let mut buf = [0u8; 1024]; let mut greeting_bytes = loop { let n = rx.read(&mut buf).await?; deframer.queue_recv(&buf[..n]); if let Some(greeting) = deframer.next_incoming_frame() { break greeting; } }; let greeting = decode_fidl::<StreamSocketGreeting>(greeting_bytes.as_mut())?; let node_id = match greeting { StreamSocketGreeting { magic_string: None, .. } => failure::bail!( "Required magic string '{}' not present in greeting", GREETING_STRING ), StreamSocketGreeting { magic_string: Some(ref x), .. } if x != GREETING_STRING => { failure::bail!( "Expected magic string '{}' in greeting, got '{}'", GREETING_STRING, x ) } StreamSocketGreeting { node_id: None, .. } => failure::bail!("No node id in greeting"), StreamSocketGreeting { node_id: Some(n), .. } => n.id, }; let (router_id, id) = { let this = &mut *self.inner.borrow_mut(); let id = this.socket_links.insert(SocketLink { writes: Some(tx), router_id: LinkId::invalid(), framer, }); let router_id = match self.new_link_inner( this, node_id.into(), node_link_id, PhysLinkId::SocketLink(id), ) { Err(e) => { this.socket_links.remove(id); failure::bail!(e); } Ok(x) => { this.socket_links.get_mut(id).unwrap().router_id = x; x } }; (router_id, id) }; let result = self.socket_link_read_loop(router_id, deframer, rx).await; self.inner.borrow_mut().socket_links.remove(id); result } async fn socket_link_read_loop( &self, rtr_id: LinkId<PhysLinkId<Runtime::LinkId>>, mut deframer: StreamDeframer, mut rx: futures::io::ReadHalf<fidl::AsyncSocket>, ) -> Result<(), Error> { let mut buf = [0u8; 1024]; loop { while let Some(mut frame) = deframer.next_incoming_frame() { self.queue_recv(rtr_id, frame.as_mut()); } let n = rx.read(&mut buf).await?; if n == 0 { return Ok(()); } deframer.queue_recv(&buf[..n]); } } /// Queue an incoming receive of `packet` from some link `link` pub fn queue_recv(&self, link_id: LinkId<PhysLinkId<Runtime::LinkId>>, packet: &mut [u8]) { let this = &mut *self.inner.borrow_mut(); this.router.queue_recv(link_id, packet); self.clone().need_flush(this); } fn new_link_inner( &self, this: &mut NodeInner<Runtime>, peer: NodeId, node_link_id: NodeLinkId, up_id: PhysLinkId<Runtime::LinkId>, ) -> Result<LinkId<PhysLinkId<Runtime::LinkId>>, Error> { let r = this.router.new_link(peer, node_link_id, up_id); this.node_to_app_link_ids.insert(node_link_id, up_id); // TODO: move this to the router update_link path this.node_table.update_link( this.router.node_id(), peer, node_link_id, LinkDescription { round_trip_time: std::time::Duration::from_secs(10) }, ); self.clone().need_flush(this); r } /// Create a new link to `peer` with application link id `up_id`. pub fn new_link( &self, peer: NodeId, up_id: Runtime::LinkId, ) -> Result<LinkId<PhysLinkId<Runtime::LinkId>>, Error> { let this = &mut *self.inner.borrow_mut(); let node_link_id = this.next_node_link_id.into(); this.next_node_link_id += 1; self.new_link_inner(this, peer, node_link_id, PhysLinkId::UpLink(up_id)) } /// Mention that some node exists pub fn mention_node(&self, node_id: NodeId) { let this = &mut *self.inner.borrow_mut(); this.node_table.mention_node(node_id); self.clone().need_flush(this); } /// Mark that we need to flush state (perform read/write callbacks, examine expired timers). fn need_flush(self, this: &mut NodeInner<Runtime>) { if this.flush_queued { return; } this.flush_queued = true; let now = Runtime::Time::now(); this.runtime.at(now, || self.flush()); } /// Flush state. fn flush(self) { let node = self.clone(); let mut this = &mut *self.inner.borrow_mut(); assert!(this.flush_queued); this.flush_queued = false; let service_map = &this.service_map; let streams = &mut this.streams; let node_table = &mut this.node_table; let runtime = &mut this.runtime; let socket_links = &mut this.socket_links; let now = Runtime::Time::now(); // Examine expired timers. this.router.update_time(now); // Pass up received messages. let mut receiver = Receiver::<Runtime> { node: node.clone(), service_map, streams, node_table, update_routing: false, runtime, }; this.router.flush_recvs(&mut receiver); // Schedule update routing information if needed (we wait a little while to avoid thrashing) if receiver.update_routing && !this.routing_update_queued { this.routing_update_queued = true; let sched_node = node.clone(); receiver.runtime.at( Runtime::Time::after(now, std::time::Duration::from_millis(100).into()), move || sched_node.perform_routing_update(), ); } // Push down sent packets. this.router.flush_sends(|link, data| match link { PhysLinkId::UpLink(link) => runtime.send_on_link(*link, data), PhysLinkId::SocketLink(link_id) => { let link = socket_links .get_mut(*link_id) .ok_or_else(|| failure::format_err!("Link {:?} not found", link_id))?; link.framer.queue_send(data)?; if let Some(tx) = link.writes.take() { runtime.spawn_local(self.clone().flush_sends_to_socket_link( *link_id, tx, link.framer.take_sends(), )); } Ok(()) } }); // Trigger node table callbacks if they're queued (this will be responses to satisfied // ListPeers requests). this.node_table.trigger_callbacks(); // Schedule an update to expire timers later, if necessary. this.timeout_key += 1; let timeout = this.router.next_timeout(); log::trace!( "timeout key -> {}; timeout={:?} now={:?}", this.timeout_key, timeout, Runtime::Time::now() ); if let Some(timeout) = timeout { let key = this.timeout_key; let node = node.clone(); this.runtime.at(timeout, move || { let this = &mut *node.inner.borrow_mut(); if this.timeout_key == key { node.clone().need_flush(this); } }); } } async fn flush_sends_to_socket_link( self, link_id: SaltedID<SocketLink<Runtime::LinkId>>, mut tx: futures::io::WriteHalf<fidl::AsyncSocket>, frame: Vec<u8>, ) { if frame.len() == 0 { let this = &mut *self.inner.borrow_mut(); if let Some(link) = this.socket_links.get_mut(link_id) { link.writes = Some(tx); } return; } if let Err(e) = tx.write_all(frame.as_slice()).await { let this = &mut *self.inner.borrow_mut(); log::warn!("Socket write failed: {}", e); this.socket_links.remove(link_id); return; } let this = &mut *self.inner.borrow_mut(); if let Some(link) = this.socket_links.get_mut(link_id) { this.runtime.spawn_local(self.clone().flush_sends_to_socket_link( link_id, tx, link.framer.take_sends(), )); } } /// Perform a route table update. fn perform_routing_update(&self) { let mut this = &mut *self.inner.borrow_mut(); assert!(this.routing_update_queued); this.routing_update_queued = false; log::trace!("UPDATE ROUTES"); for (node_id, link_id) in this.node_table.build_routes() { log::trace!(" {:?} -> {:?}", node_id, link_id); if let Some(app_id) = this.node_to_app_link_ids.get(&link_id).copied() { let rtr_id = match app_id { PhysLinkId::UpLink(app_id) => this.runtime.router_link_id(app_id), PhysLinkId::SocketLink(id) => this .socket_links .get(id) .map(|link| link.router_id) .unwrap_or(LinkId::invalid()), }; if let Err(e) = this.router.adjust_route(node_id, rtr_id) { log::trace!("Failed updating route to {:?}: {:?}", node_id, e); } } else { log::trace!("Couldn't find appid"); } } } /// Implements the read loop for getting data from a zircon channel and forwarding it to an /// Overnet stream. async fn channel_reader_inner( self, chan: Rc<AsyncChannel>, stream_id: StreamId<PhysLinkId<Runtime::LinkId>>, ) -> Result<(), Error> { let mut buf = fidl::MessageBuf::new(); loop { chan.recv_msg(&mut buf).await?; let this = &mut *self.inner.borrow_mut(); let (bytes, handles) = buf.split_mut(); let mut send_handles = Vec::new(); for handle in handles.iter() { send_handles.push(Runtime::handle_type(&handle)?); } let stream_ids = this.router.queue_send_channel_message( stream_id, std::mem::replace(bytes, Vec::new()), send_handles, )?; self.clone().need_flush(this); for (handle, stream_id) in handles.into_iter().zip(stream_ids.into_iter()) { match Runtime::handle_type(&handle).unwrap() { SendHandle::Channel => { let channel = Rc::new(AsyncChannel::from_channel(Channel::from_handle( std::mem::replace(handle, Handle::invalid()), ))?); this.streams.init(stream_id, StreamBinding::Channel(channel.clone())); this.runtime.spawn_local(self.clone().channel_reader(channel, stream_id)); } } } } } /// Wrapper for the above loop to handle errors 'gracefully'. async fn channel_reader( self, chan: Rc<AsyncChannel>, stream_id: StreamId<PhysLinkId<Runtime::LinkId>>, ) { if let Err(e) = self.channel_reader_inner(chan, stream_id).await { log::warn!("Channel reader failed: {:?}", e); } } } #[cfg(test)] mod test { use super::*; use crate::router::test_util::*; use futures::future::try_join; use futures::task::LocalSpawnExt; struct TestRuntime(futures::executor::LocalSpawner); #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Debug)] struct Time(std::time::Instant); impl RouterTime for Time { type Duration = std::time::Duration; fn now() -> Self { Time(std::time::Instant::now()) } fn after(t: Self, dt: Self::Duration) -> Self { Time(t.0 + dt) } } impl NodeRuntime for TestRuntime { type Time = Time; type LinkId = (); const IMPLEMENTATION: fidl_fuchsia_overnet_protocol::Implementation = fidl_fuchsia_overnet_protocol::Implementation::UnitTest; fn handle_type(_hdl: &Handle) -> Result<SendHandle, Error> { unimplemented!(); } fn spawn_local<F>(&mut self, _future: F) where F: Future<Output = ()> + 'static, { unimplemented!(); } fn at(&mut self, t: Time, f: impl FnOnce() + 'static) { let (tx, rx) = futures::channel::oneshot::channel(); std::thread::spawn(move || { let now = std::time::Instant::now(); if now > t.0 { std::thread::sleep(now - t.0); } let _ = tx.send(()); }); self.0 .spawn_local(async move { rx.await.unwrap(); f(); }) .unwrap(); } fn router_link_id(&self, _id: Self::LinkId) -> LinkId<PhysLinkId<()>> { unimplemented!(); } fn send_on_link(&mut self, _id: Self::LinkId, _packet: &mut [u8]) -> Result<(), Error> { unimplemented!(); } } #[test] fn construct_node() { init(); Node::new( TestRuntime(futures::executor::LocalPool::new().spawner()), NodeOptions::from_router_options(test_router_options()).export_diagnostics(false), ) .unwrap(); } #[test] fn concurrent_list_peer_calls_will_error() { init(); let mut pool = futures::executor::LocalPool::new(); let n = Node::new( TestRuntime(pool.spawner()), NodeOptions::from_router_options(test_router_options()).export_diagnostics(false), ) .unwrap(); pool.run_until(try_join(n.clone().list_peers(), n.clone().list_peers())) .expect_err("Concurrent list peers should fail"); } }
/* Trademark © Robert Horrace (I don't remember and know how to properly trademark it) This is the Rust program for HW1. It has a sum, prod, gcd, and lcm function, and they are called depending on what the user wants. The arguments will be the function name a n-amount of numbers to be added, multiplied, gcd'd, or lcm'd. */ use std::str::FromStr; use std::env; use std::mem; /*Sum of two numbers*/ fn sum(n: u64, m: u64) -> u64 { n + m } /*Test sum function*/ #[test] fn test_sum() { assert_eq!(sum(0,0),0); assert_eq!(sum(0,1),1); assert_eq!(sum(1,2),3); assert_eq!(sum(2,1),3); } /*Product of two numbers*/ fn prod(n: u64, m: u64) -> u64 { n * m } /*Test prod function*/ #[test] fn test_prod() { assert_eq!(prod(0,0),0); assert_eq!(prod(0,1),0); assert_eq!(prod(1,0),0); assert_eq!(prod(1,1),1); assert_eq!(prod(1,2),2); assert_eq!(prod(2,1),2); } /*GCD of two numbers*/ fn gcd(mut n: u64, mut m: u64) -> u64 { if n == 0 { return m; } while m != 0 { if m < n{ mem::swap(&mut m, &mut n); } m %= n; } n } /*Test gcd function*/ #[test] fn test_gcd() { assert_eq!(gcd(0,0),0); assert_eq!(gcd(0,1),1); assert_eq!(gcd(1,0),1); assert_eq!(gcd(1,2),1); assert_eq!(gcd(2,1),1); assert_eq!(gcd(2,4),2); assert_eq!(gcd(4,2),2); } /*LCM of two numbers*/ fn lcm(m: u64, n: u64) -> u64 { let mut a = m; let mut b = n; if a == 0 || b == 0 { return 0; } while a != b { if a < b { a += m; } else { b += n; } } a } /*Test lcm function*/ #[test] fn test_lcm(){ assert_eq!(lcm(0,0),0); assert_eq!(lcm(0,1),0); assert_eq!(lcm(1,0),0); assert_eq!(lcm(1,1),1); assert_eq!(lcm(1,2),2); assert_eq!(lcm(2,1),2); } /*Main function*/ fn main() { /*variable declarations*/ let flag; //Dependent on function name in cmd line let mut x; //For operations let mut cmdargs: Vec<String> = env::args().skip(1).collect(); //for capturing cmd line argumends /*If cmdargs is empty*/ if cmdargs.len() == 0 { std::process::exit(1); } let function: String = cmdargs.remove(0); // For function name (should be first argument) let mut numbers = Vec::new(); //For the numbers in cmd line /*change flag depending the on the function name*/ match function.as_ref() { "sum" => flag = 1, "prod" => flag = 2, "gcd" => flag = 3, "lcm" => flag = 4, => flag = 0, } /*Displays Error and exits early if the flag is 0*/ if flag == 0 { println!("Error: not a valid function"); std::process::exit(2); } /*If there are no numbers, display 0 then exit*/ if cmdargs.len() == 0 { println!("{}",0); std::process::exit(3); } /*For placing the the numbers in cmdargs(strings) to numbers (u64)*/ for arg in cmdargs { numbers.push(u64::from_str(&arg).expect("error parsing argument")); } /*Start one of the operations dending on flags*/ x = numbers[0]; if flag == 1 { //If sum is the function wanted for m in &numbers[1..] { x = sum(x, *m); } } else if flag == 2 { //If prod (product) is the function wanted for m in &numbers[1..] { x = prod(x, *m); } } else if flag == 3 { //If gcd is the function wanted for m in &numbers[1..] { x = gcd(x, *m); } } else { //If lcm is the function wanted for m in &numbers[1..] { x = lcm(x, *m); } } /*Print the result*/ println!("{}",x); }
/* ITL: Intermediate Tiny Language */ use std::collections::HashMap; use std::fmt; use ::ast; use ::ast::Type; use ::ast::Operator; #[derive(Debug,PartialEq,Clone)] pub enum Direct { Immediate(i32), Variable(String), } impl Direct { pub fn to_rval(&self) -> RVal { match *self { Direct::Immediate(ref val) => RVal::Immediate(*val), Direct::Variable(ref val) => RVal::Variable(val.to_string()), } } } impl fmt::Display for Direct { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { use self::Direct::*; match *self { Immediate(ref val) => write!(f, "{}", val), Variable(ref name) => write!(f, "{}", name), } } } #[derive(Debug,PartialEq,Clone)] pub enum RVal { Immediate(i32), Variable(String), Indirect(String, Direct), } impl RVal { pub fn to_direct(&self) -> Direct { match self { &RVal::Immediate(n) => Direct::Immediate(n), &RVal::Variable(ref n) => Direct::Variable(n.to_string()), _ => panic!("Unable to convert RVal `{:?}` to Direct"), } } } impl fmt::Display for RVal { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { use self::RVal::*; match *self { Immediate(ref val) => write!(f, "{}", val), Variable(ref name) => write!(f, "{}", name), Indirect(ref name, ref off) => write!(f, "{}[{}]", name, off), } } } #[derive(Debug,PartialEq,Clone)] pub enum LVal { Discard, Variable(String), Indirect(String, Direct), } impl fmt::Display for LVal { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { use self::LVal::*; match *self { Discard => write!(f, ""), _ => write!(f, "{} = ", self.to_rval()), } } } impl LVal { pub fn to_rval(&self) -> RVal { match self { &LVal::Variable(ref name) => RVal::Variable(name.to_string()), &LVal::Indirect(ref name, ref offset) => RVal::Indirect(name.to_string(), offset.clone()), _ => panic!("Impossible to convert {:?} to an RValue", self), } } pub fn to_direct(&self) -> Direct { match self { &LVal::Variable(ref name) => Direct::Variable(name.to_string()), _ => panic!("Impossible to convert {:?} to a Direct value", self), } } } #[derive(Debug,PartialEq,Clone)] pub enum OpCode { NOP, Assign(LVal, RVal), BinOp(LVal, Operator, RVal, RVal), Goto(usize), If(RVal, usize), Call(LVal, String, Vec<RVal>), Return(RVal), } impl OpCode { pub fn reloc(&self, offset: usize) -> OpCode { use self::OpCode::*; match self { &Goto(ref jmp) => Goto(jmp + offset), &If(ref cond, ref jmp) => If(cond.clone(), jmp + offset), _ => self.clone(), } } pub fn lval(&self) -> LVal { use self::OpCode::*; match self { &Assign(ref l, _) => l.clone(), &BinOp(ref l, _, _, _) => l.clone(), &Call(ref l, _, _) => l.clone(), _ => LVal::Discard, } } pub fn with_lval(&self, lval: LVal) -> OpCode { use self::OpCode::*; match self { &Assign(_, ref x) => Assign(lval, x.clone()), &BinOp(_, ref op, ref l, ref r) => BinOp(lval, op.clone(), l.clone(), r.clone()), &Call(_, ref name, ref args) => Call(lval, name.to_string(), args.clone()), _ => self.clone(), } } } impl fmt::Display for OpCode { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { use self::OpCode::*; match *self { NOP => write!(f, "\x1b[31mNOP\x1b[0m"), Assign(ref l, ref r) => write!(f, "{}{}", l, r), BinOp(ref dest, ref op, ref l, ref r) => write!(f, "{}{} {} {}", dest, l, op, r), Goto(ref pos) => write!(f, "\x1b[1;36mGOTO\x1b[0m \x1b[33m{}\x1b[0m", pos), If(ref cond, ref pos) => write!(f, "\x1b[1;36mIF\x1b[0m {} \x1b[1;36mELSE GOTO\x1b[0m \x1b[33m{}\x1b[0m", cond, pos), Call(ref dest, ref name, ref args) => write!(f, "{}\x1b[1;32mCALL\x1b[0m {} {:?}", dest, name, args), Return(ref val) => write!(f, "\x1b[1;32mRETURN\x1b[0m {}", val), } } } #[derive(Debug,PartialEq,Clone,Copy)] pub enum AddressSpace {Local, Param, Global} #[derive(Debug,PartialEq,Clone)] pub struct Block { pub params: Vec<(String,Type)>, pub frame: HashMap<String,(AddressSpace,Type)>, pub code: Vec<OpCode>, ret: Type, intermediate: usize, max_intermediate: usize, } impl Block { fn type_for_name(&self, name: &String) -> Type { self.lookup(name).1 } fn tmp_var(&mut self) -> LVal { let res = format!("$_{}", self.intermediate); self.intermediate += 1; self.max_intermediate = if self.intermediate > self.max_intermediate { self.frame.insert(res.to_string(), (AddressSpace::Local, Type::Int)); self.intermediate } else { self.max_intermediate }; LVal::Variable(res) } fn sub(&self) -> Block { Block { params: self.params.clone(), frame: self.frame.clone(), code: vec![], ret: Type::Int, intermediate: self.intermediate, max_intermediate: self.max_intermediate } } fn multiply(&mut self, r1: &RVal, r2: &RVal) -> Direct { use self::RVal::*; if &Immediate(0) == r1 || &Immediate(0) == r2 { return Direct::Immediate(0); } if &Immediate(1) == r1 { return r2.to_direct(); } if &Immediate(1) == r2 { return r1.to_direct(); } match (r1, r2) { (&Immediate(ref l), &Immediate(ref r)) => Direct::Immediate(l * r), _ => { let dest = self.tmp_var(); self.code.push(OpCode::BinOp(dest.clone(), Operator::Mul, r1.clone(), r2.clone())); dest.to_direct() } } } fn add(&mut self, r1: &RVal, r2: &RVal) -> Direct { use self::RVal::*; if &Immediate(0) == r1 { return r2.to_direct(); } if &Immediate(0) == r2 { return r1.to_direct(); } match (r1, r2) { (&Immediate(ref l), &Immediate(ref r)) => Direct::Immediate(l + r), _ => { let dest = self.tmp_var(); self.code.push(OpCode::BinOp(dest.clone(), Operator::Add, r1.clone(), r2.clone())); dest.to_direct() } } } fn internalize_array_offset(&mut self, lval: &ast::LValue, typ: &Type) -> Direct { match lval { &ast::LValue::Identifier(_) => Direct::Immediate(0), &ast::LValue::ArrayItem(ref l, ref expr) => { let t = typ.inner(); let innerpart = self.internalize_array_offset(l, &t); let off = self.internalize_expression(expr); let stride = t.size() / t.base().size(); let outerpart = self.multiply(&off, &RVal::Immediate(stride as i32)); self.add(&innerpart.to_rval(), &outerpart.to_rval()) } } } fn internalize_lvalue(&mut self, lval: &ast::LValue) -> LVal { use self::LVal::*; match lval { &ast::LValue::Identifier(ref name) => Variable(name.to_string()), &ast::LValue::ArrayItem(ref l, ref expr) => { let t = self.type_for_name(l.name()); Indirect(l.name().to_string(), self.internalize_array_offset(lval, &t)) } } } fn internalize_expression(&mut self, expr: &ast::Expression) -> RVal { use self::RVal::*; use ast::Expression::*; match expr { &Lit(ref n) => {Immediate(*n)}, &CharLit(ref n) => {Immediate(*n as i32)}, &LValue(ref lval) => {self.internalize_lvalue(lval).to_rval()}, &Funcall(ref name, ref args_expr) => { let args = args_expr.iter() .map(|ref arg| self.internalize_expression(arg)) .collect(); let dest = self.tmp_var(); let op = OpCode::Call(dest.clone(), name.to_string(), args); self.code.push(op); dest.to_rval() }, &ArrayLen(ref lval) => { let t = self.type_for_name(lval.name()); let tt = lval.with_type(&t); Immediate(tt.length() as i32) }, &InfixOp(ref op, ref left, ref right) => { let dest = self.tmp_var(); if *op == Operator::And { // Rewrite (a && b) as (a ? (b ? 1 : 0) : 0) self.internalize_ternary(left, &Ternary(Box::new((**right).clone()), Box::new(Lit(1)), Box::new(Lit(0))), &Lit(0)) } else if *op == Operator::Or { // Rewrite (a || b) as (a ? 1 : (b ? 1 : 0)) self.internalize_ternary(left, &Lit(1), &Ternary(Box::new((**right).clone()), Box::new(Lit(1)), Box::new(Lit(0)))) } else { let l = self.internalize_expression(left); let r = self.internalize_expression(right); let opcode = OpCode::BinOp(dest.clone(), *op, l, r); self.code.push(opcode); dest.to_rval() } }, &Ternary(ref cond, ref if_true, ref if_false) => { self.internalize_ternary(cond, if_true, if_false) } } } fn merge(&mut self, other: &Block) { let base = self.code.len(); for instr in other.code.iter() { self.code.push(instr.reloc(base)); } for (name, qual) in other.frame.iter() { if ! self.frame.contains_key(name) { self.frame.insert(name.to_string(), qual.clone()); } } } fn internalize_ternary(&mut self, if_cond: &ast::Expression, if_true: &ast::Expression, if_false: &ast::Expression) -> RVal { let res = self.tmp_var(); let cond = self.internalize_expression(if_cond); let mut sub_true = self.sub(); let expr_true = sub_true.internalize_expression(if_true); sub_true.code.push(OpCode::Assign(res.clone(), expr_true)); let mut sub_false = self.sub(); let expr_false = sub_false.internalize_expression(if_false); sub_false.code.push(OpCode::Assign(res.clone(), expr_false)); let after_true = 2 + self.code.len() + sub_true.code.len(); self.code.push(OpCode::If(cond, after_true)); self.merge(&sub_true); let after_false = 1 + self.code.len() + sub_false.code.len(); self.code.push(OpCode::Goto(after_false)); self.merge(&sub_false); res.to_rval() } fn internalize_condition(&mut self, if_cond: &ast::Expression, if_true: &Vec<ast::Statement>, if_false: &Vec<ast::Statement>) { let cond = self.internalize_expression(if_cond); let sub_true = self.sub()._internalize(if_true); let sub_false = self.sub()._internalize(if_false); let after_true_block = 2 + self.code.len() + sub_true.code.len(); self.code.push(OpCode::If(cond, after_true_block)); self.merge(& sub_true); let after_else_block = 1 + self.code.len() + sub_false.code.len(); self.code.push(OpCode::Goto(after_else_block)); self.merge(& sub_false); } fn internalize_loop(&mut self, loop_cond: &ast::Expression, body: &Vec<ast::Statement>) { let before_cond = self.code.len(); let cond = self.internalize_expression(loop_cond); let after_cond = self.code.len(); let sub_body = self.sub()._internalize(body); let after_body = 2 + after_cond + sub_body.code.len(); self.code.push(OpCode::If(cond, after_body)); self.merge(& sub_body); self.code.push(OpCode::Goto(before_cond)); } fn internalize_statement(&mut self, st: &ast::Statement) { use ast::Statement::*; match st { &LocalDecl(ref name, ref typ) => { self.frame.insert(name.to_string(), (AddressSpace::Local, typ.clone())); }, &RValue(ref expr) => { self.internalize_expression(expr); } &Condition(ref cond, ref if_true, ref if_false) => { self.internalize_condition(cond, if_true, if_false); } &Loop(ref cond, ref body) => { self.internalize_loop(cond, body); } &Assign(ref left, ref expr) => { let lval = self.internalize_lvalue(left); let rval = self.internalize_expression(expr); self.code.push(OpCode::Assign(lval, rval)); } &Return(ref expr) => { let ret = self.internalize_expression(expr); self.code.push(OpCode::Return(ret)); } } } fn _internalize(mut self, body: &Vec<ast::Statement>) -> Block { for st in body.iter() { self.intermediate = 0; self.internalize_statement(st); } self } pub fn internalize(ret: &Type, args: &Vec<(String, Type)>, body: &Vec<ast::Statement>, globals: &HashMap<String,Type>) -> Block { let mut res = Block { params: args.clone(), code: vec![], ret: ret.clone(), frame: HashMap::new(), intermediate: 0, max_intermediate: 0 }; for (name, typ) in globals.iter() { res.frame.insert(name.to_string(), (AddressSpace::Global, typ.clone())); } for &(ref name, ref typ) in args.iter() { res.frame.insert(name.to_string(), (AddressSpace::Param, typ.clone())); } res._internalize(body).simplify() } fn eliminate_dead_branchs(&mut self) { use self::RVal::*; use self::OpCode::*; for step in 0.. { let mut found = false; let mut dead_branch_range = 0..0; let mut condition_pos = 0; for (i, op) in self.code.iter().enumerate() { if let &If(Immediate(ref cond), ref jmp) = op { // NOP constant condition condition_pos = i; // Determine dead branch start and end dead_branch_range = if *cond == 0 { i..*jmp } else { if let Goto(ref else_end) = self.code[*jmp - 1] { *jmp..*else_end } else { panic!("Expected GOTO at end of branch"); } }; found = true; break; } } if ! found { break } else { self.code[condition_pos] = NOP; for i in dead_branch_range { self.code[i] = NOP; } // self.code[dead_branch_range] = NOP; } } } fn eliminate_double_copy(&mut self) { use self::OpCode::*; let mut prev_op = NOP; let mut new_code = vec![]; let len = self.code.len(); for i in 0..len { let op = self.code[i].clone(); if let Assign(ref l, ref r) = op { let prev_lval = prev_op.lval(); if prev_lval != LVal::Discard && &prev_lval.to_rval() == r { new_code.push(prev_op.with_lval(l.clone())); prev_op = NOP; continue; } } if i > 0 { new_code.push(prev_op); } prev_op = op; } if len > 0 { new_code.push(prev_op); } self.code = new_code; } fn eliminate_goto_next(&mut self) { use self::OpCode::*; let mut new_code = vec![]; for (i, instr) in self.code.iter().enumerate() { if let &Goto(ref jmp) = instr { if *jmp == i + 1 { new_code.push(NOP); continue; } } new_code.push(instr.clone()); } self.code = new_code; } pub fn simplify(&self) -> Block { let mut res = self.clone(); res.eliminate_dead_branchs(); res.eliminate_double_copy(); res.eliminate_goto_next(); return res; } pub fn lookup(&self, name: &String) -> (AddressSpace,Type) { if let Some(x) = self.frame.get(name) { x.clone() } else { panic!("Variable `{}` not found", name) } } pub fn get_labels(&self) -> Vec<usize> { let mut res = vec![]; for op in self.code.iter() { match op { &OpCode::Goto(ref jmp) => {res.push(*jmp);} &OpCode::If(_, ref jmp) => {res.push(*jmp);} _ => {} } } return res; } } impl fmt::Display for Block { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "("); for (i, &(ref name, ref typ)) in self.params.iter().enumerate() { if i > 0 { write!(f, ", "); } write!(f, "{}: {}", name, typ); } write!(f, "): {}\n", self.ret); for (i, opcode) in self.code.iter().enumerate() { write!(f, " \x1b[33m{:3}\x1b[0m {}\n", i, opcode); } write!(f, "\n") } } pub struct Program { pub functions: HashMap<String,Block>, pub globals: HashMap<String,Type>, } impl Program { pub fn internalize(prog: &ast::Program) -> Program { use ast::Declaration::*; let mut res = Program {functions: HashMap::new(), globals: HashMap::new()}; for decl in prog.iter() { match decl { &Func(ref name, ref ret, ref args, ref body) => { let blk = Block::internalize(ret, args, body, &res.globals); res.functions.insert(name.to_string(), blk.simplify()); }, &Var(ref name, ref typ) => { res.globals.insert(name.to_string(), typ.clone()); } } } return res; } } impl fmt::Display for Program { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { for (name, typ) in self.globals.iter() { write!(f, "GLOBAL {}: {}\n", name, typ); } for (name, blk) in self.functions.iter() { write!(f, "FUNC {} {}", name, blk); } write!(f, "\n") } }
pub struct RequestError(InternalRequestError); pub(crate) enum InternalRequestError { Decode(bitcoin::consensus::encode::Error), MissingHeader(&'static str), InvalidContentType(String), InvalidContentLength(std::num::ParseIntError), ContentLengthTooLarge(u64), } impl From<InternalRequestError> for RequestError { fn from(value: InternalRequestError) -> Self { RequestError(value) } }
#[doc = "Reader of register MACRxTxSR"] pub type R = crate::R<u32, super::MACRXTXSR>; #[doc = "Reader of field `TJT`"] pub type TJT_R = crate::R<bool, bool>; #[doc = "Reader of field `NCARR`"] pub type NCARR_R = crate::R<bool, bool>; #[doc = "Reader of field `LCARR`"] pub type LCARR_R = crate::R<bool, bool>; #[doc = "Reader of field `EXDEF`"] pub type EXDEF_R = crate::R<bool, bool>; #[doc = "Reader of field `LCOL`"] pub type LCOL_R = crate::R<bool, bool>; #[doc = "Reader of field `EXCOL`"] pub type EXCOL_R = crate::R<bool, bool>; #[doc = "Reader of field `RWT`"] pub type RWT_R = crate::R<bool, bool>; impl R { #[doc = "Bit 0 - Transmit Jabber Timeout"] #[inline(always)] pub fn tjt(&self) -> TJT_R { TJT_R::new((self.bits & 0x01) != 0) } #[doc = "Bit 1 - No Carrier"] #[inline(always)] pub fn ncarr(&self) -> NCARR_R { NCARR_R::new(((self.bits >> 1) & 0x01) != 0) } #[doc = "Bit 2 - Loss of Carrier"] #[inline(always)] pub fn lcarr(&self) -> LCARR_R { LCARR_R::new(((self.bits >> 2) & 0x01) != 0) } #[doc = "Bit 3 - Excessive Deferral"] #[inline(always)] pub fn exdef(&self) -> EXDEF_R { EXDEF_R::new(((self.bits >> 3) & 0x01) != 0) } #[doc = "Bit 4 - Late Collision"] #[inline(always)] pub fn lcol(&self) -> LCOL_R { LCOL_R::new(((self.bits >> 4) & 0x01) != 0) } #[doc = "Bit 5 - Excessive Collisions"] #[inline(always)] pub fn excol(&self) -> EXCOL_R { EXCOL_R::new(((self.bits >> 5) & 0x01) != 0) } #[doc = "Bit 8 - Receive Watchdog Timeout"] #[inline(always)] pub fn rwt(&self) -> RWT_R { RWT_R::new(((self.bits >> 8) & 0x01) != 0) } }
#![deny(rust_2018_idioms)] use libp2p::identity::Keypair; fn main() -> anyhow::Result<()> { let keypair = Keypair::generate_ed25519(); let private_key = keypair.to_protobuf_encoding()?; let encoded_private_key = base64::encode(private_key); println!("{encoded_private_key}"); Ok(()) }
//! Cells in the cellular automaton. use crate::rules::Rule; use derivative::Derivative; use std::{ cell::Cell, fmt::{Debug, Error, Formatter}, ops::{Deref, Not}, }; #[cfg(feature = "serialize")] use serde::{Deserialize, Serialize}; /// Possible states of a known cell. /// /// During the search, the state of a cell is represented by `Option<State>`, /// where `None` means that the state of the cell is unknown. #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[cfg_attr(feature = "serialize", derive(Serialize, Deserialize))] pub struct State(pub usize); pub const DEAD: State = State(0); pub const ALIVE: State = State(1); /// Flips the state. /// /// For Generations rules, the `not` of a dying state is `ALIVE`. impl Not for State { type Output = State; fn not(self) -> Self::Output { match self { ALIVE => DEAD, _ => ALIVE, } } } /// The coordinates of a cell. /// /// `(x-coordinate, y-coordinate, time)`. /// All three coordinates are 0-indexed. pub type Coord = (isize, isize, isize); /// A cell in the cellular automaton. /// /// The name `LifeCell` is chosen to avoid ambiguity with /// [`std::cell::Cell`](https://doc.rust-lang.org/std/cell/struct.Cell.html). pub struct LifeCell<'a, R: Rule> { /// The coordinates of a cell. pub coord: Coord, /// The background state of the cell. /// /// For rules without `B0`, it is always `DEAD`. /// /// For rules with `B0`, the background changes periodically. /// For example, for non-Generations rules, it is `DEAD` on even generations, /// `ALIVE` on odd generations. pub(crate) background: State, /// The state of the cell. /// /// `None` means that the state of the cell is unknown. pub(crate) state: Cell<Option<State>>, /// The “neighborhood descriptors” of the cell. /// /// It describes the states of the cell itself, its neighbors, /// and its successor. pub(crate) desc: Cell<R::Desc>, /// The predecessor of the cell. /// /// The cell in the last generation at the same position. pub(crate) pred: Option<CellRef<'a, R>>, /// The successor of the cell. /// /// The cell in the next generation at the same position. pub(crate) succ: Option<CellRef<'a, R>>, /// The eight cells in the neighborhood. pub(crate) nbhd: [Option<CellRef<'a, R>>; 8], /// The cells in the same generation that must has the same state /// with this cell because of the symmetry. pub(crate) sym: Vec<CellRef<'a, R>>, /// Whether the cell is on the first row or column. /// /// Here the choice of row or column depends on the search order. pub(crate) is_front: bool, } impl<'a, R: Rule> LifeCell<'a, R> { /// Generates a new cell with background state, such that its neighborhood /// descriptor says that all neighboring cells also have the same state. /// /// `first_gen` and `first_col` are set to `false`. pub(crate) fn new(coord: Coord, background: State, succ_state: State) -> Self { LifeCell { coord, background, state: Cell::new(Some(background)), desc: Cell::new(R::new_desc(background, succ_state)), pred: Default::default(), succ: Default::default(), nbhd: Default::default(), sym: Default::default(), is_front: false, } } /// Returns a `CellRef` from a `LifeCell`. pub(crate) fn borrow(&self) -> CellRef<'a, R> { let cell = unsafe { (self as *const LifeCell<'a, R>).as_ref().unwrap() }; CellRef { cell } } } impl<'a, R: Rule<Desc = D>, D: Copy + Debug> Debug for LifeCell<'a, R> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { f.debug_struct("LifeCell") .field("coord", &self.coord) .field("state", &self.state.get()) .field("desc", &self.desc.get()) .finish() } } /// A reference to a `LifeCell` which has the same lifetime as the cell /// it refers to. #[derive(Derivative)] #[derivative(Clone(bound = ""), Copy(bound = ""))] pub struct CellRef<'a, R: Rule> { cell: &'a LifeCell<'a, R>, } impl<'a, R: Rule> CellRef<'a, R> { /// Updates the neighborhood descriptors of all neighbors and the predecessor /// when the state of one cell is changed. /// /// Here `state` is the new state of the cell when `new` is true, /// the old state when `new` is false. pub(crate) fn update_desc(self, state: Option<State>, new: bool) { R::update_desc(self, state, new); } } impl<'a, R: Rule> PartialEq for CellRef<'a, R> { fn eq(&self, other: &Self) -> bool { std::ptr::eq(self.cell, other.cell) } } impl<'a, R: Rule> Eq for CellRef<'a, R> {} impl<'a, R: Rule> Deref for CellRef<'a, R> { type Target = LifeCell<'a, R>; fn deref(&self) -> &Self::Target { self.cell } } impl<'a, R: Rule<Desc = D>, D: Copy + Debug> Debug for CellRef<'a, R> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { f.debug_struct("CellRef") .field("coord", &self.coord) .finish() } }
//! ```elixir //! {:ok, document} = Lumen.Web.Document.new() //! {:ok, existing_child} = Lumen.Web.Document.create_element(document, "table") //! {:ok, parent} = Lumen.Web.Document.create_element(parent_document, "div") //! :ok = Lumen.Web.Node.append_child(document, parent) //! :ok = Lumen.Web.Node.append_child(parent, existing_child) //! {:ok, new_child} = Lumen.Web.Document.create_element(document, "ul"); //! {:ok, inserted_child} = Lumen.Web.insert_before(parent, new_child, nil) //! ``` #[path = "with_nil_reference_child_appends_new_child/label_1.rs"] pub mod label_1; #[path = "with_nil_reference_child_appends_new_child/label_2.rs"] pub mod label_2; #[path = "with_nil_reference_child_appends_new_child/label_3.rs"] pub mod label_3; #[path = "with_nil_reference_child_appends_new_child/label_4.rs"] pub mod label_4; #[path = "with_nil_reference_child_appends_new_child/label_5.rs"] pub mod label_5; #[path = "with_nil_reference_child_appends_new_child/label_6.rs"] pub mod label_6; use liblumen_alloc::erts::process::Process; use liblumen_alloc::erts::term::prelude::*; use liblumen_web::document; #[native_implemented::function(Elixir.Lumen.Web.Node.InsertBefore3:with_nil_reference_child_appends_new_child/0)] fn result(process: &Process) -> Term { // ```elixir // # pushed to stack: () // # returned from call: N/A // # full stack: () // # returns: {:ok, parent_document} // ``` process.queue_frame_with_arguments(document::new_0::frame().with_arguments(false, &[])); // ```elixir // # label 1 // # pushed to stack: () // # returned form call: {:ok, document} // # full stack: ({:ok, document}) // # returns: {:ok, old_child} // {:ok, existing_child} = Lumen.Web.Document.create_element(document, "table") // {:ok, parent} = Lumen.Web.Document.create_element(parent_document, "div") // :ok = Lumen.Web.Node.append_child(document, parent) // :ok = Lumen.Web.Node.append_child(parent, existing_child) // {:ok, new_child} = Lumen.Web.Document.create_element(document, "ul"); // {:ok, inserted_child} = Lumen.Web.insert_before(parent, new_child, nil) // ``` process.queue_frame_with_arguments(label_1::frame().with_arguments(true, &[])); Term::NONE }
mod error; use error::{Error, Result}; use serde::{de::Visitor, Deserialize}; struct OerDeserializer<'de> { input: &'de [u8], } impl<'de> OerDeserializer<'de> { fn from_oer_bytes(input: &'de [u8]) -> Self { Self { input } } } pub fn from_oer_bytes<'a, T>(input: &'a [u8]) -> Result<T> where T: Deserialize<'a>, { let mut deserializer = OerDeserializer::from_oer_bytes(input); let t = T::deserialize(&mut deserializer)?; if deserializer.input.is_empty() { Ok(t) } else { Err(Error::TrailingCharacters) } } impl<'de, 'a> serde::de::Deserializer<'de> for &'a mut OerDeserializer<'de> { type Error = Error; fn deserialize_any<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { Err(Error::Message(String::from("no any support"))) } fn deserialize_bool<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_i8<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_i16<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_i32<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_i64<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_i128<V>(self, visitor: V) -> Result<V::Value> where V: Visitor<'de>, { let (&field_size, rest) = self.input.split_first().ok_or(Error::Eof)?; self.input = rest; assert_eq!(1, field_size, "This method is currently not implemented for field size > 1"); let (&value, rest) = self.input.split_first().ok_or(Error::Eof)?; self.input = rest; visitor.visit_i64(i64::from(value as i8)) } /// Rec.ITU-T X.696 10.3 a /// For lower bound greater than or equal to zero. /// If the upper bound is less than or equal to 2^8 - 1, then /// every value of the integer type shall be encoded as a /// fixed-size unsigned number in a one-octet word. fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value> where V: Visitor<'de>, { let (value, rest) = self.input.split_first().ok_or(Error::Eof)?; self.input = rest; visitor.visit_u8(*value) } /// Rec.ITU-T X.696 10.3 b /// For lower bound greater than or equal to zero. /// If the upper bound is less than or equal to 2^16 - 1, then /// every value of the integer type shall be encoded as a /// fixed-size unsigned number in a one-octet word. fn deserialize_u16<V>(self, visitor: V) -> Result<V::Value> where V: Visitor<'de>, { let (value_bytes, rest) = self.input.split_at(2); self.input = rest; // interpret value_bytes as big endian let val1 = value_bytes[0]; let val2 = value_bytes[1]; let value = u16::from(val1) << 8 | u16::from(val2); visitor.visit_u16(value) } fn deserialize_u32<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_u64<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_f32<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_f64<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_char<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_str<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_string<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_bytes<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_byte_buf<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_option<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_unit<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_unit_struct<V>(self, _name: &'static str, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_newtype_struct<V>(self, _name: &'static str, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_seq<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_tuple<V>(self, len: usize, visitor: V) -> Result<V::Value> where V: Visitor<'de>, { struct Access<'a, 'de> { deserializer: &'a mut OerDeserializer<'de>, len: usize, } impl<'a, 'de> serde::de::SeqAccess<'de> for Access<'a, 'de> { type Error = Error; fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>> where T: serde::de::DeserializeSeed<'de>, { if self.len > 0 { self.len -= 1; let value = serde::de::DeserializeSeed::deserialize(seed, &mut *self.deserializer)?; Ok(Some(value)) } else { Ok(None) } } fn size_hint(&self) -> Option<usize> { Some(self.len) } } visitor.visit_seq(Access { deserializer: self, len, }) } fn deserialize_tuple_struct<V>( self, _name: &'static str, _len: usize, _visitor: V, ) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_map<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_struct<V>( self, _name: &'static str, fields: &'static [&'static str], visitor: V, ) -> Result<V::Value> where V: Visitor<'de>, { self.deserialize_tuple(fields.len(), visitor) } fn deserialize_enum<V>( self, _name: &'static str, _variants: &'static [&'static str], _visitor: V, ) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_identifier<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } fn deserialize_ignored_any<V>(self, _visitor: V) -> Result<V::Value> where V: Visitor<'de>, { unimplemented!() } } #[cfg(test)] mod tests { use super::from_oer_bytes; asn1_codegen::from!("../test-asn/geo.asn"); /// Subprocess call to asn1tools to serialize the given struct using /// OER encoding. fn serialize_with_asn1tools<'a, T>( file_path: &str, struct_name: &str, struct_under_test: &'a T, ) -> Vec<u8> where T: serde::Serialize, { let std_out_bytes = std::process::Command::new("asn1tools") .args(&[ "convert", file_path, struct_name, "-o", "oer", // output OER format "-i", "jer", // input JSON format // asn1tools expects the input in hex &hex::encode(serde_json::to_string(struct_under_test).unwrap().as_bytes()), ]) .current_dir(std::env::var("CARGO_MANIFEST_DIR").unwrap()) .output() .unwrap() .stdout; let std_out_hex_string = String::from_utf8_lossy(&std_out_bytes); let std_out_hex_string_without_newline = std_out_hex_string.trim_end(); hex::decode(std_out_hex_string_without_newline).unwrap() } #[test] fn point() { // explicitly specify the types of these fields to verify the code generation let point = Point { x: -2_i128, y: 2_i128, }; let oer_bytes = serialize_with_asn1tools("../test-asn/geo.asn", "Point", &point); // This assertion is checking the output of asn1tools, as well as our processing // and interpretation of the returned bytes. It is left here mostly because it is // helpful to see the input bytes to the deserialization code under test. assert_eq!(oer_bytes, [1, 254, 1, 2]); assert_eq!(from_oer_bytes::<Point>(&oer_bytes).unwrap(), point); } #[test] fn line() { let p1 = Point { x: 5, y: 10 }; let p2 = Point { x: 15, y: 25 }; let line = Line { p1, p2 }; let oer_bytes = serialize_with_asn1tools("../test-asn/geo.asn", "Line", &line); // Sanity check the asn1tools output assert_eq!(oer_bytes, [1, 5, 1, 10, 1, 15, 1, 25]); assert_eq!(from_oer_bytes::<Line>(&oer_bytes).unwrap(), line); } #[test] fn tiny_rectangle() { // explicitly specify the types of these fields to verify the code generation let tiny_rectangle = TinyRectangle { width: 10_u8, height: 5_u8, }; let oer_bytes = serialize_with_asn1tools("../test-asn/geo.asn", "TinyRectangle", &tiny_rectangle); // Sanity check the asn1tools output assert_eq!(oer_bytes, [10, 5]); assert_eq!( from_oer_bytes::<TinyRectangle>(&oer_bytes).unwrap(), tiny_rectangle ); } #[test] fn small_rectangle() { // explicitly specify the types of these fields to verify the code generation let small_rectangle = SmallRectangle { width: 11_u16, height: 6_u16, }; let oer_bytes = serialize_with_asn1tools("../test-asn/geo.asn", "SmallRectangle", &small_rectangle); // Sanity check the asn1tools output assert_eq!(oer_bytes, [0, 11, 0, 6]); assert_eq!( from_oer_bytes::<SmallRectangle>(&oer_bytes).unwrap(), small_rectangle ); } }
use reqwest; //move client up lazy_static pub struct UserPreference { pub mode : String, pub category : String, pub time : String, pub day : String, } pub fn register_preference(user_pref : &UserPreference) { let json_user_pref = json!( { "mode" : user_pref.mode, "category" : user_pref.category, "day" : user_pref.day, "time" : user_pref.time }); let uri = "http://localhost:8002/registerPreference" let client = reqwest::Client::new(); let mut response = client.post(uri) .json(&json_user_pref) .send() .expect("Failed to send request"); //returns hash of updated tree let mut buf = String::new(); respoese.read_to_string(&mut buf).expect("failed to read response"); println!("{}", buf); //save blockchain } pub fn get_preference_root() { let client = reqwest::Client::new(); let response = client.get("/getPreferenceRoot") .send() .expect("Failed to send request"); println!("{}", response) } pub fn get_inclusion_proof(number : String, preference : String) { let client = reqwest::Client::new(); let proof_parameters = json!( { "number" : number, "pref" : preference, }); let mut response = client.post(uri) .json(&proof_parameters) .send() .expect("Failed to send request"); } // fn post_call(uri : String) { // let mut response = client.post(uri) // .json(&proof_parameters) // .send() // .expect("Failed to send request"); // let mut buf = String::new(); // response.read_to_string(&mut buf).expect("Failed to read response"); // println!("{}", buf); // }
pub mod helpers{ use crate::image_rect; use crate::SortKey; #[derive(Debug)] pub struct ImageHelper{ pub size: u32, pub id: u32, } pub fn sort(list: &mut Vec<image_rect::image::ImageRect>, key: SortKey){ match key{ SortKey::Height => list .sort_by(|img_a, img_b| img_b.height.cmp(&img_a.height)), SortKey::Width => list .sort_by(|img_a, img_b| img_b.width.cmp(&img_a.width)), SortKey::Area => list .sort_by(|img_a, img_b| img_b.area.cmp(&img_a.area)), SortKey::MaxDimension => list .sort_by(|img_a, img_b| img_b.max_dimension.cmp(&img_a.max_dimension)) } } }
use lettre::smtp::authentication::{Credentials, Mechanism}; use lettre::smtp::ConnectionReuseParameters; use lettre::{SmtpClient, Transport}; use lettre_email::Email; use log::info; use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize)] pub struct ContactMail { pub sender_address: String, pub message: String, } pub struct Config { pub password: String, } pub fn send_contact_mail(config: Config, mail_data: ContactMail) { let email = Email::builder() // Addresses can be specified by the tuple (email, alias) .to(("helferlein@marcelkoch.net", "Marcel Koch")) .from(mail_data.sender_address) .subject("Kontaktformular") .text(mail_data.message) .build() .unwrap(); // Open a local connection on port 25 let mut mailer = SmtpClient::new_simple("koch.kasserver.com") .unwrap() .smtp_utf8(true) .credentials(Credentials::new( "helferlein@marcelkoch.net".to_string(), config.password, )) .authentication_mechanism(Mechanism::Login) .connection_reuse(ConnectionReuseParameters::ReuseUnlimited) .transport(); // Send the email let result = mailer.send(email.into()); if result.is_ok() { info!("E-Mail was sent successfully!"); } else { println!("Could not send email: {:?}", result); } mailer.close(); }
//! Safe wrappers for memory-accessing functions like `std::ptr::copy()`. use std::ptr; macro_rules! idx_check ( ($slice:expr, $idx:expr) => { assert!($idx < $slice.len(), concat!("`", stringify!($idx), "` ({}) out of bounds. Length: {}"), $idx, $slice.len()); } ); macro_rules! len_check ( ($slice:expr, $start:ident, $len:ident) => { assert!( $start.checked_add($len) .expect(concat!("Overflow evaluating ", stringify!($start + $len))) <= $slice.len(), "Length {} starting at {} is out of bounds (slice len {}).", $len, $start, $slice.len() ) } ); /// Copy `len` elements from `src_idx` to `dest_idx`. Ranges may overlap. /// /// Safe wrapper for `memmove()`/`std::ptr::copy()`. /// /// ###Panics /// * If either `src_idx` or `dest_idx` are out of bounds, or if either of these plus `len` is out of /// bounds. /// * If `src_idx + len` or `dest_idx + len` overflows. pub fn copy_over<T: Copy>(slice: &mut [T], src_idx: usize, dest_idx: usize, len: usize) { if slice.len() == 0 { return; } idx_check!(slice, src_idx); idx_check!(slice, dest_idx); len_check!(slice, src_idx, len); len_check!(slice, dest_idx, len); let src_ptr: *const T = &slice[src_idx]; let dest_ptr: *mut T = &mut slice[dest_idx]; unsafe { ptr::copy(src_ptr, dest_ptr, len); } } /// Safe wrapper for `std::ptr::write_bytes()`/`memset()`. pub fn write_bytes(slice: &mut [u8], byte: u8) { unsafe { ptr::write_bytes(slice.as_mut_ptr(), byte, slice.len()); } } /// Prepend `elems` to `vec`, resizing if necessary. /// /// ###Panics /// If `vec.len() + elems.len()` overflows. pub fn prepend<T: Copy>(elems: &[T], vec: &mut Vec<T>) { // Our overflow check occurs here, no need to do it ourselves. vec.reserve(elems.len()); let old_len = vec.len(); let new_len = old_len + elems.len(); unsafe { vec.set_len(new_len); } // Move the old elements down to the end. if old_len > 0 { copy_over(vec, 0, elems.len(), old_len); } vec[..elems.len()].copy_from_slice(elems); } #[cfg(test)] mod tests { use super::*; #[test] #[should_panic] fn bounds_check() { let mut arr = [0i32, 1, 2, 3, 4, 5]; copy_over(&mut arr, 2, 1, 7); } #[test] fn copy_empty() { let mut arr: [i32; 0] = []; copy_over(&mut arr, 0, 0, 0); } #[test] fn prepend_empty() { let mut vec: Vec<i32> = vec![]; prepend(&[1, 2, 3], &mut vec); } #[test] fn prepend_i32() { let mut vec = vec![3, 4, 5]; prepend(&[1, 2], &mut vec); assert_eq!(vec, &[1, 2, 3, 4, 5]); } }
fn main() { println!("Hello, World to rust!!!") }
#[macro_export] macro_rules! js( ($global:expr, { $( $name:tt: $value:expr ),+ }) => ({ let value = Value::new_obj(Some($global)); $( value.set_field($name, js!($value)); )* value }); ($global:expr, { $name:tt: $value:expr }) => ({ let value = Value::new_obj(Some($global)); value.set_field($name, js!($value)); value }); ($inp:expr) => ( to_value($inp) ); ); #[macro_export] macro_rules! js_extend( ($object:expr, { $name:tt: $value:expr }) => ( $object.set_field($name, $value) ); ($object:expr, { $($name:tt: $value:expr),+ }) => ({ let object = $object; $( object.set_field($name, js!($value)); )* }); );
// Copyright 2013 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 /* # if b { x } else { y } requires identical types for x and y */ fn print1(b: bool, s1: &str, s2: &str) { println!("{}", if b { s1 } else { s2 }); } fn print2<'a, 'b>(b: bool, s1: &'a str, s2: &'b str) { println!("{}", if b { s1 } else { s2 }); } fn print3(b: bool, s1: &str, s2: &str) { let mut s: &str; if b { s = s1; } else { s = s2; } println!("{}", s); } fn print4<'a, 'b>(b: bool, s1: &'a str, s2: &'b str) { let mut s: &str; if b { s = s1; } else { s = s2; } println!("{}", s); } pub fn main() {}
use std::collections::HashMap; use super::design_space::DPoint; use super::point::{EntityId, PathPoint, PointType}; use super::point_list::{PathPoints, RawSegment}; use druid::kurbo::{BezPath, PathEl}; use druid::Data; /// A single bezier path. /// /// This does not contain subpaths, but a glyph can contain multiple paths. /// UFO calls this a [contour][]. /// /// # Notes /// /// As UFO does not support the idea of a 'start point' for closed glyphs, /// and defines the points in a path as a cycle, we adopt the convention that /// the 'first point' in a closed path is always the last point in the vec. /// /// A path that is 'open' must both begin and end with on-curve points. /// /// [contour]: https://unifiedfontobject.org/versions/ufo3/glyphs/glif/#contour #[derive(Debug, Data, Clone)] pub struct CubicPath { points: PathPoints, } impl CubicPath { pub(crate) fn new(point: DPoint) -> CubicPath { CubicPath { points: PathPoints::new(point), } } pub(crate) fn from_raw_parts( id: EntityId, points: Vec<PathPoint>, trailing: Option<DPoint>, closed: bool, ) -> Self { CubicPath { points: PathPoints::from_raw_parts(id, points, None, trailing, closed), } } /// Construct a new CubicPath from the provided `PathPoints`. /// /// The caller is responsible for ensuring that the points have valid /// and unique identifiers, and are otherwise well-formed. pub(crate) fn from_path_points_unchecked(points: PathPoints) -> Self { CubicPath { points } } /// Attempt to create a `Path` from a BezPath. /// /// - on the first 'segment' of the bezier will be used. /// - we don't currently support quadratics. pub(crate) fn from_bezpath( path: impl IntoIterator<Item = PathEl>, ) -> Result<Self, &'static str> { let path_id = EntityId::next(); let mut els = path.into_iter(); let mut points = Vec::new(); let mut explicit_close = false; let start_point = match els.next() { Some(PathEl::MoveTo(pt)) => pt, _ => return Err("missing initial moveto"), }; points.push(PathPoint::on_curve(path_id, DPoint::from_raw(start_point))); for el in els { match el { // we only take the first path segment PathEl::MoveTo(_) => break, PathEl::LineTo(pt) => { points.push(PathPoint::on_curve(path_id, DPoint::from_raw(pt))); } PathEl::CurveTo(p0, p1, p2) => { points.push(PathPoint::off_curve(path_id, DPoint::from_raw(p0))); points.push(PathPoint::off_curve(path_id, DPoint::from_raw(p1))); points.push(PathPoint::on_curve(path_id, DPoint::from_raw(p2))); } PathEl::QuadTo(..) => return Err("quads not currently supported"), PathEl::ClosePath => { explicit_close = true; break; } } } let closed = if points.len() > 1 && points.first().map(|p| p.point) == points.last().map(|p| p.point) { points.pop(); true } else { explicit_close }; crate::path::mark_tangent_handles(&mut points); if closed { points.rotate_left(1); } Ok(Self::from_raw_parts(path_id, points, None, closed)) } pub(crate) fn from_norad(src: &norad::glyph::Contour) -> CubicPath { use norad::glyph::PointType as NoradPType; assert!( !src.points.is_empty(), "non empty points list should already be checked" ); let closed = !matches!(src.points[0].typ, NoradPType::Move); let path_id = EntityId::next(); let mut points = Vec::new(); let mut idents = HashMap::new(); if let Some(id) = src.identifier() { idents.insert(path_id, id.clone()); } for n_pt in &src.points { let point = DPoint::new(n_pt.x.round() as f64, n_pt.y.round() as f64); let typ = PointType::from_norad(n_pt); let id = EntityId::new_with_parent(path_id); if let Some(ident) = n_pt.identifier() { idents.insert(id, ident.to_owned()); } points.push(PathPoint { id, point, typ }); } //FIXME: this looks confused and is probably a bug? we should normalize //points we get from norad, but not arbitrarily change the order? if closed { points.rotate_left(1); } let points = PathPoints::from_raw_parts(path_id, points, Some(idents), None, closed); CubicPath { points } } pub(crate) fn to_norad(&self) -> norad::glyph::Contour { use norad::glyph::{Contour, ContourPoint, PointType as NoradPType}; let mut points = Vec::new(); let mut prev_off_curve = self .points .as_slice() .last() .map(|p| !p.is_on_curve()) .unwrap_or(false); for p in self.points.as_slice() { let needs_move = points.is_empty() && !self.points.closed(); let (typ, smooth) = match p.typ { PointType::OnCurve { smooth } if needs_move => (NoradPType::Move, smooth), PointType::OffCurve { .. } => (NoradPType::OffCurve, false), PointType::OnCurve { smooth } if prev_off_curve => (NoradPType::Curve, smooth), PointType::OnCurve { smooth } => (NoradPType::Line, smooth), }; let x = p.point.x as f32; let y = p.point.y as f32; let npoint = ContourPoint::new(x, y, typ, smooth, None, None, None); points.push(npoint); prev_off_curve = p.is_off_curve(); } if self.points.closed() { points.rotate_right(1); } let ident = self.path_points().norad_id_for_id(self.path_points().id()); Contour::new(points, ident, None) } pub(crate) fn iter_segments(&self) -> impl Iterator<Item = RawSegment> { self.path_points().iter_segments() } pub(crate) fn path_points(&self) -> &PathPoints { &self.points } pub(crate) fn path_points_mut(&mut self) -> &mut PathPoints { &mut self.points } pub(crate) fn append_to_bezier(&self, bez: &mut BezPath) { bez.move_to(self.points.start_point().point.to_raw()); for segment in self.points.iter_segments() { match segment { RawSegment::Line(_, p1) => bez.line_to(p1.point.to_raw()), RawSegment::Cubic(_, p1, p2, p3) => { bez.curve_to(p1.to_kurbo(), p2.to_kurbo(), p3.to_kurbo()) } } } if self.points.closed() { bez.close_path(); } } pub(crate) fn is_closed(&self) -> bool { self.points.closed() } pub(crate) fn split_segment_at_point(&mut self, seg: RawSegment, t: f64) { let mut pre_seg = seg.subsegment(0.0..t); if let RawSegment::Cubic(_, _, _, p3) = &mut pre_seg { p3.typ = PointType::OnCurve { smooth: true }; } let post_seg = seg.subsegment(t..1.0); self.points.split_segment(seg, pre_seg, post_seg); } } impl From<PathPoints> for CubicPath { fn from(points: PathPoints) -> CubicPath { CubicPath { points } } } #[cfg(test)] mod tests { use super::*; use druid::kurbo::{Line, PathSeg, Point, Rect, Shape}; #[test] fn from_bezpath() { let rect = Rect::from_origin_size((0., 0.), (10., 10.)); let path = CubicPath::from_bezpath(rect.to_path(0.1)).unwrap(); assert!(path.is_closed()); assert_eq!(path.points.len(), 4); assert_eq!(path.points.start_point().point.to_raw(), Point::ORIGIN); } #[test] fn iter_rect_segs() { let rect = Rect::new(0., 0., 10., 10.); let path = CubicPath::from_bezpath(rect.to_path(0.1)).unwrap(); let mut seg_iter = path.iter_segments(); assert!(matches!(seg_iter.next().unwrap(), RawSegment::Line(..))); assert!(matches!(seg_iter.next().unwrap(), RawSegment::Line(..))); assert!(matches!(seg_iter.next().unwrap(), RawSegment::Line(..))); assert!(matches!(seg_iter.next().unwrap(), RawSegment::Line(..))); } #[test] fn iter_line_sects() { let mut path = CubicPath::new(DPoint::new(0., 0.)); path.path_points_mut().push_on_curve(DPoint::new(10., 10.)); let mut seg_iter = path.iter_segments(); let seg = seg_iter.next().unwrap(); let line = match seg.to_kurbo() { PathSeg::Line(line) => line, other => panic!("expected line found {:?}", other), }; assert!(seg_iter.next().is_none()); assert!(!path.is_closed()); assert_eq!(line.p0, Point::ORIGIN); assert_eq!(line.p1, Point::new(10., 10.)); } #[test] fn iter_triangle_sects() { let mut bez = BezPath::new(); bez.move_to((10., 10.)); bez.line_to((0., 0.)); bez.line_to((20., 0.)); bez.close_path(); let path = CubicPath::from_bezpath(bez).unwrap(); assert!(path.points.closed()); assert_eq!(path.points.len(), 3); let mut iter = path.points.iter_segments().map(RawSegment::to_kurbo); assert_eq!(iter.next(), Some(Line::new((10., 10.), (0., 0.)).into())); assert_eq!(iter.next(), Some(Line::new((0., 0.), (20., 0.)).into())); assert_eq!(iter.next(), Some(Line::new((20., 0.), (10., 10.)).into())); } }
// This is a test for issue #109. use std; fn slice[T](e: vec[T]) { let result: vec[T] = std::vec::alloc[T](1 as uint); log "alloced"; result += e; log "appended"; } fn main() { slice[str](["a"]); }
use chrono::{DateTime, Local}; #[derive(Debug)] pub enum Condition { Sunny, PartiallyCloudy, Cloudy, Raining, Stormy, } #[derive(Debug, Eq, PartialEq)] pub enum TargetDate { Now, Hourly(DateTime<Local>), Daily(DateTime<Local>), } #[derive(Debug)] pub struct Forecast { pub collected_at: DateTime<Local>, pub target_at: TargetDate, pub temperature: f32, pub condition: Condition, pub location: String, pub source: String, } impl Forecast { pub fn new(collected_at: DateTime<Local>, target_at: TargetDate, temperature: f32, condition: Condition, location: &str, source: &str) -> Self { Self { collected_at, target_at, temperature, condition, location: location.into(), source: source.into(), } } pub fn is_now(&self) -> bool { self.target_at == TargetDate::Now } }
//! Utilities for use with [futures](https://docs.rs/futures/0.1.25/futures/) and //! [tokio](https://docs.rs/tokio/0.1.15/tokio/). use futures::prelude::*; use std::{collections::HashMap, hash::Hash}; /// A higher-level version of `tokio_threadpool::blocking`. #[cfg(all(feature = "tokio", feature = "tokio-threadpool"))] pub fn blocking<E, F, T>(func: F) -> impl Future<Item = T, Error = E> where F: FnOnce() -> Result<T, E>, { use futures::future::poll_fn; let mut func = Some(func); poll_fn(move || { tokio_threadpool::blocking(func.take().unwrap()) .map_err(|_| panic!("Blocking operations must be run inside a Tokio thread pool!")) }) .and_then(|r| r) } /// Runs a future, then returns it. /// /// ``` /// # use futures::prelude::*; /// # use libremexre::futures::run_and_return; /// /// #[derive(Debug, PartialEq)] /// struct FooFuture(usize); /// impl Future for FooFuture { /// type Item = usize; /// type Error = (); /// fn poll(&mut self) -> Result<Async<usize>, ()> { /// Ok(Async::Ready(self.0)) /// } /// } /// /// assert_eq!(run_and_return(FooFuture(42)).wait(), Ok((FooFuture(42), 42))); /// ``` pub fn run_and_return<Fut: Future>( fut: Fut, ) -> impl Future<Item = (Fut, Fut::Item), Error = Fut::Error> { struct RunAndReturn<Fut: Future>(Option<Fut>); impl<Fut: Future> Future for RunAndReturn<Fut> { type Item = (Fut, Fut::Item); type Error = Fut::Error; fn poll(&mut self) -> Result<Async<(Fut, Fut::Item)>, Fut::Error> { match self.0.as_mut().map(|fut| fut.poll()) { Some(Ok(Async::Ready(val))) => Ok(Async::Ready((self.0.take().unwrap(), val))), Some(Ok(Async::NotReady)) | None => Ok(Async::NotReady), Some(Err(err)) => Err(err), } } } RunAndReturn(Some(fut)) } /// Returns a future that sends a value to a sink, but does not flush it. pub fn send_to_sink<S: Sink>( sink: S, item: S::SinkItem, ) -> impl Future<Item = S, Error = S::SinkError> { struct SendToSink<S: Sink>(Option<(S, S::SinkItem)>); impl<S: Sink> Future for SendToSink<S> { type Item = S; type Error = S::SinkError; fn poll(&mut self) -> Result<Async<S>, S::SinkError> { let (mut sink, item) = self .0 .take() .expect("send_to_sink: values not present; did the sink panic?"); match sink.start_send(item) { Ok(AsyncSink::Ready) => Ok(Async::Ready(sink)), Ok(AsyncSink::NotReady(item)) => { self.0 = Some((sink, item)); Ok(Async::NotReady) } Err(err) => Err(err), } } } SendToSink(Some((sink, item))) } /// Allows selecting over several streams, keyed by identifiers. Polls in a round-robin fashion. /// Streams are dropped when they yield `Ok(Ready(None))`. #[derive(Debug)] pub struct SelectSet<K: Clone + Eq + Hash, S: Stream> { current: usize, keys: Vec<K>, streams: HashMap<K, S>, } impl<K: Clone + Eq + Hash, S: Stream> SelectSet<K, S> { /// Creates a new, empty SelectSet. Note that this will always return `Ok(NotReady)` when /// polled, until a stream is added! pub fn new() -> SelectSet<K, S> { SelectSet::default() } /// Adds a new stream with the given key. If a stream was already present, returns it. pub fn add(&mut self, key: K, stream: S) -> Option<S> { if let Some(prev) = self.streams.insert(key.clone(), stream) { Some(prev) } else { self.keys.push(key); None } } /// Removes a stream by key, if it exists. pub fn remove(&mut self, key: &K) -> Option<S> { self.streams.remove(key).map(|stream| { // This may deviate from round-robin behavior, when what we're removing was just // polled. However, the code to fix this is more trouble than it's worth. let n = self.keys.iter().position(|k| k == key).unwrap(); let _ = self.keys.remove(n); stream }) } } impl<K: Clone + Eq + Hash, S: Stream> Default for SelectSet<K, S> { fn default() -> SelectSet<K, S> { SelectSet { current: 0, keys: Vec::new(), streams: HashMap::new(), } } } impl<K: Clone + Eq + Hash, S: Stream> Stream for SelectSet<K, S> { type Item = S::Item; type Error = S::Error; fn poll(&mut self) -> Result<Async<Option<S::Item>>, S::Error> { if self.keys.is_empty() { return Ok(Async::NotReady); } self.current = (self.current + 1) % self.keys.len(); let r = self .streams .get_mut(&self.keys[self.current]) .unwrap() .poll(); if let Ok(Async::Ready(None)) = r { let key = self.keys[self.current].clone(); let _ = self.remove(&key); } r } }
extern crate hyper; use std::io::Read; use self::hyper::Client; use self::hyper::Url; use self::hyper::header::*; static PARSE_APP_ID_HEADER_KEY: &'static str = "X-Parse-Application-Id"; static PARSE_API_KEY_HEADER_KEY: &'static str = "X-Parse-REST-API-Key"; static PARSE_LOGIN_URL_TEMPLATE: &'static str = "https://api.parse.com/1/login/"; static PARSE_CLASS_URL_TEMPLATE: &'static str = "https://api.parse.com/1/classes/[class]/"; pub struct Parse { client: Client, app_id: &'static str, api_key: &'static str, } pub enum ParseUrlError { InvalidBaseUrl } #[allow(dead_code)] impl Parse { pub fn new(app_id: &'static str, api_key: &'static str) -> Parse { Parse { client: Client::new(), app_id: app_id, api_key: api_key} } pub fn login(&self, username: &str, password: &str) { let base_url = PARSE_LOGIN_URL_TEMPLATE.to_string(); let mut parameters: Vec<(&str, &str)> = vec![]; parameters.push(("username", username)); parameters.push(("password", password)); let login_url = build_query_url(&base_url, parameters).ok().unwrap(); let headers = self.get_headers(); match self.client.get(login_url).headers(headers).send() { Ok(mut response) => { let mut body = String::new(); response.read_to_string(&mut body).unwrap(); println!("Login: {}", body); }, Err(error) => println!("Failed to login: {}", error), } } // MARK: Info requests pub fn count_total(&mut self, class_name: &str, predicate: Vec<(&str, &str)>) -> String { let base_url = PARSE_CLASS_URL_TEMPLATE.to_string().replace("[class]", class_name); let mut parameters = predicate; parameters.push(("count", "1")); parameters.push(("limit", "0")); let count_url = build_query_url(&base_url, parameters).ok().unwrap(); let headers = self.get_headers(); match self.client.get(count_url).headers(headers).send() { Ok(mut response) => { let mut body = String::new(); response.read_to_string(&mut body).unwrap(); body }, Err(_) => "".to_string() } } pub fn count(&mut self, class_name: &str) -> String { let predicate = vec![]; self.count_total(class_name, predicate) } // MARK: Create requests pub fn create_object(&mut self, class_name: &str, serialized_instance: &str) { let url = Url::parse(&(PARSE_CLASS_URL_TEMPLATE.to_string().replace("[class]", class_name))).ok().unwrap(); let headers = self.get_headers(); match self.client.post(url).headers(headers).body(serialized_instance).send() { Ok(mut response) => { let mut body = String::new(); response.read_to_string(&mut body).unwrap(); println!("{}", body); } Err(_) => { } } } // MARK Utilities fn get_headers(&self) -> Headers { let mut headers = Headers::new(); let app_id = self.app_id.as_bytes().to_vec(); let api_key = self.api_key.as_bytes().to_vec(); headers.set_raw(PARSE_APP_ID_HEADER_KEY, vec![app_id]); headers.set_raw(PARSE_API_KEY_HEADER_KEY, vec![api_key]); headers } } // Utilities fn build_query_url(base_url: &str, parameters: Vec<(&str, &str)>) -> Result<Url, ParseUrlError> { match Url::parse(base_url) { Ok(mut parsed_url) => { parsed_url.set_query_from_pairs(parameters.into_iter()); Ok(parsed_url) }, Err(_) => { Err(ParseUrlError::InvalidBaseUrl) } } }
use crate::embded_lexer::tokenization::Token; pub type Identifier = String; use std::fmt; pub struct Program { pub statements: Vec<Statement>, } impl Program { pub fn new() -> Program { Program { statements: Vec::new(), } } } #[derive(Debug, Clone, PartialEq)] pub enum Statement { Let(Identifier, Expression), Expression(Expression), None, } impl fmt::Display for Statement { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { Statement::Expression(expr) => write!(f, "{}", expr), _ => writeln!(f, "{:?}", self), } } } #[derive(Debug, Clone, PartialEq)] pub enum Expression { Bool(bool), Identifier(Identifier), Integer(i64), Call { func: Box<Expression>, args: Vec<Expression>, }, Function(Identifier, Vec<Identifier>, Vec<Statement>), Infix(Infix, Box<Expression>, Box<Expression>), Prefix(Prefix, Box<Expression>), Index(Box<Expression>, Box<Expression>), } impl fmt::Display for Expression { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { Expression::Function(ident, pars, stmts) => { write!(f, "\nFunction: {}\n", ident)?; write!(f, "\tParameters:\n\t\t")?; for st in pars { write!(f, "{} ", st)?; } write!(f, "\n\tStatements: ")?; for st in stmts { write!(f, "\n\t\t{} ", st)?; } writeln!(f, "") } Expression::Index(ident, expr) => { write!(f, "{}", *ident)?; write!(f, "[{}]", *expr) } Expression::Infix(inf, expr1, expr2) => { write!(f, "\n\t\t\t{} {} {}", *expr1, inf, *expr2) } _ => write!(f, "{:?}", self), } } } #[derive(Debug, Clone, PartialEq)] pub enum Infix { Plus, Minus, Divide, Multiply, Equal, NotEqual, MoreThanAndEqual, MoreThan, LessThanAndEqual, LessThan, Assign, } impl fmt::Display for Infix { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { Infix::Plus => write!(f, "+"), Infix::Minus => write!(f, "-"), Infix::Divide => write!(f, "/"), Infix::Multiply => write!(f, "*"), Infix::Equal => write!(f, "=="), Infix::NotEqual => write!(f, "!="), Infix::MoreThanAndEqual => write!(f, ">="), Infix::MoreThan => write!(f, ">"), Infix::LessThanAndEqual => write!(f, "<="), Infix::LessThan => write!(f, "<"), Infix::Assign => write!(f, "="), } } } #[derive(Debug, Clone, PartialEq)] pub enum Prefix { Plus, Minus, Not, } impl fmt::Display for Prefix { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { Prefix::Plus => write!(f, "++"), Prefix::Minus => write!(f, "--"), Prefix::Not => write!(f, "!"), } } }
use openexr_sys as sys; use std::os::raw::{c_char, c_int}; bitflags::bitflags! { /// The version flags represents the options that are supported in the library and the EXR file. /// pub struct VersionFlags: i32 { /// File is tiled /// const TILED = 0x00000200; /// File contains long attribute or channel names /// const LONG_NAMES = 0x00000400; /// File has at least one part which is not a regular scanline image or regular tiled image (that is, it is a deep format) /// const NON_IMAGE = 0x00000800; /// File has multiple parts /// const MULTI_PART_FILE = 0x00001000; /// Bitwise OR of all known flags /// const ALL = Self::TILED.bits | Self::LONG_NAMES.bits | Self::NON_IMAGE.bits | Self::MULTI_PART_FILE.bits; } } impl VersionFlags { /// The flag object is supported by the bound OpenEXR library. /// pub fn supports_flags(&self) -> bool { let mut result: bool = false; unsafe { // NOTE: This will not raise an error, so error checking is skipped. sys::Imf_supportsFlags(&mut result, self.bits); } result } } /// The version represents a version number and the flags that are enabled for the file. /// #[derive(Debug, Copy, Clone)] pub struct Version { inner: c_int, } // NOTE: All of the functions below will not raise errors, so error checking is skipped. impl Version { /// Create a version from a given version number and flag. /// /// # Panics /// /// The version number must be between 0 and 255, otherwise this will panic. /// pub fn new(version: i32, flags: VersionFlags) -> Self { assert!( (0..=0x000000ff).contains(&version), "Version must be between 0 and 255" ); Self { inner: version | flags.bits, } } /// Create a version from the wrapped OpenEXR API. /// pub fn from_c_int(version: c_int) -> Self { Self { inner: version } } /// File is tiled /// pub fn is_tiled(&self) -> bool { let mut result = false; unsafe { sys::Imf_isTiled(&mut result, self.inner); } result } /// File has multiple parts /// pub fn is_multi_part(&self) -> bool { let mut result = false; unsafe { sys::Imf_isMultiPart(&mut result, self.inner); } result } /// File has at least one part which is not a regular scanline image or regular tiled image (that is, it is a deep format) /// pub fn is_non_image(&self) -> bool { let mut result = false; unsafe { sys::Imf_isNonImage(&mut result, self.inner); } result } /// Return the version as a tiled version /// pub fn make_tiled(&self) -> Self { let mut result: c_int = 0; unsafe { sys::Imf_makeTiled(&mut result, self.inner); } Self { inner: result } } /// Return the version as a non-tiled version /// pub fn make_non_tiled(&self) -> Self { let mut result: c_int = 0; unsafe { sys::Imf_makeNotTiled(&mut result, self.inner); } Self { inner: result } } /// Get the version number portion of encoded version. /// pub fn version(&self) -> i32 { let mut result: c_int = 0; unsafe { sys::Imf_getVersion(&mut result, self.inner); } result } /// Get the flags portion of encoded version. /// pub fn flags(&self) -> VersionFlags { let mut result: c_int = 0; unsafe { sys::Imf_getFlags(&mut result, self.inner); } VersionFlags { bits: result } } } /// Return if the byte array represents the OpenEXR magic number. /// pub fn is_imf_magic(bytes: &[c_char; 4]) -> bool { let mut result: bool = false; unsafe { sys::Imf_isImfMagic(&mut result, bytes.as_ptr()); } result } #[cfg(test)] mod tests { #[test] fn test_version_new_success() { super::Version::new(0, super::VersionFlags { bits: 0 }); super::Version::new(1, super::VersionFlags { bits: 0 }); super::Version::new(255, super::VersionFlags { bits: 0 }); } #[test] #[should_panic] fn test_version_new_failure_version_less_than_0() { super::Version::new(-1, super::VersionFlags { bits: 0 }); } #[test] #[should_panic] fn test_version_new_failure_version_greater_than_255() { super::Version::new(256, super::VersionFlags { bits: 0 }); } #[test] fn test_is_tiled_true() { let version = super::Version::new(1, super::VersionFlags::TILED); let result = version.is_tiled(); assert_eq!(result, true); } #[test] fn test_is_tiled_false() { let version = super::Version::new(1, super::VersionFlags { bits: 0 }); let result = version.is_tiled(); assert_eq!(result, false); } #[test] fn test_is_multi_part_true() { let version = super::Version::new(1, super::VersionFlags::MULTI_PART_FILE); let result = version.is_multi_part(); assert_eq!(result, true); } #[test] fn test_is_multi_part_false() { let version = super::Version::new(1, super::VersionFlags { bits: 0 }); let result = version.is_multi_part(); assert_eq!(result, false); } #[test] fn test_is_non_image_true() { let version = super::Version::new(1, super::VersionFlags::NON_IMAGE); let result = version.is_non_image(); assert_eq!(result, true); } #[test] fn test_is_non_image_false() { let version = super::Version::new(1, super::VersionFlags { bits: 0 }); let result = version.is_non_image(); assert_eq!(result, false); } #[test] fn test_make_tiled_success() { let version = super::Version::new(1, super::VersionFlags { bits: 0 }) .make_tiled(); assert_eq!(version.is_tiled(), true); } #[test] fn test_make_non_tiled_success() { let version = super::Version::new(1, super::VersionFlags::TILED).make_non_tiled(); assert_eq!(version.is_tiled(), false); } #[test] fn test_get_version_success() { #[allow(overflowing_literals)] let version = super::Version::from_c_int(0xffffffff); let result = version.version(); assert_eq!(result, 0x000000ff); } #[test] fn test_get_flags_success() { #[allow(overflowing_literals)] let version = super::Version::from_c_int(0xffffffff); let result = version.flags(); #[allow(overflowing_literals)] let expected = super::VersionFlags { bits: 0xffffff00 }; assert_eq!(result, expected); } #[test] fn test_supports_flags_true() { let result = super::VersionFlags::ALL.supports_flags(); assert_eq!(result, true); } #[test] fn test_supports_flags_false() { let result = super::VersionFlags { bits: 0x10000000 }.supports_flags(); assert_eq!(result, false); } #[test] fn test_is_imf_magic_true() { let result = super::is_imf_magic(&[118, 47, 49, 1]); assert_eq!(result, true); } #[test] fn test_is_imf_magic_false() { let result = super::is_imf_magic(&[0, 0, 0, 0]); assert_eq!(result, false); } }
use std::collections::HashSet; use std::convert::TryFrom; use std::io::BufRead; use anyhow::anyhow; use anyhow::bail; use anyhow::ensure; use anyhow::Context; use anyhow::Result; use bitflags::bitflags; use hex; use maplit::hashset; use crate::java::DataInput; pub type Checksum = [u8; 20]; #[derive(Clone, Debug, Hash, Eq, PartialEq)] pub struct UniqId { pub group: String, pub artifact: String, pub version: String, pub classifier: Option<String>, pub extension: Option<String>, } #[derive(Clone, Debug, Eq, PartialEq)] pub struct FullInfo { pub packaging: String, pub last_modified: u64, pub size: Option<u64>, pub source_attached: AttachmentStatus, pub javadoc_attached: AttachmentStatus, pub signature_attached: AttachmentStatus, pub extension: String, } #[derive(Debug)] pub struct Doc { pub id: UniqId, pub object_info: FullInfo, pub modified: u64, pub name: Option<String>, pub description: Option<String>, pub checksum: Option<Checksum>, } #[derive(Debug)] pub enum Event { Doc(Doc), Delete(UniqId), Error { error: anyhow::Error, raw: Vec<(String, String)>, }, } pub fn read<R: BufRead, F>(from: R, mut cb: F) -> Result<()> where F: FnMut(Event) -> Result<()>, { let mut from = DataInput::new(from); ensure!(1 == from.read_byte()?, "version byte"); let _timestamp_ms = from.read_long()?; loop { let fields = read_fields(&mut from).with_context(|| anyhow!("reading fields"))?; let fields = match fields { Some(fields) => fields, None => break, }; let names = fields .iter() .map(|(key, _value)| key.as_str()) .collect::<HashSet<_>>(); if names.contains("del") { cb(Event::Delete(read_uniq( fields .iter() .find_map(|(key, value)| if "del" == key { Some(value) } else { None }) .expect("just checked"), )?))?; continue; } if hashset!("DESCRIPTOR", "IDXINFO") == names { continue; } if hashset!("rootGroups", "rootGroupsList") == names { continue; } if hashset!("allGroups", "allGroupsList") == names { continue; } if !(names.contains("u") && names.contains("i") && names.contains("m")) { // TODO: move checker fails on 'fields' here cb(Event::Error { error: anyhow!("unrecognised doc type"), raw: fields.clone(), })?; continue; } cb(match read_doc(&fields) { Ok(doc) => Event::Doc(doc), Err(error) => Event::Error { error, raw: fields }, })?; } Ok(()) } fn read_doc(fields: &[(String, String)]) -> Result<Doc> { let mut you = None; let mut eye = None; let mut modified = None; let mut name = None; let mut description = None; let mut checksum = None; for (field_name, value) in fields { match field_name.as_str() { "u" => { you = Some(read_uniq(value).with_context(|| anyhow!("reading 'u': {:?}", value))?) } "i" => { eye = Some(read_info(value).with_context(|| anyhow!("reading 'i': {:?}", value))?) } "m" => { modified = Some( value .parse::<u64>() .with_context(|| anyhow!("reading 'm': {:?}", value))?, ) } "n" => name = Some(value.to_string()), "d" => description = Some(value.to_string()), "1" => checksum = read_checksum(value).ok(), _ => (), // bail!("unrecognised field value: {:?}", field_name), } } Ok(Doc { id: you.ok_or_else(|| anyhow!("no 'u'"))?, object_info: eye.ok_or_else(|| anyhow!("no 'i'"))?, modified: modified.ok_or_else(|| anyhow!("no modified"))?, name, description, checksum, }) } fn read_fields<R: BufRead>(f: &mut DataInput<R>) -> Result<Option<Vec<(String, String)>>> { if f.check_eof()? { return Ok(None); } let field_count = f .read_int() .with_context(|| anyhow!("reading field count (first field)"))?; let field_count = usize::try_from(field_count)?; let mut ret = Vec::with_capacity(field_count); for field in 0..field_count { ret.push(read_field(f).with_context(|| anyhow!("reading field {}", field))?); } Ok(Some(ret)) } fn read_field<R: BufRead>(f: &mut DataInput<R>) -> Result<(String, String)> { let flags = u8::try_from(f.read_byte()?)?; let _flags = FieldFlag::from_bits(flags).ok_or_else(|| anyhow!("decoding field flags"))?; let name_len = f.read_unsigned_short()?; let name = f.read_utf8(usize::try_from(name_len).unwrap())?; // yup, they went out of their way to use signed data here let value_len = usize::try_from(f.read_int()?)?; let value = f.read_utf8(value_len)?; Ok((name, value)) } #[inline] fn read_checksum(value: &str) -> Result<[u8; 20]> { let decoded = hex::decode(value).with_context(|| anyhow!("decoding checksum"))?; ensure!(20 == decoded.len(), "checksum was wrong length"); let mut arr = [0u8; 20]; arr.copy_from_slice(&decoded); Ok(arr) } fn read_uniq(value: &str) -> Result<UniqId> { let mut parts = value.split('|'); Ok(UniqId { group: parts .next() .ok_or_else(|| anyhow!("short uniq: group"))? .to_string(), artifact: parts .next() .ok_or_else(|| anyhow!("short uniq: artifact"))? .to_string(), version: parts .next() .ok_or_else(|| anyhow!("short uniq: version"))? .to_string(), classifier: not_na( parts .next() .ok_or_else(|| anyhow!("short uniq: classifier"))?, ) .map(|v| v.to_string()), extension: parts.next().map(|v| v.to_string()), }) } fn read_info(value: &str) -> Result<FullInfo> { let mut parts = value.split('|'); Ok(FullInfo { packaging: parts .next() .ok_or_else(|| anyhow!("short info: packaging"))? .to_string(), last_modified: parts .next() .ok_or_else(|| anyhow!("short info: time"))? .parse::<u64>() .with_context(|| anyhow!("reading time"))?, size: read_size(parts.next().ok_or_else(|| anyhow!("short i: size"))?)?, source_attached: AttachmentStatus::read( parts .next() .ok_or_else(|| anyhow!("short info: sources flag"))?, )?, javadoc_attached: AttachmentStatus::read( parts.next().ok_or_else(|| anyhow!("short info: flag 2"))?, )?, signature_attached: AttachmentStatus::read( parts.next().ok_or_else(|| anyhow!("short info: flag 3"))?, )?, extension: parts .next() .ok_or_else(|| anyhow!("short info: extension"))? .to_string(), }) } fn read_size(value: &str) -> Result<Option<u64>> { if "-1" == value { return Ok(None); } Ok(Some( value .parse::<u64>() .with_context(|| anyhow!("reading size"))?, )) } fn not_na(value: &str) -> Option<&str> { if "NA" == value { None } else { Some(value) } } #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum AttachmentStatus { Absent, Present, Unavailable, } impl AttachmentStatus { fn read(value: &str) -> Result<AttachmentStatus> { Ok(match value.parse::<u8>() { Ok(0) => AttachmentStatus::Absent, Ok(1) => AttachmentStatus::Present, Ok(2) => AttachmentStatus::Unavailable, other => bail!("invalid attachment value: {:?}: {:?}", value, other), }) } } bitflags! { struct FieldFlag: u8 { const INDEXED = 0b0000_0001; const TOKENIZED = 0b0000_0010; const STORED = 0b0000_0100; const COMPRESSED = 0b0000_1000; } }
use amethyst::{ ecs::prelude::{Component, DenseVecStorage, Entity}, prelude::*, assets::{Loader}, ui::{Anchor, LineMode, TtfFormat, UiText, UiTransform}, }; use crate::component::def::Hand; pub struct Game{ pub current_state: CurrentState, pub user_action: UserAction, pub player_hand: Hand, pub opponent_hand: Hand, pub last_winner: u32, } impl Default for Game { fn default() -> Self { Game { current_state: CurrentState::default(), user_action: UserAction::ChoosingHand, player_hand: Hand::UNKNOWN, opponent_hand: Hand::UNKNOWN, last_winner: 0 } } } impl Game { pub fn is_user_winner(&mut self) -> u32 { let result = match self.player_hand { Hand::PAPER => { match self.opponent_hand { Hand::PAPER => 0, Hand::ROCK => 1, Hand::SCISSORS => 2, Hand::UNKNOWN => 0, } }, Hand::ROCK => { match self.opponent_hand { Hand::PAPER => 2, Hand::ROCK => 0, Hand::SCISSORS => 1, Hand::UNKNOWN => 0, } }, Hand::SCISSORS => { match self.opponent_hand { Hand::PAPER => 1, Hand::ROCK => 2, Hand::SCISSORS => 0, Hand::UNKNOWN => 0, } }, Hand::UNKNOWN => 0 // handle an error instead }; self.last_winner = result; return result; } } #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum CurrentState { GamePlay, Winner } impl Default for CurrentState{ fn default() -> Self { CurrentState::GamePlay } } #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum UserAction { ChoosingHand, ValidateHand, ShowWinner, } #[derive(Debug)] pub struct WinnerMessage { pub winner_message: Entity, } impl WinnerMessage { pub fn new(world: &mut World, message_transform: UiTransform, message: String) -> WinnerMessage { let font = world.read_resource::<Loader>().load( "font/square.ttf", TtfFormat, (), &world.read_resource(), ); let winner_message = world .create_entity() .with(message_transform) .with(UiText::new( font, message.to_string(), [0., 0., 0., 1.], 30., LineMode::Single, Anchor::Middle, )) .build(); WinnerMessage{ winner_message } } } impl Component for WinnerMessage { type Storage = DenseVecStorage<Self>; }
/* Part 1 Review a sequence of digits (your puzzle input) and find the sum of all digits that match the next digit in the list. The list is circular, so the digit after the last digit is the first digit in the list. For example: 1122 produces a sum of 3 (1 + 2) because the first digit (1) matches the second digit and the third digit (2) matches the fourth digit. 1111 produces 4 because each digit (all 1) matches the next. 1234 produces 0 because no digit matches the next. 91212129 produces 9 because the only digit that matches the next one is the last digit, 9. Part 2 Now, instead of considering the next digit, it wants you to consider the digit halfway around the circular list. That is, if your list contains 10 items, only include a digit in your sum if the digit 10/2 = 5 steps forward matches it. Fortunately, your list has an even number of elements. For example: 1212 produces 6: the list contains 4 items, and all four digits match the digit 2 items ahead. 1221 produces 0, because every comparison is between a 1 and a 2. 123425 produces 4, because both 2s match each other, but no other digit has a match. 123123 produces 12. 12131415 produces 4. */ fn sum_of_matching_digits(bytes: &[u8], offset: usize) -> u32 { bytes.iter() .zip( bytes.iter() .cycle() .skip(offset) ) .fold(0, |acc: u32, (&a, &b)| { if a == b { acc + ((a - '0' as u8) as u32) } else { acc } }) } fn run_tests() { // Part 1 tests assert_eq!(sum_of_matching_digits("1122".as_bytes(), 1), 3); assert_eq!(sum_of_matching_digits("1111".as_bytes(), 1), 4); assert_eq!(sum_of_matching_digits("1234".as_bytes(), 1), 0); assert_eq!(sum_of_matching_digits("91212129".as_bytes(), 1), 9); // Part 2 tests assert_eq!(sum_of_matching_digits("1212".as_bytes(), 2), 6); assert_eq!(sum_of_matching_digits("1221".as_bytes(), 2), 0); assert_eq!(sum_of_matching_digits("123425".as_bytes(), 3), 4); assert_eq!(sum_of_matching_digits("123123".as_bytes(), 3), 12); assert_eq!(sum_of_matching_digits("12131415".as_bytes(), 4), 4); } fn main() { run_tests(); let input: &str = "1234"; let bytes = input.as_bytes(); // Part 1 let sum: u32 = sum_of_matching_digits(bytes, 1); println!("Part 1:"); println!("\tString: {}\n\tSum: {}", input, sum); // Part 2 let sum: u32 = sum_of_matching_digits(bytes, bytes.len()/2); println!("Part 2:"); println!("\tString: {}\n\tSum: {}", input, sum); }
// REF:: https://github.com/mrdoob/three.js/blob/dev/src/math/Quaternion.js use super::{Mat4, Vec3}; pub struct Quat { pub x: f32, pub y: f32, pub z: f32, pub w: f32, } impl Quat { pub fn new() -> Self { Self { x: 0.0, y: 0.0, z: 0.0, w: 1.0, } } pub fn set(&mut self, x: f32, y: f32, z: f32, w: f32) { self.x = x; self.y = y; self.z = z; self.w = w; } pub fn copy_from(&mut self, q: &Quat) { self.x = q.x; self.y = q.y; self.z = q.z; self.w = q.w; } pub fn from(q: &Quat) -> Self { Self { x: q.x, y: q.y, z: q.z, w: q.w, } } pub fn set_from_axis_angle(&mut self, axis: &Vec3, angle: f32) { // http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm // assumes axis is normalized let half_angle = angle / 2.0; let (s, c) = half_angle.sin_cos(); self.x = axis.x * s; self.y = axis.y * s; self.z = axis.z * s; self.w = c; } pub fn multiply(&mut self, q: &Quat) { let x = self.x * q.w + self.w * q.x + self.y * q.z - self.z * q.y; let y = self.y * q.w + self.w * q.y + self.z * q.x - self.x * q.z; let z = self.z * q.w + self.w * q.z + self.x * q.y - self.y * q.x; let w = self.w * q.w - self.x * q.x - self.y * q.y - self.z * q.z; self.x = x; self.y = y; self.z = z; self.w = w; } pub fn premultiply(&mut self, q: &Quat) { let x = q.x * self.w + q.w * self.x + q.y * self.z - q.z * self.y; let y = q.y * self.w + q.w * self.y + q.z * self.x - q.x * self.z; let z = q.z * self.w + q.w * self.z + q.x * self.y - q.y * self.x; let w = q.w * self.w - q.x * self.x - q.y * self.y - q.z * self.z; self.x = x; self.y = y; self.z = z; self.w = w; } pub fn multiply_quaternions(&mut self, a: &Quat, b: &Quat) { // from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm self.x = a.x * b.w + a.w * b.x + a.y * b.z - a.z * b.y; self.y = a.y * b.w + a.w * b.y + a.z * b.x - a.x * b.z; self.z = a.z * b.w + a.w * b.z + a.x * b.y - a.y * b.x; self.w = a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z; } pub fn set_from_rotation_matrix(&mut self, m: &Mat4) { // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled) let m11 = m.elements[0]; let m12 = m.elements[4]; let m13 = m.elements[8]; let m21 = m.elements[1]; let m22 = m.elements[5]; let m23 = m.elements[9]; let m31 = m.elements[2]; let m32 = m.elements[6]; let m33 = m.elements[10]; let trace = m11 + m22 + m33; if trace > 0.0 { let s = 0.5 / (trace + 1.0).sqrt(); self.w = 0.25 / s; self.x = (m32 - m23) * s; self.y = (m13 - m31) * s; self.z = (m21 - m12) * s; } else if m11 > m22 && m11 > m33 { let s = 2.0 * (1.0 + m11 - m22 - m33).sqrt(); self.w = (m32 - m23) / s; self.x = 0.25 * s; self.y = (m12 + m21) / s; self.z = (m13 + m31) / s; } else if m22 > m33 { let s = 2.0 * (1.0 + m22 - m11 - m33).sqrt(); self.w = (m13 - m31) / s; self.x = (m12 + m21) / s; self.y = 0.25 * s; self.z = (m23 + m32) / s; } else { let s = 2.0 * (1.0 + m33 - m11 - m22).sqrt(); self.w = (m21 - m12) / s; self.x = (m13 + m31) / s; self.y = (m23 + m32) / s; self.z = 0.25 * s; } } }
fn first_nonsum(preamble_len: usize, nums: &[u64]) -> u64 { for i in preamble_len.. { if !sum_of_prev2(i, preamble_len, nums) { return nums[i]; } } panic!("No nonsum"); } fn sum_of_prev2(idx: usize, n_prev: usize, nums: &[u64]) -> bool { find_sum2(nums[idx], &nums[idx - n_prev..idx]) } fn find_sum2(sum: u64, nums: &[u64]) -> bool { for n in nums { for n2 in nums { if n != n2 && n + n2 == sum { return true; } } } false } fn parse_nums(input: &str) -> Vec<u64> { input.lines().map(|l| l.parse().unwrap()).collect() } fn part1(input: &str) -> u64 { let nums = parse_nums(input); first_nonsum(25, &nums) } fn part2(input: &str) -> u64 { let nums = parse_nums(input); let sum = first_nonsum(25, &nums); let mut contig = find_sum_contig(sum, &nums).to_owned(); contig.sort_unstable(); contig.first().unwrap() + contig.last().unwrap() } fn find_sum_contig(sum: u64, nums: &[u64]) -> &[u64] { let mut first_cursor = 0; loop { let mut accum = 0; let mut added = 0; for n in &nums[first_cursor..] { accum += n; added += 1; if accum == sum && added > 1 { return &nums[first_cursor..first_cursor + added]; } } first_cursor += 1; } } #[test] fn test_first_nonsum() { let input = parse_nums(TEST_INPUT); assert_eq!(first_nonsum(5, &input), 127) } #[cfg(test)] const TEST_INPUT: &str = "35 20 15 25 47 40 62 55 65 95 102 117 150 182 127 219 299 277 309 576"; #[test] fn test_part2_pre5() { let nums = parse_nums(TEST_INPUT); let sum = first_nonsum(5, &nums); let mut contig = find_sum_contig(sum, &nums).to_owned(); contig.sort_unstable(); assert_eq!(contig.first().unwrap() + contig.last().unwrap(), 62) } aoc::tests! { fn part1: in => 27911108; fn part2: in => 4023754; } aoc::main!(part1, part2);
// Copyright 2012-2014 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 #![feature(min_const_fn)] const fn add(x: usize, y: usize) -> usize { x + y } const ARR: [i32; add(1, 2)] = [5, 6, 7]; pub fn main() {}
use crate::btree::key_value::{KeyType, KeyValuePair, ValueType}; use crate::btree::record_file::RecordFile; use std::error::Error; pub struct WAL<'d, K: KeyType<'d>, V: ValueType<'d>> { file: RecordFile<'d, K, V>, } impl<'d, K: KeyType<'d>, V: ValueType<'d>> WAL<'d, K, V> { pub fn new( file_path: &String, key_size: usize, value_size: usize, ) -> Result<WAL<'d, K, V>, Box<Error>> { let file = RecordFile::<K, V>::new(file_path, key_size, value_size)?; Ok(WAL { file }) } pub fn insert(&mut self, key: &K, value: &V) -> Result<(), Box<Error>> { let kv = KeyValuePair::new(key.clone(), value.clone()); return self.file.insert(&kv); } }
pub mod toboggan_trajectory_part_1; pub mod toboggan_trajectory_part_2;
#![allow(unused_variables, non_upper_case_globals, non_snake_case, unused_unsafe, non_camel_case_types, dead_code, clippy::all)] #[cfg(feature = "Win32_UI_Controls_Dialogs")] pub mod Dialogs; #[cfg(feature = "Win32_UI_Controls_RichEdit")] pub mod RichEdit; pub const ACM_ISPLAYING: u32 = 1128u32; pub const ACM_OPEN: u32 = 1127u32; pub const ACM_OPENA: u32 = 1124u32; pub const ACM_OPENW: u32 = 1127u32; pub const ACM_PLAY: u32 = 1125u32; pub const ACM_STOP: u32 = 1126u32; pub const ACN_START: u32 = 1u32; pub const ACN_STOP: u32 = 2u32; pub const ACS_AUTOPLAY: u32 = 4u32; pub const ACS_CENTER: u32 = 1u32; pub const ACS_TIMER: u32 = 8u32; pub const ACS_TRANSPARENT: u32 = 2u32; pub const BCM_FIRST: u32 = 5632u32; pub const BCM_GETIDEALSIZE: u32 = 5633u32; pub const BCM_GETIMAGELIST: u32 = 5635u32; pub const BCM_GETNOTE: u32 = 5642u32; pub const BCM_GETNOTELENGTH: u32 = 5643u32; pub const BCM_GETSPLITINFO: u32 = 5640u32; pub const BCM_GETTEXTMARGIN: u32 = 5637u32; pub const BCM_SETDROPDOWNSTATE: u32 = 5638u32; pub const BCM_SETIMAGELIST: u32 = 5634u32; pub const BCM_SETNOTE: u32 = 5641u32; pub const BCM_SETSHIELD: u32 = 5644u32; pub const BCM_SETSPLITINFO: u32 = 5639u32; pub const BCM_SETTEXTMARGIN: u32 = 5636u32; pub const BCN_DROPDOWN: u32 = 4294966048u32; pub const BCN_FIRST: u32 = 4294966046u32; pub const BCN_HOTITEMCHANGE: u32 = 4294966047u32; pub const BCSIF_GLYPH: u32 = 1u32; pub const BCSIF_IMAGE: u32 = 2u32; pub const BCSIF_SIZE: u32 = 8u32; pub const BCSIF_STYLE: u32 = 4u32; pub const BCSS_ALIGNLEFT: u32 = 4u32; pub const BCSS_IMAGE: u32 = 8u32; pub const BCSS_NOSPLIT: u32 = 1u32; pub const BCSS_STRETCH: u32 = 2u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct BGTYPE(pub i32); pub const BT_IMAGEFILE: BGTYPE = BGTYPE(0i32); pub const BT_BORDERFILL: BGTYPE = BGTYPE(1i32); pub const BT_NONE: BGTYPE = BGTYPE(2i32); impl ::core::convert::From<i32> for BGTYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for BGTYPE { 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 BORDERTYPE(pub i32); pub const BT_RECT: BORDERTYPE = BORDERTYPE(0i32); pub const BT_ROUNDRECT: BORDERTYPE = BORDERTYPE(1i32); pub const BT_ELLIPSE: BORDERTYPE = BORDERTYPE(2i32); impl ::core::convert::From<i32> for BORDERTYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for BORDERTYPE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct BP_ANIMATIONPARAMS { pub cbSize: u32, pub dwFlags: u32, pub style: BP_ANIMATIONSTYLE, pub dwDuration: u32, } impl BP_ANIMATIONPARAMS {} impl ::core::default::Default for BP_ANIMATIONPARAMS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for BP_ANIMATIONPARAMS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("BP_ANIMATIONPARAMS").field("cbSize", &self.cbSize).field("dwFlags", &self.dwFlags).field("style", &self.style).field("dwDuration", &self.dwDuration).finish() } } impl ::core::cmp::PartialEq for BP_ANIMATIONPARAMS { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.dwFlags == other.dwFlags && self.style == other.style && self.dwDuration == other.dwDuration } } impl ::core::cmp::Eq for BP_ANIMATIONPARAMS {} unsafe impl ::windows::core::Abi for BP_ANIMATIONPARAMS { 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 BP_ANIMATIONSTYLE(pub i32); pub const BPAS_NONE: BP_ANIMATIONSTYLE = BP_ANIMATIONSTYLE(0i32); pub const BPAS_LINEAR: BP_ANIMATIONSTYLE = BP_ANIMATIONSTYLE(1i32); pub const BPAS_CUBIC: BP_ANIMATIONSTYLE = BP_ANIMATIONSTYLE(2i32); pub const BPAS_SINE: BP_ANIMATIONSTYLE = BP_ANIMATIONSTYLE(3i32); impl ::core::convert::From<i32> for BP_ANIMATIONSTYLE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for BP_ANIMATIONSTYLE { 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 BP_BUFFERFORMAT(pub i32); pub const BPBF_COMPATIBLEBITMAP: BP_BUFFERFORMAT = BP_BUFFERFORMAT(0i32); pub const BPBF_DIB: BP_BUFFERFORMAT = BP_BUFFERFORMAT(1i32); pub const BPBF_TOPDOWNDIB: BP_BUFFERFORMAT = BP_BUFFERFORMAT(2i32); pub const BPBF_TOPDOWNMONODIB: BP_BUFFERFORMAT = BP_BUFFERFORMAT(3i32); impl ::core::convert::From<i32> for BP_BUFFERFORMAT { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for BP_BUFFERFORMAT { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct BP_PAINTPARAMS { pub cbSize: u32, pub dwFlags: BP_PAINTPARAMS_FLAGS, pub prcExclude: *mut super::super::Foundation::RECT, pub pBlendFunction: *mut super::super::Graphics::Gdi::BLENDFUNCTION, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl BP_PAINTPARAMS {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for BP_PAINTPARAMS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for BP_PAINTPARAMS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("BP_PAINTPARAMS").field("cbSize", &self.cbSize).field("dwFlags", &self.dwFlags).field("prcExclude", &self.prcExclude).field("pBlendFunction", &self.pBlendFunction).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for BP_PAINTPARAMS { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.dwFlags == other.dwFlags && self.prcExclude == other.prcExclude && self.pBlendFunction == other.pBlendFunction } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for BP_PAINTPARAMS {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for BP_PAINTPARAMS { 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 BP_PAINTPARAMS_FLAGS(pub u32); pub const BPPF_ERASE: BP_PAINTPARAMS_FLAGS = BP_PAINTPARAMS_FLAGS(1u32); pub const BPPF_NOCLIP: BP_PAINTPARAMS_FLAGS = BP_PAINTPARAMS_FLAGS(2u32); pub const BPPF_NONCLIENT: BP_PAINTPARAMS_FLAGS = BP_PAINTPARAMS_FLAGS(4u32); impl ::core::convert::From<u32> for BP_PAINTPARAMS_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for BP_PAINTPARAMS_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for BP_PAINTPARAMS_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for BP_PAINTPARAMS_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for BP_PAINTPARAMS_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for BP_PAINTPARAMS_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for BP_PAINTPARAMS_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const BST_DROPDOWNPUSHED: u32 = 1024u32; pub const BST_HOT: u32 = 512u32; pub const BS_COMMANDLINK: i32 = 14i32; pub const BS_DEFCOMMANDLINK: i32 = 15i32; pub const BS_DEFSPLITBUTTON: i32 = 13i32; pub const BS_SPLITBUTTON: i32 = 12i32; pub const BTNS_AUTOSIZE: u32 = 16u32; pub const BTNS_BUTTON: u32 = 0u32; pub const BTNS_CHECK: u32 = 2u32; pub const BTNS_DROPDOWN: u32 = 8u32; pub const BTNS_GROUP: u32 = 4u32; pub const BTNS_NOPREFIX: u32 = 32u32; pub const BTNS_SEP: u32 = 1u32; pub const BTNS_SHOWTEXT: u32 = 64u32; pub const BTNS_WHOLEDROPDOWN: u32 = 128u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct BUTTON_IMAGELIST { pub himl: HIMAGELIST, pub margin: super::super::Foundation::RECT, pub uAlign: BUTTON_IMAGELIST_ALIGN, } #[cfg(feature = "Win32_Foundation")] impl BUTTON_IMAGELIST {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for BUTTON_IMAGELIST { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for BUTTON_IMAGELIST { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("BUTTON_IMAGELIST").field("himl", &self.himl).field("margin", &self.margin).field("uAlign", &self.uAlign).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for BUTTON_IMAGELIST { fn eq(&self, other: &Self) -> bool { self.himl == other.himl && self.margin == other.margin && self.uAlign == other.uAlign } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for BUTTON_IMAGELIST {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for BUTTON_IMAGELIST { 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 BUTTON_IMAGELIST_ALIGN(pub u32); pub const BUTTON_IMAGELIST_ALIGN_LEFT: BUTTON_IMAGELIST_ALIGN = BUTTON_IMAGELIST_ALIGN(0u32); pub const BUTTON_IMAGELIST_ALIGN_RIGHT: BUTTON_IMAGELIST_ALIGN = BUTTON_IMAGELIST_ALIGN(1u32); pub const BUTTON_IMAGELIST_ALIGN_TOP: BUTTON_IMAGELIST_ALIGN = BUTTON_IMAGELIST_ALIGN(2u32); pub const BUTTON_IMAGELIST_ALIGN_BOTTOM: BUTTON_IMAGELIST_ALIGN = BUTTON_IMAGELIST_ALIGN(3u32); pub const BUTTON_IMAGELIST_ALIGN_CENTER: BUTTON_IMAGELIST_ALIGN = BUTTON_IMAGELIST_ALIGN(4u32); impl ::core::convert::From<u32> for BUTTON_IMAGELIST_ALIGN { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for BUTTON_IMAGELIST_ALIGN { type Abi = Self; } impl ::core::ops::BitOr for BUTTON_IMAGELIST_ALIGN { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for BUTTON_IMAGELIST_ALIGN { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for BUTTON_IMAGELIST_ALIGN { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for BUTTON_IMAGELIST_ALIGN { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for BUTTON_IMAGELIST_ALIGN { 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 BUTTON_SPLITINFO { pub mask: u32, pub himlGlyph: HIMAGELIST, pub uSplitStyle: u32, pub size: super::super::Foundation::SIZE, } #[cfg(feature = "Win32_Foundation")] impl BUTTON_SPLITINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for BUTTON_SPLITINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for BUTTON_SPLITINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("BUTTON_SPLITINFO").field("mask", &self.mask).field("himlGlyph", &self.himlGlyph).field("uSplitStyle", &self.uSplitStyle).field("size", &self.size).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for BUTTON_SPLITINFO { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.himlGlyph == other.himlGlyph && self.uSplitStyle == other.uSplitStyle && self.size == other.size } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for BUTTON_SPLITINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for BUTTON_SPLITINFO { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn BeginBufferedAnimation<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hwnd: Param0, hdctarget: Param1, prctarget: *const super::super::Foundation::RECT, dwformat: BP_BUFFERFORMAT, ppaintparams: *const BP_PAINTPARAMS, panimationparams: *const BP_ANIMATIONPARAMS, phdcfrom: *mut super::super::Graphics::Gdi::HDC, phdcto: *mut super::super::Graphics::Gdi::HDC) -> isize { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn BeginBufferedAnimation(hwnd: super::super::Foundation::HWND, hdctarget: super::super::Graphics::Gdi::HDC, prctarget: *const super::super::Foundation::RECT, dwformat: BP_BUFFERFORMAT, ppaintparams: *const BP_PAINTPARAMS, panimationparams: *const BP_ANIMATIONPARAMS, phdcfrom: *mut super::super::Graphics::Gdi::HDC, phdcto: *mut super::super::Graphics::Gdi::HDC) -> isize; } ::core::mem::transmute(BeginBufferedAnimation(hwnd.into_param().abi(), hdctarget.into_param().abi(), ::core::mem::transmute(prctarget), ::core::mem::transmute(dwformat), ::core::mem::transmute(ppaintparams), ::core::mem::transmute(panimationparams), ::core::mem::transmute(phdcfrom), ::core::mem::transmute(phdcto))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn BeginBufferedPaint<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hdctarget: Param0, prctarget: *const super::super::Foundation::RECT, dwformat: BP_BUFFERFORMAT, ppaintparams: *const BP_PAINTPARAMS, phdc: *mut super::super::Graphics::Gdi::HDC) -> isize { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn BeginBufferedPaint(hdctarget: super::super::Graphics::Gdi::HDC, prctarget: *const super::super::Foundation::RECT, dwformat: BP_BUFFERFORMAT, ppaintparams: *const BP_PAINTPARAMS, phdc: *mut super::super::Graphics::Gdi::HDC) -> isize; } ::core::mem::transmute(BeginBufferedPaint(hdctarget.into_param().abi(), ::core::mem::transmute(prctarget), ::core::mem::transmute(dwformat), ::core::mem::transmute(ppaintparams), ::core::mem::transmute(phdc))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn BeginPanningFeedback<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn BeginPanningFeedback(hwnd: super::super::Foundation::HWND) -> super::super::Foundation::BOOL; } ::core::mem::transmute(BeginPanningFeedback(hwnd.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn BufferedPaintClear(hbufferedpaint: isize, prc: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn BufferedPaintClear(hbufferedpaint: isize, prc: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT; } BufferedPaintClear(::core::mem::transmute(hbufferedpaint), ::core::mem::transmute(prc)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn BufferedPaintInit() -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn BufferedPaintInit() -> ::windows::core::HRESULT; } BufferedPaintInit().ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn BufferedPaintRenderAnimation<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hwnd: Param0, hdctarget: Param1) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn BufferedPaintRenderAnimation(hwnd: super::super::Foundation::HWND, hdctarget: super::super::Graphics::Gdi::HDC) -> super::super::Foundation::BOOL; } ::core::mem::transmute(BufferedPaintRenderAnimation(hwnd.into_param().abi(), hdctarget.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn BufferedPaintSetAlpha(hbufferedpaint: isize, prc: *const super::super::Foundation::RECT, alpha: u8) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn BufferedPaintSetAlpha(hbufferedpaint: isize, prc: *const super::super::Foundation::RECT, alpha: u8) -> ::windows::core::HRESULT; } BufferedPaintSetAlpha(::core::mem::transmute(hbufferedpaint), ::core::mem::transmute(prc), ::core::mem::transmute(alpha)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn BufferedPaintStopAllAnimations<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn BufferedPaintStopAllAnimations(hwnd: super::super::Foundation::HWND) -> ::windows::core::HRESULT; } BufferedPaintStopAllAnimations(hwnd.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn BufferedPaintUnInit() -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn BufferedPaintUnInit() -> ::windows::core::HRESULT; } BufferedPaintUnInit().ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const CBEMAXSTRLEN: u32 = 260u32; pub const CBEM_GETCOMBOCONTROL: u32 = 1030u32; pub const CBEM_GETEDITCONTROL: u32 = 1031u32; pub const CBEM_GETEXSTYLE: u32 = 1033u32; pub const CBEM_GETEXTENDEDSTYLE: u32 = 1033u32; pub const CBEM_GETIMAGELIST: u32 = 1027u32; pub const CBEM_GETITEM: u32 = 1037u32; pub const CBEM_GETITEMA: u32 = 1028u32; pub const CBEM_GETITEMW: u32 = 1037u32; pub const CBEM_GETUNICODEFORMAT: u32 = 8198u32; pub const CBEM_HASEDITCHANGED: u32 = 1034u32; pub const CBEM_INSERTITEM: u32 = 1035u32; pub const CBEM_INSERTITEMA: u32 = 1025u32; pub const CBEM_INSERTITEMW: u32 = 1035u32; pub const CBEM_SETEXSTYLE: u32 = 1032u32; pub const CBEM_SETEXTENDEDSTYLE: u32 = 1038u32; pub const CBEM_SETIMAGELIST: u32 = 1026u32; pub const CBEM_SETITEM: u32 = 1036u32; pub const CBEM_SETITEMA: u32 = 1029u32; pub const CBEM_SETITEMW: u32 = 1036u32; pub const CBEM_SETUNICODEFORMAT: u32 = 8197u32; pub const CBEM_SETWINDOWTHEME: u32 = 8203u32; pub const CBENF_DROPDOWN: u32 = 4u32; pub const CBENF_ESCAPE: u32 = 3u32; pub const CBENF_KILLFOCUS: u32 = 1u32; pub const CBENF_RETURN: u32 = 2u32; pub const CBES_EX_CASESENSITIVE: u32 = 16u32; pub const CBES_EX_NOEDITIMAGE: u32 = 1u32; pub const CBES_EX_NOEDITIMAGEINDENT: u32 = 2u32; pub const CBES_EX_NOSIZELIMIT: u32 = 8u32; pub const CBES_EX_PATHWORDBREAKPROC: u32 = 4u32; pub const CBES_EX_TEXTENDELLIPSIS: u32 = 32u32; pub const CBM_FIRST: u32 = 5888u32; pub const CB_GETCUEBANNER: u32 = 5892u32; pub const CB_GETMINVISIBLE: u32 = 5890u32; pub const CB_SETCUEBANNER: u32 = 5891u32; pub const CB_SETMINVISIBLE: u32 = 5889u32; pub const CCF_NOTEXT: u32 = 1u32; pub const CCHCCCLASS: u32 = 32u32; pub const CCHCCDESC: u32 = 32u32; pub const CCHCCTEXT: u32 = 256u32; #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct CCINFOA { pub szClass: [super::super::Foundation::CHAR; 32], pub flOptions: u32, pub szDesc: [super::super::Foundation::CHAR; 32], pub cxDefault: u32, pub cyDefault: u32, pub flStyleDefault: u32, pub flExtStyleDefault: u32, pub flCtrlTypeMask: u32, pub szTextDefault: [super::super::Foundation::CHAR; 256], pub cStyleFlags: i32, pub aStyleFlags: *mut CCSTYLEFLAGA, pub lpfnStyle: ::core::option::Option<LPFNCCSTYLEA>, pub lpfnSizeToText: ::core::option::Option<LPFNCCSIZETOTEXTA>, pub dwReserved1: u32, pub dwReserved2: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl CCINFOA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for CCINFOA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for CCINFOA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("CCINFOA") .field("szClass", &self.szClass) .field("flOptions", &self.flOptions) .field("szDesc", &self.szDesc) .field("cxDefault", &self.cxDefault) .field("cyDefault", &self.cyDefault) .field("flStyleDefault", &self.flStyleDefault) .field("flExtStyleDefault", &self.flExtStyleDefault) .field("flCtrlTypeMask", &self.flCtrlTypeMask) .field("szTextDefault", &self.szTextDefault) .field("cStyleFlags", &self.cStyleFlags) .field("aStyleFlags", &self.aStyleFlags) .field("dwReserved1", &self.dwReserved1) .field("dwReserved2", &self.dwReserved2) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for CCINFOA { fn eq(&self, other: &Self) -> bool { self.szClass == other.szClass && self.flOptions == other.flOptions && self.szDesc == other.szDesc && self.cxDefault == other.cxDefault && self.cyDefault == other.cyDefault && self.flStyleDefault == other.flStyleDefault && self.flExtStyleDefault == other.flExtStyleDefault && self.flCtrlTypeMask == other.flCtrlTypeMask && self.szTextDefault == other.szTextDefault && self.cStyleFlags == other.cStyleFlags && self.aStyleFlags == other.aStyleFlags && self.lpfnStyle.map(|f| f as usize) == other.lpfnStyle.map(|f| f as usize) && self.lpfnSizeToText.map(|f| f as usize) == other.lpfnSizeToText.map(|f| f as usize) && self.dwReserved1 == other.dwReserved1 && self.dwReserved2 == other.dwReserved2 } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for CCINFOA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for CCINFOA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct CCINFOW { pub szClass: [u16; 32], pub flOptions: u32, pub szDesc: [u16; 32], pub cxDefault: u32, pub cyDefault: u32, pub flStyleDefault: u32, pub flExtStyleDefault: u32, pub flCtrlTypeMask: u32, pub cStyleFlags: i32, pub aStyleFlags: *mut CCSTYLEFLAGW, pub szTextDefault: [u16; 256], pub lpfnStyle: ::core::option::Option<LPFNCCSTYLEW>, pub lpfnSizeToText: ::core::option::Option<LPFNCCSIZETOTEXTW>, pub dwReserved1: u32, pub dwReserved2: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl CCINFOW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for CCINFOW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for CCINFOW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("CCINFOW") .field("szClass", &self.szClass) .field("flOptions", &self.flOptions) .field("szDesc", &self.szDesc) .field("cxDefault", &self.cxDefault) .field("cyDefault", &self.cyDefault) .field("flStyleDefault", &self.flStyleDefault) .field("flExtStyleDefault", &self.flExtStyleDefault) .field("flCtrlTypeMask", &self.flCtrlTypeMask) .field("cStyleFlags", &self.cStyleFlags) .field("aStyleFlags", &self.aStyleFlags) .field("szTextDefault", &self.szTextDefault) .field("dwReserved1", &self.dwReserved1) .field("dwReserved2", &self.dwReserved2) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for CCINFOW { fn eq(&self, other: &Self) -> bool { self.szClass == other.szClass && self.flOptions == other.flOptions && self.szDesc == other.szDesc && self.cxDefault == other.cxDefault && self.cyDefault == other.cyDefault && self.flStyleDefault == other.flStyleDefault && self.flExtStyleDefault == other.flExtStyleDefault && self.flCtrlTypeMask == other.flCtrlTypeMask && self.cStyleFlags == other.cStyleFlags && self.aStyleFlags == other.aStyleFlags && self.szTextDefault == other.szTextDefault && self.lpfnStyle.map(|f| f as usize) == other.lpfnStyle.map(|f| f as usize) && self.lpfnSizeToText.map(|f| f as usize) == other.lpfnSizeToText.map(|f| f as usize) && self.dwReserved1 == other.dwReserved1 && self.dwReserved2 == other.dwReserved2 } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for CCINFOW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for CCINFOW { type Abi = ::core::mem::ManuallyDrop<Self>; } pub const CCM_DPISCALE: u32 = 8204u32; pub const CCM_FIRST: u32 = 8192u32; pub const CCM_GETCOLORSCHEME: u32 = 8195u32; pub const CCM_GETDROPTARGET: u32 = 8196u32; pub const CCM_GETUNICODEFORMAT: u32 = 8198u32; pub const CCM_GETVERSION: u32 = 8200u32; pub const CCM_LAST: u32 = 8704u32; pub const CCM_SETBKCOLOR: u32 = 8193u32; pub const CCM_SETCOLORSCHEME: u32 = 8194u32; pub const CCM_SETNOTIFYWINDOW: u32 = 8201u32; pub const CCM_SETUNICODEFORMAT: u32 = 8197u32; pub const CCM_SETVERSION: u32 = 8199u32; pub const CCM_SETWINDOWTHEME: u32 = 8203u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct CCSTYLEA { pub flStyle: u32, pub flExtStyle: u32, pub szText: [super::super::Foundation::CHAR; 256], pub lgid: u16, pub wReserved1: u16, } #[cfg(feature = "Win32_Foundation")] impl CCSTYLEA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for CCSTYLEA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for CCSTYLEA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("CCSTYLEA").field("flStyle", &self.flStyle).field("flExtStyle", &self.flExtStyle).field("szText", &self.szText).field("lgid", &self.lgid).field("wReserved1", &self.wReserved1).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for CCSTYLEA { fn eq(&self, other: &Self) -> bool { self.flStyle == other.flStyle && self.flExtStyle == other.flExtStyle && self.szText == other.szText && self.lgid == other.lgid && self.wReserved1 == other.wReserved1 } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for CCSTYLEA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for CCSTYLEA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct CCSTYLEFLAGA { pub flStyle: u32, pub flStyleMask: u32, pub pszStyle: super::super::Foundation::PSTR, } #[cfg(feature = "Win32_Foundation")] impl CCSTYLEFLAGA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for CCSTYLEFLAGA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for CCSTYLEFLAGA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("CCSTYLEFLAGA").field("flStyle", &self.flStyle).field("flStyleMask", &self.flStyleMask).field("pszStyle", &self.pszStyle).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for CCSTYLEFLAGA { fn eq(&self, other: &Self) -> bool { self.flStyle == other.flStyle && self.flStyleMask == other.flStyleMask && self.pszStyle == other.pszStyle } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for CCSTYLEFLAGA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for CCSTYLEFLAGA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct CCSTYLEFLAGW { pub flStyle: u32, pub flStyleMask: u32, pub pszStyle: super::super::Foundation::PWSTR, } #[cfg(feature = "Win32_Foundation")] impl CCSTYLEFLAGW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for CCSTYLEFLAGW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for CCSTYLEFLAGW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("CCSTYLEFLAGW").field("flStyle", &self.flStyle).field("flStyleMask", &self.flStyleMask).field("pszStyle", &self.pszStyle).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for CCSTYLEFLAGW { fn eq(&self, other: &Self) -> bool { self.flStyle == other.flStyle && self.flStyleMask == other.flStyleMask && self.pszStyle == other.pszStyle } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for CCSTYLEFLAGW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for CCSTYLEFLAGW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct CCSTYLEW { pub flStyle: u32, pub flExtStyle: u32, pub szText: [u16; 256], pub lgid: u16, pub wReserved1: u16, } impl CCSTYLEW {} impl ::core::default::Default for CCSTYLEW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for CCSTYLEW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("CCSTYLEW").field("flStyle", &self.flStyle).field("flExtStyle", &self.flExtStyle).field("szText", &self.szText).field("lgid", &self.lgid).field("wReserved1", &self.wReserved1).finish() } } impl ::core::cmp::PartialEq for CCSTYLEW { fn eq(&self, other: &Self) -> bool { self.flStyle == other.flStyle && self.flExtStyle == other.flExtStyle && self.szText == other.szText && self.lgid == other.lgid && self.wReserved1 == other.wReserved1 } } impl ::core::cmp::Eq for CCSTYLEW {} unsafe impl ::windows::core::Abi for CCSTYLEW { type Abi = Self; } pub const CCS_ADJUSTABLE: i32 = 32i32; pub const CCS_BOTTOM: i32 = 3i32; pub const CCS_NODIVIDER: i32 = 64i32; pub const CCS_NOMOVEY: i32 = 2i32; pub const CCS_NOPARENTALIGN: i32 = 8i32; pub const CCS_NORESIZE: i32 = 4i32; pub const CCS_TOP: i32 = 1i32; pub const CCS_VERT: i32 = 128i32; pub const CDDS_ITEM: u32 = 65536u32; pub const CDDS_POSTERASE: u32 = 4u32; pub const CDIS_CHECKED: u32 = 8u32; pub const CDIS_DEFAULT: u32 = 32u32; pub const CDIS_DISABLED: u32 = 4u32; pub const CDIS_DROPHILITED: u32 = 4096u32; pub const CDIS_FOCUS: u32 = 16u32; pub const CDIS_GRAYED: u32 = 2u32; pub const CDIS_HOT: u32 = 64u32; pub const CDIS_INDETERMINATE: u32 = 256u32; pub const CDIS_MARKED: u32 = 128u32; pub const CDIS_NEARHOT: u32 = 1024u32; pub const CDIS_OTHERSIDEHOT: u32 = 2048u32; pub const CDIS_SELECTED: u32 = 1u32; pub const CDIS_SHOWKEYBOARDCUES: u32 = 512u32; pub const CDRF_DODEFAULT: u32 = 0u32; pub const CDRF_DOERASE: u32 = 8u32; pub const CDRF_NEWFONT: u32 = 2u32; pub const CDRF_NOTIFYITEMDRAW: u32 = 32u32; pub const CDRF_NOTIFYPOSTERASE: u32 = 64u32; pub const CDRF_NOTIFYPOSTPAINT: u32 = 16u32; pub const CDRF_NOTIFYSUBITEMDRAW: u32 = 32u32; pub const CDRF_SKIPDEFAULT: u32 = 4u32; pub const CDRF_SKIPPOSTPAINT: u32 = 256u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct CLOCKPARTS(pub i32); pub const CLP_TIME: CLOCKPARTS = CLOCKPARTS(1i32); impl ::core::convert::From<i32> for CLOCKPARTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for CLOCKPARTS { 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 CLOCKSTATES(pub i32); pub const CLS_NORMAL: CLOCKSTATES = CLOCKSTATES(1i32); pub const CLS_HOT: CLOCKSTATES = CLOCKSTATES(2i32); pub const CLS_PRESSED: CLOCKSTATES = CLOCKSTATES(3i32); impl ::core::convert::From<i32> for CLOCKSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for CLOCKSTATES { type Abi = Self; } pub const CLR_DEFAULT: i32 = -16777216i32; pub const CLR_HILIGHT: i32 = -16777216i32; pub const CLR_NONE: i32 = -1i32; pub const CMB_MASKED: u32 = 2u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct COLORMAP { pub from: u32, pub to: u32, } impl COLORMAP {} impl ::core::default::Default for COLORMAP { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for COLORMAP { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("COLORMAP").field("from", &self.from).field("to", &self.to).finish() } } impl ::core::cmp::PartialEq for COLORMAP { fn eq(&self, other: &Self) -> bool { self.from == other.from && self.to == other.to } } impl ::core::cmp::Eq for COLORMAP {} unsafe impl ::windows::core::Abi for COLORMAP { type Abi = Self; } pub const COLORMGMTDLGORD: u32 = 1551u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct COLORSCHEME { pub dwSize: u32, pub clrBtnHighlight: u32, pub clrBtnShadow: u32, } impl COLORSCHEME {} impl ::core::default::Default for COLORSCHEME { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for COLORSCHEME { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("COLORSCHEME").field("dwSize", &self.dwSize).field("clrBtnHighlight", &self.clrBtnHighlight).field("clrBtnShadow", &self.clrBtnShadow).finish() } } impl ::core::cmp::PartialEq for COLORSCHEME { fn eq(&self, other: &Self) -> bool { self.dwSize == other.dwSize && self.clrBtnHighlight == other.clrBtnHighlight && self.clrBtnShadow == other.clrBtnShadow } } impl ::core::cmp::Eq for COLORSCHEME {} unsafe impl ::windows::core::Abi for COLORSCHEME { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct COMBOBOXEXITEMA { pub mask: COMBOBOX_EX_ITEM_FLAGS, pub iItem: isize, pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, pub iImage: i32, pub iSelectedImage: i32, pub iOverlay: i32, pub iIndent: i32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl COMBOBOXEXITEMA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for COMBOBOXEXITEMA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for COMBOBOXEXITEMA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("COMBOBOXEXITEMA") .field("mask", &self.mask) .field("iItem", &self.iItem) .field("pszText", &self.pszText) .field("cchTextMax", &self.cchTextMax) .field("iImage", &self.iImage) .field("iSelectedImage", &self.iSelectedImage) .field("iOverlay", &self.iOverlay) .field("iIndent", &self.iIndent) .field("lParam", &self.lParam) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for COMBOBOXEXITEMA { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.iItem == other.iItem && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.iSelectedImage == other.iSelectedImage && self.iOverlay == other.iOverlay && self.iIndent == other.iIndent && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for COMBOBOXEXITEMA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for COMBOBOXEXITEMA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct COMBOBOXEXITEMW { pub mask: COMBOBOX_EX_ITEM_FLAGS, pub iItem: isize, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub iImage: i32, pub iSelectedImage: i32, pub iOverlay: i32, pub iIndent: i32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl COMBOBOXEXITEMW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for COMBOBOXEXITEMW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for COMBOBOXEXITEMW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("COMBOBOXEXITEMW") .field("mask", &self.mask) .field("iItem", &self.iItem) .field("pszText", &self.pszText) .field("cchTextMax", &self.cchTextMax) .field("iImage", &self.iImage) .field("iSelectedImage", &self.iSelectedImage) .field("iOverlay", &self.iOverlay) .field("iIndent", &self.iIndent) .field("lParam", &self.lParam) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for COMBOBOXEXITEMW { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.iItem == other.iItem && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.iSelectedImage == other.iSelectedImage && self.iOverlay == other.iOverlay && self.iIndent == other.iIndent && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for COMBOBOXEXITEMW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for COMBOBOXEXITEMW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct COMBOBOXINFO { pub cbSize: u32, pub rcItem: super::super::Foundation::RECT, pub rcButton: super::super::Foundation::RECT, pub stateButton: COMBOBOXINFO_BUTTON_STATE, pub hwndCombo: super::super::Foundation::HWND, pub hwndItem: super::super::Foundation::HWND, pub hwndList: super::super::Foundation::HWND, } #[cfg(feature = "Win32_Foundation")] impl COMBOBOXINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for COMBOBOXINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for COMBOBOXINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("COMBOBOXINFO").field("cbSize", &self.cbSize).field("rcItem", &self.rcItem).field("rcButton", &self.rcButton).field("stateButton", &self.stateButton).field("hwndCombo", &self.hwndCombo).field("hwndItem", &self.hwndItem).field("hwndList", &self.hwndList).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for COMBOBOXINFO { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.rcItem == other.rcItem && self.rcButton == other.rcButton && self.stateButton == other.stateButton && self.hwndCombo == other.hwndCombo && self.hwndItem == other.hwndItem && self.hwndList == other.hwndList } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for COMBOBOXINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for COMBOBOXINFO { 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 COMBOBOXINFO_BUTTON_STATE(pub u32); pub const STATE_SYSTEM_INVISIBLE: COMBOBOXINFO_BUTTON_STATE = COMBOBOXINFO_BUTTON_STATE(32768u32); pub const STATE_SYSTEM_PRESSED: COMBOBOXINFO_BUTTON_STATE = COMBOBOXINFO_BUTTON_STATE(8u32); pub const STATE_SYSTEM_FOCUSABLE: COMBOBOXINFO_BUTTON_STATE = COMBOBOXINFO_BUTTON_STATE(1048576u32); pub const STATE_SYSTEM_OFFSCREEN: COMBOBOXINFO_BUTTON_STATE = COMBOBOXINFO_BUTTON_STATE(65536u32); pub const STATE_SYSTEM_UNAVAILABLE: COMBOBOXINFO_BUTTON_STATE = COMBOBOXINFO_BUTTON_STATE(1u32); impl ::core::convert::From<u32> for COMBOBOXINFO_BUTTON_STATE { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for COMBOBOXINFO_BUTTON_STATE { type Abi = Self; } impl ::core::ops::BitOr for COMBOBOXINFO_BUTTON_STATE { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for COMBOBOXINFO_BUTTON_STATE { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for COMBOBOXINFO_BUTTON_STATE { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for COMBOBOXINFO_BUTTON_STATE { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for COMBOBOXINFO_BUTTON_STATE { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct COMBOBOX_EX_ITEM_FLAGS(pub u32); pub const CBEIF_DI_SETITEM: COMBOBOX_EX_ITEM_FLAGS = COMBOBOX_EX_ITEM_FLAGS(268435456u32); pub const CBEIF_IMAGE: COMBOBOX_EX_ITEM_FLAGS = COMBOBOX_EX_ITEM_FLAGS(2u32); pub const CBEIF_INDENT: COMBOBOX_EX_ITEM_FLAGS = COMBOBOX_EX_ITEM_FLAGS(16u32); pub const CBEIF_LPARAM: COMBOBOX_EX_ITEM_FLAGS = COMBOBOX_EX_ITEM_FLAGS(32u32); pub const CBEIF_OVERLAY: COMBOBOX_EX_ITEM_FLAGS = COMBOBOX_EX_ITEM_FLAGS(8u32); pub const CBEIF_SELECTEDIMAGE: COMBOBOX_EX_ITEM_FLAGS = COMBOBOX_EX_ITEM_FLAGS(4u32); pub const CBEIF_TEXT: COMBOBOX_EX_ITEM_FLAGS = COMBOBOX_EX_ITEM_FLAGS(1u32); impl ::core::convert::From<u32> for COMBOBOX_EX_ITEM_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for COMBOBOX_EX_ITEM_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for COMBOBOX_EX_ITEM_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for COMBOBOX_EX_ITEM_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for COMBOBOX_EX_ITEM_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for COMBOBOX_EX_ITEM_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for COMBOBOX_EX_ITEM_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const COMCTL32_VERSION: u32 = 6u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct COMPAREITEMSTRUCT { pub CtlType: u32, pub CtlID: u32, pub hwndItem: super::super::Foundation::HWND, pub itemID1: u32, pub itemData1: usize, pub itemID2: u32, pub itemData2: usize, pub dwLocaleId: u32, } #[cfg(feature = "Win32_Foundation")] impl COMPAREITEMSTRUCT {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for COMPAREITEMSTRUCT { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for COMPAREITEMSTRUCT { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("COMPAREITEMSTRUCT") .field("CtlType", &self.CtlType) .field("CtlID", &self.CtlID) .field("hwndItem", &self.hwndItem) .field("itemID1", &self.itemID1) .field("itemData1", &self.itemData1) .field("itemID2", &self.itemID2) .field("itemData2", &self.itemData2) .field("dwLocaleId", &self.dwLocaleId) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for COMPAREITEMSTRUCT { fn eq(&self, other: &Self) -> bool { self.CtlType == other.CtlType && self.CtlID == other.CtlID && self.hwndItem == other.hwndItem && self.itemID1 == other.itemID1 && self.itemData1 == other.itemData1 && self.itemID2 == other.itemID2 && self.itemData2 == other.itemData2 && self.dwLocaleId == other.dwLocaleId } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for COMPAREITEMSTRUCT {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for COMPAREITEMSTRUCT { 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 CONTENTALIGNMENT(pub i32); pub const CA_LEFT: CONTENTALIGNMENT = CONTENTALIGNMENT(0i32); pub const CA_CENTER: CONTENTALIGNMENT = CONTENTALIGNMENT(1i32); pub const CA_RIGHT: CONTENTALIGNMENT = CONTENTALIGNMENT(2i32); impl ::core::convert::From<i32> for CONTENTALIGNMENT { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for CONTENTALIGNMENT { type Abi = Self; } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn CheckDlgButton<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hdlg: Param0, nidbutton: i32, ucheck: DLG_BUTTON_CHECK_STATE) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CheckDlgButton(hdlg: super::super::Foundation::HWND, nidbutton: i32, ucheck: DLG_BUTTON_CHECK_STATE) -> super::super::Foundation::BOOL; } ::core::mem::transmute(CheckDlgButton(hdlg.into_param().abi(), ::core::mem::transmute(nidbutton), ::core::mem::transmute(ucheck))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn CheckRadioButton<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hdlg: Param0, nidfirstbutton: i32, nidlastbutton: i32, nidcheckbutton: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CheckRadioButton(hdlg: super::super::Foundation::HWND, nidfirstbutton: i32, nidlastbutton: i32, nidcheckbutton: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(CheckRadioButton(hdlg.into_param().abi(), ::core::mem::transmute(nidfirstbutton), ::core::mem::transmute(nidlastbutton), ::core::mem::transmute(nidcheckbutton))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn CloseThemeData(htheme: isize) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CloseThemeData(htheme: isize) -> ::windows::core::HRESULT; } CloseThemeData(::core::mem::transmute(htheme)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn CreateMappedBitmap<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HINSTANCE>>(hinstance: Param0, idbitmap: isize, wflags: u32, lpcolormap: *const COLORMAP, inummaps: i32) -> super::super::Graphics::Gdi::HBITMAP { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateMappedBitmap(hinstance: super::super::Foundation::HINSTANCE, idbitmap: isize, wflags: u32, lpcolormap: *const COLORMAP, inummaps: i32) -> super::super::Graphics::Gdi::HBITMAP; } ::core::mem::transmute(CreateMappedBitmap(hinstance.into_param().abi(), ::core::mem::transmute(idbitmap), ::core::mem::transmute(wflags), ::core::mem::transmute(lpcolormap), ::core::mem::transmute(inummaps))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn CreatePropertySheetPageA(constpropsheetpagepointer: *mut PROPSHEETPAGEA) -> HPROPSHEETPAGE { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreatePropertySheetPageA(constpropsheetpagepointer: *mut ::core::mem::ManuallyDrop<PROPSHEETPAGEA>) -> HPROPSHEETPAGE; } ::core::mem::transmute(CreatePropertySheetPageA(::core::mem::transmute(constpropsheetpagepointer))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn CreatePropertySheetPageW(constpropsheetpagepointer: *mut PROPSHEETPAGEW) -> HPROPSHEETPAGE { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreatePropertySheetPageW(constpropsheetpagepointer: *mut ::core::mem::ManuallyDrop<PROPSHEETPAGEW>) -> HPROPSHEETPAGE; } ::core::mem::transmute(CreatePropertySheetPageW(::core::mem::transmute(constpropsheetpagepointer))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn CreateStatusWindowA<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(style: i32, lpsztext: Param1, hwndparent: Param2, wid: u32) -> super::super::Foundation::HWND { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateStatusWindowA(style: i32, lpsztext: super::super::Foundation::PSTR, hwndparent: super::super::Foundation::HWND, wid: u32) -> super::super::Foundation::HWND; } ::core::mem::transmute(CreateStatusWindowA(::core::mem::transmute(style), lpsztext.into_param().abi(), hwndparent.into_param().abi(), ::core::mem::transmute(wid))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn CreateStatusWindowW<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(style: i32, lpsztext: Param1, hwndparent: Param2, wid: u32) -> super::super::Foundation::HWND { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateStatusWindowW(style: i32, lpsztext: super::super::Foundation::PWSTR, hwndparent: super::super::Foundation::HWND, wid: u32) -> super::super::Foundation::HWND; } ::core::mem::transmute(CreateStatusWindowW(::core::mem::transmute(style), lpsztext.into_param().abi(), hwndparent.into_param().abi(), ::core::mem::transmute(wid))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] #[inline] pub unsafe fn CreateSyntheticPointerDevice(pointertype: super::WindowsAndMessaging::POINTER_INPUT_TYPE, maxcount: u32, mode: POINTER_FEEDBACK_MODE) -> HSYNTHETICPOINTERDEVICE { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateSyntheticPointerDevice(pointertype: super::WindowsAndMessaging::POINTER_INPUT_TYPE, maxcount: u32, mode: POINTER_FEEDBACK_MODE) -> HSYNTHETICPOINTERDEVICE; } ::core::mem::transmute(CreateSyntheticPointerDevice(::core::mem::transmute(pointertype), ::core::mem::transmute(maxcount), ::core::mem::transmute(mode))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn CreateToolbarEx<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::HINSTANCE>>(hwnd: Param0, ws: u32, wid: u32, nbitmaps: i32, hbminst: Param4, wbmid: usize, lpbuttons: *mut TBBUTTON, inumbuttons: i32, dxbutton: i32, dybutton: i32, dxbitmap: i32, dybitmap: i32, ustructsize: u32) -> super::super::Foundation::HWND { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateToolbarEx(hwnd: super::super::Foundation::HWND, ws: u32, wid: u32, nbitmaps: i32, hbminst: super::super::Foundation::HINSTANCE, wbmid: usize, lpbuttons: *mut TBBUTTON, inumbuttons: i32, dxbutton: i32, dybutton: i32, dxbitmap: i32, dybitmap: i32, ustructsize: u32) -> super::super::Foundation::HWND; } ::core::mem::transmute(CreateToolbarEx( hwnd.into_param().abi(), ::core::mem::transmute(ws), ::core::mem::transmute(wid), ::core::mem::transmute(nbitmaps), hbminst.into_param().abi(), ::core::mem::transmute(wbmid), ::core::mem::transmute(lpbuttons), ::core::mem::transmute(inumbuttons), ::core::mem::transmute(dxbutton), ::core::mem::transmute(dybutton), ::core::mem::transmute(dxbitmap), ::core::mem::transmute(dybitmap), ::core::mem::transmute(ustructsize), )) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn CreateUpDownControl<'a, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::HINSTANCE>, Param8: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(dwstyle: u32, x: i32, y: i32, cx: i32, cy: i32, hparent: Param5, nid: i32, hinst: Param7, hbuddy: Param8, nupper: i32, nlower: i32, npos: i32) -> super::super::Foundation::HWND { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn CreateUpDownControl(dwstyle: u32, x: i32, y: i32, cx: i32, cy: i32, hparent: super::super::Foundation::HWND, nid: i32, hinst: super::super::Foundation::HINSTANCE, hbuddy: super::super::Foundation::HWND, nupper: i32, nlower: i32, npos: i32) -> super::super::Foundation::HWND; } ::core::mem::transmute(CreateUpDownControl( ::core::mem::transmute(dwstyle), ::core::mem::transmute(x), ::core::mem::transmute(y), ::core::mem::transmute(cx), ::core::mem::transmute(cy), hparent.into_param().abi(), ::core::mem::transmute(nid), hinst.into_param().abi(), hbuddy.into_param().abi(), ::core::mem::transmute(nupper), ::core::mem::transmute(nlower), ::core::mem::transmute(npos), )) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct DATETIMEPICKERINFO { pub cbSize: u32, pub rcCheck: super::super::Foundation::RECT, pub stateCheck: u32, pub rcButton: super::super::Foundation::RECT, pub stateButton: u32, pub hwndEdit: super::super::Foundation::HWND, pub hwndUD: super::super::Foundation::HWND, pub hwndDropDown: super::super::Foundation::HWND, } #[cfg(feature = "Win32_Foundation")] impl DATETIMEPICKERINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for DATETIMEPICKERINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for DATETIMEPICKERINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("DATETIMEPICKERINFO") .field("cbSize", &self.cbSize) .field("rcCheck", &self.rcCheck) .field("stateCheck", &self.stateCheck) .field("rcButton", &self.rcButton) .field("stateButton", &self.stateButton) .field("hwndEdit", &self.hwndEdit) .field("hwndUD", &self.hwndUD) .field("hwndDropDown", &self.hwndDropDown) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for DATETIMEPICKERINFO { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.rcCheck == other.rcCheck && self.stateCheck == other.stateCheck && self.rcButton == other.rcButton && self.stateButton == other.stateButton && self.hwndEdit == other.hwndEdit && self.hwndUD == other.hwndUD && self.hwndDropDown == other.hwndDropDown } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for DATETIMEPICKERINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for DATETIMEPICKERINFO { type Abi = Self; } pub const DA_ERR: i32 = -1i32; pub const DA_LAST: u32 = 2147483647u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct DELETEITEMSTRUCT { pub CtlType: DRAWITEMSTRUCT_CTL_TYPE, pub CtlID: u32, pub itemID: u32, pub hwndItem: super::super::Foundation::HWND, pub itemData: usize, } #[cfg(feature = "Win32_Foundation")] impl DELETEITEMSTRUCT {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for DELETEITEMSTRUCT { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for DELETEITEMSTRUCT { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("DELETEITEMSTRUCT").field("CtlType", &self.CtlType).field("CtlID", &self.CtlID).field("itemID", &self.itemID).field("hwndItem", &self.hwndItem).field("itemData", &self.itemData).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for DELETEITEMSTRUCT { fn eq(&self, other: &Self) -> bool { self.CtlType == other.CtlType && self.CtlID == other.CtlID && self.itemID == other.itemID && self.hwndItem == other.hwndItem && self.itemData == other.itemData } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for DELETEITEMSTRUCT {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for DELETEITEMSTRUCT { 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 DLG_BUTTON_CHECK_STATE(pub u32); pub const BST_CHECKED: DLG_BUTTON_CHECK_STATE = DLG_BUTTON_CHECK_STATE(1u32); pub const BST_INDETERMINATE: DLG_BUTTON_CHECK_STATE = DLG_BUTTON_CHECK_STATE(2u32); pub const BST_UNCHECKED: DLG_BUTTON_CHECK_STATE = DLG_BUTTON_CHECK_STATE(0u32); impl ::core::convert::From<u32> for DLG_BUTTON_CHECK_STATE { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for DLG_BUTTON_CHECK_STATE { type Abi = Self; } impl ::core::ops::BitOr for DLG_BUTTON_CHECK_STATE { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for DLG_BUTTON_CHECK_STATE { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for DLG_BUTTON_CHECK_STATE { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for DLG_BUTTON_CHECK_STATE { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for DLG_BUTTON_CHECK_STATE { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct DLG_DIR_LIST_FILE_TYPE(pub u32); pub const DDL_ARCHIVE: DLG_DIR_LIST_FILE_TYPE = DLG_DIR_LIST_FILE_TYPE(32u32); pub const DDL_DIRECTORY: DLG_DIR_LIST_FILE_TYPE = DLG_DIR_LIST_FILE_TYPE(16u32); pub const DDL_DRIVES: DLG_DIR_LIST_FILE_TYPE = DLG_DIR_LIST_FILE_TYPE(16384u32); pub const DDL_EXCLUSIVE: DLG_DIR_LIST_FILE_TYPE = DLG_DIR_LIST_FILE_TYPE(32768u32); pub const DDL_HIDDEN: DLG_DIR_LIST_FILE_TYPE = DLG_DIR_LIST_FILE_TYPE(2u32); pub const DDL_READONLY: DLG_DIR_LIST_FILE_TYPE = DLG_DIR_LIST_FILE_TYPE(1u32); pub const DDL_READWRITE: DLG_DIR_LIST_FILE_TYPE = DLG_DIR_LIST_FILE_TYPE(0u32); pub const DDL_SYSTEM: DLG_DIR_LIST_FILE_TYPE = DLG_DIR_LIST_FILE_TYPE(4u32); pub const DDL_POSTMSGS: DLG_DIR_LIST_FILE_TYPE = DLG_DIR_LIST_FILE_TYPE(8192u32); impl ::core::convert::From<u32> for DLG_DIR_LIST_FILE_TYPE { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for DLG_DIR_LIST_FILE_TYPE { type Abi = Self; } impl ::core::ops::BitOr for DLG_DIR_LIST_FILE_TYPE { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for DLG_DIR_LIST_FILE_TYPE { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for DLG_DIR_LIST_FILE_TYPE { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for DLG_DIR_LIST_FILE_TYPE { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for DLG_DIR_LIST_FILE_TYPE { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const DL_COPYCURSOR: u32 = 2u32; pub const DL_CURSORSET: u32 = 0u32; pub const DL_MOVECURSOR: u32 = 3u32; pub const DL_STOPCURSOR: u32 = 1u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct DPAMM_MESSAGE(pub u32); pub const DPAMM_MERGE: DPAMM_MESSAGE = DPAMM_MESSAGE(1u32); pub const DPAMM_DELETE: DPAMM_MESSAGE = DPAMM_MESSAGE(2u32); pub const DPAMM_INSERT: DPAMM_MESSAGE = DPAMM_MESSAGE(3u32); impl ::core::convert::From<u32> for DPAMM_MESSAGE { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for DPAMM_MESSAGE { type Abi = Self; } impl ::core::ops::BitOr for DPAMM_MESSAGE { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for DPAMM_MESSAGE { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for DPAMM_MESSAGE { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for DPAMM_MESSAGE { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for DPAMM_MESSAGE { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const DPAM_INTERSECT: u32 = 8u32; pub const DPAM_NORMAL: u32 = 2u32; pub const DPAM_SORTED: u32 = 1u32; pub const DPAM_UNION: u32 = 4u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct DPASTREAMINFO { pub iPos: i32, pub pvItem: *mut ::core::ffi::c_void, } impl DPASTREAMINFO {} impl ::core::default::Default for DPASTREAMINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for DPASTREAMINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("DPASTREAMINFO").field("iPos", &self.iPos).field("pvItem", &self.pvItem).finish() } } impl ::core::cmp::PartialEq for DPASTREAMINFO { fn eq(&self, other: &Self) -> bool { self.iPos == other.iPos && self.pvItem == other.pvItem } } impl ::core::cmp::Eq for DPASTREAMINFO {} unsafe impl ::windows::core::Abi for DPASTREAMINFO { type Abi = Self; } pub const DPAS_INSERTAFTER: u32 = 4u32; pub const DPAS_INSERTBEFORE: u32 = 2u32; pub const DPAS_SORTED: u32 = 1u32; pub const DPA_APPEND: u32 = 2147483647u32; #[inline] pub unsafe fn DPA_Clone<'a, Param0: ::windows::core::IntoParam<'a, HDPA>, Param1: ::windows::core::IntoParam<'a, HDPA>>(hdpa: Param0, hdpanew: Param1) -> HDPA { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_Clone(hdpa: HDPA, hdpanew: HDPA) -> HDPA; } ::core::mem::transmute(DPA_Clone(hdpa.into_param().abi(), hdpanew.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DPA_Create(citemgrow: i32) -> HDPA { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_Create(citemgrow: i32) -> HDPA; } ::core::mem::transmute(DPA_Create(::core::mem::transmute(citemgrow))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DPA_CreateEx<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::HANDLE>>(cpgrow: i32, hheap: Param1) -> HDPA { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_CreateEx(cpgrow: i32, hheap: super::super::Foundation::HANDLE) -> HDPA; } ::core::mem::transmute(DPA_CreateEx(::core::mem::transmute(cpgrow), hheap.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DPA_DeleteAllPtrs<'a, Param0: ::windows::core::IntoParam<'a, HDPA>>(hdpa: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_DeleteAllPtrs(hdpa: HDPA) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DPA_DeleteAllPtrs(hdpa.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DPA_DeletePtr<'a, Param0: ::windows::core::IntoParam<'a, HDPA>>(hdpa: Param0, i: i32) -> *mut ::core::ffi::c_void { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_DeletePtr(hdpa: HDPA, i: i32) -> *mut ::core::ffi::c_void; } ::core::mem::transmute(DPA_DeletePtr(hdpa.into_param().abi(), ::core::mem::transmute(i))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DPA_Destroy<'a, Param0: ::windows::core::IntoParam<'a, HDPA>>(hdpa: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_Destroy(hdpa: HDPA) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DPA_Destroy(hdpa.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DPA_DestroyCallback<'a, Param0: ::windows::core::IntoParam<'a, HDPA>>(hdpa: Param0, pfncb: ::core::option::Option<PFNDAENUMCALLBACK>, pdata: *const ::core::ffi::c_void) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_DestroyCallback(hdpa: HDPA, pfncb: ::windows::core::RawPtr, pdata: *const ::core::ffi::c_void); } ::core::mem::transmute(DPA_DestroyCallback(hdpa.into_param().abi(), ::core::mem::transmute(pfncb), ::core::mem::transmute(pdata))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const DPA_ERR: i32 = -1i32; #[inline] pub unsafe fn DPA_EnumCallback<'a, Param0: ::windows::core::IntoParam<'a, HDPA>>(hdpa: Param0, pfncb: ::core::option::Option<PFNDAENUMCALLBACK>, pdata: *const ::core::ffi::c_void) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_EnumCallback(hdpa: HDPA, pfncb: ::windows::core::RawPtr, pdata: *const ::core::ffi::c_void); } ::core::mem::transmute(DPA_EnumCallback(hdpa.into_param().abi(), ::core::mem::transmute(pfncb), ::core::mem::transmute(pdata))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DPA_GetPtr<'a, Param0: ::windows::core::IntoParam<'a, HDPA>>(hdpa: Param0, i: isize) -> *mut ::core::ffi::c_void { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_GetPtr(hdpa: HDPA, i: isize) -> *mut ::core::ffi::c_void; } ::core::mem::transmute(DPA_GetPtr(hdpa.into_param().abi(), ::core::mem::transmute(i))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DPA_GetPtrIndex<'a, Param0: ::windows::core::IntoParam<'a, HDPA>>(hdpa: Param0, p: *const ::core::ffi::c_void) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_GetPtrIndex(hdpa: HDPA, p: *const ::core::ffi::c_void) -> i32; } ::core::mem::transmute(DPA_GetPtrIndex(hdpa.into_param().abi(), ::core::mem::transmute(p))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DPA_GetSize<'a, Param0: ::windows::core::IntoParam<'a, HDPA>>(hdpa: Param0) -> u64 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_GetSize(hdpa: HDPA) -> u64; } ::core::mem::transmute(DPA_GetSize(hdpa.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DPA_Grow<'a, Param0: ::windows::core::IntoParam<'a, HDPA>>(pdpa: Param0, cp: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_Grow(pdpa: HDPA, cp: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DPA_Grow(pdpa.into_param().abi(), ::core::mem::transmute(cp))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DPA_InsertPtr<'a, Param0: ::windows::core::IntoParam<'a, HDPA>>(hdpa: Param0, i: i32, p: *const ::core::ffi::c_void) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_InsertPtr(hdpa: HDPA, i: i32, p: *const ::core::ffi::c_void) -> i32; } ::core::mem::transmute(DPA_InsertPtr(hdpa.into_param().abi(), ::core::mem::transmute(i), ::core::mem::transmute(p))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn DPA_LoadStream<'a, Param2: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(phdpa: *mut HDPA, pfn: ::core::option::Option<PFNDPASTREAM>, pstream: Param2, pvinstdata: *const ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_LoadStream(phdpa: *mut HDPA, pfn: ::windows::core::RawPtr, pstream: ::windows::core::RawPtr, pvinstdata: *const ::core::ffi::c_void) -> ::windows::core::HRESULT; } DPA_LoadStream(::core::mem::transmute(phdpa), ::core::mem::transmute(pfn), pstream.into_param().abi(), ::core::mem::transmute(pvinstdata)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DPA_Merge<'a, Param0: ::windows::core::IntoParam<'a, HDPA>, Param1: ::windows::core::IntoParam<'a, HDPA>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::LPARAM>>(hdpadest: Param0, hdpasrc: Param1, dwflags: u32, pfncompare: ::core::option::Option<PFNDACOMPARE>, pfnmerge: ::core::option::Option<PFNDPAMERGE>, lparam: Param5) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_Merge(hdpadest: HDPA, hdpasrc: HDPA, dwflags: u32, pfncompare: ::windows::core::RawPtr, pfnmerge: ::windows::core::RawPtr, lparam: super::super::Foundation::LPARAM) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DPA_Merge(hdpadest.into_param().abi(), hdpasrc.into_param().abi(), ::core::mem::transmute(dwflags), ::core::mem::transmute(pfncompare), ::core::mem::transmute(pfnmerge), lparam.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn DPA_SaveStream<'a, Param0: ::windows::core::IntoParam<'a, HDPA>, Param2: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(hdpa: Param0, pfn: ::core::option::Option<PFNDPASTREAM>, pstream: Param2, pvinstdata: *const ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_SaveStream(hdpa: HDPA, pfn: ::windows::core::RawPtr, pstream: ::windows::core::RawPtr, pvinstdata: *const ::core::ffi::c_void) -> ::windows::core::HRESULT; } DPA_SaveStream(hdpa.into_param().abi(), ::core::mem::transmute(pfn), pstream.into_param().abi(), ::core::mem::transmute(pvinstdata)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DPA_Search<'a, Param0: ::windows::core::IntoParam<'a, HDPA>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::LPARAM>>(hdpa: Param0, pfind: *const ::core::ffi::c_void, istart: i32, pfncompare: ::core::option::Option<PFNDACOMPARE>, lparam: Param4, options: u32) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_Search(hdpa: HDPA, pfind: *const ::core::ffi::c_void, istart: i32, pfncompare: ::windows::core::RawPtr, lparam: super::super::Foundation::LPARAM, options: u32) -> i32; } ::core::mem::transmute(DPA_Search(hdpa.into_param().abi(), ::core::mem::transmute(pfind), ::core::mem::transmute(istart), ::core::mem::transmute(pfncompare), lparam.into_param().abi(), ::core::mem::transmute(options))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DPA_SetPtr<'a, Param0: ::windows::core::IntoParam<'a, HDPA>>(hdpa: Param0, i: i32, p: *const ::core::ffi::c_void) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_SetPtr(hdpa: HDPA, i: i32, p: *const ::core::ffi::c_void) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DPA_SetPtr(hdpa.into_param().abi(), ::core::mem::transmute(i), ::core::mem::transmute(p))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DPA_Sort<'a, Param0: ::windows::core::IntoParam<'a, HDPA>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::LPARAM>>(hdpa: Param0, pfncompare: ::core::option::Option<PFNDACOMPARE>, lparam: Param2) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DPA_Sort(hdpa: HDPA, pfncompare: ::windows::core::RawPtr, lparam: super::super::Foundation::LPARAM) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DPA_Sort(hdpa.into_param().abi(), ::core::mem::transmute(pfncompare), lparam.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct DRAGLISTINFO { pub uNotification: DRAGLISTINFO_NOTIFICATION_FLAGS, pub hWnd: super::super::Foundation::HWND, pub ptCursor: super::super::Foundation::POINT, } #[cfg(feature = "Win32_Foundation")] impl DRAGLISTINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for DRAGLISTINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for DRAGLISTINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("DRAGLISTINFO").field("uNotification", &self.uNotification).field("hWnd", &self.hWnd).field("ptCursor", &self.ptCursor).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for DRAGLISTINFO { fn eq(&self, other: &Self) -> bool { self.uNotification == other.uNotification && self.hWnd == other.hWnd && self.ptCursor == other.ptCursor } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for DRAGLISTINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for DRAGLISTINFO { 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 DRAGLISTINFO_NOTIFICATION_FLAGS(pub u32); pub const DL_BEGINDRAG: DRAGLISTINFO_NOTIFICATION_FLAGS = DRAGLISTINFO_NOTIFICATION_FLAGS(1157u32); pub const DL_CANCELDRAG: DRAGLISTINFO_NOTIFICATION_FLAGS = DRAGLISTINFO_NOTIFICATION_FLAGS(1160u32); pub const DL_DRAGGING: DRAGLISTINFO_NOTIFICATION_FLAGS = DRAGLISTINFO_NOTIFICATION_FLAGS(1158u32); pub const DL_DROPPED: DRAGLISTINFO_NOTIFICATION_FLAGS = DRAGLISTINFO_NOTIFICATION_FLAGS(1159u32); impl ::core::convert::From<u32> for DRAGLISTINFO_NOTIFICATION_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for DRAGLISTINFO_NOTIFICATION_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for DRAGLISTINFO_NOTIFICATION_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for DRAGLISTINFO_NOTIFICATION_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for DRAGLISTINFO_NOTIFICATION_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for DRAGLISTINFO_NOTIFICATION_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for DRAGLISTINFO_NOTIFICATION_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct DRAWITEMSTRUCT { pub CtlType: DRAWITEMSTRUCT_CTL_TYPE, pub CtlID: u32, pub itemID: u32, pub itemAction: u32, pub itemState: u32, pub hwndItem: super::super::Foundation::HWND, pub hDC: super::super::Graphics::Gdi::HDC, pub rcItem: super::super::Foundation::RECT, pub itemData: usize, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl DRAWITEMSTRUCT {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for DRAWITEMSTRUCT { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for DRAWITEMSTRUCT { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("DRAWITEMSTRUCT") .field("CtlType", &self.CtlType) .field("CtlID", &self.CtlID) .field("itemID", &self.itemID) .field("itemAction", &self.itemAction) .field("itemState", &self.itemState) .field("hwndItem", &self.hwndItem) .field("hDC", &self.hDC) .field("rcItem", &self.rcItem) .field("itemData", &self.itemData) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for DRAWITEMSTRUCT { fn eq(&self, other: &Self) -> bool { self.CtlType == other.CtlType && self.CtlID == other.CtlID && self.itemID == other.itemID && self.itemAction == other.itemAction && self.itemState == other.itemState && self.hwndItem == other.hwndItem && self.hDC == other.hDC && self.rcItem == other.rcItem && self.itemData == other.itemData } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for DRAWITEMSTRUCT {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for DRAWITEMSTRUCT { 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 DRAWITEMSTRUCT_CTL_TYPE(pub u32); pub const ODT_BUTTON: DRAWITEMSTRUCT_CTL_TYPE = DRAWITEMSTRUCT_CTL_TYPE(4u32); pub const ODT_COMBOBOX: DRAWITEMSTRUCT_CTL_TYPE = DRAWITEMSTRUCT_CTL_TYPE(3u32); pub const ODT_LISTBOX: DRAWITEMSTRUCT_CTL_TYPE = DRAWITEMSTRUCT_CTL_TYPE(2u32); pub const ODT_LISTVIEW: DRAWITEMSTRUCT_CTL_TYPE = DRAWITEMSTRUCT_CTL_TYPE(102u32); pub const ODT_MENU: DRAWITEMSTRUCT_CTL_TYPE = DRAWITEMSTRUCT_CTL_TYPE(1u32); pub const ODT_STATIC: DRAWITEMSTRUCT_CTL_TYPE = DRAWITEMSTRUCT_CTL_TYPE(5u32); pub const ODT_TAB: DRAWITEMSTRUCT_CTL_TYPE = DRAWITEMSTRUCT_CTL_TYPE(101u32); impl ::core::convert::From<u32> for DRAWITEMSTRUCT_CTL_TYPE { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for DRAWITEMSTRUCT_CTL_TYPE { type Abi = Self; } impl ::core::ops::BitOr for DRAWITEMSTRUCT_CTL_TYPE { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for DRAWITEMSTRUCT_CTL_TYPE { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for DRAWITEMSTRUCT_CTL_TYPE { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for DRAWITEMSTRUCT_CTL_TYPE { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for DRAWITEMSTRUCT_CTL_TYPE { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct DRAW_THEME_PARENT_BACKGROUND_FLAGS(pub u32); pub const DTPB_WINDOWDC: DRAW_THEME_PARENT_BACKGROUND_FLAGS = DRAW_THEME_PARENT_BACKGROUND_FLAGS(1u32); pub const DTPB_USECTLCOLORSTATIC: DRAW_THEME_PARENT_BACKGROUND_FLAGS = DRAW_THEME_PARENT_BACKGROUND_FLAGS(2u32); pub const DTPB_USEERASEBKGND: DRAW_THEME_PARENT_BACKGROUND_FLAGS = DRAW_THEME_PARENT_BACKGROUND_FLAGS(4u32); impl ::core::convert::From<u32> for DRAW_THEME_PARENT_BACKGROUND_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for DRAW_THEME_PARENT_BACKGROUND_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for DRAW_THEME_PARENT_BACKGROUND_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for DRAW_THEME_PARENT_BACKGROUND_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for DRAW_THEME_PARENT_BACKGROUND_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for DRAW_THEME_PARENT_BACKGROUND_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for DRAW_THEME_PARENT_BACKGROUND_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const DSA_APPEND: u32 = 2147483647u32; #[inline] pub unsafe fn DSA_Clone<'a, Param0: ::windows::core::IntoParam<'a, HDSA>>(hdsa: Param0) -> HDSA { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_Clone(hdsa: HDSA) -> HDSA; } ::core::mem::transmute(DSA_Clone(hdsa.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DSA_Create(cbitem: i32, citemgrow: i32) -> HDSA { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_Create(cbitem: i32, citemgrow: i32) -> HDSA; } ::core::mem::transmute(DSA_Create(::core::mem::transmute(cbitem), ::core::mem::transmute(citemgrow))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DSA_DeleteAllItems<'a, Param0: ::windows::core::IntoParam<'a, HDSA>>(hdsa: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_DeleteAllItems(hdsa: HDSA) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DSA_DeleteAllItems(hdsa.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DSA_DeleteItem<'a, Param0: ::windows::core::IntoParam<'a, HDSA>>(hdsa: Param0, i: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_DeleteItem(hdsa: HDSA, i: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DSA_DeleteItem(hdsa.into_param().abi(), ::core::mem::transmute(i))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DSA_Destroy<'a, Param0: ::windows::core::IntoParam<'a, HDSA>>(hdsa: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_Destroy(hdsa: HDSA) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DSA_Destroy(hdsa.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DSA_DestroyCallback<'a, Param0: ::windows::core::IntoParam<'a, HDSA>>(hdsa: Param0, pfncb: ::core::option::Option<PFNDAENUMCALLBACK>, pdata: *const ::core::ffi::c_void) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_DestroyCallback(hdsa: HDSA, pfncb: ::windows::core::RawPtr, pdata: *const ::core::ffi::c_void); } ::core::mem::transmute(DSA_DestroyCallback(hdsa.into_param().abi(), ::core::mem::transmute(pfncb), ::core::mem::transmute(pdata))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const DSA_ERR: i32 = -1i32; #[inline] pub unsafe fn DSA_EnumCallback<'a, Param0: ::windows::core::IntoParam<'a, HDSA>>(hdsa: Param0, pfncb: ::core::option::Option<PFNDAENUMCALLBACK>, pdata: *const ::core::ffi::c_void) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_EnumCallback(hdsa: HDSA, pfncb: ::windows::core::RawPtr, pdata: *const ::core::ffi::c_void); } ::core::mem::transmute(DSA_EnumCallback(hdsa.into_param().abi(), ::core::mem::transmute(pfncb), ::core::mem::transmute(pdata))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DSA_GetItem<'a, Param0: ::windows::core::IntoParam<'a, HDSA>>(hdsa: Param0, i: i32, pitem: *mut ::core::ffi::c_void) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_GetItem(hdsa: HDSA, i: i32, pitem: *mut ::core::ffi::c_void) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DSA_GetItem(hdsa.into_param().abi(), ::core::mem::transmute(i), ::core::mem::transmute(pitem))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DSA_GetItemPtr<'a, Param0: ::windows::core::IntoParam<'a, HDSA>>(hdsa: Param0, i: i32) -> *mut ::core::ffi::c_void { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_GetItemPtr(hdsa: HDSA, i: i32) -> *mut ::core::ffi::c_void; } ::core::mem::transmute(DSA_GetItemPtr(hdsa.into_param().abi(), ::core::mem::transmute(i))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DSA_GetSize<'a, Param0: ::windows::core::IntoParam<'a, HDSA>>(hdsa: Param0) -> u64 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_GetSize(hdsa: HDSA) -> u64; } ::core::mem::transmute(DSA_GetSize(hdsa.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DSA_InsertItem<'a, Param0: ::windows::core::IntoParam<'a, HDSA>>(hdsa: Param0, i: i32, pitem: *const ::core::ffi::c_void) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_InsertItem(hdsa: HDSA, i: i32, pitem: *const ::core::ffi::c_void) -> i32; } ::core::mem::transmute(DSA_InsertItem(hdsa.into_param().abi(), ::core::mem::transmute(i), ::core::mem::transmute(pitem))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DSA_SetItem<'a, Param0: ::windows::core::IntoParam<'a, HDSA>>(hdsa: Param0, i: i32, pitem: *const ::core::ffi::c_void) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_SetItem(hdsa: HDSA, i: i32, pitem: *const ::core::ffi::c_void) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DSA_SetItem(hdsa.into_param().abi(), ::core::mem::transmute(i), ::core::mem::transmute(pitem))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DSA_Sort<'a, Param0: ::windows::core::IntoParam<'a, HDSA>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::LPARAM>>(pdsa: Param0, pfncompare: ::core::option::Option<PFNDACOMPARE>, lparam: Param2) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DSA_Sort(pdsa: HDSA, pfncompare: ::windows::core::RawPtr, lparam: super::super::Foundation::LPARAM) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DSA_Sort(pdsa.into_param().abi(), ::core::mem::transmute(pfncompare), lparam.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct DTBGOPTS { pub dwSize: u32, pub dwFlags: u32, pub rcClip: super::super::Foundation::RECT, } #[cfg(feature = "Win32_Foundation")] impl DTBGOPTS {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for DTBGOPTS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for DTBGOPTS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("DTBGOPTS").field("dwSize", &self.dwSize).field("dwFlags", &self.dwFlags).field("rcClip", &self.rcClip).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for DTBGOPTS { fn eq(&self, other: &Self) -> bool { self.dwSize == other.dwSize && self.dwFlags == other.dwFlags && self.rcClip == other.rcClip } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for DTBGOPTS {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for DTBGOPTS { type Abi = Self; } pub const DTBG_CLIPRECT: u32 = 1u32; pub const DTBG_COMPUTINGREGION: u32 = 16u32; pub const DTBG_DRAWSOLID: u32 = 2u32; pub const DTBG_MIRRORDC: u32 = 32u32; pub const DTBG_NOMIRROR: u32 = 64u32; pub const DTBG_OMITBORDER: u32 = 4u32; pub const DTBG_OMITCONTENT: u32 = 8u32; pub const DTM_CLOSEMONTHCAL: u32 = 4109u32; pub const DTM_FIRST: u32 = 4096u32; pub const DTM_GETDATETIMEPICKERINFO: u32 = 4110u32; pub const DTM_GETIDEALSIZE: u32 = 4111u32; pub const DTM_GETMCCOLOR: u32 = 4103u32; pub const DTM_GETMCFONT: u32 = 4106u32; pub const DTM_GETMCSTYLE: u32 = 4108u32; pub const DTM_GETMONTHCAL: u32 = 4104u32; pub const DTM_GETRANGE: u32 = 4099u32; pub const DTM_GETSYSTEMTIME: u32 = 4097u32; pub const DTM_SETFORMAT: u32 = 4146u32; pub const DTM_SETFORMATA: u32 = 4101u32; pub const DTM_SETFORMATW: u32 = 4146u32; pub const DTM_SETMCCOLOR: u32 = 4102u32; pub const DTM_SETMCFONT: u32 = 4105u32; pub const DTM_SETMCSTYLE: u32 = 4107u32; pub const DTM_SETRANGE: u32 = 4100u32; pub const DTM_SETSYSTEMTIME: u32 = 4098u32; pub const DTS_APPCANPARSE: u32 = 16u32; pub const DTS_LONGDATEFORMAT: u32 = 4u32; pub const DTS_RIGHTALIGN: u32 = 32u32; pub const DTS_SHORTDATECENTURYFORMAT: u32 = 12u32; pub const DTS_SHORTDATEFORMAT: u32 = 0u32; pub const DTS_SHOWNONE: u32 = 2u32; pub const DTS_TIMEFORMAT: u32 = 9u32; pub const DTS_UPDOWN: u32 = 1u32; #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct DTTOPTS { pub dwSize: u32, pub dwFlags: u32, pub crText: u32, pub crBorder: u32, pub crShadow: u32, pub iTextShadowType: i32, pub ptShadowOffset: super::super::Foundation::POINT, pub iBorderSize: i32, pub iFontPropId: i32, pub iColorPropId: i32, pub iStateId: i32, pub fApplyOverlay: super::super::Foundation::BOOL, pub iGlowSize: i32, pub pfnDrawTextCallback: ::core::option::Option<DTT_CALLBACK_PROC>, pub lParam: super::super::Foundation::LPARAM, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl DTTOPTS {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for DTTOPTS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for DTTOPTS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("DTTOPTS") .field("dwSize", &self.dwSize) .field("dwFlags", &self.dwFlags) .field("crText", &self.crText) .field("crBorder", &self.crBorder) .field("crShadow", &self.crShadow) .field("iTextShadowType", &self.iTextShadowType) .field("ptShadowOffset", &self.ptShadowOffset) .field("iBorderSize", &self.iBorderSize) .field("iFontPropId", &self.iFontPropId) .field("iColorPropId", &self.iColorPropId) .field("iStateId", &self.iStateId) .field("fApplyOverlay", &self.fApplyOverlay) .field("iGlowSize", &self.iGlowSize) .field("lParam", &self.lParam) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for DTTOPTS { fn eq(&self, other: &Self) -> bool { self.dwSize == other.dwSize && self.dwFlags == other.dwFlags && self.crText == other.crText && self.crBorder == other.crBorder && self.crShadow == other.crShadow && self.iTextShadowType == other.iTextShadowType && self.ptShadowOffset == other.ptShadowOffset && self.iBorderSize == other.iBorderSize && self.iFontPropId == other.iFontPropId && self.iColorPropId == other.iColorPropId && self.iStateId == other.iStateId && self.fApplyOverlay == other.fApplyOverlay && self.iGlowSize == other.iGlowSize && self.pfnDrawTextCallback.map(|f| f as usize) == other.pfnDrawTextCallback.map(|f| f as usize) && self.lParam == other.lParam } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for DTTOPTS {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for DTTOPTS { type Abi = ::core::mem::ManuallyDrop<Self>; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub type DTT_CALLBACK_PROC = unsafe extern "system" fn(hdc: super::super::Graphics::Gdi::HDC, psztext: super::super::Foundation::PWSTR, cchtext: i32, prc: *mut super::super::Foundation::RECT, dwflags: u32, lparam: super::super::Foundation::LPARAM) -> i32; pub const DTT_FLAGS2VALIDBITS: u32 = 1u32; pub const DTT_GRAYED: u32 = 1u32; #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DestroyPropertySheetPage<'a, Param0: ::windows::core::IntoParam<'a, HPROPSHEETPAGE>>(param0: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DestroyPropertySheetPage(param0: HPROPSHEETPAGE) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DestroyPropertySheetPage(param0.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn DestroySyntheticPointerDevice<'a, Param0: ::windows::core::IntoParam<'a, HSYNTHETICPOINTERDEVICE>>(device: Param0) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DestroySyntheticPointerDevice(device: HSYNTHETICPOINTERDEVICE); } ::core::mem::transmute(DestroySyntheticPointerDevice(device.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DlgDirListA<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>>(hdlg: Param0, lppathspec: Param1, nidlistbox: i32, nidstaticpath: i32, ufiletype: DLG_DIR_LIST_FILE_TYPE) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DlgDirListA(hdlg: super::super::Foundation::HWND, lppathspec: super::super::Foundation::PSTR, nidlistbox: i32, nidstaticpath: i32, ufiletype: DLG_DIR_LIST_FILE_TYPE) -> i32; } ::core::mem::transmute(DlgDirListA(hdlg.into_param().abi(), lppathspec.into_param().abi(), ::core::mem::transmute(nidlistbox), ::core::mem::transmute(nidstaticpath), ::core::mem::transmute(ufiletype))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DlgDirListComboBoxA<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>>(hdlg: Param0, lppathspec: Param1, nidcombobox: i32, nidstaticpath: i32, ufiletype: DLG_DIR_LIST_FILE_TYPE) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DlgDirListComboBoxA(hdlg: super::super::Foundation::HWND, lppathspec: super::super::Foundation::PSTR, nidcombobox: i32, nidstaticpath: i32, ufiletype: DLG_DIR_LIST_FILE_TYPE) -> i32; } ::core::mem::transmute(DlgDirListComboBoxA(hdlg.into_param().abi(), lppathspec.into_param().abi(), ::core::mem::transmute(nidcombobox), ::core::mem::transmute(nidstaticpath), ::core::mem::transmute(ufiletype))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DlgDirListComboBoxW<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hdlg: Param0, lppathspec: Param1, nidcombobox: i32, nidstaticpath: i32, ufiletype: DLG_DIR_LIST_FILE_TYPE) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DlgDirListComboBoxW(hdlg: super::super::Foundation::HWND, lppathspec: super::super::Foundation::PWSTR, nidcombobox: i32, nidstaticpath: i32, ufiletype: DLG_DIR_LIST_FILE_TYPE) -> i32; } ::core::mem::transmute(DlgDirListComboBoxW(hdlg.into_param().abi(), lppathspec.into_param().abi(), ::core::mem::transmute(nidcombobox), ::core::mem::transmute(nidstaticpath), ::core::mem::transmute(ufiletype))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DlgDirListW<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hdlg: Param0, lppathspec: Param1, nidlistbox: i32, nidstaticpath: i32, ufiletype: DLG_DIR_LIST_FILE_TYPE) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DlgDirListW(hdlg: super::super::Foundation::HWND, lppathspec: super::super::Foundation::PWSTR, nidlistbox: i32, nidstaticpath: i32, ufiletype: DLG_DIR_LIST_FILE_TYPE) -> i32; } ::core::mem::transmute(DlgDirListW(hdlg.into_param().abi(), lppathspec.into_param().abi(), ::core::mem::transmute(nidlistbox), ::core::mem::transmute(nidstaticpath), ::core::mem::transmute(ufiletype))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DlgDirSelectComboBoxExA<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnddlg: Param0, lpstring: super::super::Foundation::PSTR, cchout: i32, idcombobox: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DlgDirSelectComboBoxExA(hwnddlg: super::super::Foundation::HWND, lpstring: super::super::Foundation::PSTR, cchout: i32, idcombobox: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DlgDirSelectComboBoxExA(hwnddlg.into_param().abi(), ::core::mem::transmute(lpstring), ::core::mem::transmute(cchout), ::core::mem::transmute(idcombobox))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DlgDirSelectComboBoxExW<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnddlg: Param0, lpstring: super::super::Foundation::PWSTR, cchout: i32, idcombobox: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DlgDirSelectComboBoxExW(hwnddlg: super::super::Foundation::HWND, lpstring: super::super::Foundation::PWSTR, cchout: i32, idcombobox: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DlgDirSelectComboBoxExW(hwnddlg.into_param().abi(), ::core::mem::transmute(lpstring), ::core::mem::transmute(cchout), ::core::mem::transmute(idcombobox))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DlgDirSelectExA<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnddlg: Param0, lpstring: super::super::Foundation::PSTR, chcount: i32, idlistbox: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DlgDirSelectExA(hwnddlg: super::super::Foundation::HWND, lpstring: super::super::Foundation::PSTR, chcount: i32, idlistbox: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DlgDirSelectExA(hwnddlg.into_param().abi(), ::core::mem::transmute(lpstring), ::core::mem::transmute(chcount), ::core::mem::transmute(idlistbox))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DlgDirSelectExW<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnddlg: Param0, lpstring: super::super::Foundation::PWSTR, chcount: i32, idlistbox: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DlgDirSelectExW(hwnddlg: super::super::Foundation::HWND, lpstring: super::super::Foundation::PWSTR, chcount: i32, idlistbox: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(DlgDirSelectExW(hwnddlg.into_param().abi(), ::core::mem::transmute(lpstring), ::core::mem::transmute(chcount), ::core::mem::transmute(idlistbox))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn DrawInsert<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(handparent: Param0, hlb: Param1, nitem: i32) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawInsert(handparent: super::super::Foundation::HWND, hlb: super::super::Foundation::HWND, nitem: i32); } ::core::mem::transmute(DrawInsert(handparent.into_param().abi(), hlb.into_param().abi(), ::core::mem::transmute(nitem))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn DrawShadowText<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hdc: Param0, psztext: Param1, cch: u32, prc: *const super::super::Foundation::RECT, dwflags: u32, crtext: u32, crshadow: u32, ixoffset: i32, iyoffset: i32) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawShadowText(hdc: super::super::Graphics::Gdi::HDC, psztext: super::super::Foundation::PWSTR, cch: u32, prc: *const super::super::Foundation::RECT, dwflags: u32, crtext: u32, crshadow: u32, ixoffset: i32, iyoffset: i32) -> i32; } ::core::mem::transmute(DrawShadowText(hdc.into_param().abi(), psztext.into_param().abi(), ::core::mem::transmute(cch), ::core::mem::transmute(prc), ::core::mem::transmute(dwflags), ::core::mem::transmute(crtext), ::core::mem::transmute(crshadow), ::core::mem::transmute(ixoffset), ::core::mem::transmute(iyoffset))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn DrawStatusTextA<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>>(hdc: Param0, lprc: *mut super::super::Foundation::RECT, psztext: Param2, uflags: u32) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawStatusTextA(hdc: super::super::Graphics::Gdi::HDC, lprc: *mut super::super::Foundation::RECT, psztext: super::super::Foundation::PSTR, uflags: u32); } ::core::mem::transmute(DrawStatusTextA(hdc.into_param().abi(), ::core::mem::transmute(lprc), psztext.into_param().abi(), ::core::mem::transmute(uflags))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn DrawStatusTextW<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hdc: Param0, lprc: *mut super::super::Foundation::RECT, psztext: Param2, uflags: u32) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawStatusTextW(hdc: super::super::Graphics::Gdi::HDC, lprc: *mut super::super::Foundation::RECT, psztext: super::super::Foundation::PWSTR, uflags: u32); } ::core::mem::transmute(DrawStatusTextW(hdc.into_param().abi(), ::core::mem::transmute(lprc), psztext.into_param().abi(), ::core::mem::transmute(uflags))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn DrawThemeBackground<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, prect: *const super::super::Foundation::RECT, pcliprect: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawThemeBackground(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, prect: *const super::super::Foundation::RECT, pcliprect: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT; } DrawThemeBackground(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(prect), ::core::mem::transmute(pcliprect)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn DrawThemeBackgroundEx<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, prect: *const super::super::Foundation::RECT, poptions: *const DTBGOPTS) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawThemeBackgroundEx(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, prect: *const super::super::Foundation::RECT, poptions: *const DTBGOPTS) -> ::windows::core::HRESULT; } DrawThemeBackgroundEx(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(prect), ::core::mem::transmute(poptions)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn DrawThemeEdge<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, pdestrect: *const super::super::Foundation::RECT, uedge: u32, uflags: u32) -> ::windows::core::Result<super::super::Foundation::RECT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawThemeEdge(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, pdestrect: *const super::super::Foundation::RECT, uedge: u32, uflags: u32, pcontentrect: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); DrawThemeEdge(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(pdestrect), ::core::mem::transmute(uedge), ::core::mem::transmute(uflags), &mut result__).from_abi::<super::super::Foundation::RECT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn DrawThemeIcon<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param5: ::windows::core::IntoParam<'a, HIMAGELIST>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, prect: *const super::super::Foundation::RECT, himl: Param5, iimageindex: i32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawThemeIcon(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, prect: *const super::super::Foundation::RECT, himl: HIMAGELIST, iimageindex: i32) -> ::windows::core::HRESULT; } DrawThemeIcon(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(prect), himl.into_param().abi(), ::core::mem::transmute(iimageindex)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn DrawThemeParentBackground<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hwnd: Param0, hdc: Param1, prc: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawThemeParentBackground(hwnd: super::super::Foundation::HWND, hdc: super::super::Graphics::Gdi::HDC, prc: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT; } DrawThemeParentBackground(hwnd.into_param().abi(), hdc.into_param().abi(), ::core::mem::transmute(prc)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn DrawThemeParentBackgroundEx<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(hwnd: Param0, hdc: Param1, dwflags: DRAW_THEME_PARENT_BACKGROUND_FLAGS, prc: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawThemeParentBackgroundEx(hwnd: super::super::Foundation::HWND, hdc: super::super::Graphics::Gdi::HDC, dwflags: DRAW_THEME_PARENT_BACKGROUND_FLAGS, prc: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT; } DrawThemeParentBackgroundEx(hwnd.into_param().abi(), hdc.into_param().abi(), ::core::mem::transmute(dwflags), ::core::mem::transmute(prc)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn DrawThemeText<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, psztext: Param4, cchtext: i32, dwtextflags: u32, dwtextflags2: u32, prect: *const super::super::Foundation::RECT) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawThemeText(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, psztext: super::super::Foundation::PWSTR, cchtext: i32, dwtextflags: u32, dwtextflags2: u32, prect: *const super::super::Foundation::RECT) -> ::windows::core::HRESULT; } DrawThemeText(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), psztext.into_param().abi(), ::core::mem::transmute(cchtext), ::core::mem::transmute(dwtextflags), ::core::mem::transmute(dwtextflags2), ::core::mem::transmute(prect)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn DrawThemeTextEx<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, psztext: Param4, cchtext: i32, dwtextflags: u32, prect: *mut super::super::Foundation::RECT, poptions: *const DTTOPTS) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn DrawThemeTextEx(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, psztext: super::super::Foundation::PWSTR, cchtext: i32, dwtextflags: u32, prect: *mut super::super::Foundation::RECT, poptions: *const ::core::mem::ManuallyDrop<DTTOPTS>) -> ::windows::core::HRESULT; } DrawThemeTextEx(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), psztext.into_param().abi(), ::core::mem::transmute(cchtext), ::core::mem::transmute(dwtextflags), ::core::mem::transmute(prect), ::core::mem::transmute(poptions)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const ECM_FIRST: u32 = 5376u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct EC_ENDOFLINE(pub i32); pub const EC_ENDOFLINE_DETECTFROMCONTENT: EC_ENDOFLINE = EC_ENDOFLINE(0i32); pub const EC_ENDOFLINE_CRLF: EC_ENDOFLINE = EC_ENDOFLINE(1i32); pub const EC_ENDOFLINE_CR: EC_ENDOFLINE = EC_ENDOFLINE(2i32); pub const EC_ENDOFLINE_LF: EC_ENDOFLINE = EC_ENDOFLINE(3i32); impl ::core::convert::From<i32> for EC_ENDOFLINE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for EC_ENDOFLINE { 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 EC_SEARCHWEB_ENTRYPOINT(pub i32); pub const EC_SEARCHWEB_ENTRYPOINT_EXTERNAL: EC_SEARCHWEB_ENTRYPOINT = EC_SEARCHWEB_ENTRYPOINT(0i32); pub const EC_SEARCHWEB_ENTRYPOINT_CONTEXTMENU: EC_SEARCHWEB_ENTRYPOINT = EC_SEARCHWEB_ENTRYPOINT(1i32); impl ::core::convert::From<i32> for EC_SEARCHWEB_ENTRYPOINT { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for EC_SEARCHWEB_ENTRYPOINT { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct EDITBALLOONTIP { pub cbStruct: u32, pub pszTitle: super::super::Foundation::PWSTR, pub pszText: super::super::Foundation::PWSTR, pub ttiIcon: EDITBALLOONTIP_ICON, } #[cfg(feature = "Win32_Foundation")] impl EDITBALLOONTIP {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for EDITBALLOONTIP { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for EDITBALLOONTIP { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("EDITBALLOONTIP").field("cbStruct", &self.cbStruct).field("pszTitle", &self.pszTitle).field("pszText", &self.pszText).field("ttiIcon", &self.ttiIcon).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for EDITBALLOONTIP { fn eq(&self, other: &Self) -> bool { self.cbStruct == other.cbStruct && self.pszTitle == other.pszTitle && self.pszText == other.pszText && self.ttiIcon == other.ttiIcon } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for EDITBALLOONTIP {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for EDITBALLOONTIP { 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 EDITBALLOONTIP_ICON(pub u32); pub const TTI_ERROR: EDITBALLOONTIP_ICON = EDITBALLOONTIP_ICON(3u32); pub const TTI_INFO: EDITBALLOONTIP_ICON = EDITBALLOONTIP_ICON(1u32); pub const TTI_NONE: EDITBALLOONTIP_ICON = EDITBALLOONTIP_ICON(0u32); pub const TTI_WARNING: EDITBALLOONTIP_ICON = EDITBALLOONTIP_ICON(2u32); pub const TTI_INFO_LARGE: EDITBALLOONTIP_ICON = EDITBALLOONTIP_ICON(4u32); pub const TTI_WARNING_LARGE: EDITBALLOONTIP_ICON = EDITBALLOONTIP_ICON(5u32); pub const TTI_ERROR_LARGE: EDITBALLOONTIP_ICON = EDITBALLOONTIP_ICON(6u32); impl ::core::convert::From<u32> for EDITBALLOONTIP_ICON { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for EDITBALLOONTIP_ICON { type Abi = Self; } impl ::core::ops::BitOr for EDITBALLOONTIP_ICON { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for EDITBALLOONTIP_ICON { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for EDITBALLOONTIP_ICON { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for EDITBALLOONTIP_ICON { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for EDITBALLOONTIP_ICON { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[cfg(feature = "Win32_Foundation")] pub type EDITWORDBREAKPROCA = unsafe extern "system" fn(lpch: super::super::Foundation::PSTR, ichcurrent: i32, cch: i32, code: WORD_BREAK_ACTION) -> i32; #[cfg(feature = "Win32_Foundation")] pub type EDITWORDBREAKPROCW = unsafe extern "system" fn(lpch: super::super::Foundation::PWSTR, ichcurrent: i32, cch: i32, code: WORD_BREAK_ACTION) -> i32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct EMPTYMARKUPPARTS(pub i32); pub const EMP_MARKUPTEXT: EMPTYMARKUPPARTS = EMPTYMARKUPPARTS(1i32); impl ::core::convert::From<i32> for EMPTYMARKUPPARTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for EMPTYMARKUPPARTS { type Abi = Self; } pub const EM_CANUNDO: u32 = 198u32; pub const EM_CHARFROMPOS: u32 = 215u32; pub const EM_EMPTYUNDOBUFFER: u32 = 205u32; pub const EM_ENABLEFEATURE: u32 = 218u32; pub const EM_ENABLESEARCHWEB: u32 = 5390u32; pub const EM_FILELINEFROMCHAR: u32 = 5395u32; pub const EM_FILELINEINDEX: u32 = 5396u32; pub const EM_FILELINELENGTH: u32 = 5397u32; pub const EM_FMTLINES: u32 = 200u32; pub const EM_GETCARETINDEX: u32 = 5394u32; pub const EM_GETCUEBANNER: u32 = 5378u32; pub const EM_GETENDOFLINE: u32 = 5389u32; pub const EM_GETEXTENDEDSTYLE: u32 = 5387u32; pub const EM_GETFILELINE: u32 = 5398u32; pub const EM_GETFILELINECOUNT: u32 = 5399u32; pub const EM_GETFIRSTVISIBLELINE: u32 = 206u32; pub const EM_GETHANDLE: u32 = 189u32; pub const EM_GETHILITE: u32 = 5382u32; pub const EM_GETIMESTATUS: u32 = 217u32; pub const EM_GETLIMITTEXT: u32 = 213u32; pub const EM_GETLINE: u32 = 196u32; pub const EM_GETLINECOUNT: u32 = 186u32; pub const EM_GETMARGINS: u32 = 212u32; pub const EM_GETMODIFY: u32 = 184u32; pub const EM_GETPASSWORDCHAR: u32 = 210u32; pub const EM_GETRECT: u32 = 178u32; pub const EM_GETSEL: u32 = 176u32; pub const EM_GETTHUMB: u32 = 190u32; pub const EM_GETWORDBREAKPROC: u32 = 209u32; pub const EM_HIDEBALLOONTIP: u32 = 5380u32; pub const EM_LIMITTEXT: u32 = 197u32; pub const EM_LINEFROMCHAR: u32 = 201u32; pub const EM_LINEINDEX: u32 = 187u32; pub const EM_LINELENGTH: u32 = 193u32; pub const EM_LINESCROLL: u32 = 182u32; pub const EM_NOSETFOCUS: u32 = 5383u32; pub const EM_POSFROMCHAR: u32 = 214u32; pub const EM_REPLACESEL: u32 = 194u32; pub const EM_SCROLL: u32 = 181u32; pub const EM_SCROLLCARET: u32 = 183u32; pub const EM_SEARCHWEB: u32 = 5391u32; pub const EM_SETCARETINDEX: u32 = 5393u32; pub const EM_SETCUEBANNER: u32 = 5377u32; pub const EM_SETENDOFLINE: u32 = 5388u32; pub const EM_SETEXTENDEDSTYLE: u32 = 5386u32; pub const EM_SETHANDLE: u32 = 188u32; pub const EM_SETHILITE: u32 = 5381u32; pub const EM_SETIMESTATUS: u32 = 216u32; pub const EM_SETLIMITTEXT: u32 = 197u32; pub const EM_SETMARGINS: u32 = 211u32; pub const EM_SETMODIFY: u32 = 185u32; pub const EM_SETPASSWORDCHAR: u32 = 204u32; pub const EM_SETREADONLY: u32 = 207u32; pub const EM_SETRECT: u32 = 179u32; pub const EM_SETRECTNP: u32 = 180u32; pub const EM_SETSEL: u32 = 177u32; pub const EM_SETTABSTOPS: u32 = 203u32; pub const EM_SETWORDBREAKPROC: u32 = 208u32; pub const EM_SHOWBALLOONTIP: u32 = 5379u32; pub const EM_TAKEFOCUS: u32 = 5384u32; pub const EM_UNDO: u32 = 199u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct ENABLE_SCROLL_BAR_ARROWS(pub u32); pub const ESB_DISABLE_BOTH: ENABLE_SCROLL_BAR_ARROWS = ENABLE_SCROLL_BAR_ARROWS(3u32); pub const ESB_DISABLE_DOWN: ENABLE_SCROLL_BAR_ARROWS = ENABLE_SCROLL_BAR_ARROWS(2u32); pub const ESB_DISABLE_LEFT: ENABLE_SCROLL_BAR_ARROWS = ENABLE_SCROLL_BAR_ARROWS(1u32); pub const ESB_DISABLE_LTUP: ENABLE_SCROLL_BAR_ARROWS = ENABLE_SCROLL_BAR_ARROWS(1u32); pub const ESB_DISABLE_RIGHT: ENABLE_SCROLL_BAR_ARROWS = ENABLE_SCROLL_BAR_ARROWS(2u32); pub const ESB_DISABLE_RTDN: ENABLE_SCROLL_BAR_ARROWS = ENABLE_SCROLL_BAR_ARROWS(2u32); pub const ESB_DISABLE_UP: ENABLE_SCROLL_BAR_ARROWS = ENABLE_SCROLL_BAR_ARROWS(1u32); pub const ESB_ENABLE_BOTH: ENABLE_SCROLL_BAR_ARROWS = ENABLE_SCROLL_BAR_ARROWS(0u32); impl ::core::convert::From<u32> for ENABLE_SCROLL_BAR_ARROWS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for ENABLE_SCROLL_BAR_ARROWS { type Abi = Self; } impl ::core::ops::BitOr for ENABLE_SCROLL_BAR_ARROWS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for ENABLE_SCROLL_BAR_ARROWS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for ENABLE_SCROLL_BAR_ARROWS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for ENABLE_SCROLL_BAR_ARROWS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for ENABLE_SCROLL_BAR_ARROWS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const ES_EX_ALLOWEOL_CR: i32 = 1i32; pub const ES_EX_ALLOWEOL_LF: i32 = 2i32; pub const ES_EX_CONVERT_EOL_ON_PASTE: i32 = 4i32; pub const ES_EX_ZOOMABLE: i32 = 16i32; pub const ETDT_DISABLE: u32 = 1u32; pub const ETDT_ENABLE: u32 = 2u32; pub const ETDT_USEAEROWIZARDTABTEXTURE: u32 = 8u32; pub const ETDT_USETABTEXTURE: u32 = 4u32; #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn EnableScrollBar<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0, wsbflags: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, warrows: ENABLE_SCROLL_BAR_ARROWS) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn EnableScrollBar(hwnd: super::super::Foundation::HWND, wsbflags: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, warrows: ENABLE_SCROLL_BAR_ARROWS) -> super::super::Foundation::BOOL; } ::core::mem::transmute(EnableScrollBar(hwnd.into_param().abi(), ::core::mem::transmute(wsbflags), ::core::mem::transmute(warrows))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn EnableThemeDialogTexture<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0, dwflags: u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn EnableThemeDialogTexture(hwnd: super::super::Foundation::HWND, dwflags: u32) -> ::windows::core::HRESULT; } EnableThemeDialogTexture(hwnd.into_param().abi(), ::core::mem::transmute(dwflags)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn EnableTheming<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(fenable: Param0) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn EnableTheming(fenable: super::super::Foundation::BOOL) -> ::windows::core::HRESULT; } EnableTheming(fenable.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn EndBufferedAnimation<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(hbpanimation: isize, fupdatetarget: Param1) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn EndBufferedAnimation(hbpanimation: isize, fupdatetarget: super::super::Foundation::BOOL) -> ::windows::core::HRESULT; } EndBufferedAnimation(::core::mem::transmute(hbpanimation), fupdatetarget.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn EndBufferedPaint<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(hbufferedpaint: isize, fupdatetarget: Param1) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn EndBufferedPaint(hbufferedpaint: isize, fupdatetarget: super::super::Foundation::BOOL) -> ::windows::core::HRESULT; } EndBufferedPaint(::core::mem::transmute(hbufferedpaint), fupdatetarget.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn EndPanningFeedback<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(hwnd: Param0, fanimateback: Param1) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn EndPanningFeedback(hwnd: super::super::Foundation::HWND, fanimateback: super::super::Foundation::BOOL) -> super::super::Foundation::BOOL; } ::core::mem::transmute(EndPanningFeedback(hwnd.into_param().abi(), fanimateback.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn EvaluateProximityToPolygon(numvertices: u32, controlpolygon: *const super::super::Foundation::POINT, phittestinginput: *const TOUCH_HIT_TESTING_INPUT, pproximityeval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn EvaluateProximityToPolygon(numvertices: u32, controlpolygon: *const super::super::Foundation::POINT, phittestinginput: *const TOUCH_HIT_TESTING_INPUT, pproximityeval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION) -> super::super::Foundation::BOOL; } ::core::mem::transmute(EvaluateProximityToPolygon(::core::mem::transmute(numvertices), ::core::mem::transmute(controlpolygon), ::core::mem::transmute(phittestinginput), ::core::mem::transmute(pproximityeval))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn EvaluateProximityToRect(controlboundingbox: *const super::super::Foundation::RECT, phittestinginput: *const TOUCH_HIT_TESTING_INPUT, pproximityeval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn EvaluateProximityToRect(controlboundingbox: *const super::super::Foundation::RECT, phittestinginput: *const TOUCH_HIT_TESTING_INPUT, pproximityeval: *mut TOUCH_HIT_TESTING_PROXIMITY_EVALUATION) -> super::super::Foundation::BOOL; } ::core::mem::transmute(EvaluateProximityToRect(::core::mem::transmute(controlboundingbox), ::core::mem::transmute(phittestinginput), ::core::mem::transmute(pproximityeval))) } #[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 FEEDBACK_TYPE(pub i32); pub const FEEDBACK_TOUCH_CONTACTVISUALIZATION: FEEDBACK_TYPE = FEEDBACK_TYPE(1i32); pub const FEEDBACK_PEN_BARRELVISUALIZATION: FEEDBACK_TYPE = FEEDBACK_TYPE(2i32); pub const FEEDBACK_PEN_TAP: FEEDBACK_TYPE = FEEDBACK_TYPE(3i32); pub const FEEDBACK_PEN_DOUBLETAP: FEEDBACK_TYPE = FEEDBACK_TYPE(4i32); pub const FEEDBACK_PEN_PRESSANDHOLD: FEEDBACK_TYPE = FEEDBACK_TYPE(5i32); pub const FEEDBACK_PEN_RIGHTTAP: FEEDBACK_TYPE = FEEDBACK_TYPE(6i32); pub const FEEDBACK_TOUCH_TAP: FEEDBACK_TYPE = FEEDBACK_TYPE(7i32); pub const FEEDBACK_TOUCH_DOUBLETAP: FEEDBACK_TYPE = FEEDBACK_TYPE(8i32); pub const FEEDBACK_TOUCH_PRESSANDHOLD: FEEDBACK_TYPE = FEEDBACK_TYPE(9i32); pub const FEEDBACK_TOUCH_RIGHTTAP: FEEDBACK_TYPE = FEEDBACK_TYPE(10i32); pub const FEEDBACK_GESTURE_PRESSANDTAP: FEEDBACK_TYPE = FEEDBACK_TYPE(11i32); pub const FEEDBACK_MAX: FEEDBACK_TYPE = FEEDBACK_TYPE(-1i32); impl ::core::convert::From<i32> for FEEDBACK_TYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for FEEDBACK_TYPE { type Abi = Self; } pub const FILEOPENORD: u32 = 1536u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct FILLTYPE(pub i32); pub const FT_SOLID: FILLTYPE = FILLTYPE(0i32); pub const FT_VERTGRADIENT: FILLTYPE = FILLTYPE(1i32); pub const FT_HORZGRADIENT: FILLTYPE = FILLTYPE(2i32); pub const FT_RADIALGRADIENT: FILLTYPE = FILLTYPE(3i32); pub const FT_TILEIMAGE: FILLTYPE = FILLTYPE(4i32); impl ::core::convert::From<i32> for FILLTYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for FILLTYPE { type Abi = Self; } pub const FINDDLGORD: u32 = 1540u32; pub const FONTDLGORD: u32 = 1542u32; pub const FORMATDLGORD30: u32 = 1544u32; pub const FORMATDLGORD31: u32 = 1543u32; pub const FSB_ENCARTA_MODE: u32 = 1u32; pub const FSB_FLAT_MODE: u32 = 2u32; pub const FSB_REGULAR_MODE: u32 = 0u32; #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn FlatSB_EnableScrollBar<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(param0: Param0, param1: i32, param2: u32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn FlatSB_EnableScrollBar(param0: super::super::Foundation::HWND, param1: i32, param2: u32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(FlatSB_EnableScrollBar(param0.into_param().abi(), ::core::mem::transmute(param1), ::core::mem::transmute(param2))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn FlatSB_GetScrollInfo<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(param0: Param0, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, param2: *mut super::WindowsAndMessaging::SCROLLINFO) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn FlatSB_GetScrollInfo(param0: super::super::Foundation::HWND, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, param2: *mut super::WindowsAndMessaging::SCROLLINFO) -> super::super::Foundation::BOOL; } ::core::mem::transmute(FlatSB_GetScrollInfo(param0.into_param().abi(), ::core::mem::transmute(code), ::core::mem::transmute(param2))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn FlatSB_GetScrollPos<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(param0: Param0, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn FlatSB_GetScrollPos(param0: super::super::Foundation::HWND, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS) -> i32; } ::core::mem::transmute(FlatSB_GetScrollPos(param0.into_param().abi(), ::core::mem::transmute(code))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn FlatSB_GetScrollProp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(param0: Param0, propindex: WSB_PROP, param2: *mut i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn FlatSB_GetScrollProp(param0: super::super::Foundation::HWND, propindex: WSB_PROP, param2: *mut i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(FlatSB_GetScrollProp(param0.into_param().abi(), ::core::mem::transmute(propindex), ::core::mem::transmute(param2))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn FlatSB_GetScrollRange<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(param0: Param0, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, param2: *mut i32, param3: *mut i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn FlatSB_GetScrollRange(param0: super::super::Foundation::HWND, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, param2: *mut i32, param3: *mut i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(FlatSB_GetScrollRange(param0.into_param().abi(), ::core::mem::transmute(code), ::core::mem::transmute(param2), ::core::mem::transmute(param3))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn FlatSB_SetScrollInfo<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(param0: Param0, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, psi: *mut super::WindowsAndMessaging::SCROLLINFO, fredraw: Param3) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn FlatSB_SetScrollInfo(param0: super::super::Foundation::HWND, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, psi: *mut super::WindowsAndMessaging::SCROLLINFO, fredraw: super::super::Foundation::BOOL) -> i32; } ::core::mem::transmute(FlatSB_SetScrollInfo(param0.into_param().abi(), ::core::mem::transmute(code), ::core::mem::transmute(psi), fredraw.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn FlatSB_SetScrollPos<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(param0: Param0, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, pos: i32, fredraw: Param3) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn FlatSB_SetScrollPos(param0: super::super::Foundation::HWND, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, pos: i32, fredraw: super::super::Foundation::BOOL) -> i32; } ::core::mem::transmute(FlatSB_SetScrollPos(param0.into_param().abi(), ::core::mem::transmute(code), ::core::mem::transmute(pos), fredraw.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn FlatSB_SetScrollProp<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(param0: Param0, index: WSB_PROP, newvalue: isize, param3: Param3) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn FlatSB_SetScrollProp(param0: super::super::Foundation::HWND, index: WSB_PROP, newvalue: isize, param3: super::super::Foundation::BOOL) -> super::super::Foundation::BOOL; } ::core::mem::transmute(FlatSB_SetScrollProp(param0.into_param().abi(), ::core::mem::transmute(index), ::core::mem::transmute(newvalue), param3.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn FlatSB_SetScrollRange<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(param0: Param0, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, min: i32, max: i32, fredraw: Param4) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn FlatSB_SetScrollRange(param0: super::super::Foundation::HWND, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, min: i32, max: i32, fredraw: super::super::Foundation::BOOL) -> i32; } ::core::mem::transmute(FlatSB_SetScrollRange(param0.into_param().abi(), ::core::mem::transmute(code), ::core::mem::transmute(min), ::core::mem::transmute(max), fredraw.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn FlatSB_ShowScrollBar<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(param0: Param0, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, param2: Param2) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn FlatSB_ShowScrollBar(param0: super::super::Foundation::HWND, code: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, param2: super::super::Foundation::BOOL) -> super::super::Foundation::BOOL; } ::core::mem::transmute(FlatSB_ShowScrollBar(param0.into_param().abi(), ::core::mem::transmute(code), param2.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const GDTR_MAX: u32 = 2u32; pub const GDTR_MIN: u32 = 1u32; pub const GDT_ERROR: i32 = -1i32; pub const GDT_NONE: u32 = 1u32; pub const GDT_VALID: u32 = 0u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct GET_THEME_BITMAP_FLAGS(pub u32); pub const GBF_DIRECT: GET_THEME_BITMAP_FLAGS = GET_THEME_BITMAP_FLAGS(1u32); pub const GBF_COPY: GET_THEME_BITMAP_FLAGS = GET_THEME_BITMAP_FLAGS(2u32); pub const GBF_VALIDBITS: GET_THEME_BITMAP_FLAGS = GET_THEME_BITMAP_FLAGS(3u32); impl ::core::convert::From<u32> for GET_THEME_BITMAP_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for GET_THEME_BITMAP_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for GET_THEME_BITMAP_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for GET_THEME_BITMAP_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for GET_THEME_BITMAP_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for GET_THEME_BITMAP_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for GET_THEME_BITMAP_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct GLYPHFONTSIZINGTYPE(pub i32); pub const GFST_NONE: GLYPHFONTSIZINGTYPE = GLYPHFONTSIZINGTYPE(0i32); pub const GFST_SIZE: GLYPHFONTSIZINGTYPE = GLYPHFONTSIZINGTYPE(1i32); pub const GFST_DPI: GLYPHFONTSIZINGTYPE = GLYPHFONTSIZINGTYPE(2i32); impl ::core::convert::From<i32> for GLYPHFONTSIZINGTYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for GLYPHFONTSIZINGTYPE { 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 GLYPHTYPE(pub i32); pub const GT_NONE: GLYPHTYPE = GLYPHTYPE(0i32); pub const GT_IMAGEGLYPH: GLYPHTYPE = GLYPHTYPE(1i32); pub const GT_FONTGLYPH: GLYPHTYPE = GLYPHTYPE(2i32); impl ::core::convert::From<i32> for GLYPHTYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for GLYPHTYPE { type Abi = Self; } pub const GMR_DAYSTATE: u32 = 1u32; pub const GMR_VISIBLE: u32 = 0u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct GRIDCELLBACKGROUNDSTATES(pub i32); pub const MCGCB_SELECTED: GRIDCELLBACKGROUNDSTATES = GRIDCELLBACKGROUNDSTATES(1i32); pub const MCGCB_HOT: GRIDCELLBACKGROUNDSTATES = GRIDCELLBACKGROUNDSTATES(2i32); pub const MCGCB_SELECTEDHOT: GRIDCELLBACKGROUNDSTATES = GRIDCELLBACKGROUNDSTATES(3i32); pub const MCGCB_SELECTEDNOTFOCUSED: GRIDCELLBACKGROUNDSTATES = GRIDCELLBACKGROUNDSTATES(4i32); pub const MCGCB_TODAY: GRIDCELLBACKGROUNDSTATES = GRIDCELLBACKGROUNDSTATES(5i32); pub const MCGCB_TODAYSELECTED: GRIDCELLBACKGROUNDSTATES = GRIDCELLBACKGROUNDSTATES(6i32); impl ::core::convert::From<i32> for GRIDCELLBACKGROUNDSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for GRIDCELLBACKGROUNDSTATES { 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 GRIDCELLSTATES(pub i32); pub const MCGC_HOT: GRIDCELLSTATES = GRIDCELLSTATES(1i32); pub const MCGC_HASSTATE: GRIDCELLSTATES = GRIDCELLSTATES(2i32); pub const MCGC_HASSTATEHOT: GRIDCELLSTATES = GRIDCELLSTATES(3i32); pub const MCGC_TODAY: GRIDCELLSTATES = GRIDCELLSTATES(4i32); pub const MCGC_TODAYSELECTED: GRIDCELLSTATES = GRIDCELLSTATES(5i32); pub const MCGC_SELECTED: GRIDCELLSTATES = GRIDCELLSTATES(6i32); pub const MCGC_SELECTEDHOT: GRIDCELLSTATES = GRIDCELLSTATES(7i32); impl ::core::convert::From<i32> for GRIDCELLSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for GRIDCELLSTATES { 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 GRIDCELLUPPERSTATES(pub i32); pub const MCGCU_HOT: GRIDCELLUPPERSTATES = GRIDCELLUPPERSTATES(1i32); pub const MCGCU_HASSTATE: GRIDCELLUPPERSTATES = GRIDCELLUPPERSTATES(2i32); pub const MCGCU_HASSTATEHOT: GRIDCELLUPPERSTATES = GRIDCELLUPPERSTATES(3i32); pub const MCGCU_SELECTED: GRIDCELLUPPERSTATES = GRIDCELLUPPERSTATES(4i32); pub const MCGCU_SELECTEDHOT: GRIDCELLUPPERSTATES = GRIDCELLUPPERSTATES(5i32); impl ::core::convert::From<i32> for GRIDCELLUPPERSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for GRIDCELLUPPERSTATES { type Abi = Self; } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn GetBufferedPaintBits(hbufferedpaint: isize, ppbbuffer: *mut *mut super::super::Graphics::Gdi::RGBQUAD, pcxrow: *mut i32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetBufferedPaintBits(hbufferedpaint: isize, ppbbuffer: *mut *mut super::super::Graphics::Gdi::RGBQUAD, pcxrow: *mut i32) -> ::windows::core::HRESULT; } GetBufferedPaintBits(::core::mem::transmute(hbufferedpaint), ::core::mem::transmute(ppbbuffer), ::core::mem::transmute(pcxrow)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn GetBufferedPaintDC(hbufferedpaint: isize) -> super::super::Graphics::Gdi::HDC { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetBufferedPaintDC(hbufferedpaint: isize) -> super::super::Graphics::Gdi::HDC; } ::core::mem::transmute(GetBufferedPaintDC(::core::mem::transmute(hbufferedpaint))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn GetBufferedPaintTargetDC(hbufferedpaint: isize) -> super::super::Graphics::Gdi::HDC { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetBufferedPaintTargetDC(hbufferedpaint: isize) -> super::super::Graphics::Gdi::HDC; } ::core::mem::transmute(GetBufferedPaintTargetDC(::core::mem::transmute(hbufferedpaint))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetBufferedPaintTargetRect(hbufferedpaint: isize) -> ::windows::core::Result<super::super::Foundation::RECT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetBufferedPaintTargetRect(hbufferedpaint: isize, prc: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetBufferedPaintTargetRect(::core::mem::transmute(hbufferedpaint), &mut result__).from_abi::<super::super::Foundation::RECT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetComboBoxInfo<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwndcombo: Param0, pcbi: *mut COMBOBOXINFO) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetComboBoxInfo(hwndcombo: super::super::Foundation::HWND, pcbi: *mut COMBOBOXINFO) -> super::super::Foundation::BOOL; } ::core::mem::transmute(GetComboBoxInfo(hwndcombo.into_param().abi(), ::core::mem::transmute(pcbi))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetCurrentThemeName(pszthemefilename: super::super::Foundation::PWSTR, cchmaxnamechars: i32, pszcolorbuff: super::super::Foundation::PWSTR, cchmaxcolorchars: i32, pszsizebuff: super::super::Foundation::PWSTR, cchmaxsizechars: i32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetCurrentThemeName(pszthemefilename: super::super::Foundation::PWSTR, cchmaxnamechars: i32, pszcolorbuff: super::super::Foundation::PWSTR, cchmaxcolorchars: i32, pszsizebuff: super::super::Foundation::PWSTR, cchmaxsizechars: i32) -> ::windows::core::HRESULT; } GetCurrentThemeName(::core::mem::transmute(pszthemefilename), ::core::mem::transmute(cchmaxnamechars), ::core::mem::transmute(pszcolorbuff), ::core::mem::transmute(cchmaxcolorchars), ::core::mem::transmute(pszsizebuff), ::core::mem::transmute(cchmaxsizechars)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetEffectiveClientRect<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0, lprc: *mut super::super::Foundation::RECT, lpinfo: *const i32) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetEffectiveClientRect(hwnd: super::super::Foundation::HWND, lprc: *mut super::super::Foundation::RECT, lpinfo: *const i32); } ::core::mem::transmute(GetEffectiveClientRect(hwnd.into_param().abi(), ::core::mem::transmute(lprc), ::core::mem::transmute(lpinfo))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetListBoxInfo<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetListBoxInfo(hwnd: super::super::Foundation::HWND) -> u32; } ::core::mem::transmute(GetListBoxInfo(hwnd.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetMUILanguage() -> u16 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetMUILanguage() -> u16; } ::core::mem::transmute(GetMUILanguage()) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeAnimationProperty(htheme: isize, istoryboardid: i32, itargetid: i32, eproperty: TA_PROPERTY, pvproperty: *mut ::core::ffi::c_void, cbsize: u32, pcbsizeout: *mut u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeAnimationProperty(htheme: isize, istoryboardid: i32, itargetid: i32, eproperty: TA_PROPERTY, pvproperty: *mut ::core::ffi::c_void, cbsize: u32, pcbsizeout: *mut u32) -> ::windows::core::HRESULT; } GetThemeAnimationProperty(::core::mem::transmute(htheme), ::core::mem::transmute(istoryboardid), ::core::mem::transmute(itargetid), ::core::mem::transmute(eproperty), ::core::mem::transmute(pvproperty), ::core::mem::transmute(cbsize), ::core::mem::transmute(pcbsizeout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeAnimationTransform(htheme: isize, istoryboardid: i32, itargetid: i32, dwtransformindex: u32, ptransform: *mut TA_TRANSFORM, cbsize: u32, pcbsizeout: *mut u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeAnimationTransform(htheme: isize, istoryboardid: i32, itargetid: i32, dwtransformindex: u32, ptransform: *mut TA_TRANSFORM, cbsize: u32, pcbsizeout: *mut u32) -> ::windows::core::HRESULT; } GetThemeAnimationTransform(::core::mem::transmute(htheme), ::core::mem::transmute(istoryboardid), ::core::mem::transmute(itargetid), ::core::mem::transmute(dwtransformindex), ::core::mem::transmute(ptransform), ::core::mem::transmute(cbsize), ::core::mem::transmute(pcbsizeout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeAppProperties() -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeAppProperties() -> u32; } ::core::mem::transmute(GetThemeAppProperties()) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn GetThemeBackgroundContentRect<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, pboundingrect: *const super::super::Foundation::RECT) -> ::windows::core::Result<super::super::Foundation::RECT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeBackgroundContentRect(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, pboundingrect: *const super::super::Foundation::RECT, pcontentrect: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeBackgroundContentRect(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(pboundingrect), &mut result__).from_abi::<super::super::Foundation::RECT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn GetThemeBackgroundExtent<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, pcontentrect: *const super::super::Foundation::RECT) -> ::windows::core::Result<super::super::Foundation::RECT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeBackgroundExtent(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, pcontentrect: *const super::super::Foundation::RECT, pextentrect: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeBackgroundExtent(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(pcontentrect), &mut result__).from_abi::<super::super::Foundation::RECT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn GetThemeBackgroundRegion<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, prect: *const super::super::Foundation::RECT) -> ::windows::core::Result<super::super::Graphics::Gdi::HRGN> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeBackgroundRegion(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, prect: *const super::super::Foundation::RECT, pregion: *mut super::super::Graphics::Gdi::HRGN) -> ::windows::core::HRESULT; } let mut result__: <super::super::Graphics::Gdi::HRGN as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeBackgroundRegion(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(prect), &mut result__).from_abi::<super::super::Graphics::Gdi::HRGN>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn GetThemeBitmap(htheme: isize, ipartid: i32, istateid: i32, ipropid: THEME_PROPERTY_SYMBOL_ID, dwflags: GET_THEME_BITMAP_FLAGS) -> ::windows::core::Result<super::super::Graphics::Gdi::HBITMAP> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeBitmap(htheme: isize, ipartid: i32, istateid: i32, ipropid: THEME_PROPERTY_SYMBOL_ID, dwflags: GET_THEME_BITMAP_FLAGS, phbitmap: *mut super::super::Graphics::Gdi::HBITMAP) -> ::windows::core::HRESULT; } let mut result__: <super::super::Graphics::Gdi::HBITMAP as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeBitmap(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), ::core::mem::transmute(dwflags), &mut result__).from_abi::<super::super::Graphics::Gdi::HBITMAP>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetThemeBool(htheme: isize, ipartid: i32, istateid: i32, ipropid: THEME_PROPERTY_SYMBOL_ID) -> ::windows::core::Result<super::super::Foundation::BOOL> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeBool(htheme: isize, ipartid: i32, istateid: i32, ipropid: THEME_PROPERTY_SYMBOL_ID, pfval: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::BOOL as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeBool(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), &mut result__).from_abi::<super::super::Foundation::BOOL>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeColor(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeColor(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, pcolor: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeColor(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetThemeDocumentationProperty<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(pszthemename: Param0, pszpropertyname: Param1, pszvaluebuff: super::super::Foundation::PWSTR, cchmaxvalchars: i32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeDocumentationProperty(pszthemename: super::super::Foundation::PWSTR, pszpropertyname: super::super::Foundation::PWSTR, pszvaluebuff: super::super::Foundation::PWSTR, cchmaxvalchars: i32) -> ::windows::core::HRESULT; } GetThemeDocumentationProperty(pszthemename.into_param().abi(), pszpropertyname.into_param().abi(), ::core::mem::transmute(pszvaluebuff), ::core::mem::transmute(cchmaxvalchars)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeEnumValue(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeEnumValue(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, pival: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeEnumValue(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetThemeFilename(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, pszthemefilename: super::super::Foundation::PWSTR, cchmaxbuffchars: i32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeFilename(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, pszthemefilename: super::super::Foundation::PWSTR, cchmaxbuffchars: i32) -> ::windows::core::HRESULT; } GetThemeFilename(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), ::core::mem::transmute(pszthemefilename), ::core::mem::transmute(cchmaxbuffchars)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn GetThemeFont<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, ipropid: i32) -> ::windows::core::Result<super::super::Graphics::Gdi::LOGFONTW> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeFont(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, ipropid: i32, pfont: *mut super::super::Graphics::Gdi::LOGFONTW) -> ::windows::core::HRESULT; } let mut result__: <super::super::Graphics::Gdi::LOGFONTW as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeFont(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), &mut result__).from_abi::<super::super::Graphics::Gdi::LOGFONTW>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeInt(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeInt(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, pival: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeInt(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeIntList(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32) -> ::windows::core::Result<INTLIST> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeIntList(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, pintlist: *mut INTLIST) -> ::windows::core::HRESULT; } let mut result__: <INTLIST as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeIntList(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), &mut result__).from_abi::<INTLIST>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn GetThemeMargins<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, ipropid: i32, prc: *const super::super::Foundation::RECT) -> ::windows::core::Result<MARGINS> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeMargins(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, ipropid: i32, prc: *const super::super::Foundation::RECT, pmargins: *mut MARGINS) -> ::windows::core::HRESULT; } let mut result__: <MARGINS as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeMargins(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), ::core::mem::transmute(prc), &mut result__).from_abi::<MARGINS>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn GetThemeMetric<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, ipropid: THEME_PROPERTY_SYMBOL_ID) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeMetric(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, ipropid: THEME_PROPERTY_SYMBOL_ID, pival: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeMetric(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn GetThemePartSize<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, prc: *const super::super::Foundation::RECT, esize: THEMESIZE) -> ::windows::core::Result<super::super::Foundation::SIZE> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemePartSize(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, prc: *const super::super::Foundation::RECT, esize: THEMESIZE, psz: *mut super::super::Foundation::SIZE) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::SIZE as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemePartSize(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(prc), ::core::mem::transmute(esize), &mut result__).from_abi::<super::super::Foundation::SIZE>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetThemePosition(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32) -> ::windows::core::Result<super::super::Foundation::POINT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemePosition(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, ppoint: *mut super::super::Foundation::POINT) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::POINT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemePosition(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), &mut result__).from_abi::<super::super::Foundation::POINT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemePropertyOrigin(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32) -> ::windows::core::Result<PROPERTYORIGIN> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemePropertyOrigin(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, porigin: *mut PROPERTYORIGIN) -> ::windows::core::HRESULT; } let mut result__: <PROPERTYORIGIN as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemePropertyOrigin(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), &mut result__).from_abi::<PROPERTYORIGIN>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetThemeRect(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32) -> ::windows::core::Result<super::super::Foundation::RECT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeRect(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, prect: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeRect(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), &mut result__).from_abi::<super::super::Foundation::RECT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetThemeStream<'a, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::HINSTANCE>>(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, ppvstream: *mut *mut ::core::ffi::c_void, pcbstream: *mut u32, hinst: Param6) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeStream(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, ppvstream: *mut *mut ::core::ffi::c_void, pcbstream: *mut u32, hinst: super::super::Foundation::HINSTANCE) -> ::windows::core::HRESULT; } GetThemeStream(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), ::core::mem::transmute(ppvstream), ::core::mem::transmute(pcbstream), hinst.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetThemeString(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, pszbuff: super::super::Foundation::PWSTR, cchmaxbuffchars: i32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeString(htheme: isize, ipartid: i32, istateid: i32, ipropid: i32, pszbuff: super::super::Foundation::PWSTR, cchmaxbuffchars: i32) -> ::windows::core::HRESULT; } GetThemeString(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(ipropid), ::core::mem::transmute(pszbuff), ::core::mem::transmute(cchmaxbuffchars)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetThemeSysBool(htheme: isize, iboolid: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeSysBool(htheme: isize, iboolid: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(GetThemeSysBool(::core::mem::transmute(htheme), ::core::mem::transmute(iboolid))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeSysColor(htheme: isize, icolorid: i32) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeSysColor(htheme: isize, icolorid: i32) -> u32; } ::core::mem::transmute(GetThemeSysColor(::core::mem::transmute(htheme), ::core::mem::transmute(icolorid))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn GetThemeSysColorBrush(htheme: isize, icolorid: THEME_PROPERTY_SYMBOL_ID) -> super::super::Graphics::Gdi::HBRUSH { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeSysColorBrush(htheme: isize, icolorid: THEME_PROPERTY_SYMBOL_ID) -> super::super::Graphics::Gdi::HBRUSH; } ::core::mem::transmute(GetThemeSysColorBrush(::core::mem::transmute(htheme), ::core::mem::transmute(icolorid))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn GetThemeSysFont(htheme: isize, ifontid: THEME_PROPERTY_SYMBOL_ID) -> ::windows::core::Result<super::super::Graphics::Gdi::LOGFONTW> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeSysFont(htheme: isize, ifontid: THEME_PROPERTY_SYMBOL_ID, plf: *mut super::super::Graphics::Gdi::LOGFONTW) -> ::windows::core::HRESULT; } let mut result__: <super::super::Graphics::Gdi::LOGFONTW as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeSysFont(::core::mem::transmute(htheme), ::core::mem::transmute(ifontid), &mut result__).from_abi::<super::super::Graphics::Gdi::LOGFONTW>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeSysInt(htheme: isize, iintid: i32) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeSysInt(htheme: isize, iintid: i32, pivalue: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeSysInt(::core::mem::transmute(htheme), ::core::mem::transmute(iintid), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeSysSize(htheme: isize, isizeid: i32) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeSysSize(htheme: isize, isizeid: i32) -> i32; } ::core::mem::transmute(GetThemeSysSize(::core::mem::transmute(htheme), ::core::mem::transmute(isizeid))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetThemeSysString(htheme: isize, istringid: THEME_PROPERTY_SYMBOL_ID, pszstringbuff: super::super::Foundation::PWSTR, cchmaxstringchars: i32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeSysString(htheme: isize, istringid: THEME_PROPERTY_SYMBOL_ID, pszstringbuff: super::super::Foundation::PWSTR, cchmaxstringchars: i32) -> ::windows::core::HRESULT; } GetThemeSysString(::core::mem::transmute(htheme), ::core::mem::transmute(istringid), ::core::mem::transmute(pszstringbuff), ::core::mem::transmute(cchmaxstringchars)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn GetThemeTextExtent<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, psztext: Param4, cchcharcount: i32, dwtextflags: u32, pboundingrect: *const super::super::Foundation::RECT) -> ::windows::core::Result<super::super::Foundation::RECT> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeTextExtent(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, psztext: super::super::Foundation::PWSTR, cchcharcount: i32, dwtextflags: u32, pboundingrect: *const super::super::Foundation::RECT, pextentrect: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT; } let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeTextExtent(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), psztext.into_param().abi(), ::core::mem::transmute(cchcharcount), ::core::mem::transmute(dwtextflags), ::core::mem::transmute(pboundingrect), &mut result__).from_abi::<super::super::Foundation::RECT>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn GetThemeTextMetrics<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32) -> ::windows::core::Result<super::super::Graphics::Gdi::TEXTMETRICW> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeTextMetrics(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, ptm: *mut super::super::Graphics::Gdi::TEXTMETRICW) -> ::windows::core::HRESULT; } let mut result__: <super::super::Graphics::Gdi::TEXTMETRICW as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeTextMetrics(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), &mut result__).from_abi::<super::super::Graphics::Gdi::TEXTMETRICW>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeTimingFunction(htheme: isize, itimingfunctionid: i32, ptimingfunction: *mut TA_TIMINGFUNCTION, cbsize: u32, pcbsizeout: *mut u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeTimingFunction(htheme: isize, itimingfunctionid: i32, ptimingfunction: *mut TA_TIMINGFUNCTION, cbsize: u32, pcbsizeout: *mut u32) -> ::windows::core::HRESULT; } GetThemeTimingFunction(::core::mem::transmute(htheme), ::core::mem::transmute(itimingfunctionid), ::core::mem::transmute(ptimingfunction), ::core::mem::transmute(cbsize), ::core::mem::transmute(pcbsizeout)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn GetThemeTransitionDuration(htheme: isize, ipartid: i32, istateidfrom: i32, istateidto: i32, ipropid: i32) -> ::windows::core::Result<u32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetThemeTransitionDuration(htheme: isize, ipartid: i32, istateidfrom: i32, istateidto: i32, ipropid: i32, pdwduration: *mut u32) -> ::windows::core::HRESULT; } let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); GetThemeTransitionDuration(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateidfrom), ::core::mem::transmute(istateidto), ::core::mem::transmute(ipropid), &mut result__).from_abi::<u32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetWindowFeedbackSetting<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0, feedback: FEEDBACK_TYPE, dwflags: u32, psize: *mut u32, config: *mut ::core::ffi::c_void) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetWindowFeedbackSetting(hwnd: super::super::Foundation::HWND, feedback: FEEDBACK_TYPE, dwflags: u32, psize: *mut u32, config: *mut ::core::ffi::c_void) -> super::super::Foundation::BOOL; } ::core::mem::transmute(GetWindowFeedbackSetting(hwnd.into_param().abi(), ::core::mem::transmute(feedback), ::core::mem::transmute(dwflags), ::core::mem::transmute(psize), ::core::mem::transmute(config))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn GetWindowTheme<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0) -> isize { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn GetWindowTheme(hwnd: super::super::Foundation::HWND) -> isize; } ::core::mem::transmute(GetWindowTheme(hwnd.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 HALIGN(pub i32); pub const HA_LEFT: HALIGN = HALIGN(0i32); pub const HA_CENTER: HALIGN = HALIGN(1i32); pub const HA_RIGHT: HALIGN = HALIGN(2i32); impl ::core::convert::From<i32> for HALIGN { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for HALIGN { type Abi = Self; } pub const HDFT_HASNOVALUE: u32 = 32768u32; pub const HDFT_ISDATE: u32 = 2u32; pub const HDFT_ISNUMBER: u32 = 1u32; pub const HDFT_ISSTRING: u32 = 0u32; pub const HDF_BITMAP: u32 = 8192u32; pub const HDF_BITMAP_ON_RIGHT: u32 = 4096u32; pub const HDF_CENTER: u32 = 2u32; pub const HDF_CHECKBOX: u32 = 64u32; pub const HDF_CHECKED: u32 = 128u32; pub const HDF_FIXEDWIDTH: u32 = 256u32; pub const HDF_IMAGE: u32 = 2048u32; pub const HDF_JUSTIFYMASK: u32 = 3u32; pub const HDF_LEFT: u32 = 0u32; pub const HDF_OWNERDRAW: u32 = 32768u32; pub const HDF_RIGHT: u32 = 1u32; pub const HDF_RTLREADING: u32 = 4u32; pub const HDF_SORTDOWN: u32 = 512u32; pub const HDF_SORTUP: u32 = 1024u32; pub const HDF_SPLITBUTTON: u32 = 16777216u32; pub const HDF_STRING: u32 = 16384u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct HDHITTESTINFO { pub pt: super::super::Foundation::POINT, pub flags: u32, pub iItem: i32, } #[cfg(feature = "Win32_Foundation")] impl HDHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for HDHITTESTINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for HDHITTESTINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("HDHITTESTINFO").field("pt", &self.pt).field("flags", &self.flags).field("iItem", &self.iItem).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for HDHITTESTINFO { fn eq(&self, other: &Self) -> bool { self.pt == other.pt && self.flags == other.flags && self.iItem == other.iItem } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for HDHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for HDHITTESTINFO { type Abi = Self; } pub const HDIS_FOCUSED: u32 = 1u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct HDITEMA { pub mask: HDI_MASK, pub cxy: i32, pub pszText: super::super::Foundation::PSTR, pub hbm: super::super::Graphics::Gdi::HBITMAP, pub cchTextMax: i32, pub fmt: i32, pub lParam: super::super::Foundation::LPARAM, pub iImage: i32, pub iOrder: i32, pub r#type: u32, pub pvFilter: *mut ::core::ffi::c_void, pub state: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl HDITEMA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for HDITEMA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for HDITEMA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("HDITEMA") .field("mask", &self.mask) .field("cxy", &self.cxy) .field("pszText", &self.pszText) .field("hbm", &self.hbm) .field("cchTextMax", &self.cchTextMax) .field("fmt", &self.fmt) .field("lParam", &self.lParam) .field("iImage", &self.iImage) .field("iOrder", &self.iOrder) .field("r#type", &self.r#type) .field("pvFilter", &self.pvFilter) .field("state", &self.state) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for HDITEMA { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.cxy == other.cxy && self.pszText == other.pszText && self.hbm == other.hbm && self.cchTextMax == other.cchTextMax && self.fmt == other.fmt && self.lParam == other.lParam && self.iImage == other.iImage && self.iOrder == other.iOrder && self.r#type == other.r#type && self.pvFilter == other.pvFilter && self.state == other.state } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for HDITEMA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for HDITEMA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct HDITEMW { pub mask: HDI_MASK, pub cxy: i32, pub pszText: super::super::Foundation::PWSTR, pub hbm: super::super::Graphics::Gdi::HBITMAP, pub cchTextMax: i32, pub fmt: i32, pub lParam: super::super::Foundation::LPARAM, pub iImage: i32, pub iOrder: i32, pub r#type: u32, pub pvFilter: *mut ::core::ffi::c_void, pub state: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl HDITEMW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for HDITEMW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for HDITEMW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("HDITEMW") .field("mask", &self.mask) .field("cxy", &self.cxy) .field("pszText", &self.pszText) .field("hbm", &self.hbm) .field("cchTextMax", &self.cchTextMax) .field("fmt", &self.fmt) .field("lParam", &self.lParam) .field("iImage", &self.iImage) .field("iOrder", &self.iOrder) .field("r#type", &self.r#type) .field("pvFilter", &self.pvFilter) .field("state", &self.state) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for HDITEMW { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.cxy == other.cxy && self.pszText == other.pszText && self.hbm == other.hbm && self.cchTextMax == other.cchTextMax && self.fmt == other.fmt && self.lParam == other.lParam && self.iImage == other.iImage && self.iOrder == other.iOrder && self.r#type == other.r#type && self.pvFilter == other.pvFilter && self.state == other.state } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for HDITEMW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for HDITEMW { 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 HDI_MASK(pub u32); pub const HDI_WIDTH: HDI_MASK = HDI_MASK(1u32); pub const HDI_HEIGHT: HDI_MASK = HDI_MASK(1u32); pub const HDI_TEXT: HDI_MASK = HDI_MASK(2u32); pub const HDI_FORMAT: HDI_MASK = HDI_MASK(4u32); pub const HDI_LPARAM: HDI_MASK = HDI_MASK(8u32); pub const HDI_BITMAP: HDI_MASK = HDI_MASK(16u32); pub const HDI_IMAGE: HDI_MASK = HDI_MASK(32u32); pub const HDI_DI_SETITEM: HDI_MASK = HDI_MASK(64u32); pub const HDI_ORDER: HDI_MASK = HDI_MASK(128u32); pub const HDI_FILTER: HDI_MASK = HDI_MASK(256u32); pub const HDI_STATE: HDI_MASK = HDI_MASK(512u32); impl ::core::convert::From<u32> for HDI_MASK { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for HDI_MASK { type Abi = Self; } impl ::core::ops::BitOr for HDI_MASK { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for HDI_MASK { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for HDI_MASK { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for HDI_MASK { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for HDI_MASK { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub struct HDLAYOUT { pub prc: *mut super::super::Foundation::RECT, pub pwpos: *mut super::WindowsAndMessaging::WINDOWPOS, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl HDLAYOUT {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for HDLAYOUT { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::fmt::Debug for HDLAYOUT { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("HDLAYOUT").field("prc", &self.prc).field("pwpos", &self.pwpos).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for HDLAYOUT { fn eq(&self, other: &Self) -> bool { self.prc == other.prc && self.pwpos == other.pwpos } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for HDLAYOUT {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for HDLAYOUT { type Abi = Self; } pub const HDM_CLEARFILTER: u32 = 4632u32; pub const HDM_CREATEDRAGIMAGE: u32 = 4624u32; pub const HDM_DELETEITEM: u32 = 4610u32; pub const HDM_EDITFILTER: u32 = 4631u32; pub const HDM_FIRST: u32 = 4608u32; pub const HDM_GETBITMAPMARGIN: u32 = 4629u32; pub const HDM_GETFOCUSEDITEM: u32 = 4635u32; pub const HDM_GETIMAGELIST: u32 = 4617u32; pub const HDM_GETITEM: u32 = 4619u32; pub const HDM_GETITEMA: u32 = 4611u32; pub const HDM_GETITEMCOUNT: u32 = 4608u32; pub const HDM_GETITEMDROPDOWNRECT: u32 = 4633u32; pub const HDM_GETITEMRECT: u32 = 4615u32; pub const HDM_GETITEMW: u32 = 4619u32; pub const HDM_GETORDERARRAY: u32 = 4625u32; pub const HDM_GETOVERFLOWRECT: u32 = 4634u32; pub const HDM_GETUNICODEFORMAT: u32 = 8198u32; pub const HDM_HITTEST: u32 = 4614u32; pub const HDM_INSERTITEM: u32 = 4618u32; pub const HDM_INSERTITEMA: u32 = 4609u32; pub const HDM_INSERTITEMW: u32 = 4618u32; pub const HDM_LAYOUT: u32 = 4613u32; pub const HDM_ORDERTOINDEX: u32 = 4623u32; pub const HDM_SETBITMAPMARGIN: u32 = 4628u32; pub const HDM_SETFILTERCHANGETIMEOUT: u32 = 4630u32; pub const HDM_SETFOCUSEDITEM: u32 = 4636u32; pub const HDM_SETHOTDIVIDER: u32 = 4627u32; pub const HDM_SETIMAGELIST: u32 = 4616u32; pub const HDM_SETITEM: u32 = 4620u32; pub const HDM_SETITEMA: u32 = 4612u32; pub const HDM_SETITEMW: u32 = 4620u32; pub const HDM_SETORDERARRAY: u32 = 4626u32; pub const HDM_SETUNICODEFORMAT: u32 = 8197u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy, :: core :: fmt :: Debug, :: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] #[repr(transparent)] pub struct HDPA(pub isize); impl ::core::default::Default for HDPA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } unsafe impl ::windows::core::Handle for HDPA {} unsafe impl ::windows::core::Abi for HDPA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy, :: core :: fmt :: Debug, :: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] #[repr(transparent)] pub struct HDSA(pub isize); impl ::core::default::Default for HDSA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } unsafe impl ::windows::core::Handle for HDSA {} unsafe impl ::windows::core::Abi for HDSA { type Abi = Self; } pub const HDSIL_NORMAL: u32 = 0u32; pub const HDSIL_STATE: u32 = 1u32; pub const HDS_BUTTONS: u32 = 2u32; pub const HDS_CHECKBOXES: u32 = 1024u32; pub const HDS_DRAGDROP: u32 = 64u32; pub const HDS_FILTERBAR: u32 = 256u32; pub const HDS_FLAT: u32 = 512u32; pub const HDS_FULLDRAG: u32 = 128u32; pub const HDS_HIDDEN: u32 = 8u32; pub const HDS_HORZ: u32 = 0u32; pub const HDS_HOTTRACK: u32 = 4u32; pub const HDS_NOSIZING: u32 = 2048u32; pub const HDS_OVERFLOW: u32 = 4096u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct HD_TEXTFILTERA { pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, } #[cfg(feature = "Win32_Foundation")] impl HD_TEXTFILTERA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for HD_TEXTFILTERA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for HD_TEXTFILTERA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("HD_TEXTFILTERA").field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for HD_TEXTFILTERA { fn eq(&self, other: &Self) -> bool { self.pszText == other.pszText && self.cchTextMax == other.cchTextMax } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for HD_TEXTFILTERA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for HD_TEXTFILTERA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct HD_TEXTFILTERW { pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, } #[cfg(feature = "Win32_Foundation")] impl HD_TEXTFILTERW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for HD_TEXTFILTERW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for HD_TEXTFILTERW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("HD_TEXTFILTERW").field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for HD_TEXTFILTERW { fn eq(&self, other: &Self) -> bool { self.pszText == other.pszText && self.cchTextMax == other.cchTextMax } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for HD_TEXTFILTERW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for HD_TEXTFILTERW { 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 HEADER_CONTROL_NOTIFICATION_BUTTON(pub u32); pub const HEADER_CONTROL_NOTIFICATION_BUTTON_LEFT: HEADER_CONTROL_NOTIFICATION_BUTTON = HEADER_CONTROL_NOTIFICATION_BUTTON(0u32); pub const HEADER_CONTROL_NOTIFICATION_BUTTON_RIGHT: HEADER_CONTROL_NOTIFICATION_BUTTON = HEADER_CONTROL_NOTIFICATION_BUTTON(1u32); pub const HEADER_CONTROL_NOTIFICATION_BUTTON_MIDDLE: HEADER_CONTROL_NOTIFICATION_BUTTON = HEADER_CONTROL_NOTIFICATION_BUTTON(2u32); impl ::core::convert::From<u32> for HEADER_CONTROL_NOTIFICATION_BUTTON { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for HEADER_CONTROL_NOTIFICATION_BUTTON { type Abi = Self; } impl ::core::ops::BitOr for HEADER_CONTROL_NOTIFICATION_BUTTON { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for HEADER_CONTROL_NOTIFICATION_BUTTON { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for HEADER_CONTROL_NOTIFICATION_BUTTON { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for HEADER_CONTROL_NOTIFICATION_BUTTON { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for HEADER_CONTROL_NOTIFICATION_BUTTON { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const HHT_ABOVE: u32 = 256u32; pub const HHT_BELOW: u32 = 512u32; pub const HHT_NOWHERE: u32 = 1u32; pub const HHT_ONDIVIDER: u32 = 4u32; pub const HHT_ONDIVOPEN: u32 = 8u32; pub const HHT_ONDROPDOWN: u32 = 8192u32; pub const HHT_ONFILTER: u32 = 16u32; pub const HHT_ONFILTERBUTTON: u32 = 32u32; pub const HHT_ONHEADER: u32 = 2u32; pub const HHT_ONITEMSTATEICON: u32 = 4096u32; pub const HHT_ONOVERFLOW: u32 = 16384u32; pub const HHT_TOLEFT: u32 = 2048u32; pub const HHT_TORIGHT: u32 = 1024u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy, :: core :: fmt :: Debug, :: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] #[repr(transparent)] pub struct HIMAGELIST(pub isize); impl ::core::default::Default for HIMAGELIST { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } unsafe impl ::windows::core::Handle for HIMAGELIST {} unsafe impl ::windows::core::Abi for HIMAGELIST { type Abi = Self; } #[inline] pub unsafe fn HIMAGELIST_QueryInterface<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn HIMAGELIST_QueryInterface(himl: HIMAGELIST, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } HIMAGELIST_QueryInterface(himl.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(ppv)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const HIST_ADDTOFAVORITES: u32 = 3u32; pub const HIST_BACK: u32 = 0u32; pub const HIST_FAVORITES: u32 = 2u32; pub const HIST_FORWARD: u32 = 1u32; pub const HIST_VIEWTREE: u32 = 4u32; pub const HKCOMB_A: u32 = 8u32; pub const HKCOMB_C: u32 = 4u32; pub const HKCOMB_CA: u32 = 64u32; pub const HKCOMB_NONE: u32 = 1u32; pub const HKCOMB_S: u32 = 2u32; pub const HKCOMB_SA: u32 = 32u32; pub const HKCOMB_SC: u32 = 16u32; pub const HKCOMB_SCA: u32 = 128u32; pub const HKM_GETHOTKEY: u32 = 1026u32; pub const HKM_SETHOTKEY: u32 = 1025u32; pub const HKM_SETRULES: u32 = 1027u32; pub const HOTKEYF_ALT: u32 = 4u32; pub const HOTKEYF_CONTROL: u32 = 2u32; pub const HOTKEYF_EXT: u32 = 128u32; pub const HOTKEYF_SHIFT: u32 = 1u32; pub const HOVER_DEFAULT: u32 = 4294967295u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy, :: core :: fmt :: Debug, :: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] #[repr(transparent)] pub struct HPROPSHEETPAGE(pub isize); impl ::core::default::Default for HPROPSHEETPAGE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } unsafe impl ::windows::core::Handle for HPROPSHEETPAGE {} unsafe impl ::windows::core::Abi for HPROPSHEETPAGE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy, :: core :: fmt :: Debug, :: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] #[repr(transparent)] pub struct HSYNTHETICPOINTERDEVICE(pub isize); impl ::core::default::Default for HSYNTHETICPOINTERDEVICE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } unsafe impl ::windows::core::Handle for HSYNTHETICPOINTERDEVICE {} unsafe impl ::windows::core::Abi for HSYNTHETICPOINTERDEVICE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy, :: core :: fmt :: Debug, :: core :: cmp :: PartialEq, :: core :: cmp :: Eq)] #[repr(transparent)] pub struct HTREEITEM(pub isize); impl ::core::default::Default for HTREEITEM { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } unsafe impl ::windows::core::Handle for HTREEITEM {} unsafe impl ::windows::core::Abi for HTREEITEM { type Abi = Self; } pub const HTTB_BACKGROUNDSEG: u32 = 0u32; pub const HTTB_CAPTION: u32 = 4u32; pub const HTTB_FIXEDBORDER: u32 = 2u32; pub const HTTB_RESIZINGBORDER_BOTTOM: u32 = 128u32; pub const HTTB_RESIZINGBORDER_LEFT: u32 = 16u32; pub const HTTB_RESIZINGBORDER_RIGHT: u32 = 64u32; pub const HTTB_RESIZINGBORDER_TOP: u32 = 32u32; pub const HTTB_SIZINGTEMPLATE: u32 = 256u32; pub const HTTB_SYSTEMSIZINGMARGINS: u32 = 512u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct HYPERLINKSTATES(pub i32); pub const HLS_NORMALTEXT: HYPERLINKSTATES = HYPERLINKSTATES(1i32); pub const HLS_LINKTEXT: HYPERLINKSTATES = HYPERLINKSTATES(2i32); impl ::core::convert::From<i32> for HYPERLINKSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for HYPERLINKSTATES { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn HitTestThemeBackground<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>, Param6: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HRGN>, Param7: ::windows::core::IntoParam<'a, super::super::Foundation::POINT>>(htheme: isize, hdc: Param1, ipartid: i32, istateid: i32, dwoptions: u32, prect: *const super::super::Foundation::RECT, hrgn: Param6, pttest: Param7) -> ::windows::core::Result<u16> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn HitTestThemeBackground(htheme: isize, hdc: super::super::Graphics::Gdi::HDC, ipartid: i32, istateid: i32, dwoptions: u32, prect: *const super::super::Foundation::RECT, hrgn: super::super::Graphics::Gdi::HRGN, pttest: super::super::Foundation::POINT, pwhittestcode: *mut u16) -> ::windows::core::HRESULT; } let mut result__: <u16 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); HitTestThemeBackground(::core::mem::transmute(htheme), hdc.into_param().abi(), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid), ::core::mem::transmute(dwoptions), ::core::mem::transmute(prect), hrgn.into_param().abi(), pttest.into_param().abi(), &mut result__).from_abi::<u16>(result__) } #[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 ICONEFFECT(pub i32); pub const ICE_NONE: ICONEFFECT = ICONEFFECT(0i32); pub const ICE_GLOW: ICONEFFECT = ICONEFFECT(1i32); pub const ICE_SHADOW: ICONEFFECT = ICONEFFECT(2i32); pub const ICE_PULSE: ICONEFFECT = ICONEFFECT(3i32); pub const ICE_ALPHA: ICONEFFECT = ICONEFFECT(4i32); impl ::core::convert::From<i32> for ICONEFFECT { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for ICONEFFECT { type Abi = Self; } pub const IDB_HIST_DISABLED: u32 = 14u32; pub const IDB_HIST_HOT: u32 = 13u32; pub const IDB_HIST_LARGE_COLOR: u32 = 9u32; pub const IDB_HIST_NORMAL: u32 = 12u32; pub const IDB_HIST_PRESSED: u32 = 15u32; pub const IDB_HIST_SMALL_COLOR: u32 = 8u32; pub const IDB_STD_LARGE_COLOR: u32 = 1u32; pub const IDB_STD_SMALL_COLOR: u32 = 0u32; pub const IDB_VIEW_LARGE_COLOR: u32 = 5u32; pub const IDB_VIEW_SMALL_COLOR: u32 = 4u32; pub const IDC_MANAGE_LINK: u32 = 1592u32; pub const ID_PSRESTARTWINDOWS: u32 = 2u32; #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IImageList(pub ::windows::core::IUnknown); impl IImageList { #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn Add<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>>(&self, hbmimage: Param0, hbmmask: Param1) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), hbmimage.into_param().abi(), hbmmask.into_param().abi(), &mut result__).from_abi::<i32>(result__) } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe fn ReplaceIcon<'a, Param1: ::windows::core::IntoParam<'a, super::WindowsAndMessaging::HICON>>(&self, i: i32, hicon: Param1) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), hicon.into_param().abi(), &mut result__).from_abi::<i32>(result__) } pub unsafe fn SetOverlayImage(&self, iimage: i32, ioverlay: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(iimage), ::core::mem::transmute(ioverlay)).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn Replace<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>, Param2: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>>(&self, i: i32, hbmimage: Param1, hbmmask: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), hbmimage.into_param().abi(), hbmmask.into_param().abi()).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn AddMasked<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>>(&self, hbmimage: Param0, crmask: u32) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), hbmimage.into_param().abi(), ::core::mem::transmute(crmask), &mut result__).from_abi::<i32>(result__) } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn Draw(&self, pimldp: *const IMAGELISTDRAWPARAMS) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(pimldp)).ok() } pub unsafe fn Remove(&self, i: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(i)).ok() } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe fn GetIcon(&self, i: i32, flags: u32) -> ::windows::core::Result<super::WindowsAndMessaging::HICON> { let mut result__: <super::WindowsAndMessaging::HICON as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), ::core::mem::transmute(flags), &mut result__).from_abi::<super::WindowsAndMessaging::HICON>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe fn GetImageInfo(&self, i: i32) -> ::windows::core::Result<IMAGEINFO> { let mut result__: <IMAGEINFO as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), &mut result__).from_abi::<IMAGEINFO>(result__) } pub unsafe fn Copy<'a, Param1: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, idst: i32, punksrc: Param1, isrc: i32, uflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(idst), punksrc.into_param().abi(), ::core::mem::transmute(isrc), ::core::mem::transmute(uflags)).ok() } pub unsafe fn Merge<'a, Param1: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, i1: i32, punk2: Param1, i2: i32, dx: i32, dy: i32, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(i1), punk2.into_param().abi(), ::core::mem::transmute(i2), ::core::mem::transmute(dx), ::core::mem::transmute(dy), ::core::mem::transmute(riid), ::core::mem::transmute(ppv)).ok() } pub unsafe fn Clone(&self, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(riid), ::core::mem::transmute(ppv)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetImageRect(&self, i: i32) -> ::windows::core::Result<super::super::Foundation::RECT> { let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), &mut result__).from_abi::<super::super::Foundation::RECT>(result__) } pub unsafe fn GetIconSize(&self, cx: *mut i32, cy: *mut i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(cx), ::core::mem::transmute(cy)).ok() } pub unsafe fn SetIconSize(&self, cx: i32, cy: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(cx), ::core::mem::transmute(cy)).ok() } pub unsafe fn GetImageCount(&self) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), &mut result__).from_abi::<i32>(result__) } pub unsafe fn SetImageCount(&self, unewcount: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(unewcount)).ok() } pub unsafe fn SetBkColor(&self, clrbk: u32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(clrbk), &mut result__).from_abi::<u32>(result__) } pub unsafe fn GetBkColor(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } pub unsafe fn BeginDrag(&self, itrack: i32, dxhotspot: i32, dyhotspot: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(itrack), ::core::mem::transmute(dxhotspot), ::core::mem::transmute(dyhotspot)).ok() } pub unsafe fn EndDrag(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn DragEnter<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(&self, hwndlock: Param0, x: i32, y: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), hwndlock.into_param().abi(), ::core::mem::transmute(x), ::core::mem::transmute(y)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn DragLeave<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(&self, hwndlock: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), hwndlock.into_param().abi()).ok() } pub unsafe fn DragMove(&self, x: i32, y: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), ::core::mem::transmute(x), ::core::mem::transmute(y)).ok() } pub unsafe fn SetDragCursorImage<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, punk: Param0, idrag: i32, dxhotspot: i32, dyhotspot: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), punk.into_param().abi(), ::core::mem::transmute(idrag), ::core::mem::transmute(dxhotspot), ::core::mem::transmute(dyhotspot)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn DragShowNolock<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fshow: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), fshow.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetDragImage(&self, ppt: *mut super::super::Foundation::POINT, ppthotspot: *mut super::super::Foundation::POINT, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), ::core::mem::transmute(ppt), ::core::mem::transmute(ppthotspot), ::core::mem::transmute(riid), ::core::mem::transmute(ppv)).ok() } pub unsafe fn GetItemFlags(&self, i: i32) -> ::windows::core::Result<IMAGE_LIST_ITEM_FLAGS> { let mut result__: <IMAGE_LIST_ITEM_FLAGS as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), &mut result__).from_abi::<IMAGE_LIST_ITEM_FLAGS>(result__) } pub unsafe fn GetOverlayImage(&self, ioverlay: i32) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), ::core::mem::transmute(ioverlay), &mut result__).from_abi::<i32>(result__) } } unsafe impl ::windows::core::Interface for IImageList { type Vtable = IImageList_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x46eb5926_582e_4017_9fdf_e8998daa0950); } impl ::core::convert::From<IImageList> for ::windows::core::IUnknown { fn from(value: IImageList) -> Self { value.0 } } impl ::core::convert::From<&IImageList> for ::windows::core::IUnknown { fn from(value: &IImageList) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IImageList { 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 IImageList { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } #[repr(C)] #[doc(hidden)] pub struct IImageList_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hbmimage: super::super::Graphics::Gdi::HBITMAP, hbmmask: super::super::Graphics::Gdi::HBITMAP, pi: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, hicon: super::WindowsAndMessaging::HICON, pi: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_UI_WindowsAndMessaging"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iimage: i32, ioverlay: i32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, hbmimage: super::super::Graphics::Gdi::HBITMAP, hbmmask: super::super::Graphics::Gdi::HBITMAP) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hbmimage: super::super::Graphics::Gdi::HBITMAP, crmask: u32, pi: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pimldp: *const IMAGELISTDRAWPARAMS) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, flags: u32, picon: *mut super::WindowsAndMessaging::HICON) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_UI_WindowsAndMessaging"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, pimageinfo: *mut IMAGEINFO) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, idst: i32, punksrc: ::windows::core::RawPtr, isrc: i32, uflags: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i1: i32, punk2: ::windows::core::RawPtr, i2: i32, dx: i32, dy: i32, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, prc: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cx: *mut i32, cy: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cx: i32, cy: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pi: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unewcount: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clrbk: u32, pclr: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pclr: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, itrack: i32, dxhotspot: i32, dyhotspot: i32) -> ::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, hwndlock: super::super::Foundation::HWND, x: i32, y: i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hwndlock: super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, x: i32, y: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, punk: ::windows::core::RawPtr, idrag: i32, dxhotspot: i32, dyhotspot: i32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fshow: 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, ppt: *mut super::super::Foundation::POINT, ppthotspot: *mut super::super::Foundation::POINT, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, dwflags: *mut IMAGE_LIST_ITEM_FLAGS) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ioverlay: i32, piindex: *mut i32) -> ::windows::core::HRESULT, ); #[repr(transparent)] #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: clone :: Clone, :: core :: fmt :: Debug)] pub struct IImageList2(pub ::windows::core::IUnknown); impl IImageList2 { #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn Add<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>>(&self, hbmimage: Param0, hbmmask: Param1) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).3)(::core::mem::transmute_copy(self), hbmimage.into_param().abi(), hbmmask.into_param().abi(), &mut result__).from_abi::<i32>(result__) } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe fn ReplaceIcon<'a, Param1: ::windows::core::IntoParam<'a, super::WindowsAndMessaging::HICON>>(&self, i: i32, hicon: Param1) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).4)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), hicon.into_param().abi(), &mut result__).from_abi::<i32>(result__) } pub unsafe fn SetOverlayImage(&self, iimage: i32, ioverlay: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).5)(::core::mem::transmute_copy(self), ::core::mem::transmute(iimage), ::core::mem::transmute(ioverlay)).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn Replace<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>, Param2: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>>(&self, i: i32, hbmimage: Param1, hbmmask: Param2) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).6)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), hbmimage.into_param().abi(), hbmmask.into_param().abi()).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn AddMasked<'a, Param0: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>>(&self, hbmimage: Param0, crmask: u32) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).7)(::core::mem::transmute_copy(self), hbmimage.into_param().abi(), ::core::mem::transmute(crmask), &mut result__).from_abi::<i32>(result__) } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn Draw(&self, pimldp: *const IMAGELISTDRAWPARAMS) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).8)(::core::mem::transmute_copy(self), ::core::mem::transmute(pimldp)).ok() } pub unsafe fn Remove(&self, i: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).9)(::core::mem::transmute_copy(self), ::core::mem::transmute(i)).ok() } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe fn GetIcon(&self, i: i32, flags: u32) -> ::windows::core::Result<super::WindowsAndMessaging::HICON> { let mut result__: <super::WindowsAndMessaging::HICON as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).10)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), ::core::mem::transmute(flags), &mut result__).from_abi::<super::WindowsAndMessaging::HICON>(result__) } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe fn GetImageInfo(&self, i: i32) -> ::windows::core::Result<IMAGEINFO> { let mut result__: <IMAGEINFO as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).11)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), &mut result__).from_abi::<IMAGEINFO>(result__) } pub unsafe fn Copy<'a, Param1: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, idst: i32, punksrc: Param1, isrc: i32, uflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).12)(::core::mem::transmute_copy(self), ::core::mem::transmute(idst), punksrc.into_param().abi(), ::core::mem::transmute(isrc), ::core::mem::transmute(uflags)).ok() } pub unsafe fn Merge<'a, Param1: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, i1: i32, punk2: Param1, i2: i32, dx: i32, dy: i32, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).13)(::core::mem::transmute_copy(self), ::core::mem::transmute(i1), punk2.into_param().abi(), ::core::mem::transmute(i2), ::core::mem::transmute(dx), ::core::mem::transmute(dy), ::core::mem::transmute(riid), ::core::mem::transmute(ppv)).ok() } pub unsafe fn Clone(&self, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).14)(::core::mem::transmute_copy(self), ::core::mem::transmute(riid), ::core::mem::transmute(ppv)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetImageRect(&self, i: i32) -> ::windows::core::Result<super::super::Foundation::RECT> { let mut result__: <super::super::Foundation::RECT as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).15)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), &mut result__).from_abi::<super::super::Foundation::RECT>(result__) } pub unsafe fn GetIconSize(&self, cx: *mut i32, cy: *mut i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).16)(::core::mem::transmute_copy(self), ::core::mem::transmute(cx), ::core::mem::transmute(cy)).ok() } pub unsafe fn SetIconSize(&self, cx: i32, cy: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).17)(::core::mem::transmute_copy(self), ::core::mem::transmute(cx), ::core::mem::transmute(cy)).ok() } pub unsafe fn GetImageCount(&self) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).18)(::core::mem::transmute_copy(self), &mut result__).from_abi::<i32>(result__) } pub unsafe fn SetImageCount(&self, unewcount: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).19)(::core::mem::transmute_copy(self), ::core::mem::transmute(unewcount)).ok() } pub unsafe fn SetBkColor(&self, clrbk: u32) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).20)(::core::mem::transmute_copy(self), ::core::mem::transmute(clrbk), &mut result__).from_abi::<u32>(result__) } pub unsafe fn GetBkColor(&self) -> ::windows::core::Result<u32> { let mut result__: <u32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).21)(::core::mem::transmute_copy(self), &mut result__).from_abi::<u32>(result__) } pub unsafe fn BeginDrag(&self, itrack: i32, dxhotspot: i32, dyhotspot: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).22)(::core::mem::transmute_copy(self), ::core::mem::transmute(itrack), ::core::mem::transmute(dxhotspot), ::core::mem::transmute(dyhotspot)).ok() } pub unsafe fn EndDrag(&self) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).23)(::core::mem::transmute_copy(self)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn DragEnter<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(&self, hwndlock: Param0, x: i32, y: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).24)(::core::mem::transmute_copy(self), hwndlock.into_param().abi(), ::core::mem::transmute(x), ::core::mem::transmute(y)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn DragLeave<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(&self, hwndlock: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).25)(::core::mem::transmute_copy(self), hwndlock.into_param().abi()).ok() } pub unsafe fn DragMove(&self, x: i32, y: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).26)(::core::mem::transmute_copy(self), ::core::mem::transmute(x), ::core::mem::transmute(y)).ok() } pub unsafe fn SetDragCursorImage<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, punk: Param0, idrag: i32, dxhotspot: i32, dyhotspot: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).27)(::core::mem::transmute_copy(self), punk.into_param().abi(), ::core::mem::transmute(idrag), ::core::mem::transmute(dxhotspot), ::core::mem::transmute(dyhotspot)).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn DragShowNolock<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(&self, fshow: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).28)(::core::mem::transmute_copy(self), fshow.into_param().abi()).ok() } #[cfg(feature = "Win32_Foundation")] pub unsafe fn GetDragImage(&self, ppt: *mut super::super::Foundation::POINT, ppthotspot: *mut super::super::Foundation::POINT, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).29)(::core::mem::transmute_copy(self), ::core::mem::transmute(ppt), ::core::mem::transmute(ppthotspot), ::core::mem::transmute(riid), ::core::mem::transmute(ppv)).ok() } pub unsafe fn GetItemFlags(&self, i: i32) -> ::windows::core::Result<IMAGE_LIST_ITEM_FLAGS> { let mut result__: <IMAGE_LIST_ITEM_FLAGS as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).30)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), &mut result__).from_abi::<IMAGE_LIST_ITEM_FLAGS>(result__) } pub unsafe fn GetOverlayImage(&self, ioverlay: i32) -> ::windows::core::Result<i32> { let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); (::windows::core::Interface::vtable(self).31)(::core::mem::transmute_copy(self), ::core::mem::transmute(ioverlay), &mut result__).from_abi::<i32>(result__) } pub unsafe fn Resize(&self, cxnewiconsize: i32, cynewiconsize: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).32)(::core::mem::transmute_copy(self), ::core::mem::transmute(cxnewiconsize), ::core::mem::transmute(cynewiconsize)).ok() } pub unsafe fn GetOriginalSize(&self, iimage: i32, dwflags: u32, pcx: *mut i32, pcy: *mut i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).33)(::core::mem::transmute_copy(self), ::core::mem::transmute(iimage), ::core::mem::transmute(dwflags), ::core::mem::transmute(pcx), ::core::mem::transmute(pcy)).ok() } pub unsafe fn SetOriginalSize(&self, iimage: i32, cx: i32, cy: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).34)(::core::mem::transmute_copy(self), ::core::mem::transmute(iimage), ::core::mem::transmute(cx), ::core::mem::transmute(cy)).ok() } pub unsafe fn SetCallback<'a, Param0: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, punk: Param0) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).35)(::core::mem::transmute_copy(self), punk.into_param().abi()).ok() } pub unsafe fn GetCallback(&self, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).36)(::core::mem::transmute_copy(self), ::core::mem::transmute(riid), ::core::mem::transmute(ppv)).ok() } pub unsafe fn ForceImagePresent(&self, iimage: i32, dwflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).37)(::core::mem::transmute_copy(self), ::core::mem::transmute(iimage), ::core::mem::transmute(dwflags)).ok() } pub unsafe fn DiscardImages(&self, ifirstimage: i32, ilastimage: i32, dwflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).38)(::core::mem::transmute_copy(self), ::core::mem::transmute(ifirstimage), ::core::mem::transmute(ilastimage), ::core::mem::transmute(dwflags)).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn PreloadImages(&self, pimldp: *const IMAGELISTDRAWPARAMS) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).39)(::core::mem::transmute_copy(self), ::core::mem::transmute(pimldp)).ok() } pub unsafe fn GetStatistics(&self, pils: *mut IMAGELISTSTATS) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).40)(::core::mem::transmute_copy(self), ::core::mem::transmute(pils)).ok() } pub unsafe fn Initialize(&self, cx: i32, cy: i32, flags: IMAGELIST_CREATION_FLAGS, cinitial: i32, cgrow: i32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).41)(::core::mem::transmute_copy(self), ::core::mem::transmute(cx), ::core::mem::transmute(cy), ::core::mem::transmute(flags), ::core::mem::transmute(cinitial), ::core::mem::transmute(cgrow)).ok() } #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe fn Replace2<'a, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>, Param2: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>, Param3: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, i: i32, hbmimage: Param1, hbmmask: Param2, punk: Param3, dwflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).42)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), hbmimage.into_param().abi(), hbmmask.into_param().abi(), punk.into_param().abi(), ::core::mem::transmute(dwflags)).ok() } pub unsafe fn ReplaceFromImageList<'a, Param1: ::windows::core::IntoParam<'a, IImageList>, Param3: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(&self, i: i32, pil: Param1, isrc: i32, punk: Param3, dwflags: u32) -> ::windows::core::Result<()> { (::windows::core::Interface::vtable(self).43)(::core::mem::transmute_copy(self), ::core::mem::transmute(i), pil.into_param().abi(), ::core::mem::transmute(isrc), punk.into_param().abi(), ::core::mem::transmute(dwflags)).ok() } } unsafe impl ::windows::core::Interface for IImageList2 { type Vtable = IImageList2_abi; const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x192b9d83_50fc_457b_90a0_2b82a8b5dae1); } impl ::core::convert::From<IImageList2> for ::windows::core::IUnknown { fn from(value: IImageList2) -> Self { value.0 } } impl ::core::convert::From<&IImageList2> for ::windows::core::IUnknown { fn from(value: &IImageList2) -> Self { value.0.clone() } } impl<'a> ::windows::core::IntoParam<'a, ::windows::core::IUnknown> for IImageList2 { 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 IImageList2 { fn into_param(self) -> ::windows::core::Param<'a, ::windows::core::IUnknown> { ::windows::core::Param::Borrowed(&self.0) } } impl ::core::convert::From<IImageList2> for IImageList { fn from(value: IImageList2) -> Self { unsafe { ::core::mem::transmute(value) } } } impl ::core::convert::From<&IImageList2> for IImageList { fn from(value: &IImageList2) -> Self { ::core::convert::From::from(::core::clone::Clone::clone(value)) } } impl<'a> ::windows::core::IntoParam<'a, IImageList> for IImageList2 { fn into_param(self) -> ::windows::core::Param<'a, IImageList> { ::windows::core::Param::Owned(unsafe { ::core::mem::transmute(self) }) } } impl<'a> ::windows::core::IntoParam<'a, IImageList> for &IImageList2 { fn into_param(self) -> ::windows::core::Param<'a, IImageList> { ::windows::core::Param::Borrowed(unsafe { ::core::mem::transmute(self) }) } } #[repr(C)] #[doc(hidden)] pub struct IImageList2_abi( pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iid: &::windows::core::GUID, interface: *mut ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, pub unsafe extern "system" fn(this: ::windows::core::RawPtr) -> u32, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hbmimage: super::super::Graphics::Gdi::HBITMAP, hbmmask: super::super::Graphics::Gdi::HBITMAP, pi: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, hicon: super::WindowsAndMessaging::HICON, pi: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_UI_WindowsAndMessaging"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iimage: i32, ioverlay: i32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, hbmimage: super::super::Graphics::Gdi::HBITMAP, hbmmask: super::super::Graphics::Gdi::HBITMAP) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hbmimage: super::super::Graphics::Gdi::HBITMAP, crmask: u32, pi: *mut i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pimldp: *const IMAGELISTDRAWPARAMS) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_UI_WindowsAndMessaging")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, flags: u32, picon: *mut super::WindowsAndMessaging::HICON) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_UI_WindowsAndMessaging"))] usize, #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, pimageinfo: *mut IMAGEINFO) -> ::windows::core::HRESULT, #[cfg(not(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi")))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, idst: i32, punksrc: ::windows::core::RawPtr, isrc: i32, uflags: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i1: i32, punk2: ::windows::core::RawPtr, i2: i32, dx: i32, dy: i32, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, prc: *mut super::super::Foundation::RECT) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cx: *mut i32, cy: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cx: i32, cy: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pi: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, unewcount: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, clrbk: u32, pclr: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pclr: *mut u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, itrack: i32, dxhotspot: i32, dyhotspot: i32) -> ::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, hwndlock: super::super::Foundation::HWND, x: i32, y: i32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, hwndlock: super::super::Foundation::HWND) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, x: i32, y: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, punk: ::windows::core::RawPtr, idrag: i32, dxhotspot: i32, dyhotspot: i32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Foundation")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, fshow: 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, ppt: *mut super::super::Foundation::POINT, ppthotspot: *mut super::super::Foundation::POINT, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Foundation"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, dwflags: *mut IMAGE_LIST_ITEM_FLAGS) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ioverlay: i32, piindex: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cxnewiconsize: i32, cynewiconsize: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iimage: i32, dwflags: u32, pcx: *mut i32, pcy: *mut i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iimage: i32, cx: i32, cy: i32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, punk: ::windows::core::RawPtr) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, iimage: i32, dwflags: u32) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, ifirstimage: i32, ilastimage: i32, dwflags: u32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pimldp: *const IMAGELISTDRAWPARAMS) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, pils: *mut IMAGELISTSTATS) -> ::windows::core::HRESULT, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, cx: i32, cy: i32, flags: IMAGELIST_CREATION_FLAGS, cinitial: i32, cgrow: i32) -> ::windows::core::HRESULT, #[cfg(feature = "Win32_Graphics_Gdi")] pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, hbmimage: super::super::Graphics::Gdi::HBITMAP, hbmmask: super::super::Graphics::Gdi::HBITMAP, punk: ::windows::core::RawPtr, dwflags: u32) -> ::windows::core::HRESULT, #[cfg(not(feature = "Win32_Graphics_Gdi"))] usize, pub unsafe extern "system" fn(this: ::windows::core::RawPtr, i: i32, pil: ::windows::core::RawPtr, isrc: i32, punk: ::windows::core::RawPtr, dwflags: u32) -> ::windows::core::HRESULT, ); pub const ILDI_PURGE: u32 = 1u32; pub const ILDI_QUERYACCESS: u32 = 8u32; pub const ILDI_RESETACCESS: u32 = 4u32; pub const ILDI_STANDBY: u32 = 2u32; pub const ILDRF_IMAGELOWQUALITY: u32 = 1u32; pub const ILDRF_OVERLAYLOWQUALITY: u32 = 16u32; pub const ILD_ASYNC: u32 = 32768u32; pub const ILD_BLEND25: u32 = 2u32; pub const ILD_DPISCALE: u32 = 16384u32; pub const ILD_IMAGE: u32 = 32u32; pub const ILD_OVERLAYMASK: u32 = 3840u32; pub const ILD_PRESERVEALPHA: u32 = 4096u32; pub const ILD_ROP: u32 = 64u32; pub const ILD_SCALE: u32 = 8192u32; pub const ILD_TRANSPARENT: u32 = 1u32; pub const ILFIP_ALWAYS: u32 = 0u32; pub const ILFIP_FROMSTANDBY: u32 = 1u32; pub const ILGOS_ALWAYS: u32 = 0u32; pub const ILGOS_FROMSTANDBY: u32 = 1u32; pub const ILGT_ASYNC: u32 = 1u32; pub const ILGT_NORMAL: u32 = 0u32; pub const ILP_DOWNLEVEL: u32 = 1u32; pub const ILP_NORMAL: u32 = 0u32; pub const ILR_DEFAULT: u32 = 0u32; pub const ILR_HORIZONTAL_CENTER: u32 = 1u32; pub const ILR_HORIZONTAL_LEFT: u32 = 0u32; pub const ILR_HORIZONTAL_RIGHT: u32 = 2u32; pub const ILR_SCALE_ASPECTRATIO: u32 = 256u32; pub const ILR_SCALE_CLIP: u32 = 0u32; pub const ILR_VERTICAL_BOTTOM: u32 = 32u32; pub const ILR_VERTICAL_CENTER: u32 = 16u32; pub const ILR_VERTICAL_TOP: u32 = 0u32; pub const ILS_ALPHA: u32 = 8u32; pub const ILS_GLOW: u32 = 1u32; pub const ILS_NORMAL: u32 = 0u32; pub const ILS_SATURATE: u32 = 4u32; pub const ILS_SHADOW: u32 = 2u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct IMAGEINFO { pub hbmImage: super::super::Graphics::Gdi::HBITMAP, pub hbmMask: super::super::Graphics::Gdi::HBITMAP, pub Unused1: i32, pub Unused2: i32, pub rcImage: super::super::Foundation::RECT, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl IMAGEINFO {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for IMAGEINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for IMAGEINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("IMAGEINFO").field("hbmImage", &self.hbmImage).field("hbmMask", &self.hbmMask).field("Unused1", &self.Unused1).field("Unused2", &self.Unused2).field("rcImage", &self.rcImage).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for IMAGEINFO { fn eq(&self, other: &Self) -> bool { self.hbmImage == other.hbmImage && self.hbmMask == other.hbmMask && self.Unused1 == other.Unused1 && self.Unused2 == other.Unused2 && self.rcImage == other.rcImage } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for IMAGEINFO {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for IMAGEINFO { 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 IMAGELAYOUT(pub i32); pub const IL_VERTICAL: IMAGELAYOUT = IMAGELAYOUT(0i32); pub const IL_HORIZONTAL: IMAGELAYOUT = IMAGELAYOUT(1i32); impl ::core::convert::From<i32> for IMAGELAYOUT { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for IMAGELAYOUT { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Graphics_Gdi")] pub struct IMAGELISTDRAWPARAMS { pub cbSize: u32, pub himl: HIMAGELIST, pub i: i32, pub hdcDst: super::super::Graphics::Gdi::HDC, pub x: i32, pub y: i32, pub cx: i32, pub cy: i32, pub xBitmap: i32, pub yBitmap: i32, pub rgbBk: u32, pub rgbFg: u32, pub fStyle: u32, pub dwRop: u32, pub fState: u32, pub Frame: u32, pub crEffect: u32, } #[cfg(feature = "Win32_Graphics_Gdi")] impl IMAGELISTDRAWPARAMS {} #[cfg(feature = "Win32_Graphics_Gdi")] impl ::core::default::Default for IMAGELISTDRAWPARAMS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Graphics_Gdi")] impl ::core::fmt::Debug for IMAGELISTDRAWPARAMS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("IMAGELISTDRAWPARAMS") .field("cbSize", &self.cbSize) .field("himl", &self.himl) .field("i", &self.i) .field("hdcDst", &self.hdcDst) .field("x", &self.x) .field("y", &self.y) .field("cx", &self.cx) .field("cy", &self.cy) .field("xBitmap", &self.xBitmap) .field("yBitmap", &self.yBitmap) .field("rgbBk", &self.rgbBk) .field("rgbFg", &self.rgbFg) .field("fStyle", &self.fStyle) .field("dwRop", &self.dwRop) .field("fState", &self.fState) .field("Frame", &self.Frame) .field("crEffect", &self.crEffect) .finish() } } #[cfg(feature = "Win32_Graphics_Gdi")] impl ::core::cmp::PartialEq for IMAGELISTDRAWPARAMS { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.himl == other.himl && self.i == other.i && self.hdcDst == other.hdcDst && self.x == other.x && self.y == other.y && self.cx == other.cx && self.cy == other.cy && self.xBitmap == other.xBitmap && self.yBitmap == other.yBitmap && self.rgbBk == other.rgbBk && self.rgbFg == other.rgbFg && self.fStyle == other.fStyle && self.dwRop == other.dwRop && self.fState == other.fState && self.Frame == other.Frame && self.crEffect == other.crEffect } } #[cfg(feature = "Win32_Graphics_Gdi")] impl ::core::cmp::Eq for IMAGELISTDRAWPARAMS {} #[cfg(feature = "Win32_Graphics_Gdi")] unsafe impl ::windows::core::Abi for IMAGELISTDRAWPARAMS { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct IMAGELISTSTATS { pub cbSize: u32, pub cAlloc: i32, pub cUsed: i32, pub cStandby: i32, } impl IMAGELISTSTATS {} impl ::core::default::Default for IMAGELISTSTATS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for IMAGELISTSTATS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("IMAGELISTSTATS").field("cbSize", &self.cbSize).field("cAlloc", &self.cAlloc).field("cUsed", &self.cUsed).field("cStandby", &self.cStandby).finish() } } impl ::core::cmp::PartialEq for IMAGELISTSTATS { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.cAlloc == other.cAlloc && self.cUsed == other.cUsed && self.cStandby == other.cStandby } } impl ::core::cmp::Eq for IMAGELISTSTATS {} unsafe impl ::windows::core::Abi for IMAGELISTSTATS { 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 IMAGELIST_CREATION_FLAGS(pub u32); pub const ILC_MASK: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(1u32); pub const ILC_COLOR: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(0u32); pub const ILC_COLORDDB: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(254u32); pub const ILC_COLOR4: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(4u32); pub const ILC_COLOR8: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(8u32); pub const ILC_COLOR16: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(16u32); pub const ILC_COLOR24: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(24u32); pub const ILC_COLOR32: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(32u32); pub const ILC_PALETTE: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(2048u32); pub const ILC_MIRROR: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(8192u32); pub const ILC_PERITEMMIRROR: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(32768u32); pub const ILC_ORIGINALSIZE: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(65536u32); pub const ILC_HIGHQUALITYSCALE: IMAGELIST_CREATION_FLAGS = IMAGELIST_CREATION_FLAGS(131072u32); impl ::core::convert::From<u32> for IMAGELIST_CREATION_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for IMAGELIST_CREATION_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for IMAGELIST_CREATION_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for IMAGELIST_CREATION_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for IMAGELIST_CREATION_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for IMAGELIST_CREATION_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for IMAGELIST_CREATION_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct IMAGESELECTTYPE(pub i32); pub const IST_NONE: IMAGESELECTTYPE = IMAGESELECTTYPE(0i32); pub const IST_SIZE: IMAGESELECTTYPE = IMAGESELECTTYPE(1i32); pub const IST_DPI: IMAGESELECTTYPE = IMAGESELECTTYPE(2i32); impl ::core::convert::From<i32> for IMAGESELECTTYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for IMAGESELECTTYPE { 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 IMAGE_LIST_COPY_FLAGS(pub u32); pub const ILCF_MOVE: IMAGE_LIST_COPY_FLAGS = IMAGE_LIST_COPY_FLAGS(0u32); pub const ILCF_SWAP: IMAGE_LIST_COPY_FLAGS = IMAGE_LIST_COPY_FLAGS(1u32); impl ::core::convert::From<u32> for IMAGE_LIST_COPY_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for IMAGE_LIST_COPY_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for IMAGE_LIST_COPY_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for IMAGE_LIST_COPY_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for IMAGE_LIST_COPY_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for IMAGE_LIST_COPY_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for IMAGE_LIST_COPY_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct IMAGE_LIST_DRAW_STYLE(pub u32); pub const ILD_BLEND: IMAGE_LIST_DRAW_STYLE = IMAGE_LIST_DRAW_STYLE(4u32); pub const ILD_BLEND50: IMAGE_LIST_DRAW_STYLE = IMAGE_LIST_DRAW_STYLE(4u32); pub const ILD_FOCUS: IMAGE_LIST_DRAW_STYLE = IMAGE_LIST_DRAW_STYLE(2u32); pub const ILD_MASK: IMAGE_LIST_DRAW_STYLE = IMAGE_LIST_DRAW_STYLE(16u32); pub const ILD_NORMAL: IMAGE_LIST_DRAW_STYLE = IMAGE_LIST_DRAW_STYLE(0u32); pub const ILD_SELECTED: IMAGE_LIST_DRAW_STYLE = IMAGE_LIST_DRAW_STYLE(4u32); impl ::core::convert::From<u32> for IMAGE_LIST_DRAW_STYLE { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for IMAGE_LIST_DRAW_STYLE { type Abi = Self; } impl ::core::ops::BitOr for IMAGE_LIST_DRAW_STYLE { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for IMAGE_LIST_DRAW_STYLE { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for IMAGE_LIST_DRAW_STYLE { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for IMAGE_LIST_DRAW_STYLE { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for IMAGE_LIST_DRAW_STYLE { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct IMAGE_LIST_ITEM_FLAGS(pub u32); pub const ILIF_ALPHA: IMAGE_LIST_ITEM_FLAGS = IMAGE_LIST_ITEM_FLAGS(1u32); pub const ILIF_LOWQUALITY: IMAGE_LIST_ITEM_FLAGS = IMAGE_LIST_ITEM_FLAGS(2u32); impl ::core::convert::From<u32> for IMAGE_LIST_ITEM_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for IMAGE_LIST_ITEM_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for IMAGE_LIST_ITEM_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for IMAGE_LIST_ITEM_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for IMAGE_LIST_ITEM_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for IMAGE_LIST_ITEM_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for IMAGE_LIST_ITEM_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const INFOTIPSIZE: u32 = 1024u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct INITCOMMONCONTROLSEX { pub dwSize: u32, pub dwICC: INITCOMMONCONTROLSEX_ICC, } impl INITCOMMONCONTROLSEX {} impl ::core::default::Default for INITCOMMONCONTROLSEX { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for INITCOMMONCONTROLSEX { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("INITCOMMONCONTROLSEX").field("dwSize", &self.dwSize).field("dwICC", &self.dwICC).finish() } } impl ::core::cmp::PartialEq for INITCOMMONCONTROLSEX { fn eq(&self, other: &Self) -> bool { self.dwSize == other.dwSize && self.dwICC == other.dwICC } } impl ::core::cmp::Eq for INITCOMMONCONTROLSEX {} unsafe impl ::windows::core::Abi for INITCOMMONCONTROLSEX { 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 INITCOMMONCONTROLSEX_ICC(pub u32); pub const ICC_ANIMATE_CLASS: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(128u32); pub const ICC_BAR_CLASSES: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(4u32); pub const ICC_COOL_CLASSES: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(1024u32); pub const ICC_DATE_CLASSES: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(256u32); pub const ICC_HOTKEY_CLASS: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(64u32); pub const ICC_INTERNET_CLASSES: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(2048u32); pub const ICC_LINK_CLASS: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(32768u32); pub const ICC_LISTVIEW_CLASSES: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(1u32); pub const ICC_NATIVEFNTCTL_CLASS: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(8192u32); pub const ICC_PAGESCROLLER_CLASS: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(4096u32); pub const ICC_PROGRESS_CLASS: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(32u32); pub const ICC_STANDARD_CLASSES: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(16384u32); pub const ICC_TAB_CLASSES: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(8u32); pub const ICC_TREEVIEW_CLASSES: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(2u32); pub const ICC_UPDOWN_CLASS: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(16u32); pub const ICC_USEREX_CLASSES: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(512u32); pub const ICC_WIN95_CLASSES: INITCOMMONCONTROLSEX_ICC = INITCOMMONCONTROLSEX_ICC(255u32); impl ::core::convert::From<u32> for INITCOMMONCONTROLSEX_ICC { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for INITCOMMONCONTROLSEX_ICC { type Abi = Self; } impl ::core::ops::BitOr for INITCOMMONCONTROLSEX_ICC { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for INITCOMMONCONTROLSEX_ICC { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for INITCOMMONCONTROLSEX_ICC { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for INITCOMMONCONTROLSEX_ICC { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for INITCOMMONCONTROLSEX_ICC { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct INTLIST { pub iValueCount: i32, pub iValues: [i32; 402], } impl INTLIST {} impl ::core::default::Default for INTLIST { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for INTLIST { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("INTLIST").field("iValueCount", &self.iValueCount).field("iValues", &self.iValues).finish() } } impl ::core::cmp::PartialEq for INTLIST { fn eq(&self, other: &Self) -> bool { self.iValueCount == other.iValueCount && self.iValues == other.iValues } } impl ::core::cmp::Eq for INTLIST {} unsafe impl ::windows::core::Abi for INTLIST { type Abi = Self; } pub const INVALID_LINK_INDEX: i32 = -1i32; pub const IPM_CLEARADDRESS: u32 = 1124u32; pub const IPM_GETADDRESS: u32 = 1126u32; pub const IPM_ISBLANK: u32 = 1129u32; pub const IPM_SETADDRESS: u32 = 1125u32; pub const IPM_SETFOCUS: u32 = 1128u32; pub const IPM_SETRANGE: u32 = 1127u32; pub const I_IMAGECALLBACK: i32 = -1i32; pub const I_IMAGENONE: i32 = -2i32; pub const I_INDENTCALLBACK: i32 = -1i32; pub const ImageList: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x7c476ba2_02b1_48f4_8048_b24619ddc058); #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn ImageList_Add<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>, Param2: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>>(himl: Param0, hbmimage: Param1, hbmmask: Param2) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_Add(himl: HIMAGELIST, hbmimage: super::super::Graphics::Gdi::HBITMAP, hbmmask: super::super::Graphics::Gdi::HBITMAP) -> i32; } ::core::mem::transmute(ImageList_Add(himl.into_param().abi(), hbmimage.into_param().abi(), hbmmask.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Graphics_Gdi")] #[inline] pub unsafe fn ImageList_AddMasked<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>, Param1: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>>(himl: Param0, hbmimage: Param1, crmask: u32) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_AddMasked(himl: HIMAGELIST, hbmimage: super::super::Graphics::Gdi::HBITMAP, crmask: u32) -> i32; } ::core::mem::transmute(ImageList_AddMasked(himl.into_param().abi(), hbmimage.into_param().abi(), ::core::mem::transmute(crmask))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_BeginDrag<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himltrack: Param0, itrack: i32, dxhotspot: i32, dyhotspot: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_BeginDrag(himltrack: HIMAGELIST, itrack: i32, dxhotspot: i32, dyhotspot: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_BeginDrag(himltrack.into_param().abi(), ::core::mem::transmute(itrack), ::core::mem::transmute(dxhotspot), ::core::mem::transmute(dyhotspot))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn ImageList_CoCreateInstance<'a, Param1: ::windows::core::IntoParam<'a, ::windows::core::IUnknown>>(rclsid: *const ::windows::core::GUID, punkouter: Param1, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_CoCreateInstance(rclsid: *const ::windows::core::GUID, punkouter: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } ImageList_CoCreateInstance(::core::mem::transmute(rclsid), punkouter.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(ppv)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_Copy<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>, Param2: ::windows::core::IntoParam<'a, HIMAGELIST>>(himldst: Param0, idst: i32, himlsrc: Param2, isrc: i32, uflags: IMAGE_LIST_COPY_FLAGS) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_Copy(himldst: HIMAGELIST, idst: i32, himlsrc: HIMAGELIST, isrc: i32, uflags: IMAGE_LIST_COPY_FLAGS) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_Copy(himldst.into_param().abi(), ::core::mem::transmute(idst), himlsrc.into_param().abi(), ::core::mem::transmute(isrc), ::core::mem::transmute(uflags))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn ImageList_Create(cx: i32, cy: i32, flags: IMAGELIST_CREATION_FLAGS, cinitial: i32, cgrow: i32) -> HIMAGELIST { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_Create(cx: i32, cy: i32, flags: IMAGELIST_CREATION_FLAGS, cinitial: i32, cgrow: i32) -> HIMAGELIST; } ::core::mem::transmute(ImageList_Create(::core::mem::transmute(cx), ::core::mem::transmute(cy), ::core::mem::transmute(flags), ::core::mem::transmute(cinitial), ::core::mem::transmute(cgrow))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_Destroy<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_Destroy(himl: HIMAGELIST) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_Destroy(himl.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_DragEnter<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwndlock: Param0, x: i32, y: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_DragEnter(hwndlock: super::super::Foundation::HWND, x: i32, y: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_DragEnter(hwndlock.into_param().abi(), ::core::mem::transmute(x), ::core::mem::transmute(y))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_DragLeave<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwndlock: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_DragLeave(hwndlock: super::super::Foundation::HWND) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_DragLeave(hwndlock.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_DragMove(x: i32, y: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_DragMove(x: i32, y: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_DragMove(::core::mem::transmute(x), ::core::mem::transmute(y))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_DragShowNolock<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(fshow: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_DragShowNolock(fshow: super::super::Foundation::BOOL) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_DragShowNolock(fshow.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn ImageList_Draw<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>, Param2: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(himl: Param0, i: i32, hdcdst: Param2, x: i32, y: i32, fstyle: IMAGE_LIST_DRAW_STYLE) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_Draw(himl: HIMAGELIST, i: i32, hdcdst: super::super::Graphics::Gdi::HDC, x: i32, y: i32, fstyle: IMAGE_LIST_DRAW_STYLE) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_Draw(himl.into_param().abi(), ::core::mem::transmute(i), hdcdst.into_param().abi(), ::core::mem::transmute(x), ::core::mem::transmute(y), ::core::mem::transmute(fstyle))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn ImageList_DrawEx<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>, Param2: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HDC>>(himl: Param0, i: i32, hdcdst: Param2, x: i32, y: i32, dx: i32, dy: i32, rgbbk: u32, rgbfg: u32, fstyle: IMAGE_LIST_DRAW_STYLE) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_DrawEx(himl: HIMAGELIST, i: i32, hdcdst: super::super::Graphics::Gdi::HDC, x: i32, y: i32, dx: i32, dy: i32, rgbbk: u32, rgbfg: u32, fstyle: IMAGE_LIST_DRAW_STYLE) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_DrawEx(himl.into_param().abi(), ::core::mem::transmute(i), hdcdst.into_param().abi(), ::core::mem::transmute(x), ::core::mem::transmute(y), ::core::mem::transmute(dx), ::core::mem::transmute(dy), ::core::mem::transmute(rgbbk), ::core::mem::transmute(rgbfg), ::core::mem::transmute(fstyle))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn ImageList_DrawIndirect(pimldp: *const IMAGELISTDRAWPARAMS) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_DrawIndirect(pimldp: *const IMAGELISTDRAWPARAMS) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_DrawIndirect(::core::mem::transmute(pimldp))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn ImageList_Duplicate<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0) -> HIMAGELIST { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_Duplicate(himl: HIMAGELIST) -> HIMAGELIST; } ::core::mem::transmute(ImageList_Duplicate(himl.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn ImageList_EndDrag() { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_EndDrag(); } ::core::mem::transmute(ImageList_EndDrag()) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn ImageList_GetBkColor<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_GetBkColor(himl: HIMAGELIST) -> u32; } ::core::mem::transmute(ImageList_GetBkColor(himl.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_GetDragImage(ppt: *mut super::super::Foundation::POINT, ppthotspot: *mut super::super::Foundation::POINT) -> HIMAGELIST { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_GetDragImage(ppt: *mut super::super::Foundation::POINT, ppthotspot: *mut super::super::Foundation::POINT) -> HIMAGELIST; } ::core::mem::transmute(ImageList_GetDragImage(::core::mem::transmute(ppt), ::core::mem::transmute(ppthotspot))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] #[inline] pub unsafe fn ImageList_GetIcon<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0, i: i32, flags: u32) -> super::WindowsAndMessaging::HICON { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_GetIcon(himl: HIMAGELIST, i: i32, flags: u32) -> super::WindowsAndMessaging::HICON; } ::core::mem::transmute(ImageList_GetIcon(himl.into_param().abi(), ::core::mem::transmute(i), ::core::mem::transmute(flags))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_GetIconSize<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0, cx: *mut i32, cy: *mut i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_GetIconSize(himl: HIMAGELIST, cx: *mut i32, cy: *mut i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_GetIconSize(himl.into_param().abi(), ::core::mem::transmute(cx), ::core::mem::transmute(cy))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn ImageList_GetImageCount<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_GetImageCount(himl: HIMAGELIST) -> i32; } ::core::mem::transmute(ImageList_GetImageCount(himl.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn ImageList_GetImageInfo<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0, i: i32, pimageinfo: *mut IMAGEINFO) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_GetImageInfo(himl: HIMAGELIST, i: i32, pimageinfo: *mut IMAGEINFO) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_GetImageInfo(himl.into_param().abi(), ::core::mem::transmute(i), ::core::mem::transmute(pimageinfo))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn ImageList_LoadImageA<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HINSTANCE>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PSTR>>(hi: Param0, lpbmp: Param1, cx: i32, cgrow: i32, crmask: u32, utype: u32, uflags: super::WindowsAndMessaging::IMAGE_FLAGS) -> HIMAGELIST { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_LoadImageA(hi: super::super::Foundation::HINSTANCE, lpbmp: super::super::Foundation::PSTR, cx: i32, cgrow: i32, crmask: u32, utype: u32, uflags: super::WindowsAndMessaging::IMAGE_FLAGS) -> HIMAGELIST; } ::core::mem::transmute(ImageList_LoadImageA(hi.into_param().abi(), lpbmp.into_param().abi(), ::core::mem::transmute(cx), ::core::mem::transmute(cgrow), ::core::mem::transmute(crmask), ::core::mem::transmute(utype), ::core::mem::transmute(uflags))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn ImageList_LoadImageW<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HINSTANCE>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hi: Param0, lpbmp: Param1, cx: i32, cgrow: i32, crmask: u32, utype: u32, uflags: super::WindowsAndMessaging::IMAGE_FLAGS) -> HIMAGELIST { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_LoadImageW(hi: super::super::Foundation::HINSTANCE, lpbmp: super::super::Foundation::PWSTR, cx: i32, cgrow: i32, crmask: u32, utype: u32, uflags: super::WindowsAndMessaging::IMAGE_FLAGS) -> HIMAGELIST; } ::core::mem::transmute(ImageList_LoadImageW(hi.into_param().abi(), lpbmp.into_param().abi(), ::core::mem::transmute(cx), ::core::mem::transmute(cgrow), ::core::mem::transmute(crmask), ::core::mem::transmute(utype), ::core::mem::transmute(uflags))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn ImageList_Merge<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>, Param2: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl1: Param0, i1: i32, himl2: Param2, i2: i32, dx: i32, dy: i32) -> HIMAGELIST { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_Merge(himl1: HIMAGELIST, i1: i32, himl2: HIMAGELIST, i2: i32, dx: i32, dy: i32) -> HIMAGELIST; } ::core::mem::transmute(ImageList_Merge(himl1.into_param().abi(), ::core::mem::transmute(i1), himl2.into_param().abi(), ::core::mem::transmute(i2), ::core::mem::transmute(dx), ::core::mem::transmute(dy))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn ImageList_Read<'a, Param0: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(pstm: Param0) -> HIMAGELIST { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_Read(pstm: ::windows::core::RawPtr) -> HIMAGELIST; } ::core::mem::transmute(ImageList_Read(pstm.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn ImageList_ReadEx<'a, Param1: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(dwflags: u32, pstm: Param1, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_ReadEx(dwflags: u32, pstm: ::windows::core::RawPtr, riid: *const ::windows::core::GUID, ppv: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT; } ImageList_ReadEx(::core::mem::transmute(dwflags), pstm.into_param().abi(), ::core::mem::transmute(riid), ::core::mem::transmute(ppv)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_Remove<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0, i: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_Remove(himl: HIMAGELIST, i: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_Remove(himl.into_param().abi(), ::core::mem::transmute(i))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] #[inline] pub unsafe fn ImageList_Replace<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>, Param2: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>, Param3: ::windows::core::IntoParam<'a, super::super::Graphics::Gdi::HBITMAP>>(himl: Param0, i: i32, hbmimage: Param2, hbmmask: Param3) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_Replace(himl: HIMAGELIST, i: i32, hbmimage: super::super::Graphics::Gdi::HBITMAP, hbmmask: super::super::Graphics::Gdi::HBITMAP) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_Replace(himl.into_param().abi(), ::core::mem::transmute(i), hbmimage.into_param().abi(), hbmmask.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_UI_WindowsAndMessaging")] #[inline] pub unsafe fn ImageList_ReplaceIcon<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>, Param2: ::windows::core::IntoParam<'a, super::WindowsAndMessaging::HICON>>(himl: Param0, i: i32, hicon: Param2) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_ReplaceIcon(himl: HIMAGELIST, i: i32, hicon: super::WindowsAndMessaging::HICON) -> i32; } ::core::mem::transmute(ImageList_ReplaceIcon(himl.into_param().abi(), ::core::mem::transmute(i), hicon.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn ImageList_SetBkColor<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0, clrbk: u32) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_SetBkColor(himl: HIMAGELIST, clrbk: u32) -> u32; } ::core::mem::transmute(ImageList_SetBkColor(himl.into_param().abi(), ::core::mem::transmute(clrbk))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_SetDragCursorImage<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himldrag: Param0, idrag: i32, dxhotspot: i32, dyhotspot: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_SetDragCursorImage(himldrag: HIMAGELIST, idrag: i32, dxhotspot: i32, dyhotspot: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_SetDragCursorImage(himldrag.into_param().abi(), ::core::mem::transmute(idrag), ::core::mem::transmute(dxhotspot), ::core::mem::transmute(dyhotspot))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_SetIconSize<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0, cx: i32, cy: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_SetIconSize(himl: HIMAGELIST, cx: i32, cy: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_SetIconSize(himl.into_param().abi(), ::core::mem::transmute(cx), ::core::mem::transmute(cy))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_SetImageCount<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0, unewcount: u32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_SetImageCount(himl: HIMAGELIST, unewcount: u32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_SetImageCount(himl.into_param().abi(), ::core::mem::transmute(unewcount))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ImageList_SetOverlayImage<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>>(himl: Param0, iimage: i32, ioverlay: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_SetOverlayImage(himl: HIMAGELIST, iimage: i32, ioverlay: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_SetOverlayImage(himl.into_param().abi(), ::core::mem::transmute(iimage), ::core::mem::transmute(ioverlay))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] #[inline] pub unsafe fn ImageList_Write<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>, Param1: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(himl: Param0, pstm: Param1) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_Write(himl: HIMAGELIST, pstm: ::windows::core::RawPtr) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ImageList_Write(himl.into_param().abi(), pstm.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_System_Com")] #[inline] pub unsafe fn ImageList_WriteEx<'a, Param0: ::windows::core::IntoParam<'a, HIMAGELIST>, Param2: ::windows::core::IntoParam<'a, super::super::System::Com::IStream>>(himl: Param0, dwflags: u32, pstm: Param2) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ImageList_WriteEx(himl: HIMAGELIST, dwflags: u32, pstm: ::windows::core::RawPtr) -> ::windows::core::HRESULT; } ImageList_WriteEx(himl.into_param().abi(), ::core::mem::transmute(dwflags), pstm.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn InitCommonControls() { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn InitCommonControls(); } ::core::mem::transmute(InitCommonControls()) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn InitCommonControlsEx(picce: *const INITCOMMONCONTROLSEX) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn InitCommonControlsEx(picce: *const INITCOMMONCONTROLSEX) -> super::super::Foundation::BOOL; } ::core::mem::transmute(InitCommonControlsEx(::core::mem::transmute(picce))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn InitMUILanguage(uilang: u16) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn InitMUILanguage(uilang: u16); } ::core::mem::transmute(InitMUILanguage(::core::mem::transmute(uilang))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn InitializeFlatSB<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(param0: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn InitializeFlatSB(param0: super::super::Foundation::HWND) -> super::super::Foundation::BOOL; } ::core::mem::transmute(InitializeFlatSB(param0.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn IsAppThemed() -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn IsAppThemed() -> super::super::Foundation::BOOL; } ::core::mem::transmute(IsAppThemed()) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn IsCharLowerW(ch: u16) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn IsCharLowerW(ch: u16) -> super::super::Foundation::BOOL; } ::core::mem::transmute(IsCharLowerW(::core::mem::transmute(ch))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn IsCompositionActive() -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn IsCompositionActive() -> super::super::Foundation::BOOL; } ::core::mem::transmute(IsCompositionActive()) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn IsDlgButtonChecked<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hdlg: Param0, nidbutton: i32) -> u32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn IsDlgButtonChecked(hdlg: super::super::Foundation::HWND, nidbutton: i32) -> u32; } ::core::mem::transmute(IsDlgButtonChecked(hdlg.into_param().abi(), ::core::mem::transmute(nidbutton))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn IsThemeActive() -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn IsThemeActive() -> super::super::Foundation::BOOL; } ::core::mem::transmute(IsThemeActive()) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn IsThemeBackgroundPartiallyTransparent(htheme: isize, ipartid: i32, istateid: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn IsThemeBackgroundPartiallyTransparent(htheme: isize, ipartid: i32, istateid: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(IsThemeBackgroundPartiallyTransparent(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn IsThemeDialogTextureEnabled<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn IsThemeDialogTextureEnabled(hwnd: super::super::Foundation::HWND) -> super::super::Foundation::BOOL; } ::core::mem::transmute(IsThemeDialogTextureEnabled(hwnd.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn IsThemePartDefined(htheme: isize, ipartid: i32, istateid: i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn IsThemePartDefined(htheme: isize, ipartid: i32, istateid: i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(IsThemePartDefined(::core::mem::transmute(htheme), ::core::mem::transmute(ipartid), ::core::mem::transmute(istateid))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn LBItemFromPt<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::POINT>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(hlb: Param0, pt: Param1, bautoscroll: Param2) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn LBItemFromPt(hlb: super::super::Foundation::HWND, pt: super::super::Foundation::POINT, bautoscroll: super::super::Foundation::BOOL) -> i32; } ::core::mem::transmute(LBItemFromPt(hlb.into_param().abi(), pt.into_param().abi(), bautoscroll.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LHITTESTINFO { pub pt: super::super::Foundation::POINT, pub item: LITEM, } #[cfg(feature = "Win32_Foundation")] impl LHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LHITTESTINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LHITTESTINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LHITTESTINFO").field("pt", &self.pt).field("item", &self.item).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LHITTESTINFO { fn eq(&self, other: &Self) -> bool { self.pt == other.pt && self.item == other.item } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LHITTESTINFO { type Abi = Self; } pub const LIF_ITEMID: u32 = 4u32; pub const LIF_ITEMINDEX: u32 = 1u32; pub const LIF_STATE: u32 = 2u32; pub const LIF_URL: u32 = 8u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct LINKPARTS(pub i32); pub const LP_HYPERLINK: LINKPARTS = LINKPARTS(1i32); impl ::core::convert::From<i32> for LINKPARTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for LINKPARTS { type Abi = Self; } pub const LIS_DEFAULTCOLORS: u32 = 16u32; pub const LIS_ENABLED: u32 = 2u32; pub const LIS_FOCUSED: u32 = 1u32; pub const LIS_HOTTRACK: u32 = 8u32; pub const LIS_VISITED: u32 = 4u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct LITEM { pub mask: u32, pub iLink: i32, pub state: u32, pub stateMask: u32, pub szID: [u16; 48], pub szUrl: [u16; 2084], } impl LITEM {} impl ::core::default::Default for LITEM { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for LITEM { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LITEM").field("mask", &self.mask).field("iLink", &self.iLink).field("state", &self.state).field("stateMask", &self.stateMask).field("szID", &self.szID).field("szUrl", &self.szUrl).finish() } } impl ::core::cmp::PartialEq for LITEM { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.iLink == other.iLink && self.state == other.state && self.stateMask == other.stateMask && self.szID == other.szID && self.szUrl == other.szUrl } } impl ::core::cmp::Eq for LITEM {} unsafe impl ::windows::core::Abi for LITEM { type Abi = Self; } pub const LM_GETIDEALHEIGHT: u32 = 1793u32; pub const LM_GETIDEALSIZE: u32 = 1793u32; pub const LM_GETITEM: u32 = 1795u32; pub const LM_HITTEST: u32 = 1792u32; pub const LM_SETITEM: u32 = 1794u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct LOGOFFBUTTONSSTATES(pub i32); pub const SPLS_NORMAL: LOGOFFBUTTONSSTATES = LOGOFFBUTTONSSTATES(1i32); pub const SPLS_HOT: LOGOFFBUTTONSSTATES = LOGOFFBUTTONSSTATES(2i32); pub const SPLS_PRESSED: LOGOFFBUTTONSSTATES = LOGOFFBUTTONSSTATES(3i32); impl ::core::convert::From<i32> for LOGOFFBUTTONSSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for LOGOFFBUTTONSSTATES { type Abi = Self; } #[cfg(feature = "Win32_Foundation")] pub type LPFNADDPROPSHEETPAGES = unsafe extern "system" fn(param0: *mut ::core::ffi::c_void, param1: ::windows::core::RawPtr, param2: super::super::Foundation::LPARAM) -> super::super::Foundation::BOOL; #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub type LPFNCCINFOA = unsafe extern "system" fn(acci: *mut ::core::mem::ManuallyDrop<CCINFOA>) -> u32; #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub type LPFNCCINFOW = unsafe extern "system" fn(acci: *mut ::core::mem::ManuallyDrop<CCINFOW>) -> u32; #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub type LPFNCCSIZETOTEXTA = unsafe extern "system" fn(flstyle: u32, flextstyle: u32, hfont: super::super::Graphics::Gdi::HFONT, psztext: super::super::Foundation::PSTR) -> i32; #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub type LPFNCCSIZETOTEXTW = unsafe extern "system" fn(flstyle: u32, flextstyle: u32, hfont: super::super::Graphics::Gdi::HFONT, psztext: super::super::Foundation::PWSTR) -> i32; #[cfg(feature = "Win32_Foundation")] pub type LPFNCCSTYLEA = unsafe extern "system" fn(hwndparent: super::super::Foundation::HWND, pccs: *mut CCSTYLEA) -> super::super::Foundation::BOOL; #[cfg(feature = "Win32_Foundation")] pub type LPFNCCSTYLEW = unsafe extern "system" fn(hwndparent: super::super::Foundation::HWND, pccs: *mut CCSTYLEW) -> super::super::Foundation::BOOL; #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub type LPFNPSPCALLBACKA = unsafe extern "system" fn(hwnd: super::super::Foundation::HWND, umsg: PSPCB_MESSAGE, ppsp: *mut ::core::mem::ManuallyDrop<PROPSHEETPAGEA>) -> u32; #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub type LPFNPSPCALLBACKW = unsafe extern "system" fn(hwnd: super::super::Foundation::HWND, umsg: PSPCB_MESSAGE, ppsp: *mut ::core::mem::ManuallyDrop<PROPSHEETPAGEW>) -> u32; #[cfg(feature = "Win32_Foundation")] pub type LPFNSVADDPROPSHEETPAGE = unsafe extern "system" fn(param0: HPROPSHEETPAGE, param1: super::super::Foundation::LPARAM) -> super::super::Foundation::BOOL; pub const LVA_ALIGNLEFT: u32 = 1u32; pub const LVA_ALIGNTOP: u32 = 2u32; pub const LVA_DEFAULT: u32 = 0u32; pub const LVA_SNAPTOGRID: u32 = 5u32; pub const LVBKIF_FLAG_ALPHABLEND: u32 = 536870912u32; pub const LVBKIF_FLAG_TILEOFFSET: u32 = 256u32; pub const LVBKIF_SOURCE_HBITMAP: u32 = 1u32; pub const LVBKIF_SOURCE_MASK: u32 = 3u32; pub const LVBKIF_SOURCE_NONE: u32 = 0u32; pub const LVBKIF_SOURCE_URL: u32 = 2u32; pub const LVBKIF_STYLE_MASK: u32 = 16u32; pub const LVBKIF_STYLE_NORMAL: u32 = 0u32; pub const LVBKIF_STYLE_TILE: u32 = 16u32; pub const LVBKIF_TYPE_WATERMARK: u32 = 268435456u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct LVBKIMAGEA { pub ulFlags: u32, pub hbm: super::super::Graphics::Gdi::HBITMAP, pub pszImage: super::super::Foundation::PSTR, pub cchImageMax: u32, pub xOffsetPercent: i32, pub yOffsetPercent: i32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl LVBKIMAGEA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for LVBKIMAGEA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for LVBKIMAGEA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVBKIMAGEA").field("ulFlags", &self.ulFlags).field("hbm", &self.hbm).field("pszImage", &self.pszImage).field("cchImageMax", &self.cchImageMax).field("xOffsetPercent", &self.xOffsetPercent).field("yOffsetPercent", &self.yOffsetPercent).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for LVBKIMAGEA { fn eq(&self, other: &Self) -> bool { self.ulFlags == other.ulFlags && self.hbm == other.hbm && self.pszImage == other.pszImage && self.cchImageMax == other.cchImageMax && self.xOffsetPercent == other.xOffsetPercent && self.yOffsetPercent == other.yOffsetPercent } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for LVBKIMAGEA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for LVBKIMAGEA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct LVBKIMAGEW { pub ulFlags: u32, pub hbm: super::super::Graphics::Gdi::HBITMAP, pub pszImage: super::super::Foundation::PWSTR, pub cchImageMax: u32, pub xOffsetPercent: i32, pub yOffsetPercent: i32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl LVBKIMAGEW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for LVBKIMAGEW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for LVBKIMAGEW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVBKIMAGEW").field("ulFlags", &self.ulFlags).field("hbm", &self.hbm).field("pszImage", &self.pszImage).field("cchImageMax", &self.cchImageMax).field("xOffsetPercent", &self.xOffsetPercent).field("yOffsetPercent", &self.yOffsetPercent).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for LVBKIMAGEW { fn eq(&self, other: &Self) -> bool { self.ulFlags == other.ulFlags && self.hbm == other.hbm && self.pszImage == other.pszImage && self.cchImageMax == other.cchImageMax && self.xOffsetPercent == other.xOffsetPercent && self.yOffsetPercent == other.yOffsetPercent } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for LVBKIMAGEW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for LVBKIMAGEW { type Abi = Self; } pub const LVCDRF_NOGROUPFRAME: u32 = 131072u32; pub const LVCDRF_NOSELECT: u32 = 65536u32; pub const LVCFMT_FILL: u32 = 2097152u32; pub const LVCFMT_LINE_BREAK: u32 = 1048576u32; pub const LVCFMT_NO_TITLE: u32 = 8388608u32; pub const LVCFMT_WRAP: u32 = 4194304u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVCOLUMNA { pub mask: LVCOLUMNW_MASK, pub fmt: LVCOLUMNW_FORMAT, pub cx: i32, pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, pub iSubItem: i32, pub iImage: i32, pub iOrder: i32, pub cxMin: i32, pub cxDefault: i32, pub cxIdeal: i32, } #[cfg(feature = "Win32_Foundation")] impl LVCOLUMNA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVCOLUMNA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVCOLUMNA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVCOLUMNA") .field("mask", &self.mask) .field("fmt", &self.fmt) .field("cx", &self.cx) .field("pszText", &self.pszText) .field("cchTextMax", &self.cchTextMax) .field("iSubItem", &self.iSubItem) .field("iImage", &self.iImage) .field("iOrder", &self.iOrder) .field("cxMin", &self.cxMin) .field("cxDefault", &self.cxDefault) .field("cxIdeal", &self.cxIdeal) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVCOLUMNA { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.fmt == other.fmt && self.cx == other.cx && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iSubItem == other.iSubItem && self.iImage == other.iImage && self.iOrder == other.iOrder && self.cxMin == other.cxMin && self.cxDefault == other.cxDefault && self.cxIdeal == other.cxIdeal } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVCOLUMNA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVCOLUMNA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVCOLUMNW { pub mask: LVCOLUMNW_MASK, pub fmt: LVCOLUMNW_FORMAT, pub cx: i32, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub iSubItem: i32, pub iImage: i32, pub iOrder: i32, pub cxMin: i32, pub cxDefault: i32, pub cxIdeal: i32, } #[cfg(feature = "Win32_Foundation")] impl LVCOLUMNW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVCOLUMNW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVCOLUMNW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVCOLUMNW") .field("mask", &self.mask) .field("fmt", &self.fmt) .field("cx", &self.cx) .field("pszText", &self.pszText) .field("cchTextMax", &self.cchTextMax) .field("iSubItem", &self.iSubItem) .field("iImage", &self.iImage) .field("iOrder", &self.iOrder) .field("cxMin", &self.cxMin) .field("cxDefault", &self.cxDefault) .field("cxIdeal", &self.cxIdeal) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVCOLUMNW { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.fmt == other.fmt && self.cx == other.cx && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iSubItem == other.iSubItem && self.iImage == other.iImage && self.iOrder == other.iOrder && self.cxMin == other.cxMin && self.cxDefault == other.cxDefault && self.cxIdeal == other.cxIdeal } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVCOLUMNW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVCOLUMNW { 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 LVCOLUMNW_FORMAT(pub u32); pub const LVCFMT_LEFT: LVCOLUMNW_FORMAT = LVCOLUMNW_FORMAT(0u32); pub const LVCFMT_RIGHT: LVCOLUMNW_FORMAT = LVCOLUMNW_FORMAT(1u32); pub const LVCFMT_CENTER: LVCOLUMNW_FORMAT = LVCOLUMNW_FORMAT(2u32); pub const LVCFMT_JUSTIFYMASK: LVCOLUMNW_FORMAT = LVCOLUMNW_FORMAT(3u32); pub const LVCFMT_IMAGE: LVCOLUMNW_FORMAT = LVCOLUMNW_FORMAT(2048u32); pub const LVCFMT_BITMAP_ON_RIGHT: LVCOLUMNW_FORMAT = LVCOLUMNW_FORMAT(4096u32); pub const LVCFMT_COL_HAS_IMAGES: LVCOLUMNW_FORMAT = LVCOLUMNW_FORMAT(32768u32); pub const LVCFMT_FIXED_WIDTH: LVCOLUMNW_FORMAT = LVCOLUMNW_FORMAT(256u32); pub const LVCFMT_NO_DPI_SCALE: LVCOLUMNW_FORMAT = LVCOLUMNW_FORMAT(262144u32); pub const LVCFMT_FIXED_RATIO: LVCOLUMNW_FORMAT = LVCOLUMNW_FORMAT(524288u32); pub const LVCFMT_SPLITBUTTON: LVCOLUMNW_FORMAT = LVCOLUMNW_FORMAT(16777216u32); impl ::core::convert::From<u32> for LVCOLUMNW_FORMAT { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for LVCOLUMNW_FORMAT { type Abi = Self; } impl ::core::ops::BitOr for LVCOLUMNW_FORMAT { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for LVCOLUMNW_FORMAT { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for LVCOLUMNW_FORMAT { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for LVCOLUMNW_FORMAT { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for LVCOLUMNW_FORMAT { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct LVCOLUMNW_MASK(pub u32); pub const LVCF_FMT: LVCOLUMNW_MASK = LVCOLUMNW_MASK(1u32); pub const LVCF_WIDTH: LVCOLUMNW_MASK = LVCOLUMNW_MASK(2u32); pub const LVCF_TEXT: LVCOLUMNW_MASK = LVCOLUMNW_MASK(4u32); pub const LVCF_SUBITEM: LVCOLUMNW_MASK = LVCOLUMNW_MASK(8u32); pub const LVCF_IMAGE: LVCOLUMNW_MASK = LVCOLUMNW_MASK(16u32); pub const LVCF_ORDER: LVCOLUMNW_MASK = LVCOLUMNW_MASK(32u32); pub const LVCF_MINWIDTH: LVCOLUMNW_MASK = LVCOLUMNW_MASK(64u32); pub const LVCF_DEFAULTWIDTH: LVCOLUMNW_MASK = LVCOLUMNW_MASK(128u32); pub const LVCF_IDEALWIDTH: LVCOLUMNW_MASK = LVCOLUMNW_MASK(256u32); impl ::core::convert::From<u32> for LVCOLUMNW_MASK { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for LVCOLUMNW_MASK { type Abi = Self; } impl ::core::ops::BitOr for LVCOLUMNW_MASK { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for LVCOLUMNW_MASK { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for LVCOLUMNW_MASK { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for LVCOLUMNW_MASK { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for LVCOLUMNW_MASK { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const LVFF_ITEMCOUNT: u32 = 1u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVFINDINFOA { pub flags: LVFINDINFOW_FLAGS, pub psz: super::super::Foundation::PSTR, pub lParam: super::super::Foundation::LPARAM, pub pt: super::super::Foundation::POINT, pub vkDirection: u32, } #[cfg(feature = "Win32_Foundation")] impl LVFINDINFOA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVFINDINFOA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVFINDINFOA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVFINDINFOA").field("flags", &self.flags).field("psz", &self.psz).field("lParam", &self.lParam).field("pt", &self.pt).field("vkDirection", &self.vkDirection).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVFINDINFOA { fn eq(&self, other: &Self) -> bool { self.flags == other.flags && self.psz == other.psz && self.lParam == other.lParam && self.pt == other.pt && self.vkDirection == other.vkDirection } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVFINDINFOA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVFINDINFOA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVFINDINFOW { pub flags: LVFINDINFOW_FLAGS, pub psz: super::super::Foundation::PWSTR, pub lParam: super::super::Foundation::LPARAM, pub pt: super::super::Foundation::POINT, pub vkDirection: u32, } #[cfg(feature = "Win32_Foundation")] impl LVFINDINFOW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVFINDINFOW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVFINDINFOW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVFINDINFOW").field("flags", &self.flags).field("psz", &self.psz).field("lParam", &self.lParam).field("pt", &self.pt).field("vkDirection", &self.vkDirection).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVFINDINFOW { fn eq(&self, other: &Self) -> bool { self.flags == other.flags && self.psz == other.psz && self.lParam == other.lParam && self.pt == other.pt && self.vkDirection == other.vkDirection } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVFINDINFOW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVFINDINFOW { 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 LVFINDINFOW_FLAGS(pub u32); pub const LVFI_PARAM: LVFINDINFOW_FLAGS = LVFINDINFOW_FLAGS(1u32); pub const LVFI_PARTIAL: LVFINDINFOW_FLAGS = LVFINDINFOW_FLAGS(8u32); pub const LVFI_STRING: LVFINDINFOW_FLAGS = LVFINDINFOW_FLAGS(2u32); pub const LVFI_SUBSTRING: LVFINDINFOW_FLAGS = LVFINDINFOW_FLAGS(4u32); pub const LVFI_WRAP: LVFINDINFOW_FLAGS = LVFINDINFOW_FLAGS(32u32); pub const LVFI_NEARESTXY: LVFINDINFOW_FLAGS = LVFINDINFOW_FLAGS(64u32); impl ::core::convert::From<u32> for LVFINDINFOW_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for LVFINDINFOW_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for LVFINDINFOW_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for LVFINDINFOW_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for LVFINDINFOW_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for LVFINDINFOW_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for LVFINDINFOW_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const LVFIS_FOCUSED: u32 = 1u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVFOOTERINFO { pub mask: u32, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub cItems: u32, } #[cfg(feature = "Win32_Foundation")] impl LVFOOTERINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVFOOTERINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVFOOTERINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVFOOTERINFO").field("mask", &self.mask).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("cItems", &self.cItems).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVFOOTERINFO { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.cItems == other.cItems } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVFOOTERINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVFOOTERINFO { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVFOOTERITEM { pub mask: LVFOOTERITEM_MASK, pub iItem: i32, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub state: u32, pub stateMask: u32, } #[cfg(feature = "Win32_Foundation")] impl LVFOOTERITEM {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVFOOTERITEM { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVFOOTERITEM { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVFOOTERITEM").field("mask", &self.mask).field("iItem", &self.iItem).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("state", &self.state).field("stateMask", &self.stateMask).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVFOOTERITEM { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.iItem == other.iItem && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.state == other.state && self.stateMask == other.stateMask } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVFOOTERITEM {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVFOOTERITEM { 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 LVFOOTERITEM_MASK(pub u32); pub const LVFIF_TEXT: LVFOOTERITEM_MASK = LVFOOTERITEM_MASK(1u32); pub const LVFIF_STATE: LVFOOTERITEM_MASK = LVFOOTERITEM_MASK(2u32); impl ::core::convert::From<u32> for LVFOOTERITEM_MASK { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for LVFOOTERITEM_MASK { type Abi = Self; } impl ::core::ops::BitOr for LVFOOTERITEM_MASK { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for LVFOOTERITEM_MASK { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for LVFOOTERITEM_MASK { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for LVFOOTERITEM_MASK { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for LVFOOTERITEM_MASK { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const LVGA_FOOTER_CENTER: u32 = 16u32; pub const LVGA_FOOTER_LEFT: u32 = 8u32; pub const LVGA_FOOTER_RIGHT: u32 = 32u32; pub const LVGF_ALIGN: u32 = 8u32; pub const LVGF_DESCRIPTIONBOTTOM: u32 = 2048u32; pub const LVGF_DESCRIPTIONTOP: u32 = 1024u32; pub const LVGF_EXTENDEDIMAGE: u32 = 8192u32; pub const LVGF_GROUPID: u32 = 16u32; pub const LVGF_ITEMS: u32 = 16384u32; pub const LVGF_SUBSET: u32 = 32768u32; pub const LVGF_SUBSETITEMS: u32 = 65536u32; pub const LVGF_SUBTITLE: u32 = 256u32; pub const LVGF_TASK: u32 = 512u32; pub const LVGF_TITLEIMAGE: u32 = 4096u32; pub const LVGGR_GROUP: u32 = 0u32; pub const LVGGR_HEADER: u32 = 1u32; pub const LVGGR_LABEL: u32 = 2u32; pub const LVGGR_SUBSETLINK: u32 = 3u32; pub const LVGIT_UNFOLDED: u32 = 1u32; pub const LVGMF_BORDERCOLOR: u32 = 2u32; pub const LVGMF_BORDERSIZE: u32 = 1u32; pub const LVGMF_NONE: u32 = 0u32; pub const LVGMF_TEXTCOLOR: u32 = 4u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVGROUP { pub cbSize: u32, pub mask: LVGROUP_MASK, pub pszHeader: super::super::Foundation::PWSTR, pub cchHeader: i32, pub pszFooter: super::super::Foundation::PWSTR, pub cchFooter: i32, pub iGroupId: i32, pub stateMask: u32, pub state: u32, pub uAlign: u32, pub pszSubtitle: super::super::Foundation::PWSTR, pub cchSubtitle: u32, pub pszTask: super::super::Foundation::PWSTR, pub cchTask: u32, pub pszDescriptionTop: super::super::Foundation::PWSTR, pub cchDescriptionTop: u32, pub pszDescriptionBottom: super::super::Foundation::PWSTR, pub cchDescriptionBottom: u32, pub iTitleImage: i32, pub iExtendedImage: i32, pub iFirstItem: i32, pub cItems: u32, pub pszSubsetTitle: super::super::Foundation::PWSTR, pub cchSubsetTitle: u32, } #[cfg(feature = "Win32_Foundation")] impl LVGROUP {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVGROUP { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVGROUP { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVGROUP") .field("cbSize", &self.cbSize) .field("mask", &self.mask) .field("pszHeader", &self.pszHeader) .field("cchHeader", &self.cchHeader) .field("pszFooter", &self.pszFooter) .field("cchFooter", &self.cchFooter) .field("iGroupId", &self.iGroupId) .field("stateMask", &self.stateMask) .field("state", &self.state) .field("uAlign", &self.uAlign) .field("pszSubtitle", &self.pszSubtitle) .field("cchSubtitle", &self.cchSubtitle) .field("pszTask", &self.pszTask) .field("cchTask", &self.cchTask) .field("pszDescriptionTop", &self.pszDescriptionTop) .field("cchDescriptionTop", &self.cchDescriptionTop) .field("pszDescriptionBottom", &self.pszDescriptionBottom) .field("cchDescriptionBottom", &self.cchDescriptionBottom) .field("iTitleImage", &self.iTitleImage) .field("iExtendedImage", &self.iExtendedImage) .field("iFirstItem", &self.iFirstItem) .field("cItems", &self.cItems) .field("pszSubsetTitle", &self.pszSubsetTitle) .field("cchSubsetTitle", &self.cchSubsetTitle) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVGROUP { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.mask == other.mask && self.pszHeader == other.pszHeader && self.cchHeader == other.cchHeader && self.pszFooter == other.pszFooter && self.cchFooter == other.cchFooter && self.iGroupId == other.iGroupId && self.stateMask == other.stateMask && self.state == other.state && self.uAlign == other.uAlign && self.pszSubtitle == other.pszSubtitle && self.cchSubtitle == other.cchSubtitle && self.pszTask == other.pszTask && self.cchTask == other.cchTask && self.pszDescriptionTop == other.pszDescriptionTop && self.cchDescriptionTop == other.cchDescriptionTop && self.pszDescriptionBottom == other.pszDescriptionBottom && self.cchDescriptionBottom == other.cchDescriptionBottom && self.iTitleImage == other.iTitleImage && self.iExtendedImage == other.iExtendedImage && self.iFirstItem == other.iFirstItem && self.cItems == other.cItems && self.pszSubsetTitle == other.pszSubsetTitle && self.cchSubsetTitle == other.cchSubsetTitle } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVGROUP {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVGROUP { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct LVGROUPMETRICS { pub cbSize: u32, pub mask: u32, pub Left: u32, pub Top: u32, pub Right: u32, pub Bottom: u32, pub crLeft: u32, pub crTop: u32, pub crRight: u32, pub crBottom: u32, pub crHeader: u32, pub crFooter: u32, } impl LVGROUPMETRICS {} impl ::core::default::Default for LVGROUPMETRICS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for LVGROUPMETRICS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVGROUPMETRICS") .field("cbSize", &self.cbSize) .field("mask", &self.mask) .field("Left", &self.Left) .field("Top", &self.Top) .field("Right", &self.Right) .field("Bottom", &self.Bottom) .field("crLeft", &self.crLeft) .field("crTop", &self.crTop) .field("crRight", &self.crRight) .field("crBottom", &self.crBottom) .field("crHeader", &self.crHeader) .field("crFooter", &self.crFooter) .finish() } } impl ::core::cmp::PartialEq for LVGROUPMETRICS { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.mask == other.mask && self.Left == other.Left && self.Top == other.Top && self.Right == other.Right && self.Bottom == other.Bottom && self.crLeft == other.crLeft && self.crTop == other.crTop && self.crRight == other.crRight && self.crBottom == other.crBottom && self.crHeader == other.crHeader && self.crFooter == other.crFooter } } impl ::core::cmp::Eq for LVGROUPMETRICS {} unsafe impl ::windows::core::Abi for LVGROUPMETRICS { 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 LVGROUP_MASK(pub u32); pub const LVGF_NONE: LVGROUP_MASK = LVGROUP_MASK(0u32); pub const LVGF_HEADER: LVGROUP_MASK = LVGROUP_MASK(1u32); pub const LVGF_FOOTER: LVGROUP_MASK = LVGROUP_MASK(2u32); pub const LVGF_STATE: LVGROUP_MASK = LVGROUP_MASK(4u32); impl ::core::convert::From<u32> for LVGROUP_MASK { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for LVGROUP_MASK { type Abi = Self; } impl ::core::ops::BitOr for LVGROUP_MASK { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for LVGROUP_MASK { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for LVGROUP_MASK { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for LVGROUP_MASK { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for LVGROUP_MASK { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const LVGS_COLLAPSED: u32 = 1u32; pub const LVGS_COLLAPSIBLE: u32 = 8u32; pub const LVGS_FOCUSED: u32 = 16u32; pub const LVGS_HIDDEN: u32 = 2u32; pub const LVGS_NOHEADER: u32 = 4u32; pub const LVGS_NORMAL: u32 = 0u32; pub const LVGS_SELECTED: u32 = 32u32; pub const LVGS_SUBSETED: u32 = 64u32; pub const LVGS_SUBSETLINKFOCUSED: u32 = 128u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVHITTESTINFO { pub pt: super::super::Foundation::POINT, pub flags: LVHITTESTINFO_FLAGS, pub iItem: i32, pub iSubItem: i32, pub iGroup: i32, } #[cfg(feature = "Win32_Foundation")] impl LVHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVHITTESTINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVHITTESTINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVHITTESTINFO").field("pt", &self.pt).field("flags", &self.flags).field("iItem", &self.iItem).field("iSubItem", &self.iSubItem).field("iGroup", &self.iGroup).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVHITTESTINFO { fn eq(&self, other: &Self) -> bool { self.pt == other.pt && self.flags == other.flags && self.iItem == other.iItem && self.iSubItem == other.iSubItem && self.iGroup == other.iGroup } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVHITTESTINFO { 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 LVHITTESTINFO_FLAGS(pub u32); pub const LVHT_ABOVE: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(8u32); pub const LVHT_BELOW: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(16u32); pub const LVHT_NOWHERE: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(1u32); pub const LVHT_ONITEMICON: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(2u32); pub const LVHT_ONITEMLABEL: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(4u32); pub const LVHT_ONITEMSTATEICON: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(8u32); pub const LVHT_TOLEFT: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(64u32); pub const LVHT_TORIGHT: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(32u32); pub const LVHT_EX_GROUP_HEADER: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(268435456u32); pub const LVHT_EX_GROUP_FOOTER: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(536870912u32); pub const LVHT_EX_GROUP_COLLAPSE: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(1073741824u32); pub const LVHT_EX_GROUP_BACKGROUND: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(2147483648u32); pub const LVHT_EX_GROUP_STATEICON: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(16777216u32); pub const LVHT_EX_GROUP_SUBSETLINK: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(33554432u32); pub const LVHT_EX_GROUP: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(4076863488u32); pub const LVHT_EX_ONCONTENTS: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(67108864u32); pub const LVHT_EX_FOOTER: LVHITTESTINFO_FLAGS = LVHITTESTINFO_FLAGS(134217728u32); impl ::core::convert::From<u32> for LVHITTESTINFO_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for LVHITTESTINFO_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for LVHITTESTINFO_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for LVHITTESTINFO_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for LVHITTESTINFO_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for LVHITTESTINFO_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for LVHITTESTINFO_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const LVIF_COLFMT: u32 = 65536u32; pub const LVIF_COLUMNS: u32 = 512u32; pub const LVIF_DI_SETITEM: u32 = 4096u32; pub const LVIF_GROUPID: u32 = 256u32; pub const LVIF_IMAGE: u32 = 2u32; pub const LVIF_INDENT: u32 = 16u32; pub const LVIF_NORECOMPUTE: u32 = 2048u32; pub const LVIF_PARAM: u32 = 4u32; pub const LVIF_STATE: u32 = 8u32; pub const LVIF_TEXT: u32 = 1u32; pub const LVIM_AFTER: u32 = 1u32; #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVINSERTGROUPSORTED { pub pfnGroupCompare: ::core::option::Option<PFNLVGROUPCOMPARE>, pub pvData: *mut ::core::ffi::c_void, pub lvGroup: LVGROUP, } #[cfg(feature = "Win32_Foundation")] impl LVINSERTGROUPSORTED {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVINSERTGROUPSORTED { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVINSERTGROUPSORTED { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVINSERTGROUPSORTED").field("pvData", &self.pvData).field("lvGroup", &self.lvGroup).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVINSERTGROUPSORTED { fn eq(&self, other: &Self) -> bool { self.pfnGroupCompare.map(|f| f as usize) == other.pfnGroupCompare.map(|f| f as usize) && self.pvData == other.pvData && self.lvGroup == other.lvGroup } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVINSERTGROUPSORTED {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVINSERTGROUPSORTED { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct LVINSERTMARK { pub cbSize: u32, pub dwFlags: u32, pub iItem: i32, pub dwReserved: u32, } impl LVINSERTMARK {} impl ::core::default::Default for LVINSERTMARK { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for LVINSERTMARK { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVINSERTMARK").field("cbSize", &self.cbSize).field("dwFlags", &self.dwFlags).field("iItem", &self.iItem).field("dwReserved", &self.dwReserved).finish() } } impl ::core::cmp::PartialEq for LVINSERTMARK { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.dwFlags == other.dwFlags && self.iItem == other.iItem && self.dwReserved == other.dwReserved } } impl ::core::cmp::Eq for LVINSERTMARK {} unsafe impl ::windows::core::Abi for LVINSERTMARK { type Abi = Self; } pub const LVIR_BOUNDS: u32 = 0u32; pub const LVIR_ICON: u32 = 1u32; pub const LVIR_LABEL: u32 = 2u32; pub const LVIR_SELECTBOUNDS: u32 = 3u32; pub const LVIS_ACTIVATING: u32 = 32u32; pub const LVIS_CUT: u32 = 4u32; pub const LVIS_DROPHILITED: u32 = 8u32; pub const LVIS_FOCUSED: u32 = 1u32; pub const LVIS_GLOW: u32 = 16u32; pub const LVIS_OVERLAYMASK: u32 = 3840u32; pub const LVIS_SELECTED: u32 = 2u32; pub const LVIS_STATEIMAGEMASK: u32 = 61440u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVITEMA { pub mask: u32, pub iItem: i32, pub iSubItem: i32, pub state: u32, pub stateMask: u32, pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, pub iImage: i32, pub lParam: super::super::Foundation::LPARAM, pub iIndent: i32, pub iGroupId: LVITEMA_GROUP_ID, pub cColumns: u32, pub puColumns: *mut u32, pub piColFmt: *mut i32, pub iGroup: i32, } #[cfg(feature = "Win32_Foundation")] impl LVITEMA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVITEMA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVITEMA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVITEMA") .field("mask", &self.mask) .field("iItem", &self.iItem) .field("iSubItem", &self.iSubItem) .field("state", &self.state) .field("stateMask", &self.stateMask) .field("pszText", &self.pszText) .field("cchTextMax", &self.cchTextMax) .field("iImage", &self.iImage) .field("lParam", &self.lParam) .field("iIndent", &self.iIndent) .field("iGroupId", &self.iGroupId) .field("cColumns", &self.cColumns) .field("puColumns", &self.puColumns) .field("piColFmt", &self.piColFmt) .field("iGroup", &self.iGroup) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVITEMA { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.iItem == other.iItem && self.iSubItem == other.iSubItem && self.state == other.state && self.stateMask == other.stateMask && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.lParam == other.lParam && self.iIndent == other.iIndent && self.iGroupId == other.iGroupId && self.cColumns == other.cColumns && self.puColumns == other.puColumns && self.piColFmt == other.piColFmt && self.iGroup == other.iGroup } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVITEMA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVITEMA { 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 LVITEMA_GROUP_ID(pub i32); pub const I_GROUPIDCALLBACK: LVITEMA_GROUP_ID = LVITEMA_GROUP_ID(-1i32); pub const I_GROUPIDNONE: LVITEMA_GROUP_ID = LVITEMA_GROUP_ID(-2i32); impl ::core::convert::From<i32> for LVITEMA_GROUP_ID { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for LVITEMA_GROUP_ID { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct LVITEMINDEX { pub iItem: i32, pub iGroup: i32, } impl LVITEMINDEX {} impl ::core::default::Default for LVITEMINDEX { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for LVITEMINDEX { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVITEMINDEX").field("iItem", &self.iItem).field("iGroup", &self.iGroup).finish() } } impl ::core::cmp::PartialEq for LVITEMINDEX { fn eq(&self, other: &Self) -> bool { self.iItem == other.iItem && self.iGroup == other.iGroup } } impl ::core::cmp::Eq for LVITEMINDEX {} unsafe impl ::windows::core::Abi for LVITEMINDEX { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVITEMW { pub mask: u32, pub iItem: i32, pub iSubItem: i32, pub state: u32, pub stateMask: u32, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub iImage: i32, pub lParam: super::super::Foundation::LPARAM, pub iIndent: i32, pub iGroupId: LVITEMA_GROUP_ID, pub cColumns: u32, pub puColumns: *mut u32, pub piColFmt: *mut i32, pub iGroup: i32, } #[cfg(feature = "Win32_Foundation")] impl LVITEMW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVITEMW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVITEMW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVITEMW") .field("mask", &self.mask) .field("iItem", &self.iItem) .field("iSubItem", &self.iSubItem) .field("state", &self.state) .field("stateMask", &self.stateMask) .field("pszText", &self.pszText) .field("cchTextMax", &self.cchTextMax) .field("iImage", &self.iImage) .field("lParam", &self.lParam) .field("iIndent", &self.iIndent) .field("iGroupId", &self.iGroupId) .field("cColumns", &self.cColumns) .field("puColumns", &self.puColumns) .field("piColFmt", &self.piColFmt) .field("iGroup", &self.iGroup) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVITEMW { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.iItem == other.iItem && self.iSubItem == other.iSubItem && self.state == other.state && self.stateMask == other.stateMask && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.lParam == other.lParam && self.iIndent == other.iIndent && self.iGroupId == other.iGroupId && self.cColumns == other.cColumns && self.puColumns == other.puColumns && self.piColFmt == other.piColFmt && self.iGroup == other.iGroup } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVITEMW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVITEMW { type Abi = Self; } pub const LVKF_ALT: u32 = 1u32; pub const LVKF_CONTROL: u32 = 2u32; pub const LVKF_SHIFT: u32 = 4u32; pub const LVM_APPROXIMATEVIEWRECT: u32 = 4160u32; pub const LVM_ARRANGE: u32 = 4118u32; pub const LVM_CANCELEDITLABEL: u32 = 4275u32; pub const LVM_CREATEDRAGIMAGE: u32 = 4129u32; pub const LVM_DELETEALLITEMS: u32 = 4105u32; pub const LVM_DELETECOLUMN: u32 = 4124u32; pub const LVM_DELETEITEM: u32 = 4104u32; pub const LVM_EDITLABEL: u32 = 4214u32; pub const LVM_EDITLABELA: u32 = 4119u32; pub const LVM_EDITLABELW: u32 = 4214u32; pub const LVM_ENABLEGROUPVIEW: u32 = 4253u32; pub const LVM_ENSUREVISIBLE: u32 = 4115u32; pub const LVM_FINDITEM: u32 = 4179u32; pub const LVM_FINDITEMA: u32 = 4109u32; pub const LVM_FINDITEMW: u32 = 4179u32; pub const LVM_FIRST: u32 = 4096u32; pub const LVM_GETBKCOLOR: u32 = 4096u32; pub const LVM_GETBKIMAGE: u32 = 4235u32; pub const LVM_GETBKIMAGEA: u32 = 4165u32; pub const LVM_GETBKIMAGEW: u32 = 4235u32; pub const LVM_GETCALLBACKMASK: u32 = 4106u32; pub const LVM_GETCOLUMN: u32 = 4191u32; pub const LVM_GETCOLUMNA: u32 = 4121u32; pub const LVM_GETCOLUMNORDERARRAY: u32 = 4155u32; pub const LVM_GETCOLUMNW: u32 = 4191u32; pub const LVM_GETCOLUMNWIDTH: u32 = 4125u32; pub const LVM_GETCOUNTPERPAGE: u32 = 4136u32; pub const LVM_GETEDITCONTROL: u32 = 4120u32; pub const LVM_GETEMPTYTEXT: u32 = 4300u32; pub const LVM_GETEXTENDEDLISTVIEWSTYLE: u32 = 4151u32; pub const LVM_GETFOCUSEDGROUP: u32 = 4189u32; pub const LVM_GETFOOTERINFO: u32 = 4302u32; pub const LVM_GETFOOTERITEM: u32 = 4304u32; pub const LVM_GETFOOTERITEMRECT: u32 = 4303u32; pub const LVM_GETFOOTERRECT: u32 = 4301u32; pub const LVM_GETGROUPCOUNT: u32 = 4248u32; pub const LVM_GETGROUPINFO: u32 = 4245u32; pub const LVM_GETGROUPINFOBYINDEX: u32 = 4249u32; pub const LVM_GETGROUPMETRICS: u32 = 4252u32; pub const LVM_GETGROUPRECT: u32 = 4194u32; pub const LVM_GETGROUPSTATE: u32 = 4188u32; pub const LVM_GETHEADER: u32 = 4127u32; pub const LVM_GETHOTCURSOR: u32 = 4159u32; pub const LVM_GETHOTITEM: u32 = 4157u32; pub const LVM_GETHOVERTIME: u32 = 4168u32; pub const LVM_GETIMAGELIST: u32 = 4098u32; pub const LVM_GETINSERTMARK: u32 = 4263u32; pub const LVM_GETINSERTMARKCOLOR: u32 = 4267u32; pub const LVM_GETINSERTMARKRECT: u32 = 4265u32; pub const LVM_GETISEARCHSTRING: u32 = 4213u32; pub const LVM_GETISEARCHSTRINGA: u32 = 4148u32; pub const LVM_GETISEARCHSTRINGW: u32 = 4213u32; pub const LVM_GETITEM: u32 = 4171u32; pub const LVM_GETITEMA: u32 = 4101u32; pub const LVM_GETITEMCOUNT: u32 = 4100u32; pub const LVM_GETITEMINDEXRECT: u32 = 4305u32; pub const LVM_GETITEMPOSITION: u32 = 4112u32; pub const LVM_GETITEMRECT: u32 = 4110u32; pub const LVM_GETITEMSPACING: u32 = 4147u32; pub const LVM_GETITEMSTATE: u32 = 4140u32; pub const LVM_GETITEMTEXT: u32 = 4211u32; pub const LVM_GETITEMTEXTA: u32 = 4141u32; pub const LVM_GETITEMTEXTW: u32 = 4211u32; pub const LVM_GETITEMW: u32 = 4171u32; pub const LVM_GETNEXTITEM: u32 = 4108u32; pub const LVM_GETNEXTITEMINDEX: u32 = 4307u32; pub const LVM_GETNUMBEROFWORKAREAS: u32 = 4169u32; pub const LVM_GETORIGIN: u32 = 4137u32; pub const LVM_GETOUTLINECOLOR: u32 = 4272u32; pub const LVM_GETSELECTEDCOLUMN: u32 = 4270u32; pub const LVM_GETSELECTEDCOUNT: u32 = 4146u32; pub const LVM_GETSELECTIONMARK: u32 = 4162u32; pub const LVM_GETSTRINGWIDTH: u32 = 4183u32; pub const LVM_GETSTRINGWIDTHA: u32 = 4113u32; pub const LVM_GETSTRINGWIDTHW: u32 = 4183u32; pub const LVM_GETSUBITEMRECT: u32 = 4152u32; pub const LVM_GETTEXTBKCOLOR: u32 = 4133u32; pub const LVM_GETTEXTCOLOR: u32 = 4131u32; pub const LVM_GETTILEINFO: u32 = 4261u32; pub const LVM_GETTILEVIEWINFO: u32 = 4259u32; pub const LVM_GETTOOLTIPS: u32 = 4174u32; pub const LVM_GETTOPINDEX: u32 = 4135u32; pub const LVM_GETUNICODEFORMAT: u32 = 8198u32; pub const LVM_GETVIEW: u32 = 4239u32; pub const LVM_GETVIEWRECT: u32 = 4130u32; pub const LVM_GETWORKAREAS: u32 = 4166u32; pub const LVM_HASGROUP: u32 = 4257u32; pub const LVM_HITTEST: u32 = 4114u32; pub const LVM_INSERTCOLUMNA: u32 = 4123u32; pub const LVM_INSERTCOLUMNW: u32 = 4193u32; pub const LVM_INSERTGROUP: u32 = 4241u32; pub const LVM_INSERTGROUPSORTED: u32 = 4255u32; pub const LVM_INSERTITEM: u32 = 4173u32; pub const LVM_INSERTITEMA: u32 = 4103u32; pub const LVM_INSERTITEMW: u32 = 4173u32; pub const LVM_INSERTMARKHITTEST: u32 = 4264u32; pub const LVM_ISGROUPVIEWENABLED: u32 = 4271u32; pub const LVM_ISITEMVISIBLE: u32 = 4278u32; pub const LVM_MAPIDTOINDEX: u32 = 4277u32; pub const LVM_MAPINDEXTOID: u32 = 4276u32; pub const LVM_MOVEGROUP: u32 = 4247u32; pub const LVM_MOVEITEMTOGROUP: u32 = 4250u32; pub const LVM_REDRAWITEMS: u32 = 4117u32; pub const LVM_REMOVEALLGROUPS: u32 = 4256u32; pub const LVM_REMOVEGROUP: u32 = 4246u32; pub const LVM_SCROLL: u32 = 4116u32; pub const LVM_SETBKCOLOR: u32 = 4097u32; pub const LVM_SETBKIMAGE: u32 = 4234u32; pub const LVM_SETBKIMAGEA: u32 = 4164u32; pub const LVM_SETBKIMAGEW: u32 = 4234u32; pub const LVM_SETCALLBACKMASK: u32 = 4107u32; pub const LVM_SETCOLUMN: u32 = 4192u32; pub const LVM_SETCOLUMNA: u32 = 4122u32; pub const LVM_SETCOLUMNORDERARRAY: u32 = 4154u32; pub const LVM_SETCOLUMNW: u32 = 4192u32; pub const LVM_SETCOLUMNWIDTH: u32 = 4126u32; pub const LVM_SETEXTENDEDLISTVIEWSTYLE: u32 = 4150u32; pub const LVM_SETGROUPINFO: u32 = 4243u32; pub const LVM_SETGROUPMETRICS: u32 = 4251u32; pub const LVM_SETHOTCURSOR: u32 = 4158u32; pub const LVM_SETHOTITEM: u32 = 4156u32; pub const LVM_SETHOVERTIME: u32 = 4167u32; pub const LVM_SETICONSPACING: u32 = 4149u32; pub const LVM_SETIMAGELIST: u32 = 4099u32; pub const LVM_SETINFOTIP: u32 = 4269u32; pub const LVM_SETINSERTMARK: u32 = 4262u32; pub const LVM_SETINSERTMARKCOLOR: u32 = 4266u32; pub const LVM_SETITEM: u32 = 4172u32; pub const LVM_SETITEMA: u32 = 4102u32; pub const LVM_SETITEMCOUNT: u32 = 4143u32; pub const LVM_SETITEMINDEXSTATE: u32 = 4306u32; pub const LVM_SETITEMPOSITION: u32 = 4111u32; pub const LVM_SETITEMPOSITION32: u32 = 4145u32; pub const LVM_SETITEMSTATE: u32 = 4139u32; pub const LVM_SETITEMTEXT: u32 = 4212u32; pub const LVM_SETITEMTEXTA: u32 = 4142u32; pub const LVM_SETITEMTEXTW: u32 = 4212u32; pub const LVM_SETITEMW: u32 = 4172u32; pub const LVM_SETOUTLINECOLOR: u32 = 4273u32; pub const LVM_SETSELECTEDCOLUMN: u32 = 4236u32; pub const LVM_SETSELECTIONMARK: u32 = 4163u32; pub const LVM_SETTEXTBKCOLOR: u32 = 4134u32; pub const LVM_SETTEXTCOLOR: u32 = 4132u32; pub const LVM_SETTILEINFO: u32 = 4260u32; pub const LVM_SETTILEVIEWINFO: u32 = 4258u32; pub const LVM_SETTOOLTIPS: u32 = 4170u32; pub const LVM_SETUNICODEFORMAT: u32 = 8197u32; pub const LVM_SETVIEW: u32 = 4238u32; pub const LVM_SETWORKAREAS: u32 = 4161u32; pub const LVM_SORTGROUPS: u32 = 4254u32; pub const LVM_SORTITEMS: u32 = 4144u32; pub const LVM_SORTITEMSEX: u32 = 4177u32; pub const LVM_SUBITEMHITTEST: u32 = 4153u32; pub const LVM_UPDATE: u32 = 4138u32; pub const LVNI_ABOVE: u32 = 256u32; pub const LVNI_ALL: u32 = 0u32; pub const LVNI_BELOW: u32 = 512u32; pub const LVNI_CUT: u32 = 4u32; pub const LVNI_DROPHILITED: u32 = 8u32; pub const LVNI_FOCUSED: u32 = 1u32; pub const LVNI_PREVIOUS: u32 = 32u32; pub const LVNI_SAMEGROUPONLY: u32 = 128u32; pub const LVNI_SELECTED: u32 = 2u32; pub const LVNI_TOLEFT: u32 = 1024u32; pub const LVNI_TORIGHT: u32 = 2048u32; pub const LVNI_VISIBLEONLY: u32 = 64u32; pub const LVNI_VISIBLEORDER: u32 = 16u32; pub const LVNSCH_DEFAULT: i32 = -1i32; pub const LVNSCH_ERROR: i32 = -2i32; pub const LVNSCH_IGNORE: i32 = -3i32; pub const LVSCW_AUTOSIZE: i32 = -1i32; pub const LVSCW_AUTOSIZE_USEHEADER: i32 = -2i32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVSETINFOTIP { pub cbSize: u32, pub dwFlags: u32, pub pszText: super::super::Foundation::PWSTR, pub iItem: i32, pub iSubItem: i32, } #[cfg(feature = "Win32_Foundation")] impl LVSETINFOTIP {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVSETINFOTIP { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVSETINFOTIP { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVSETINFOTIP").field("cbSize", &self.cbSize).field("dwFlags", &self.dwFlags).field("pszText", &self.pszText).field("iItem", &self.iItem).field("iSubItem", &self.iSubItem).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVSETINFOTIP { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.dwFlags == other.dwFlags && self.pszText == other.pszText && self.iItem == other.iItem && self.iSubItem == other.iSubItem } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVSETINFOTIP {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVSETINFOTIP { type Abi = Self; } pub const LVSICF_NOINVALIDATEALL: u32 = 1u32; pub const LVSICF_NOSCROLL: u32 = 2u32; pub const LVSIL_GROUPHEADER: u32 = 3u32; pub const LVSIL_NORMAL: u32 = 0u32; pub const LVSIL_SMALL: u32 = 1u32; pub const LVSIL_STATE: u32 = 2u32; pub const LVS_ALIGNLEFT: u32 = 2048u32; pub const LVS_ALIGNMASK: u32 = 3072u32; pub const LVS_ALIGNTOP: u32 = 0u32; pub const LVS_AUTOARRANGE: u32 = 256u32; pub const LVS_EDITLABELS: u32 = 512u32; pub const LVS_EX_AUTOAUTOARRANGE: u32 = 16777216u32; pub const LVS_EX_AUTOCHECKSELECT: u32 = 134217728u32; pub const LVS_EX_AUTOSIZECOLUMNS: u32 = 268435456u32; pub const LVS_EX_BORDERSELECT: u32 = 32768u32; pub const LVS_EX_CHECKBOXES: u32 = 4u32; pub const LVS_EX_COLUMNOVERFLOW: u32 = 2147483648u32; pub const LVS_EX_COLUMNSNAPPOINTS: u32 = 1073741824u32; pub const LVS_EX_DOUBLEBUFFER: u32 = 65536u32; pub const LVS_EX_FLATSB: u32 = 256u32; pub const LVS_EX_FULLROWSELECT: u32 = 32u32; pub const LVS_EX_GRIDLINES: u32 = 1u32; pub const LVS_EX_HEADERDRAGDROP: u32 = 16u32; pub const LVS_EX_HEADERINALLVIEWS: u32 = 33554432u32; pub const LVS_EX_HIDELABELS: u32 = 131072u32; pub const LVS_EX_INFOTIP: u32 = 1024u32; pub const LVS_EX_JUSTIFYCOLUMNS: u32 = 2097152u32; pub const LVS_EX_LABELTIP: u32 = 16384u32; pub const LVS_EX_MULTIWORKAREAS: u32 = 8192u32; pub const LVS_EX_ONECLICKACTIVATE: u32 = 64u32; pub const LVS_EX_REGIONAL: u32 = 512u32; pub const LVS_EX_SIMPLESELECT: u32 = 1048576u32; pub const LVS_EX_SINGLEROW: u32 = 262144u32; pub const LVS_EX_SNAPTOGRID: u32 = 524288u32; pub const LVS_EX_SUBITEMIMAGES: u32 = 2u32; pub const LVS_EX_TRACKSELECT: u32 = 8u32; pub const LVS_EX_TRANSPARENTBKGND: u32 = 4194304u32; pub const LVS_EX_TRANSPARENTSHADOWTEXT: u32 = 8388608u32; pub const LVS_EX_TWOCLICKACTIVATE: u32 = 128u32; pub const LVS_EX_UNDERLINECOLD: u32 = 4096u32; pub const LVS_EX_UNDERLINEHOT: u32 = 2048u32; pub const LVS_ICON: u32 = 0u32; pub const LVS_LIST: u32 = 3u32; pub const LVS_NOCOLUMNHEADER: u32 = 16384u32; pub const LVS_NOLABELWRAP: u32 = 128u32; pub const LVS_NOSCROLL: u32 = 8192u32; pub const LVS_NOSORTHEADER: u32 = 32768u32; pub const LVS_OWNERDATA: u32 = 4096u32; pub const LVS_OWNERDRAWFIXED: u32 = 1024u32; pub const LVS_REPORT: u32 = 1u32; pub const LVS_SHAREIMAGELISTS: u32 = 64u32; pub const LVS_SHOWSELALWAYS: u32 = 8u32; pub const LVS_SINGLESEL: u32 = 4u32; pub const LVS_SMALLICON: u32 = 2u32; pub const LVS_SORTASCENDING: u32 = 16u32; pub const LVS_SORTDESCENDING: u32 = 32u32; pub const LVS_TYPEMASK: u32 = 3u32; pub const LVS_TYPESTYLEMASK: u32 = 64512u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct LVTILEINFO { pub cbSize: u32, pub iItem: i32, pub cColumns: u32, pub puColumns: *mut u32, pub piColFmt: *mut i32, } impl LVTILEINFO {} impl ::core::default::Default for LVTILEINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for LVTILEINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVTILEINFO").field("cbSize", &self.cbSize).field("iItem", &self.iItem).field("cColumns", &self.cColumns).field("puColumns", &self.puColumns).field("piColFmt", &self.piColFmt).finish() } } impl ::core::cmp::PartialEq for LVTILEINFO { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.iItem == other.iItem && self.cColumns == other.cColumns && self.puColumns == other.puColumns && self.piColFmt == other.piColFmt } } impl ::core::cmp::Eq for LVTILEINFO {} unsafe impl ::windows::core::Abi for LVTILEINFO { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct LVTILEVIEWINFO { pub cbSize: u32, pub dwMask: u32, pub dwFlags: LVTILEVIEWINFO_FLAGS, pub sizeTile: super::super::Foundation::SIZE, pub cLines: i32, pub rcLabelMargin: super::super::Foundation::RECT, } #[cfg(feature = "Win32_Foundation")] impl LVTILEVIEWINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for LVTILEVIEWINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for LVTILEVIEWINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("LVTILEVIEWINFO").field("cbSize", &self.cbSize).field("dwMask", &self.dwMask).field("dwFlags", &self.dwFlags).field("sizeTile", &self.sizeTile).field("cLines", &self.cLines).field("rcLabelMargin", &self.rcLabelMargin).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for LVTILEVIEWINFO { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.dwMask == other.dwMask && self.dwFlags == other.dwFlags && self.sizeTile == other.sizeTile && self.cLines == other.cLines && self.rcLabelMargin == other.rcLabelMargin } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for LVTILEVIEWINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for LVTILEVIEWINFO { 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 LVTILEVIEWINFO_FLAGS(pub u32); pub const LVTVIF_EXTENDED: LVTILEVIEWINFO_FLAGS = LVTILEVIEWINFO_FLAGS(4u32); impl ::core::convert::From<u32> for LVTILEVIEWINFO_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for LVTILEVIEWINFO_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for LVTILEVIEWINFO_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for LVTILEVIEWINFO_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for LVTILEVIEWINFO_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for LVTILEVIEWINFO_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for LVTILEVIEWINFO_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const LVTVIF_AUTOSIZE: u32 = 0u32; pub const LVTVIF_FIXEDHEIGHT: u32 = 2u32; pub const LVTVIF_FIXEDSIZE: u32 = 3u32; pub const LVTVIF_FIXEDWIDTH: u32 = 1u32; pub const LVTVIM_COLUMNS: u32 = 2u32; pub const LVTVIM_LABELMARGIN: u32 = 4u32; pub const LVTVIM_TILESIZE: u32 = 1u32; pub const LV_MAX_WORKAREAS: u32 = 16u32; pub const LV_VIEW_DETAILS: u32 = 1u32; pub const LV_VIEW_ICON: u32 = 0u32; pub const LV_VIEW_LIST: u32 = 3u32; pub const LV_VIEW_MAX: u32 = 4u32; pub const LV_VIEW_SMALLICON: u32 = 2u32; pub const LV_VIEW_TILE: u32 = 4u32; pub const LWS_IGNORERETURN: u32 = 2u32; pub const LWS_NOPREFIX: u32 = 4u32; pub const LWS_RIGHT: u32 = 32u32; pub const LWS_TRANSPARENT: u32 = 1u32; pub const LWS_USECUSTOMTEXT: u32 = 16u32; pub const LWS_USEVISUALSTYLE: u32 = 8u32; #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn LoadIconMetric<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HINSTANCE>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hinst: Param0, pszname: Param1, lims: _LI_METRIC) -> ::windows::core::Result<super::WindowsAndMessaging::HICON> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn LoadIconMetric(hinst: super::super::Foundation::HINSTANCE, pszname: super::super::Foundation::PWSTR, lims: _LI_METRIC, phico: *mut super::WindowsAndMessaging::HICON) -> ::windows::core::HRESULT; } let mut result__: <super::WindowsAndMessaging::HICON as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); LoadIconMetric(hinst.into_param().abi(), pszname.into_param().abi(), ::core::mem::transmute(lims), &mut result__).from_abi::<super::WindowsAndMessaging::HICON>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn LoadIconWithScaleDown<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HINSTANCE>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hinst: Param0, pszname: Param1, cx: i32, cy: i32) -> ::windows::core::Result<super::WindowsAndMessaging::HICON> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn LoadIconWithScaleDown(hinst: super::super::Foundation::HINSTANCE, pszname: super::super::Foundation::PWSTR, cx: i32, cy: i32, phico: *mut super::WindowsAndMessaging::HICON) -> ::windows::core::HRESULT; } let mut result__: <super::WindowsAndMessaging::HICON as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); LoadIconWithScaleDown(hinst.into_param().abi(), pszname.into_param().abi(), ::core::mem::transmute(cx), ::core::mem::transmute(cy), &mut result__).from_abi::<super::WindowsAndMessaging::HICON>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct MARGINS { pub cxLeftWidth: i32, pub cxRightWidth: i32, pub cyTopHeight: i32, pub cyBottomHeight: i32, } impl MARGINS {} impl ::core::default::Default for MARGINS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for MARGINS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("MARGINS").field("cxLeftWidth", &self.cxLeftWidth).field("cxRightWidth", &self.cxRightWidth).field("cyTopHeight", &self.cyTopHeight).field("cyBottomHeight", &self.cyBottomHeight).finish() } } impl ::core::cmp::PartialEq for MARGINS { fn eq(&self, other: &Self) -> bool { self.cxLeftWidth == other.cxLeftWidth && self.cxRightWidth == other.cxRightWidth && self.cyTopHeight == other.cyTopHeight && self.cyBottomHeight == other.cyBottomHeight } } impl ::core::cmp::Eq for MARGINS {} unsafe impl ::windows::core::Abi for MARGINS { 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 MARKUPTEXTSTATES(pub i32); pub const EMT_NORMALTEXT: MARKUPTEXTSTATES = MARKUPTEXTSTATES(1i32); pub const EMT_LINKTEXT: MARKUPTEXTSTATES = MARKUPTEXTSTATES(2i32); impl ::core::convert::From<i32> for MARKUPTEXTSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for MARKUPTEXTSTATES { type Abi = Self; } pub const MAXPROPPAGES: u32 = 100u32; pub const MAX_INTLIST_COUNT: u32 = 402u32; pub const MAX_LINKID_TEXT: u32 = 48u32; pub const MAX_THEMECOLOR: u32 = 64u32; pub const MAX_THEMESIZE: u32 = 64u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct MCGRIDINFO { pub cbSize: u32, pub dwPart: MCGRIDINFO_PART, pub dwFlags: MCGRIDINFO_FLAGS, pub iCalendar: i32, pub iRow: i32, pub iCol: i32, pub bSelected: super::super::Foundation::BOOL, pub stStart: super::super::Foundation::SYSTEMTIME, pub stEnd: super::super::Foundation::SYSTEMTIME, pub rc: super::super::Foundation::RECT, pub pszName: super::super::Foundation::PWSTR, pub cchName: usize, } #[cfg(feature = "Win32_Foundation")] impl MCGRIDINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for MCGRIDINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for MCGRIDINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("MCGRIDINFO") .field("cbSize", &self.cbSize) .field("dwPart", &self.dwPart) .field("dwFlags", &self.dwFlags) .field("iCalendar", &self.iCalendar) .field("iRow", &self.iRow) .field("iCol", &self.iCol) .field("bSelected", &self.bSelected) .field("stStart", &self.stStart) .field("stEnd", &self.stEnd) .field("rc", &self.rc) .field("pszName", &self.pszName) .field("cchName", &self.cchName) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for MCGRIDINFO { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.dwPart == other.dwPart && self.dwFlags == other.dwFlags && self.iCalendar == other.iCalendar && self.iRow == other.iRow && self.iCol == other.iCol && self.bSelected == other.bSelected && self.stStart == other.stStart && self.stEnd == other.stEnd && self.rc == other.rc && self.pszName == other.pszName && self.cchName == other.cchName } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for MCGRIDINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for MCGRIDINFO { 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 MCGRIDINFO_FLAGS(pub u32); pub const MCGIF_DATE: MCGRIDINFO_FLAGS = MCGRIDINFO_FLAGS(1u32); pub const MCGIF_RECT: MCGRIDINFO_FLAGS = MCGRIDINFO_FLAGS(2u32); pub const MCGIF_NAME: MCGRIDINFO_FLAGS = MCGRIDINFO_FLAGS(4u32); impl ::core::convert::From<u32> for MCGRIDINFO_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for MCGRIDINFO_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for MCGRIDINFO_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for MCGRIDINFO_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for MCGRIDINFO_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for MCGRIDINFO_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for MCGRIDINFO_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct MCGRIDINFO_PART(pub u32); pub const MCGIP_CALENDARCONTROL: MCGRIDINFO_PART = MCGRIDINFO_PART(0u32); pub const MCGIP_NEXT: MCGRIDINFO_PART = MCGRIDINFO_PART(1u32); pub const MCGIP_PREV: MCGRIDINFO_PART = MCGRIDINFO_PART(2u32); pub const MCGIP_FOOTER: MCGRIDINFO_PART = MCGRIDINFO_PART(3u32); pub const MCGIP_CALENDAR: MCGRIDINFO_PART = MCGRIDINFO_PART(4u32); pub const MCGIP_CALENDARHEADER: MCGRIDINFO_PART = MCGRIDINFO_PART(5u32); pub const MCGIP_CALENDARBODY: MCGRIDINFO_PART = MCGRIDINFO_PART(6u32); pub const MCGIP_CALENDARROW: MCGRIDINFO_PART = MCGRIDINFO_PART(7u32); pub const MCGIP_CALENDARCELL: MCGRIDINFO_PART = MCGRIDINFO_PART(8u32); impl ::core::convert::From<u32> for MCGRIDINFO_PART { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for MCGRIDINFO_PART { type Abi = Self; } impl ::core::ops::BitOr for MCGRIDINFO_PART { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for MCGRIDINFO_PART { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for MCGRIDINFO_PART { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for MCGRIDINFO_PART { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for MCGRIDINFO_PART { 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 MCHITTESTINFO { pub cbSize: u32, pub pt: super::super::Foundation::POINT, pub uHit: u32, pub st: super::super::Foundation::SYSTEMTIME, pub rc: super::super::Foundation::RECT, pub iOffset: i32, pub iRow: i32, pub iCol: i32, } #[cfg(feature = "Win32_Foundation")] impl MCHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for MCHITTESTINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for MCHITTESTINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("MCHITTESTINFO").field("cbSize", &self.cbSize).field("pt", &self.pt).field("uHit", &self.uHit).field("st", &self.st).field("rc", &self.rc).field("iOffset", &self.iOffset).field("iRow", &self.iRow).field("iCol", &self.iCol).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for MCHITTESTINFO { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.pt == other.pt && self.uHit == other.uHit && self.st == other.st && self.rc == other.rc && self.iOffset == other.iOffset && self.iRow == other.iRow && self.iCol == other.iCol } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for MCHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for MCHITTESTINFO { type Abi = Self; } pub const MCHT_CALENDAR: u32 = 131072u32; pub const MCHT_CALENDARBK: u32 = 131072u32; pub const MCHT_CALENDARCONTROL: u32 = 1048576u32; pub const MCHT_NEXT: u32 = 16777216u32; pub const MCHT_NOWHERE: u32 = 0u32; pub const MCHT_PREV: u32 = 33554432u32; pub const MCHT_TITLE: u32 = 65536u32; pub const MCHT_TITLEBK: u32 = 65536u32; pub const MCHT_TODAYLINK: u32 = 196608u32; pub const MCMV_CENTURY: u32 = 3u32; pub const MCMV_DECADE: u32 = 2u32; pub const MCMV_MAX: u32 = 3u32; pub const MCMV_MONTH: u32 = 0u32; pub const MCMV_YEAR: u32 = 1u32; pub const MCM_FIRST: u32 = 4096u32; pub const MCM_GETCALENDARBORDER: u32 = 4127u32; pub const MCM_GETCALENDARCOUNT: u32 = 4119u32; pub const MCM_GETCALENDARGRIDINFO: u32 = 4120u32; pub const MCM_GETCALID: u32 = 4123u32; pub const MCM_GETCOLOR: u32 = 4107u32; pub const MCM_GETCURRENTVIEW: u32 = 4118u32; pub const MCM_GETCURSEL: u32 = 4097u32; pub const MCM_GETFIRSTDAYOFWEEK: u32 = 4112u32; pub const MCM_GETMAXSELCOUNT: u32 = 4099u32; pub const MCM_GETMAXTODAYWIDTH: u32 = 4117u32; pub const MCM_GETMINREQRECT: u32 = 4105u32; pub const MCM_GETMONTHDELTA: u32 = 4115u32; pub const MCM_GETMONTHRANGE: u32 = 4103u32; pub const MCM_GETRANGE: u32 = 4113u32; pub const MCM_GETSELRANGE: u32 = 4101u32; pub const MCM_GETTODAY: u32 = 4109u32; pub const MCM_GETUNICODEFORMAT: u32 = 8198u32; pub const MCM_HITTEST: u32 = 4110u32; pub const MCM_SETCALENDARBORDER: u32 = 4126u32; pub const MCM_SETCALID: u32 = 4124u32; pub const MCM_SETCOLOR: u32 = 4106u32; pub const MCM_SETCURRENTVIEW: u32 = 4128u32; pub const MCM_SETCURSEL: u32 = 4098u32; pub const MCM_SETDAYSTATE: u32 = 4104u32; pub const MCM_SETFIRSTDAYOFWEEK: u32 = 4111u32; pub const MCM_SETMAXSELCOUNT: u32 = 4100u32; pub const MCM_SETMONTHDELTA: u32 = 4116u32; pub const MCM_SETRANGE: u32 = 4114u32; pub const MCM_SETSELRANGE: u32 = 4102u32; pub const MCM_SETTODAY: u32 = 4108u32; pub const MCM_SETUNICODEFORMAT: u32 = 8197u32; pub const MCM_SIZERECTTOMIN: u32 = 4125u32; pub const MCSC_BACKGROUND: u32 = 0u32; pub const MCSC_MONTHBK: u32 = 4u32; pub const MCSC_TEXT: u32 = 1u32; pub const MCSC_TITLEBK: u32 = 2u32; pub const MCSC_TITLETEXT: u32 = 3u32; pub const MCSC_TRAILINGTEXT: u32 = 5u32; pub const MCS_DAYSTATE: u32 = 1u32; pub const MCS_MULTISELECT: u32 = 2u32; pub const MCS_NOSELCHANGEONNAV: u32 = 256u32; pub const MCS_NOTODAY: u32 = 16u32; pub const MCS_NOTODAYCIRCLE: u32 = 8u32; pub const MCS_NOTRAILINGDATES: u32 = 64u32; pub const MCS_SHORTDAYSOFWEEK: u32 = 128u32; pub const MCS_WEEKNUMBERS: u32 = 4u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct MEASUREITEMSTRUCT { pub CtlType: u32, pub CtlID: u32, pub itemID: u32, pub itemWidth: u32, pub itemHeight: u32, pub itemData: usize, } impl MEASUREITEMSTRUCT {} impl ::core::default::Default for MEASUREITEMSTRUCT { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for MEASUREITEMSTRUCT { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("MEASUREITEMSTRUCT").field("CtlType", &self.CtlType).field("CtlID", &self.CtlID).field("itemID", &self.itemID).field("itemWidth", &self.itemWidth).field("itemHeight", &self.itemHeight).field("itemData", &self.itemData).finish() } } impl ::core::cmp::PartialEq for MEASUREITEMSTRUCT { fn eq(&self, other: &Self) -> bool { self.CtlType == other.CtlType && self.CtlID == other.CtlID && self.itemID == other.itemID && self.itemWidth == other.itemWidth && self.itemHeight == other.itemHeight && self.itemData == other.itemData } } impl ::core::cmp::Eq for MEASUREITEMSTRUCT {} unsafe impl ::windows::core::Abi for MEASUREITEMSTRUCT { 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 MENUBANDPARTS(pub i32); pub const MDP_NEWAPPBUTTON: MENUBANDPARTS = MENUBANDPARTS(1i32); pub const MDP_SEPERATOR: MENUBANDPARTS = MENUBANDPARTS(2i32); impl ::core::convert::From<i32> for MENUBANDPARTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for MENUBANDPARTS { 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 MENUBANDSTATES(pub i32); pub const MDS_NORMAL: MENUBANDSTATES = MENUBANDSTATES(1i32); pub const MDS_HOT: MENUBANDSTATES = MENUBANDSTATES(2i32); pub const MDS_PRESSED: MENUBANDSTATES = MENUBANDSTATES(3i32); pub const MDS_DISABLED: MENUBANDSTATES = MENUBANDSTATES(4i32); pub const MDS_CHECKED: MENUBANDSTATES = MENUBANDSTATES(5i32); pub const MDS_HOTCHECKED: MENUBANDSTATES = MENUBANDSTATES(6i32); impl ::core::convert::From<i32> for MENUBANDSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for MENUBANDSTATES { 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 MONTHCALPARTS(pub i32); pub const MC_BACKGROUND: MONTHCALPARTS = MONTHCALPARTS(1i32); pub const MC_BORDERS: MONTHCALPARTS = MONTHCALPARTS(2i32); pub const MC_GRIDBACKGROUND: MONTHCALPARTS = MONTHCALPARTS(3i32); pub const MC_COLHEADERSPLITTER: MONTHCALPARTS = MONTHCALPARTS(4i32); pub const MC_GRIDCELLBACKGROUND: MONTHCALPARTS = MONTHCALPARTS(5i32); pub const MC_GRIDCELL: MONTHCALPARTS = MONTHCALPARTS(6i32); pub const MC_GRIDCELLUPPER: MONTHCALPARTS = MONTHCALPARTS(7i32); pub const MC_TRAILINGGRIDCELL: MONTHCALPARTS = MONTHCALPARTS(8i32); pub const MC_TRAILINGGRIDCELLUPPER: MONTHCALPARTS = MONTHCALPARTS(9i32); pub const MC_NAVNEXT: MONTHCALPARTS = MONTHCALPARTS(10i32); pub const MC_NAVPREV: MONTHCALPARTS = MONTHCALPARTS(11i32); impl ::core::convert::From<i32> for MONTHCALPARTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for MONTHCALPARTS { 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 MOREPROGRAMSARROWBACKSTATES(pub i32); pub const SPSB_NORMAL: MOREPROGRAMSARROWBACKSTATES = MOREPROGRAMSARROWBACKSTATES(1i32); pub const SPSB_HOT: MOREPROGRAMSARROWBACKSTATES = MOREPROGRAMSARROWBACKSTATES(2i32); pub const SPSB_PRESSED: MOREPROGRAMSARROWBACKSTATES = MOREPROGRAMSARROWBACKSTATES(3i32); impl ::core::convert::From<i32> for MOREPROGRAMSARROWBACKSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for MOREPROGRAMSARROWBACKSTATES { 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 MOREPROGRAMSARROWSTATES(pub i32); pub const SPS_NORMAL: MOREPROGRAMSARROWSTATES = MOREPROGRAMSARROWSTATES(1i32); pub const SPS_HOT: MOREPROGRAMSARROWSTATES = MOREPROGRAMSARROWSTATES(2i32); pub const SPS_PRESSED: MOREPROGRAMSARROWSTATES = MOREPROGRAMSARROWSTATES(3i32); impl ::core::convert::From<i32> for MOREPROGRAMSARROWSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for MOREPROGRAMSARROWSTATES { 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 MOREPROGRAMSTABSTATES(pub i32); pub const SPMPT_NORMAL: MOREPROGRAMSTABSTATES = MOREPROGRAMSTABSTATES(1i32); pub const SPMPT_HOT: MOREPROGRAMSTABSTATES = MOREPROGRAMSTABSTATES(2i32); pub const SPMPT_SELECTED: MOREPROGRAMSTABSTATES = MOREPROGRAMSTABSTATES(3i32); pub const SPMPT_DISABLED: MOREPROGRAMSTABSTATES = MOREPROGRAMSTABSTATES(4i32); pub const SPMPT_FOCUSED: MOREPROGRAMSTABSTATES = MOREPROGRAMSTABSTATES(5i32); impl ::core::convert::From<i32> for MOREPROGRAMSTABSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for MOREPROGRAMSTABSTATES { type Abi = Self; } pub const MSGF_COMMCTRL_BEGINDRAG: u32 = 16896u32; pub const MSGF_COMMCTRL_DRAGSELECT: u32 = 16898u32; pub const MSGF_COMMCTRL_SIZEHEADER: u32 = 16897u32; pub const MSGF_COMMCTRL_TOOLBARCUST: u32 = 16899u32; pub const MULTIFILEOPENORD: u32 = 1537u32; #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn MakeDragList<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hlb: Param0) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn MakeDragList(hlb: super::super::Foundation::HWND) -> super::super::Foundation::BOOL; } ::core::mem::transmute(MakeDragList(hlb.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn MenuHelp<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::WPARAM>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::LPARAM>, Param3: ::windows::core::IntoParam<'a, super::WindowsAndMessaging::HMENU>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::HINSTANCE>, Param5: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>( umsg: u32, wparam: Param1, lparam: Param2, hmainmenu: Param3, hinst: Param4, hwndstatus: Param5, lpwids: *const u32, ) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn MenuHelp(umsg: u32, wparam: super::super::Foundation::WPARAM, lparam: super::super::Foundation::LPARAM, hmainmenu: super::WindowsAndMessaging::HMENU, hinst: super::super::Foundation::HINSTANCE, hwndstatus: super::super::Foundation::HWND, lpwids: *const u32); } ::core::mem::transmute(MenuHelp(::core::mem::transmute(umsg), wparam.into_param().abi(), lparam.into_param().abi(), hmainmenu.into_param().abi(), hinst.into_param().abi(), hwndstatus.into_param().abi(), ::core::mem::transmute(lpwids))) } #[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 NAVNEXTSTATES(pub i32); pub const MCNN_NORMAL: NAVNEXTSTATES = NAVNEXTSTATES(1i32); pub const MCNN_HOT: NAVNEXTSTATES = NAVNEXTSTATES(2i32); pub const MCNN_PRESSED: NAVNEXTSTATES = NAVNEXTSTATES(3i32); pub const MCNN_DISABLED: NAVNEXTSTATES = NAVNEXTSTATES(4i32); impl ::core::convert::From<i32> for NAVNEXTSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NAVNEXTSTATES { 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 NAVPREVSTATES(pub i32); pub const MCNP_NORMAL: NAVPREVSTATES = NAVPREVSTATES(1i32); pub const MCNP_HOT: NAVPREVSTATES = NAVPREVSTATES(2i32); pub const MCNP_PRESSED: NAVPREVSTATES = NAVPREVSTATES(3i32); pub const MCNP_DISABLED: NAVPREVSTATES = NAVPREVSTATES(4i32); impl ::core::convert::From<i32> for NAVPREVSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NAVPREVSTATES { type Abi = Self; } pub const NEWFILEOPENORD: u32 = 1547u32; pub const NEWFILEOPENV2ORD: u32 = 1552u32; pub const NEWFILEOPENV3ORD: u32 = 1553u32; pub const NEWFORMATDLGWITHLINK: u32 = 1591u32; pub const NFS_ALL: u32 = 16u32; pub const NFS_BUTTON: u32 = 8u32; pub const NFS_EDIT: u32 = 1u32; pub const NFS_LISTCOMBO: u32 = 4u32; pub const NFS_STATIC: u32 = 2u32; pub const NFS_USEFONTASSOC: u32 = 32u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMBCDROPDOWN { pub hdr: NMHDR, pub rcButton: super::super::Foundation::RECT, } #[cfg(feature = "Win32_Foundation")] impl NMBCDROPDOWN {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMBCDROPDOWN { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMBCDROPDOWN { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMBCDROPDOWN").field("hdr", &self.hdr).field("rcButton", &self.rcButton).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMBCDROPDOWN { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.rcButton == other.rcButton } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMBCDROPDOWN {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMBCDROPDOWN { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMBCHOTITEM { pub hdr: NMHDR, pub dwFlags: NMTBHOTITEM_FLAGS, } #[cfg(feature = "Win32_Foundation")] impl NMBCHOTITEM {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMBCHOTITEM { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMBCHOTITEM { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMBCHOTITEM").field("hdr", &self.hdr).field("dwFlags", &self.dwFlags).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMBCHOTITEM { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dwFlags == other.dwFlags } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMBCHOTITEM {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMBCHOTITEM { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMCBEDRAGBEGINA { pub hdr: NMHDR, pub iItemid: i32, pub szText: [super::super::Foundation::CHAR; 260], } #[cfg(feature = "Win32_Foundation")] impl NMCBEDRAGBEGINA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMCBEDRAGBEGINA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMCBEDRAGBEGINA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMCBEDRAGBEGINA").field("hdr", &self.hdr).field("iItemid", &self.iItemid).field("szText", &self.szText).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMCBEDRAGBEGINA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItemid == other.iItemid && self.szText == other.szText } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMCBEDRAGBEGINA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMCBEDRAGBEGINA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMCBEDRAGBEGINW { pub hdr: NMHDR, pub iItemid: i32, pub szText: [u16; 260], } #[cfg(feature = "Win32_Foundation")] impl NMCBEDRAGBEGINW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMCBEDRAGBEGINW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMCBEDRAGBEGINW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMCBEDRAGBEGINW").field("hdr", &self.hdr).field("iItemid", &self.iItemid).field("szText", &self.szText).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMCBEDRAGBEGINW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItemid == other.iItemid && self.szText == other.szText } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMCBEDRAGBEGINW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMCBEDRAGBEGINW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMCBEENDEDITA { pub hdr: NMHDR, pub fChanged: super::super::Foundation::BOOL, pub iNewSelection: i32, pub szText: [super::super::Foundation::CHAR; 260], pub iWhy: i32, } #[cfg(feature = "Win32_Foundation")] impl NMCBEENDEDITA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMCBEENDEDITA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMCBEENDEDITA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMCBEENDEDITA").field("hdr", &self.hdr).field("fChanged", &self.fChanged).field("iNewSelection", &self.iNewSelection).field("szText", &self.szText).field("iWhy", &self.iWhy).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMCBEENDEDITA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.fChanged == other.fChanged && self.iNewSelection == other.iNewSelection && self.szText == other.szText && self.iWhy == other.iWhy } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMCBEENDEDITA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMCBEENDEDITA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMCBEENDEDITW { pub hdr: NMHDR, pub fChanged: super::super::Foundation::BOOL, pub iNewSelection: i32, pub szText: [u16; 260], pub iWhy: i32, } #[cfg(feature = "Win32_Foundation")] impl NMCBEENDEDITW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMCBEENDEDITW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMCBEENDEDITW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMCBEENDEDITW").field("hdr", &self.hdr).field("fChanged", &self.fChanged).field("iNewSelection", &self.iNewSelection).field("szText", &self.szText).field("iWhy", &self.iWhy).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMCBEENDEDITW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.fChanged == other.fChanged && self.iNewSelection == other.iNewSelection && self.szText == other.szText && self.iWhy == other.iWhy } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMCBEENDEDITW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMCBEENDEDITW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMCHAR { pub hdr: NMHDR, pub ch: u32, pub dwItemPrev: u32, pub dwItemNext: u32, } #[cfg(feature = "Win32_Foundation")] impl NMCHAR {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMCHAR { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMCHAR { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMCHAR").field("hdr", &self.hdr).field("ch", &self.ch).field("dwItemPrev", &self.dwItemPrev).field("dwItemNext", &self.dwItemNext).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMCHAR { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.ch == other.ch && self.dwItemPrev == other.dwItemPrev && self.dwItemNext == other.dwItemNext } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMCHAR {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMCHAR { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMCOMBOBOXEXA { pub hdr: NMHDR, pub ceItem: COMBOBOXEXITEMA, } #[cfg(feature = "Win32_Foundation")] impl NMCOMBOBOXEXA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMCOMBOBOXEXA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMCOMBOBOXEXA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMCOMBOBOXEXA").field("hdr", &self.hdr).field("ceItem", &self.ceItem).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMCOMBOBOXEXA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.ceItem == other.ceItem } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMCOMBOBOXEXA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMCOMBOBOXEXA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMCOMBOBOXEXW { pub hdr: NMHDR, pub ceItem: COMBOBOXEXITEMW, } #[cfg(feature = "Win32_Foundation")] impl NMCOMBOBOXEXW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMCOMBOBOXEXW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMCOMBOBOXEXW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMCOMBOBOXEXW").field("hdr", &self.hdr).field("ceItem", &self.ceItem).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMCOMBOBOXEXW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.ceItem == other.ceItem } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMCOMBOBOXEXW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMCOMBOBOXEXW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct NMCUSTOMDRAW { pub hdr: NMHDR, pub dwDrawStage: NMCUSTOMDRAW_DRAW_STAGE, pub hdc: super::super::Graphics::Gdi::HDC, pub rc: super::super::Foundation::RECT, pub dwItemSpec: usize, pub uItemState: u32, pub lItemlParam: super::super::Foundation::LPARAM, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl NMCUSTOMDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for NMCUSTOMDRAW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for NMCUSTOMDRAW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMCUSTOMDRAW").field("hdr", &self.hdr).field("dwDrawStage", &self.dwDrawStage).field("hdc", &self.hdc).field("rc", &self.rc).field("dwItemSpec", &self.dwItemSpec).field("uItemState", &self.uItemState).field("lItemlParam", &self.lItemlParam).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for NMCUSTOMDRAW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dwDrawStage == other.dwDrawStage && self.hdc == other.hdc && self.rc == other.rc && self.dwItemSpec == other.dwItemSpec && self.uItemState == other.uItemState && self.lItemlParam == other.lItemlParam } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for NMCUSTOMDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for NMCUSTOMDRAW { 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 NMCUSTOMDRAW_DRAW_STAGE(pub u32); pub const CDDS_POSTPAINT: NMCUSTOMDRAW_DRAW_STAGE = NMCUSTOMDRAW_DRAW_STAGE(2u32); pub const CDDS_PREERASE: NMCUSTOMDRAW_DRAW_STAGE = NMCUSTOMDRAW_DRAW_STAGE(3u32); pub const CDDS_PREPAINT: NMCUSTOMDRAW_DRAW_STAGE = NMCUSTOMDRAW_DRAW_STAGE(1u32); pub const CDDS_ITEMPOSTERASE: NMCUSTOMDRAW_DRAW_STAGE = NMCUSTOMDRAW_DRAW_STAGE(65540u32); pub const CDDS_ITEMPOSTPAINT: NMCUSTOMDRAW_DRAW_STAGE = NMCUSTOMDRAW_DRAW_STAGE(65538u32); pub const CDDS_ITEMPREERASE: NMCUSTOMDRAW_DRAW_STAGE = NMCUSTOMDRAW_DRAW_STAGE(65539u32); pub const CDDS_ITEMPREPAINT: NMCUSTOMDRAW_DRAW_STAGE = NMCUSTOMDRAW_DRAW_STAGE(65537u32); pub const CDDS_SUBITEM: NMCUSTOMDRAW_DRAW_STAGE = NMCUSTOMDRAW_DRAW_STAGE(131072u32); impl ::core::convert::From<u32> for NMCUSTOMDRAW_DRAW_STAGE { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NMCUSTOMDRAW_DRAW_STAGE { type Abi = Self; } impl ::core::ops::BitOr for NMCUSTOMDRAW_DRAW_STAGE { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for NMCUSTOMDRAW_DRAW_STAGE { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for NMCUSTOMDRAW_DRAW_STAGE { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for NMCUSTOMDRAW_DRAW_STAGE { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for NMCUSTOMDRAW_DRAW_STAGE { 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 NMCUSTOMSPLITRECTINFO { pub hdr: NMHDR, pub rcClient: super::super::Foundation::RECT, pub rcButton: super::super::Foundation::RECT, pub rcSplit: super::super::Foundation::RECT, } #[cfg(feature = "Win32_Foundation")] impl NMCUSTOMSPLITRECTINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMCUSTOMSPLITRECTINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMCUSTOMSPLITRECTINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMCUSTOMSPLITRECTINFO").field("hdr", &self.hdr).field("rcClient", &self.rcClient).field("rcButton", &self.rcButton).field("rcSplit", &self.rcSplit).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMCUSTOMSPLITRECTINFO { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.rcClient == other.rcClient && self.rcButton == other.rcButton && self.rcSplit == other.rcSplit } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMCUSTOMSPLITRECTINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMCUSTOMSPLITRECTINFO { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct NMCUSTOMTEXT { pub hdr: NMHDR, pub hDC: super::super::Graphics::Gdi::HDC, pub lpString: super::super::Foundation::PWSTR, pub nCount: i32, pub lpRect: *mut super::super::Foundation::RECT, pub uFormat: u32, pub fLink: super::super::Foundation::BOOL, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl NMCUSTOMTEXT {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for NMCUSTOMTEXT { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for NMCUSTOMTEXT { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMCUSTOMTEXT").field("hdr", &self.hdr).field("hDC", &self.hDC).field("lpString", &self.lpString).field("nCount", &self.nCount).field("lpRect", &self.lpRect).field("uFormat", &self.uFormat).field("fLink", &self.fLink).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for NMCUSTOMTEXT { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.hDC == other.hDC && self.lpString == other.lpString && self.nCount == other.nCount && self.lpRect == other.lpRect && self.uFormat == other.uFormat && self.fLink == other.fLink } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for NMCUSTOMTEXT {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for NMCUSTOMTEXT { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMDATETIMECHANGE { pub nmhdr: NMHDR, pub dwFlags: u32, pub st: super::super::Foundation::SYSTEMTIME, } #[cfg(feature = "Win32_Foundation")] impl NMDATETIMECHANGE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMDATETIMECHANGE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMDATETIMECHANGE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMDATETIMECHANGE").field("nmhdr", &self.nmhdr).field("dwFlags", &self.dwFlags).field("st", &self.st).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMDATETIMECHANGE { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.dwFlags == other.dwFlags && self.st == other.st } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMDATETIMECHANGE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMDATETIMECHANGE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMDATETIMEFORMATA { pub nmhdr: NMHDR, pub pszFormat: super::super::Foundation::PSTR, pub st: super::super::Foundation::SYSTEMTIME, pub pszDisplay: super::super::Foundation::PSTR, pub szDisplay: [super::super::Foundation::CHAR; 64], } #[cfg(feature = "Win32_Foundation")] impl NMDATETIMEFORMATA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMDATETIMEFORMATA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMDATETIMEFORMATA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMDATETIMEFORMATA").field("nmhdr", &self.nmhdr).field("pszFormat", &self.pszFormat).field("st", &self.st).field("pszDisplay", &self.pszDisplay).field("szDisplay", &self.szDisplay).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMDATETIMEFORMATA { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.pszFormat == other.pszFormat && self.st == other.st && self.pszDisplay == other.pszDisplay && self.szDisplay == other.szDisplay } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMDATETIMEFORMATA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMDATETIMEFORMATA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMDATETIMEFORMATQUERYA { pub nmhdr: NMHDR, pub pszFormat: super::super::Foundation::PSTR, pub szMax: super::super::Foundation::SIZE, } #[cfg(feature = "Win32_Foundation")] impl NMDATETIMEFORMATQUERYA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMDATETIMEFORMATQUERYA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMDATETIMEFORMATQUERYA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMDATETIMEFORMATQUERYA").field("nmhdr", &self.nmhdr).field("pszFormat", &self.pszFormat).field("szMax", &self.szMax).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMDATETIMEFORMATQUERYA { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.pszFormat == other.pszFormat && self.szMax == other.szMax } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMDATETIMEFORMATQUERYA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMDATETIMEFORMATQUERYA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMDATETIMEFORMATQUERYW { pub nmhdr: NMHDR, pub pszFormat: super::super::Foundation::PWSTR, pub szMax: super::super::Foundation::SIZE, } #[cfg(feature = "Win32_Foundation")] impl NMDATETIMEFORMATQUERYW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMDATETIMEFORMATQUERYW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMDATETIMEFORMATQUERYW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMDATETIMEFORMATQUERYW").field("nmhdr", &self.nmhdr).field("pszFormat", &self.pszFormat).field("szMax", &self.szMax).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMDATETIMEFORMATQUERYW { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.pszFormat == other.pszFormat && self.szMax == other.szMax } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMDATETIMEFORMATQUERYW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMDATETIMEFORMATQUERYW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMDATETIMEFORMATW { pub nmhdr: NMHDR, pub pszFormat: super::super::Foundation::PWSTR, pub st: super::super::Foundation::SYSTEMTIME, pub pszDisplay: super::super::Foundation::PWSTR, pub szDisplay: [u16; 64], } #[cfg(feature = "Win32_Foundation")] impl NMDATETIMEFORMATW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMDATETIMEFORMATW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMDATETIMEFORMATW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMDATETIMEFORMATW").field("nmhdr", &self.nmhdr).field("pszFormat", &self.pszFormat).field("st", &self.st).field("pszDisplay", &self.pszDisplay).field("szDisplay", &self.szDisplay).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMDATETIMEFORMATW { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.pszFormat == other.pszFormat && self.st == other.st && self.pszDisplay == other.pszDisplay && self.szDisplay == other.szDisplay } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMDATETIMEFORMATW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMDATETIMEFORMATW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMDATETIMESTRINGA { pub nmhdr: NMHDR, pub pszUserString: super::super::Foundation::PSTR, pub st: super::super::Foundation::SYSTEMTIME, pub dwFlags: u32, } #[cfg(feature = "Win32_Foundation")] impl NMDATETIMESTRINGA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMDATETIMESTRINGA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMDATETIMESTRINGA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMDATETIMESTRINGA").field("nmhdr", &self.nmhdr).field("pszUserString", &self.pszUserString).field("st", &self.st).field("dwFlags", &self.dwFlags).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMDATETIMESTRINGA { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.pszUserString == other.pszUserString && self.st == other.st && self.dwFlags == other.dwFlags } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMDATETIMESTRINGA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMDATETIMESTRINGA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMDATETIMESTRINGW { pub nmhdr: NMHDR, pub pszUserString: super::super::Foundation::PWSTR, pub st: super::super::Foundation::SYSTEMTIME, pub dwFlags: u32, } #[cfg(feature = "Win32_Foundation")] impl NMDATETIMESTRINGW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMDATETIMESTRINGW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMDATETIMESTRINGW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMDATETIMESTRINGW").field("nmhdr", &self.nmhdr).field("pszUserString", &self.pszUserString).field("st", &self.st).field("dwFlags", &self.dwFlags).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMDATETIMESTRINGW { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.pszUserString == other.pszUserString && self.st == other.st && self.dwFlags == other.dwFlags } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMDATETIMESTRINGW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMDATETIMESTRINGW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMDATETIMEWMKEYDOWNA { pub nmhdr: NMHDR, pub nVirtKey: i32, pub pszFormat: super::super::Foundation::PSTR, pub st: super::super::Foundation::SYSTEMTIME, } #[cfg(feature = "Win32_Foundation")] impl NMDATETIMEWMKEYDOWNA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMDATETIMEWMKEYDOWNA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMDATETIMEWMKEYDOWNA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMDATETIMEWMKEYDOWNA").field("nmhdr", &self.nmhdr).field("nVirtKey", &self.nVirtKey).field("pszFormat", &self.pszFormat).field("st", &self.st).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMDATETIMEWMKEYDOWNA { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.nVirtKey == other.nVirtKey && self.pszFormat == other.pszFormat && self.st == other.st } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMDATETIMEWMKEYDOWNA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMDATETIMEWMKEYDOWNA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMDATETIMEWMKEYDOWNW { pub nmhdr: NMHDR, pub nVirtKey: i32, pub pszFormat: super::super::Foundation::PWSTR, pub st: super::super::Foundation::SYSTEMTIME, } #[cfg(feature = "Win32_Foundation")] impl NMDATETIMEWMKEYDOWNW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMDATETIMEWMKEYDOWNW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMDATETIMEWMKEYDOWNW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMDATETIMEWMKEYDOWNW").field("nmhdr", &self.nmhdr).field("nVirtKey", &self.nVirtKey).field("pszFormat", &self.pszFormat).field("st", &self.st).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMDATETIMEWMKEYDOWNW { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.nVirtKey == other.nVirtKey && self.pszFormat == other.pszFormat && self.st == other.st } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMDATETIMEWMKEYDOWNW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMDATETIMEWMKEYDOWNW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMDAYSTATE { pub nmhdr: NMHDR, pub stStart: super::super::Foundation::SYSTEMTIME, pub cDayState: i32, pub prgDayState: *mut u32, } #[cfg(feature = "Win32_Foundation")] impl NMDAYSTATE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMDAYSTATE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMDAYSTATE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMDAYSTATE").field("nmhdr", &self.nmhdr).field("stStart", &self.stStart).field("cDayState", &self.cDayState).field("prgDayState", &self.prgDayState).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMDAYSTATE { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.stStart == other.stStart && self.cDayState == other.cDayState && self.prgDayState == other.prgDayState } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMDAYSTATE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMDAYSTATE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMHDDISPINFOA { pub hdr: NMHDR, pub iItem: i32, pub mask: HDI_MASK, pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, pub iImage: i32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMHDDISPINFOA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMHDDISPINFOA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMHDDISPINFOA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMHDDISPINFOA").field("hdr", &self.hdr).field("iItem", &self.iItem).field("mask", &self.mask).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("iImage", &self.iImage).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMHDDISPINFOA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItem == other.iItem && self.mask == other.mask && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMHDDISPINFOA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMHDDISPINFOA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMHDDISPINFOW { pub hdr: NMHDR, pub iItem: i32, pub mask: HDI_MASK, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub iImage: i32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMHDDISPINFOW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMHDDISPINFOW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMHDDISPINFOW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMHDDISPINFOW").field("hdr", &self.hdr).field("iItem", &self.iItem).field("mask", &self.mask).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("iImage", &self.iImage).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMHDDISPINFOW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItem == other.iItem && self.mask == other.mask && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMHDDISPINFOW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMHDDISPINFOW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMHDFILTERBTNCLICK { pub hdr: NMHDR, pub iItem: i32, pub rc: super::super::Foundation::RECT, } #[cfg(feature = "Win32_Foundation")] impl NMHDFILTERBTNCLICK {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMHDFILTERBTNCLICK { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMHDFILTERBTNCLICK { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMHDFILTERBTNCLICK").field("hdr", &self.hdr).field("iItem", &self.iItem).field("rc", &self.rc).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMHDFILTERBTNCLICK { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItem == other.iItem && self.rc == other.rc } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMHDFILTERBTNCLICK {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMHDFILTERBTNCLICK { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMHDR { pub hwndFrom: super::super::Foundation::HWND, pub idFrom: usize, pub code: u32, } #[cfg(feature = "Win32_Foundation")] impl NMHDR {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMHDR { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMHDR { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMHDR").field("hwndFrom", &self.hwndFrom).field("idFrom", &self.idFrom).field("code", &self.code).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMHDR { fn eq(&self, other: &Self) -> bool { self.hwndFrom == other.hwndFrom && self.idFrom == other.idFrom && self.code == other.code } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMHDR {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMHDR { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct NMHEADERA { pub hdr: NMHDR, pub iItem: i32, pub iButton: HEADER_CONTROL_NOTIFICATION_BUTTON, pub pitem: *mut HDITEMA, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl NMHEADERA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for NMHEADERA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for NMHEADERA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMHEADERA").field("hdr", &self.hdr).field("iItem", &self.iItem).field("iButton", &self.iButton).field("pitem", &self.pitem).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for NMHEADERA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItem == other.iItem && self.iButton == other.iButton && self.pitem == other.pitem } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for NMHEADERA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for NMHEADERA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct NMHEADERW { pub hdr: NMHDR, pub iItem: i32, pub iButton: HEADER_CONTROL_NOTIFICATION_BUTTON, pub pitem: *mut HDITEMW, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl NMHEADERW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for NMHEADERW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for NMHEADERW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMHEADERW").field("hdr", &self.hdr).field("iItem", &self.iItem).field("iButton", &self.iButton).field("pitem", &self.pitem).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for NMHEADERW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItem == other.iItem && self.iButton == other.iButton && self.pitem == other.pitem } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for NMHEADERW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for NMHEADERW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMIPADDRESS { pub hdr: NMHDR, pub iField: i32, pub iValue: i32, } #[cfg(feature = "Win32_Foundation")] impl NMIPADDRESS {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMIPADDRESS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMIPADDRESS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMIPADDRESS").field("hdr", &self.hdr).field("iField", &self.iField).field("iValue", &self.iValue).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMIPADDRESS { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iField == other.iField && self.iValue == other.iValue } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMIPADDRESS {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMIPADDRESS { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMITEMACTIVATE { pub hdr: NMHDR, pub iItem: i32, pub iSubItem: i32, pub uNewState: u32, pub uOldState: u32, pub uChanged: u32, pub ptAction: super::super::Foundation::POINT, pub lParam: super::super::Foundation::LPARAM, pub uKeyFlags: u32, } #[cfg(feature = "Win32_Foundation")] impl NMITEMACTIVATE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMITEMACTIVATE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMITEMACTIVATE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMITEMACTIVATE") .field("hdr", &self.hdr) .field("iItem", &self.iItem) .field("iSubItem", &self.iSubItem) .field("uNewState", &self.uNewState) .field("uOldState", &self.uOldState) .field("uChanged", &self.uChanged) .field("ptAction", &self.ptAction) .field("lParam", &self.lParam) .field("uKeyFlags", &self.uKeyFlags) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMITEMACTIVATE { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItem == other.iItem && self.iSubItem == other.iSubItem && self.uNewState == other.uNewState && self.uOldState == other.uOldState && self.uChanged == other.uChanged && self.ptAction == other.ptAction && self.lParam == other.lParam && self.uKeyFlags == other.uKeyFlags } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMITEMACTIVATE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMITEMACTIVATE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMKEY { pub hdr: NMHDR, pub nVKey: u32, pub uFlags: u32, } #[cfg(feature = "Win32_Foundation")] impl NMKEY {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMKEY { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMKEY { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMKEY").field("hdr", &self.hdr).field("nVKey", &self.nVKey).field("uFlags", &self.uFlags).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMKEY { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.nVKey == other.nVKey && self.uFlags == other.uFlags } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMKEY {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMKEY { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMLINK { pub hdr: NMHDR, pub item: LITEM, } #[cfg(feature = "Win32_Foundation")] impl NMLINK {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLINK { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLINK { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLINK").field("hdr", &self.hdr).field("item", &self.item).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLINK { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.item == other.item } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLINK {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLINK { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMLISTVIEW { pub hdr: NMHDR, pub iItem: i32, pub iSubItem: i32, pub uNewState: u32, pub uOldState: u32, pub uChanged: u32, pub ptAction: super::super::Foundation::POINT, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMLISTVIEW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLISTVIEW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLISTVIEW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLISTVIEW").field("hdr", &self.hdr).field("iItem", &self.iItem).field("iSubItem", &self.iSubItem).field("uNewState", &self.uNewState).field("uOldState", &self.uOldState).field("uChanged", &self.uChanged).field("ptAction", &self.ptAction).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLISTVIEW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItem == other.iItem && self.iSubItem == other.iSubItem && self.uNewState == other.uNewState && self.uOldState == other.uOldState && self.uChanged == other.uChanged && self.ptAction == other.ptAction && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLISTVIEW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLISTVIEW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMLVCACHEHINT { pub hdr: NMHDR, pub iFrom: i32, pub iTo: i32, } #[cfg(feature = "Win32_Foundation")] impl NMLVCACHEHINT {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVCACHEHINT { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLVCACHEHINT { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVCACHEHINT").field("hdr", &self.hdr).field("iFrom", &self.iFrom).field("iTo", &self.iTo).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVCACHEHINT { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iFrom == other.iFrom && self.iTo == other.iTo } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVCACHEHINT {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVCACHEHINT { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct NMLVCUSTOMDRAW { pub nmcd: NMCUSTOMDRAW, pub clrText: u32, pub clrTextBk: u32, pub iSubItem: i32, pub dwItemType: NMLVCUSTOMDRAW_ITEM_TYPE, pub clrFace: u32, pub iIconEffect: i32, pub iIconPhase: i32, pub iPartId: i32, pub iStateId: i32, pub rcText: super::super::Foundation::RECT, pub uAlign: NMLVCUSTOMDRAW_ALIGN, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl NMLVCUSTOMDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for NMLVCUSTOMDRAW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for NMLVCUSTOMDRAW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVCUSTOMDRAW") .field("nmcd", &self.nmcd) .field("clrText", &self.clrText) .field("clrTextBk", &self.clrTextBk) .field("iSubItem", &self.iSubItem) .field("dwItemType", &self.dwItemType) .field("clrFace", &self.clrFace) .field("iIconEffect", &self.iIconEffect) .field("iIconPhase", &self.iIconPhase) .field("iPartId", &self.iPartId) .field("iStateId", &self.iStateId) .field("rcText", &self.rcText) .field("uAlign", &self.uAlign) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for NMLVCUSTOMDRAW { fn eq(&self, other: &Self) -> bool { self.nmcd == other.nmcd && self.clrText == other.clrText && self.clrTextBk == other.clrTextBk && self.iSubItem == other.iSubItem && self.dwItemType == other.dwItemType && self.clrFace == other.clrFace && self.iIconEffect == other.iIconEffect && self.iIconPhase == other.iIconPhase && self.iPartId == other.iPartId && self.iStateId == other.iStateId && self.rcText == other.rcText && self.uAlign == other.uAlign } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for NMLVCUSTOMDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for NMLVCUSTOMDRAW { 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 NMLVCUSTOMDRAW_ALIGN(pub u32); pub const LVGA_HEADER_CENTER: NMLVCUSTOMDRAW_ALIGN = NMLVCUSTOMDRAW_ALIGN(2u32); pub const LVGA_HEADER_LEFT: NMLVCUSTOMDRAW_ALIGN = NMLVCUSTOMDRAW_ALIGN(1u32); pub const LVGA_HEADER_RIGHT: NMLVCUSTOMDRAW_ALIGN = NMLVCUSTOMDRAW_ALIGN(4u32); impl ::core::convert::From<u32> for NMLVCUSTOMDRAW_ALIGN { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NMLVCUSTOMDRAW_ALIGN { type Abi = Self; } impl ::core::ops::BitOr for NMLVCUSTOMDRAW_ALIGN { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for NMLVCUSTOMDRAW_ALIGN { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for NMLVCUSTOMDRAW_ALIGN { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for NMLVCUSTOMDRAW_ALIGN { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for NMLVCUSTOMDRAW_ALIGN { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct NMLVCUSTOMDRAW_ITEM_TYPE(pub u32); pub const LVCDI_ITEM: NMLVCUSTOMDRAW_ITEM_TYPE = NMLVCUSTOMDRAW_ITEM_TYPE(0u32); pub const LVCDI_GROUP: NMLVCUSTOMDRAW_ITEM_TYPE = NMLVCUSTOMDRAW_ITEM_TYPE(1u32); pub const LVCDI_ITEMSLIST: NMLVCUSTOMDRAW_ITEM_TYPE = NMLVCUSTOMDRAW_ITEM_TYPE(2u32); impl ::core::convert::From<u32> for NMLVCUSTOMDRAW_ITEM_TYPE { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NMLVCUSTOMDRAW_ITEM_TYPE { type Abi = Self; } impl ::core::ops::BitOr for NMLVCUSTOMDRAW_ITEM_TYPE { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for NMLVCUSTOMDRAW_ITEM_TYPE { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for NMLVCUSTOMDRAW_ITEM_TYPE { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for NMLVCUSTOMDRAW_ITEM_TYPE { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for NMLVCUSTOMDRAW_ITEM_TYPE { 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 NMLVDISPINFOA { pub hdr: NMHDR, pub item: LVITEMA, } #[cfg(feature = "Win32_Foundation")] impl NMLVDISPINFOA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVDISPINFOA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLVDISPINFOA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVDISPINFOA").field("hdr", &self.hdr).field("item", &self.item).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVDISPINFOA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.item == other.item } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVDISPINFOA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVDISPINFOA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMLVDISPINFOW { pub hdr: NMHDR, pub item: LVITEMW, } #[cfg(feature = "Win32_Foundation")] impl NMLVDISPINFOW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVDISPINFOW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLVDISPINFOW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVDISPINFOW").field("hdr", &self.hdr).field("item", &self.item).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVDISPINFOW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.item == other.item } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVDISPINFOW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVDISPINFOW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMLVEMPTYMARKUP { pub hdr: NMHDR, pub dwFlags: NMLVEMPTYMARKUP_FLAGS, pub szMarkup: [u16; 2084], } #[cfg(feature = "Win32_Foundation")] impl NMLVEMPTYMARKUP {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVEMPTYMARKUP { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLVEMPTYMARKUP { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVEMPTYMARKUP").field("hdr", &self.hdr).field("dwFlags", &self.dwFlags).field("szMarkup", &self.szMarkup).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVEMPTYMARKUP { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dwFlags == other.dwFlags && self.szMarkup == other.szMarkup } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVEMPTYMARKUP {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVEMPTYMARKUP { 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 NMLVEMPTYMARKUP_FLAGS(pub u32); pub const EMF_CENTERED: NMLVEMPTYMARKUP_FLAGS = NMLVEMPTYMARKUP_FLAGS(1u32); impl ::core::convert::From<u32> for NMLVEMPTYMARKUP_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NMLVEMPTYMARKUP_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for NMLVEMPTYMARKUP_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for NMLVEMPTYMARKUP_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for NMLVEMPTYMARKUP_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for NMLVEMPTYMARKUP_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for NMLVEMPTYMARKUP_FLAGS { 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 NMLVFINDITEMA { pub hdr: NMHDR, pub iStart: i32, pub lvfi: LVFINDINFOA, } #[cfg(feature = "Win32_Foundation")] impl NMLVFINDITEMA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVFINDITEMA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLVFINDITEMA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVFINDITEMA").field("hdr", &self.hdr).field("iStart", &self.iStart).field("lvfi", &self.lvfi).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVFINDITEMA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iStart == other.iStart && self.lvfi == other.lvfi } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVFINDITEMA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVFINDITEMA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMLVFINDITEMW { pub hdr: NMHDR, pub iStart: i32, pub lvfi: LVFINDINFOW, } #[cfg(feature = "Win32_Foundation")] impl NMLVFINDITEMW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVFINDITEMW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLVFINDITEMW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVFINDITEMW").field("hdr", &self.hdr).field("iStart", &self.iStart).field("lvfi", &self.lvfi).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVFINDITEMW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iStart == other.iStart && self.lvfi == other.lvfi } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVFINDITEMW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVFINDITEMW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMLVGETINFOTIPA { pub hdr: NMHDR, pub dwFlags: u32, pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, pub iItem: i32, pub iSubItem: i32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMLVGETINFOTIPA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVGETINFOTIPA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLVGETINFOTIPA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVGETINFOTIPA").field("hdr", &self.hdr).field("dwFlags", &self.dwFlags).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("iItem", &self.iItem).field("iSubItem", &self.iSubItem).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVGETINFOTIPA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dwFlags == other.dwFlags && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iItem == other.iItem && self.iSubItem == other.iSubItem && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVGETINFOTIPA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVGETINFOTIPA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMLVGETINFOTIPW { pub hdr: NMHDR, pub dwFlags: u32, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub iItem: i32, pub iSubItem: i32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMLVGETINFOTIPW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVGETINFOTIPW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLVGETINFOTIPW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVGETINFOTIPW").field("hdr", &self.hdr).field("dwFlags", &self.dwFlags).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("iItem", &self.iItem).field("iSubItem", &self.iSubItem).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVGETINFOTIPW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dwFlags == other.dwFlags && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iItem == other.iItem && self.iSubItem == other.iSubItem && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVGETINFOTIPW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVGETINFOTIPW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C, packed(1))] #[cfg(feature = "Win32_Foundation")] pub struct NMLVKEYDOWN { pub hdr: NMHDR, pub wVKey: u16, pub flags: u32, } #[cfg(feature = "Win32_Foundation")] impl NMLVKEYDOWN {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVKEYDOWN { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVKEYDOWN { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVKEYDOWN {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVKEYDOWN { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMLVLINK { pub hdr: NMHDR, pub link: LITEM, pub iItem: i32, pub iSubItem: i32, } #[cfg(feature = "Win32_Foundation")] impl NMLVLINK {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVLINK { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLVLINK { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVLINK").field("hdr", &self.hdr).field("link", &self.link).field("iItem", &self.iItem).field("iSubItem", &self.iSubItem).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVLINK { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.link == other.link && self.iItem == other.iItem && self.iSubItem == other.iSubItem } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVLINK {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVLINK { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMLVODSTATECHANGE { pub hdr: NMHDR, pub iFrom: i32, pub iTo: i32, pub uNewState: u32, pub uOldState: u32, } #[cfg(feature = "Win32_Foundation")] impl NMLVODSTATECHANGE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVODSTATECHANGE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLVODSTATECHANGE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVODSTATECHANGE").field("hdr", &self.hdr).field("iFrom", &self.iFrom).field("iTo", &self.iTo).field("uNewState", &self.uNewState).field("uOldState", &self.uOldState).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVODSTATECHANGE { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iFrom == other.iFrom && self.iTo == other.iTo && self.uNewState == other.uNewState && self.uOldState == other.uOldState } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVODSTATECHANGE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVODSTATECHANGE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMLVSCROLL { pub hdr: NMHDR, pub dx: i32, pub dy: i32, } #[cfg(feature = "Win32_Foundation")] impl NMLVSCROLL {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMLVSCROLL { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMLVSCROLL { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMLVSCROLL").field("hdr", &self.hdr).field("dx", &self.dx).field("dy", &self.dy).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMLVSCROLL { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dx == other.dx && self.dy == other.dy } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMLVSCROLL {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMLVSCROLL { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMMOUSE { pub hdr: NMHDR, pub dwItemSpec: usize, pub dwItemData: usize, pub pt: super::super::Foundation::POINT, pub dwHitInfo: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMMOUSE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMMOUSE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMMOUSE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMMOUSE").field("hdr", &self.hdr).field("dwItemSpec", &self.dwItemSpec).field("dwItemData", &self.dwItemData).field("pt", &self.pt).field("dwHitInfo", &self.dwHitInfo).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMMOUSE { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dwItemSpec == other.dwItemSpec && self.dwItemData == other.dwItemData && self.pt == other.pt && self.dwHitInfo == other.dwHitInfo } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMMOUSE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMMOUSE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMOBJECTNOTIFY { pub hdr: NMHDR, pub iItem: i32, pub piid: *mut ::windows::core::GUID, pub pObject: *mut ::core::ffi::c_void, pub hResult: ::windows::core::HRESULT, pub dwFlags: u32, } #[cfg(feature = "Win32_Foundation")] impl NMOBJECTNOTIFY {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMOBJECTNOTIFY { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMOBJECTNOTIFY { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMOBJECTNOTIFY").field("hdr", &self.hdr).field("iItem", &self.iItem).field("piid", &self.piid).field("pObject", &self.pObject).field("hResult", &self.hResult).field("dwFlags", &self.dwFlags).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMOBJECTNOTIFY { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItem == other.iItem && self.piid == other.piid && self.pObject == other.pObject && self.hResult == other.hResult && self.dwFlags == other.dwFlags } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMOBJECTNOTIFY {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMOBJECTNOTIFY { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMPGCALCSIZE { pub hdr: NMHDR, pub dwFlag: NMPGCALCSIZE_FLAGS, pub iWidth: i32, pub iHeight: i32, } #[cfg(feature = "Win32_Foundation")] impl NMPGCALCSIZE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMPGCALCSIZE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMPGCALCSIZE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMPGCALCSIZE").field("hdr", &self.hdr).field("dwFlag", &self.dwFlag).field("iWidth", &self.iWidth).field("iHeight", &self.iHeight).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMPGCALCSIZE { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dwFlag == other.dwFlag && self.iWidth == other.iWidth && self.iHeight == other.iHeight } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMPGCALCSIZE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMPGCALCSIZE { 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 NMPGCALCSIZE_FLAGS(pub u32); pub const PGF_CALCHEIGHT: NMPGCALCSIZE_FLAGS = NMPGCALCSIZE_FLAGS(2u32); pub const PGF_CALCWIDTH: NMPGCALCSIZE_FLAGS = NMPGCALCSIZE_FLAGS(1u32); impl ::core::convert::From<u32> for NMPGCALCSIZE_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NMPGCALCSIZE_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for NMPGCALCSIZE_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for NMPGCALCSIZE_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for NMPGCALCSIZE_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for NMPGCALCSIZE_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for NMPGCALCSIZE_FLAGS { 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 NMPGHOTITEM { pub hdr: NMHDR, pub idOld: i32, pub idNew: i32, pub dwFlags: u32, } #[cfg(feature = "Win32_Foundation")] impl NMPGHOTITEM {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMPGHOTITEM { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMPGHOTITEM { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMPGHOTITEM").field("hdr", &self.hdr).field("idOld", &self.idOld).field("idNew", &self.idNew).field("dwFlags", &self.dwFlags).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMPGHOTITEM { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.idOld == other.idOld && self.idNew == other.idNew && self.dwFlags == other.dwFlags } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMPGHOTITEM {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMPGHOTITEM { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C, packed(1))] #[cfg(feature = "Win32_Foundation")] pub struct NMPGSCROLL { pub hdr: NMHDR, pub fwKeys: NMPGSCROLL_KEYS, pub rcParent: super::super::Foundation::RECT, pub iDir: NMPGSCROLL_DIR, pub iXpos: i32, pub iYpos: i32, pub iScroll: i32, } #[cfg(feature = "Win32_Foundation")] impl NMPGSCROLL {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMPGSCROLL { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMPGSCROLL { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMPGSCROLL {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMPGSCROLL { 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 NMPGSCROLL_DIR(pub u32); pub const PGF_SCROLLDOWN: NMPGSCROLL_DIR = NMPGSCROLL_DIR(2u32); pub const PGF_SCROLLLEFT: NMPGSCROLL_DIR = NMPGSCROLL_DIR(4u32); pub const PGF_SCROLLRIGHT: NMPGSCROLL_DIR = NMPGSCROLL_DIR(8u32); pub const PGF_SCROLLUP: NMPGSCROLL_DIR = NMPGSCROLL_DIR(1u32); impl ::core::convert::From<u32> for NMPGSCROLL_DIR { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NMPGSCROLL_DIR { type Abi = Self; } impl ::core::ops::BitOr for NMPGSCROLL_DIR { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for NMPGSCROLL_DIR { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for NMPGSCROLL_DIR { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for NMPGSCROLL_DIR { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for NMPGSCROLL_DIR { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct NMPGSCROLL_KEYS(pub u16); pub const PGK_NONE: NMPGSCROLL_KEYS = NMPGSCROLL_KEYS(0u16); pub const PGK_SHIFT: NMPGSCROLL_KEYS = NMPGSCROLL_KEYS(1u16); pub const PGK_CONTROL: NMPGSCROLL_KEYS = NMPGSCROLL_KEYS(2u16); pub const PGK_MENU: NMPGSCROLL_KEYS = NMPGSCROLL_KEYS(4u16); impl ::core::convert::From<u16> for NMPGSCROLL_KEYS { fn from(value: u16) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NMPGSCROLL_KEYS { type Abi = Self; } impl ::core::ops::BitOr for NMPGSCROLL_KEYS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for NMPGSCROLL_KEYS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for NMPGSCROLL_KEYS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for NMPGSCROLL_KEYS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for NMPGSCROLL_KEYS { 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 NMRBAUTOSIZE { pub hdr: NMHDR, pub fChanged: super::super::Foundation::BOOL, pub rcTarget: super::super::Foundation::RECT, pub rcActual: super::super::Foundation::RECT, } #[cfg(feature = "Win32_Foundation")] impl NMRBAUTOSIZE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMRBAUTOSIZE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMRBAUTOSIZE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMRBAUTOSIZE").field("hdr", &self.hdr).field("fChanged", &self.fChanged).field("rcTarget", &self.rcTarget).field("rcActual", &self.rcActual).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMRBAUTOSIZE { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.fChanged == other.fChanged && self.rcTarget == other.rcTarget && self.rcActual == other.rcActual } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMRBAUTOSIZE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMRBAUTOSIZE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMREBAR { pub hdr: NMHDR, pub dwMask: NMREBAR_MASK_FLAGS, pub uBand: u32, pub fStyle: u32, pub wID: u32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMREBAR {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMREBAR { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMREBAR { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMREBAR").field("hdr", &self.hdr).field("dwMask", &self.dwMask).field("uBand", &self.uBand).field("fStyle", &self.fStyle).field("wID", &self.wID).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMREBAR { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dwMask == other.dwMask && self.uBand == other.uBand && self.fStyle == other.fStyle && self.wID == other.wID && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMREBAR {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMREBAR { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMREBARAUTOBREAK { pub hdr: NMHDR, pub uBand: u32, pub wID: u32, pub lParam: super::super::Foundation::LPARAM, pub uMsg: u32, pub fStyleCurrent: u32, pub fAutoBreak: super::super::Foundation::BOOL, } #[cfg(feature = "Win32_Foundation")] impl NMREBARAUTOBREAK {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMREBARAUTOBREAK { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMREBARAUTOBREAK { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMREBARAUTOBREAK").field("hdr", &self.hdr).field("uBand", &self.uBand).field("wID", &self.wID).field("lParam", &self.lParam).field("uMsg", &self.uMsg).field("fStyleCurrent", &self.fStyleCurrent).field("fAutoBreak", &self.fAutoBreak).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMREBARAUTOBREAK { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.uBand == other.uBand && self.wID == other.wID && self.lParam == other.lParam && self.uMsg == other.uMsg && self.fStyleCurrent == other.fStyleCurrent && self.fAutoBreak == other.fAutoBreak } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMREBARAUTOBREAK {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMREBARAUTOBREAK { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMREBARCHEVRON { pub hdr: NMHDR, pub uBand: u32, pub wID: u32, pub lParam: super::super::Foundation::LPARAM, pub rc: super::super::Foundation::RECT, pub lParamNM: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMREBARCHEVRON {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMREBARCHEVRON { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMREBARCHEVRON { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMREBARCHEVRON").field("hdr", &self.hdr).field("uBand", &self.uBand).field("wID", &self.wID).field("lParam", &self.lParam).field("rc", &self.rc).field("lParamNM", &self.lParamNM).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMREBARCHEVRON { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.uBand == other.uBand && self.wID == other.wID && self.lParam == other.lParam && self.rc == other.rc && self.lParamNM == other.lParamNM } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMREBARCHEVRON {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMREBARCHEVRON { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMREBARCHILDSIZE { pub hdr: NMHDR, pub uBand: u32, pub wID: u32, pub rcChild: super::super::Foundation::RECT, pub rcBand: super::super::Foundation::RECT, } #[cfg(feature = "Win32_Foundation")] impl NMREBARCHILDSIZE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMREBARCHILDSIZE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMREBARCHILDSIZE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMREBARCHILDSIZE").field("hdr", &self.hdr).field("uBand", &self.uBand).field("wID", &self.wID).field("rcChild", &self.rcChild).field("rcBand", &self.rcBand).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMREBARCHILDSIZE { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.uBand == other.uBand && self.wID == other.wID && self.rcChild == other.rcChild && self.rcBand == other.rcBand } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMREBARCHILDSIZE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMREBARCHILDSIZE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMREBARSPLITTER { pub hdr: NMHDR, pub rcSizing: super::super::Foundation::RECT, } #[cfg(feature = "Win32_Foundation")] impl NMREBARSPLITTER {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMREBARSPLITTER { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMREBARSPLITTER { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMREBARSPLITTER").field("hdr", &self.hdr).field("rcSizing", &self.rcSizing).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMREBARSPLITTER { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.rcSizing == other.rcSizing } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMREBARSPLITTER {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMREBARSPLITTER { 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 NMREBAR_MASK_FLAGS(pub u32); pub const RBNM_ID: NMREBAR_MASK_FLAGS = NMREBAR_MASK_FLAGS(1u32); pub const RBNM_LPARAM: NMREBAR_MASK_FLAGS = NMREBAR_MASK_FLAGS(4u32); pub const RBNM_STYLE: NMREBAR_MASK_FLAGS = NMREBAR_MASK_FLAGS(2u32); impl ::core::convert::From<u32> for NMREBAR_MASK_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NMREBAR_MASK_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for NMREBAR_MASK_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for NMREBAR_MASK_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for NMREBAR_MASK_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for NMREBAR_MASK_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for NMREBAR_MASK_FLAGS { 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 NMSEARCHWEB { pub hdr: NMHDR, pub entrypoint: EC_SEARCHWEB_ENTRYPOINT, pub hasQueryText: super::super::Foundation::BOOL, pub invokeSucceeded: super::super::Foundation::BOOL, } #[cfg(feature = "Win32_Foundation")] impl NMSEARCHWEB {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMSEARCHWEB { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMSEARCHWEB { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMSEARCHWEB").field("hdr", &self.hdr).field("entrypoint", &self.entrypoint).field("hasQueryText", &self.hasQueryText).field("invokeSucceeded", &self.invokeSucceeded).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMSEARCHWEB { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.entrypoint == other.entrypoint && self.hasQueryText == other.hasQueryText && self.invokeSucceeded == other.invokeSucceeded } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMSEARCHWEB {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMSEARCHWEB { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMSELCHANGE { pub nmhdr: NMHDR, pub stSelStart: super::super::Foundation::SYSTEMTIME, pub stSelEnd: super::super::Foundation::SYSTEMTIME, } #[cfg(feature = "Win32_Foundation")] impl NMSELCHANGE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMSELCHANGE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMSELCHANGE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMSELCHANGE").field("nmhdr", &self.nmhdr).field("stSelStart", &self.stSelStart).field("stSelEnd", &self.stSelEnd).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMSELCHANGE { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.stSelStart == other.stSelStart && self.stSelEnd == other.stSelEnd } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMSELCHANGE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMSELCHANGE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct NMTBCUSTOMDRAW { pub nmcd: NMCUSTOMDRAW, pub hbrMonoDither: super::super::Graphics::Gdi::HBRUSH, pub hbrLines: super::super::Graphics::Gdi::HBRUSH, pub hpenLines: super::super::Graphics::Gdi::HPEN, pub clrText: u32, pub clrMark: u32, pub clrTextHighlight: u32, pub clrBtnFace: u32, pub clrBtnHighlight: u32, pub clrHighlightHotTrack: u32, pub rcText: super::super::Foundation::RECT, pub nStringBkMode: i32, pub nHLStringBkMode: i32, pub iListGap: i32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl NMTBCUSTOMDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for NMTBCUSTOMDRAW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for NMTBCUSTOMDRAW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTBCUSTOMDRAW") .field("nmcd", &self.nmcd) .field("hbrMonoDither", &self.hbrMonoDither) .field("hbrLines", &self.hbrLines) .field("hpenLines", &self.hpenLines) .field("clrText", &self.clrText) .field("clrMark", &self.clrMark) .field("clrTextHighlight", &self.clrTextHighlight) .field("clrBtnFace", &self.clrBtnFace) .field("clrBtnHighlight", &self.clrBtnHighlight) .field("clrHighlightHotTrack", &self.clrHighlightHotTrack) .field("rcText", &self.rcText) .field("nStringBkMode", &self.nStringBkMode) .field("nHLStringBkMode", &self.nHLStringBkMode) .field("iListGap", &self.iListGap) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for NMTBCUSTOMDRAW { fn eq(&self, other: &Self) -> bool { self.nmcd == other.nmcd && self.hbrMonoDither == other.hbrMonoDither && self.hbrLines == other.hbrLines && self.hpenLines == other.hpenLines && self.clrText == other.clrText && self.clrMark == other.clrMark && self.clrTextHighlight == other.clrTextHighlight && self.clrBtnFace == other.clrBtnFace && self.clrBtnHighlight == other.clrBtnHighlight && self.clrHighlightHotTrack == other.clrHighlightHotTrack && self.rcText == other.rcText && self.nStringBkMode == other.nStringBkMode && self.nHLStringBkMode == other.nHLStringBkMode && self.iListGap == other.iListGap } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for NMTBCUSTOMDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for NMTBCUSTOMDRAW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTBDISPINFOA { pub hdr: NMHDR, pub dwMask: NMTBDISPINFOW_MASK, pub idCommand: i32, pub lParam: usize, pub iImage: i32, pub pszText: super::super::Foundation::PSTR, pub cchText: i32, } #[cfg(feature = "Win32_Foundation")] impl NMTBDISPINFOA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTBDISPINFOA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTBDISPINFOA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTBDISPINFOA").field("hdr", &self.hdr).field("dwMask", &self.dwMask).field("idCommand", &self.idCommand).field("lParam", &self.lParam).field("iImage", &self.iImage).field("pszText", &self.pszText).field("cchText", &self.cchText).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTBDISPINFOA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dwMask == other.dwMask && self.idCommand == other.idCommand && self.lParam == other.lParam && self.iImage == other.iImage && self.pszText == other.pszText && self.cchText == other.cchText } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTBDISPINFOA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTBDISPINFOA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTBDISPINFOW { pub hdr: NMHDR, pub dwMask: NMTBDISPINFOW_MASK, pub idCommand: i32, pub lParam: usize, pub iImage: i32, pub pszText: super::super::Foundation::PWSTR, pub cchText: i32, } #[cfg(feature = "Win32_Foundation")] impl NMTBDISPINFOW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTBDISPINFOW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTBDISPINFOW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTBDISPINFOW").field("hdr", &self.hdr).field("dwMask", &self.dwMask).field("idCommand", &self.idCommand).field("lParam", &self.lParam).field("iImage", &self.iImage).field("pszText", &self.pszText).field("cchText", &self.cchText).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTBDISPINFOW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dwMask == other.dwMask && self.idCommand == other.idCommand && self.lParam == other.lParam && self.iImage == other.iImage && self.pszText == other.pszText && self.cchText == other.cchText } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTBDISPINFOW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTBDISPINFOW { 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 NMTBDISPINFOW_MASK(pub u32); pub const TBNF_IMAGE: NMTBDISPINFOW_MASK = NMTBDISPINFOW_MASK(1u32); pub const TBNF_TEXT: NMTBDISPINFOW_MASK = NMTBDISPINFOW_MASK(2u32); pub const TBNF_DI_SETITEM: NMTBDISPINFOW_MASK = NMTBDISPINFOW_MASK(268435456u32); impl ::core::convert::From<u32> for NMTBDISPINFOW_MASK { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NMTBDISPINFOW_MASK { type Abi = Self; } impl ::core::ops::BitOr for NMTBDISPINFOW_MASK { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for NMTBDISPINFOW_MASK { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for NMTBDISPINFOW_MASK { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for NMTBDISPINFOW_MASK { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for NMTBDISPINFOW_MASK { 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 NMTBGETINFOTIPA { pub hdr: NMHDR, pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, pub iItem: i32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMTBGETINFOTIPA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTBGETINFOTIPA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTBGETINFOTIPA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTBGETINFOTIPA").field("hdr", &self.hdr).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("iItem", &self.iItem).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTBGETINFOTIPA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iItem == other.iItem && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTBGETINFOTIPA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTBGETINFOTIPA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTBGETINFOTIPW { pub hdr: NMHDR, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub iItem: i32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMTBGETINFOTIPW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTBGETINFOTIPW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTBGETINFOTIPW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTBGETINFOTIPW").field("hdr", &self.hdr).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("iItem", &self.iItem).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTBGETINFOTIPW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iItem == other.iItem && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTBGETINFOTIPW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTBGETINFOTIPW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTBHOTITEM { pub hdr: NMHDR, pub idOld: i32, pub idNew: i32, pub dwFlags: NMTBHOTITEM_FLAGS, } #[cfg(feature = "Win32_Foundation")] impl NMTBHOTITEM {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTBHOTITEM { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTBHOTITEM { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTBHOTITEM").field("hdr", &self.hdr).field("idOld", &self.idOld).field("idNew", &self.idNew).field("dwFlags", &self.dwFlags).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTBHOTITEM { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.idOld == other.idOld && self.idNew == other.idNew && self.dwFlags == other.dwFlags } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTBHOTITEM {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTBHOTITEM { 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 NMTBHOTITEM_FLAGS(pub u32); pub const HICF_ACCELERATOR: NMTBHOTITEM_FLAGS = NMTBHOTITEM_FLAGS(4u32); pub const HICF_ARROWKEYS: NMTBHOTITEM_FLAGS = NMTBHOTITEM_FLAGS(2u32); pub const HICF_DUPACCEL: NMTBHOTITEM_FLAGS = NMTBHOTITEM_FLAGS(8u32); pub const HICF_ENTERING: NMTBHOTITEM_FLAGS = NMTBHOTITEM_FLAGS(16u32); pub const HICF_LEAVING: NMTBHOTITEM_FLAGS = NMTBHOTITEM_FLAGS(32u32); pub const HICF_LMOUSE: NMTBHOTITEM_FLAGS = NMTBHOTITEM_FLAGS(128u32); pub const HICF_MOUSE: NMTBHOTITEM_FLAGS = NMTBHOTITEM_FLAGS(1u32); pub const HICF_OTHER: NMTBHOTITEM_FLAGS = NMTBHOTITEM_FLAGS(0u32); pub const HICF_RESELECT: NMTBHOTITEM_FLAGS = NMTBHOTITEM_FLAGS(64u32); pub const HICF_TOGGLEDROPDOWN: NMTBHOTITEM_FLAGS = NMTBHOTITEM_FLAGS(256u32); impl ::core::convert::From<u32> for NMTBHOTITEM_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for NMTBHOTITEM_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for NMTBHOTITEM_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for NMTBHOTITEM_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for NMTBHOTITEM_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for NMTBHOTITEM_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for NMTBHOTITEM_FLAGS { 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 NMTBRESTORE { pub hdr: NMHDR, pub pData: *mut u32, pub pCurrent: *mut u32, pub cbData: u32, pub iItem: i32, pub cButtons: i32, pub cbBytesPerRecord: i32, pub tbButton: TBBUTTON, } #[cfg(feature = "Win32_Foundation")] impl NMTBRESTORE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTBRESTORE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTBRESTORE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTBRESTORE") .field("hdr", &self.hdr) .field("pData", &self.pData) .field("pCurrent", &self.pCurrent) .field("cbData", &self.cbData) .field("iItem", &self.iItem) .field("cButtons", &self.cButtons) .field("cbBytesPerRecord", &self.cbBytesPerRecord) .field("tbButton", &self.tbButton) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTBRESTORE { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.pData == other.pData && self.pCurrent == other.pCurrent && self.cbData == other.cbData && self.iItem == other.iItem && self.cButtons == other.cButtons && self.cbBytesPerRecord == other.cbBytesPerRecord && self.tbButton == other.tbButton } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTBRESTORE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTBRESTORE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTBSAVE { pub hdr: NMHDR, pub pData: *mut u32, pub pCurrent: *mut u32, pub cbData: u32, pub iItem: i32, pub cButtons: i32, pub tbButton: TBBUTTON, } #[cfg(feature = "Win32_Foundation")] impl NMTBSAVE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTBSAVE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTBSAVE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTBSAVE").field("hdr", &self.hdr).field("pData", &self.pData).field("pCurrent", &self.pCurrent).field("cbData", &self.cbData).field("iItem", &self.iItem).field("cButtons", &self.cButtons).field("tbButton", &self.tbButton).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTBSAVE { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.pData == other.pData && self.pCurrent == other.pCurrent && self.cbData == other.cbData && self.iItem == other.iItem && self.cButtons == other.cButtons && self.tbButton == other.tbButton } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTBSAVE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTBSAVE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C, packed(1))] #[cfg(feature = "Win32_Foundation")] pub struct NMTCKEYDOWN { pub hdr: NMHDR, pub wVKey: u16, pub flags: u32, } #[cfg(feature = "Win32_Foundation")] impl NMTCKEYDOWN {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTCKEYDOWN { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTCKEYDOWN { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTCKEYDOWN {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTCKEYDOWN { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTOOLBARA { pub hdr: NMHDR, pub iItem: i32, pub tbButton: TBBUTTON, pub cchText: i32, pub pszText: super::super::Foundation::PSTR, pub rcButton: super::super::Foundation::RECT, } #[cfg(feature = "Win32_Foundation")] impl NMTOOLBARA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTOOLBARA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTOOLBARA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTOOLBARA").field("hdr", &self.hdr).field("iItem", &self.iItem).field("tbButton", &self.tbButton).field("cchText", &self.cchText).field("pszText", &self.pszText).field("rcButton", &self.rcButton).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTOOLBARA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItem == other.iItem && self.tbButton == other.tbButton && self.cchText == other.cchText && self.pszText == other.pszText && self.rcButton == other.rcButton } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTOOLBARA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTOOLBARA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTOOLBARW { pub hdr: NMHDR, pub iItem: i32, pub tbButton: TBBUTTON, pub cchText: i32, pub pszText: super::super::Foundation::PWSTR, pub rcButton: super::super::Foundation::RECT, } #[cfg(feature = "Win32_Foundation")] impl NMTOOLBARW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTOOLBARW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTOOLBARW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTOOLBARW").field("hdr", &self.hdr).field("iItem", &self.iItem).field("tbButton", &self.tbButton).field("cchText", &self.cchText).field("pszText", &self.pszText).field("rcButton", &self.rcButton).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTOOLBARW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iItem == other.iItem && self.tbButton == other.tbButton && self.cchText == other.cchText && self.pszText == other.pszText && self.rcButton == other.rcButton } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTOOLBARW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTOOLBARW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTOOLTIPSCREATED { pub hdr: NMHDR, pub hwndToolTips: super::super::Foundation::HWND, } #[cfg(feature = "Win32_Foundation")] impl NMTOOLTIPSCREATED {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTOOLTIPSCREATED { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTOOLTIPSCREATED { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTOOLTIPSCREATED").field("hdr", &self.hdr).field("hwndToolTips", &self.hwndToolTips).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTOOLTIPSCREATED { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.hwndToolTips == other.hwndToolTips } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTOOLTIPSCREATED {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTOOLTIPSCREATED { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTRBTHUMBPOSCHANGING { pub hdr: NMHDR, pub dwPos: u32, pub nReason: i32, } #[cfg(feature = "Win32_Foundation")] impl NMTRBTHUMBPOSCHANGING {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTRBTHUMBPOSCHANGING { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTRBTHUMBPOSCHANGING { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTRBTHUMBPOSCHANGING").field("hdr", &self.hdr).field("dwPos", &self.dwPos).field("nReason", &self.nReason).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTRBTHUMBPOSCHANGING { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.dwPos == other.dwPos && self.nReason == other.nReason } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTRBTHUMBPOSCHANGING {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTRBTHUMBPOSCHANGING { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTREEVIEWA { pub hdr: NMHDR, pub action: u32, pub itemOld: TVITEMA, pub itemNew: TVITEMA, pub ptDrag: super::super::Foundation::POINT, } #[cfg(feature = "Win32_Foundation")] impl NMTREEVIEWA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTREEVIEWA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTREEVIEWA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTREEVIEWA").field("hdr", &self.hdr).field("action", &self.action).field("itemOld", &self.itemOld).field("itemNew", &self.itemNew).field("ptDrag", &self.ptDrag).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTREEVIEWA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.action == other.action && self.itemOld == other.itemOld && self.itemNew == other.itemNew && self.ptDrag == other.ptDrag } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTREEVIEWA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTREEVIEWA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTREEVIEWW { pub hdr: NMHDR, pub action: u32, pub itemOld: TVITEMW, pub itemNew: TVITEMW, pub ptDrag: super::super::Foundation::POINT, } #[cfg(feature = "Win32_Foundation")] impl NMTREEVIEWW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTREEVIEWW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTREEVIEWW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTREEVIEWW").field("hdr", &self.hdr).field("action", &self.action).field("itemOld", &self.itemOld).field("itemNew", &self.itemNew).field("ptDrag", &self.ptDrag).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTREEVIEWW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.action == other.action && self.itemOld == other.itemOld && self.itemNew == other.itemNew && self.ptDrag == other.ptDrag } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTREEVIEWW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTREEVIEWW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct NMTTCUSTOMDRAW { pub nmcd: NMCUSTOMDRAW, pub uDrawFlags: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl NMTTCUSTOMDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for NMTTCUSTOMDRAW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for NMTTCUSTOMDRAW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTTCUSTOMDRAW").field("nmcd", &self.nmcd).field("uDrawFlags", &self.uDrawFlags).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for NMTTCUSTOMDRAW { fn eq(&self, other: &Self) -> bool { self.nmcd == other.nmcd && self.uDrawFlags == other.uDrawFlags } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for NMTTCUSTOMDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for NMTTCUSTOMDRAW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTTDISPINFOA { pub hdr: NMHDR, pub lpszText: super::super::Foundation::PSTR, pub szText: [super::super::Foundation::CHAR; 80], pub hinst: super::super::Foundation::HINSTANCE, pub uFlags: u32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMTTDISPINFOA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTTDISPINFOA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTTDISPINFOA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTTDISPINFOA").field("hdr", &self.hdr).field("lpszText", &self.lpszText).field("szText", &self.szText).field("hinst", &self.hinst).field("uFlags", &self.uFlags).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTTDISPINFOA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.lpszText == other.lpszText && self.szText == other.szText && self.hinst == other.hinst && self.uFlags == other.uFlags && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTTDISPINFOA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTTDISPINFOA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTTDISPINFOW { pub hdr: NMHDR, pub lpszText: super::super::Foundation::PWSTR, pub szText: [u16; 80], pub hinst: super::super::Foundation::HINSTANCE, pub uFlags: u32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMTTDISPINFOW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTTDISPINFOW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTTDISPINFOW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTTDISPINFOW").field("hdr", &self.hdr).field("lpszText", &self.lpszText).field("szText", &self.szText).field("hinst", &self.hinst).field("uFlags", &self.uFlags).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTTDISPINFOW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.lpszText == other.lpszText && self.szText == other.szText && self.hinst == other.hinst && self.uFlags == other.uFlags && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTTDISPINFOW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTTDISPINFOW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct NMTVASYNCDRAW { pub hdr: NMHDR, pub pimldp: *mut IMAGELISTDRAWPARAMS, pub hr: ::windows::core::HRESULT, pub hItem: HTREEITEM, pub lParam: super::super::Foundation::LPARAM, pub dwRetFlags: u32, pub iRetImageIndex: i32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl NMTVASYNCDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for NMTVASYNCDRAW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for NMTVASYNCDRAW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTVASYNCDRAW").field("hdr", &self.hdr).field("pimldp", &self.pimldp).field("hr", &self.hr).field("hItem", &self.hItem).field("lParam", &self.lParam).field("dwRetFlags", &self.dwRetFlags).field("iRetImageIndex", &self.iRetImageIndex).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for NMTVASYNCDRAW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.pimldp == other.pimldp && self.hr == other.hr && self.hItem == other.hItem && self.lParam == other.lParam && self.dwRetFlags == other.dwRetFlags && self.iRetImageIndex == other.iRetImageIndex } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for NMTVASYNCDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for NMTVASYNCDRAW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct NMTVCUSTOMDRAW { pub nmcd: NMCUSTOMDRAW, pub clrText: u32, pub clrTextBk: u32, pub iLevel: i32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl NMTVCUSTOMDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for NMTVCUSTOMDRAW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for NMTVCUSTOMDRAW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTVCUSTOMDRAW").field("nmcd", &self.nmcd).field("clrText", &self.clrText).field("clrTextBk", &self.clrTextBk).field("iLevel", &self.iLevel).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for NMTVCUSTOMDRAW { fn eq(&self, other: &Self) -> bool { self.nmcd == other.nmcd && self.clrText == other.clrText && self.clrTextBk == other.clrTextBk && self.iLevel == other.iLevel } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for NMTVCUSTOMDRAW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for NMTVCUSTOMDRAW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTVDISPINFOA { pub hdr: NMHDR, pub item: TVITEMA, } #[cfg(feature = "Win32_Foundation")] impl NMTVDISPINFOA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTVDISPINFOA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTVDISPINFOA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTVDISPINFOA").field("hdr", &self.hdr).field("item", &self.item).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTVDISPINFOA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.item == other.item } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTVDISPINFOA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTVDISPINFOA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTVDISPINFOEXA { pub hdr: NMHDR, pub item: TVITEMEXA, } #[cfg(feature = "Win32_Foundation")] impl NMTVDISPINFOEXA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTVDISPINFOEXA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTVDISPINFOEXA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTVDISPINFOEXA").field("hdr", &self.hdr).field("item", &self.item).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTVDISPINFOEXA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.item == other.item } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTVDISPINFOEXA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTVDISPINFOEXA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTVDISPINFOEXW { pub hdr: NMHDR, pub item: TVITEMEXW, } #[cfg(feature = "Win32_Foundation")] impl NMTVDISPINFOEXW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTVDISPINFOEXW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTVDISPINFOEXW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTVDISPINFOEXW").field("hdr", &self.hdr).field("item", &self.item).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTVDISPINFOEXW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.item == other.item } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTVDISPINFOEXW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTVDISPINFOEXW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTVDISPINFOW { pub hdr: NMHDR, pub item: TVITEMW, } #[cfg(feature = "Win32_Foundation")] impl NMTVDISPINFOW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTVDISPINFOW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTVDISPINFOW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTVDISPINFOW").field("hdr", &self.hdr).field("item", &self.item).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTVDISPINFOW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.item == other.item } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTVDISPINFOW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTVDISPINFOW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTVGETINFOTIPA { pub hdr: NMHDR, pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, pub hItem: HTREEITEM, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMTVGETINFOTIPA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTVGETINFOTIPA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTVGETINFOTIPA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTVGETINFOTIPA").field("hdr", &self.hdr).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("hItem", &self.hItem).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTVGETINFOTIPA { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.hItem == other.hItem && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTVGETINFOTIPA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTVGETINFOTIPA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTVGETINFOTIPW { pub hdr: NMHDR, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub hItem: HTREEITEM, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMTVGETINFOTIPW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTVGETINFOTIPW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTVGETINFOTIPW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTVGETINFOTIPW").field("hdr", &self.hdr).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("hItem", &self.hItem).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTVGETINFOTIPW { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.hItem == other.hItem && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTVGETINFOTIPW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTVGETINFOTIPW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTVITEMCHANGE { pub hdr: NMHDR, pub uChanged: u32, pub hItem: HTREEITEM, pub uStateNew: u32, pub uStateOld: u32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl NMTVITEMCHANGE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTVITEMCHANGE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTVITEMCHANGE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTVITEMCHANGE").field("hdr", &self.hdr).field("uChanged", &self.uChanged).field("hItem", &self.hItem).field("uStateNew", &self.uStateNew).field("uStateOld", &self.uStateOld).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTVITEMCHANGE { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.uChanged == other.uChanged && self.hItem == other.hItem && self.uStateNew == other.uStateNew && self.uStateOld == other.uStateOld && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTVITEMCHANGE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTVITEMCHANGE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C, packed(1))] #[cfg(feature = "Win32_Foundation")] pub struct NMTVKEYDOWN { pub hdr: NMHDR, pub wVKey: u16, pub flags: u32, } #[cfg(feature = "Win32_Foundation")] impl NMTVKEYDOWN {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTVKEYDOWN { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTVKEYDOWN { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTVKEYDOWN {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTVKEYDOWN { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMTVSTATEIMAGECHANGING { pub hdr: NMHDR, pub hti: HTREEITEM, pub iOldStateImageIndex: i32, pub iNewStateImageIndex: i32, } #[cfg(feature = "Win32_Foundation")] impl NMTVSTATEIMAGECHANGING {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMTVSTATEIMAGECHANGING { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMTVSTATEIMAGECHANGING { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMTVSTATEIMAGECHANGING").field("hdr", &self.hdr).field("hti", &self.hti).field("iOldStateImageIndex", &self.iOldStateImageIndex).field("iNewStateImageIndex", &self.iNewStateImageIndex).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMTVSTATEIMAGECHANGING { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.hti == other.hti && self.iOldStateImageIndex == other.iOldStateImageIndex && self.iNewStateImageIndex == other.iNewStateImageIndex } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMTVSTATEIMAGECHANGING {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMTVSTATEIMAGECHANGING { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMUPDOWN { pub hdr: NMHDR, pub iPos: i32, pub iDelta: i32, } #[cfg(feature = "Win32_Foundation")] impl NMUPDOWN {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMUPDOWN { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMUPDOWN { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMUPDOWN").field("hdr", &self.hdr).field("iPos", &self.iPos).field("iDelta", &self.iDelta).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMUPDOWN { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.iPos == other.iPos && self.iDelta == other.iDelta } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMUPDOWN {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMUPDOWN { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct NMVIEWCHANGE { pub nmhdr: NMHDR, pub dwOldView: u32, pub dwNewView: u32, } #[cfg(feature = "Win32_Foundation")] impl NMVIEWCHANGE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for NMVIEWCHANGE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for NMVIEWCHANGE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("NMVIEWCHANGE").field("nmhdr", &self.nmhdr).field("dwOldView", &self.dwOldView).field("dwNewView", &self.dwNewView).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for NMVIEWCHANGE { fn eq(&self, other: &Self) -> bool { self.nmhdr == other.nmhdr && self.dwOldView == other.dwOldView && self.dwNewView == other.dwNewView } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for NMVIEWCHANGE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for NMVIEWCHANGE { type Abi = Self; } pub const NM_GETCUSTOMSPLITRECT: u32 = 4294966049u32; pub const ODT_HEADER: u32 = 100u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct OFFSETTYPE(pub i32); pub const OT_TOPLEFT: OFFSETTYPE = OFFSETTYPE(0i32); pub const OT_TOPRIGHT: OFFSETTYPE = OFFSETTYPE(1i32); pub const OT_TOPMIDDLE: OFFSETTYPE = OFFSETTYPE(2i32); pub const OT_BOTTOMLEFT: OFFSETTYPE = OFFSETTYPE(3i32); pub const OT_BOTTOMRIGHT: OFFSETTYPE = OFFSETTYPE(4i32); pub const OT_BOTTOMMIDDLE: OFFSETTYPE = OFFSETTYPE(5i32); pub const OT_MIDDLELEFT: OFFSETTYPE = OFFSETTYPE(6i32); pub const OT_MIDDLERIGHT: OFFSETTYPE = OFFSETTYPE(7i32); pub const OT_LEFTOFCAPTION: OFFSETTYPE = OFFSETTYPE(8i32); pub const OT_RIGHTOFCAPTION: OFFSETTYPE = OFFSETTYPE(9i32); pub const OT_LEFTOFLASTBUTTON: OFFSETTYPE = OFFSETTYPE(10i32); pub const OT_RIGHTOFLASTBUTTON: OFFSETTYPE = OFFSETTYPE(11i32); pub const OT_ABOVELASTBUTTON: OFFSETTYPE = OFFSETTYPE(12i32); pub const OT_BELOWLASTBUTTON: OFFSETTYPE = OFFSETTYPE(13i32); impl ::core::convert::From<i32> for OFFSETTYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OFFSETTYPE { 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 OPENBOXSTATES(pub i32); pub const SPOB_NORMAL: OPENBOXSTATES = OPENBOXSTATES(1i32); pub const SPOB_HOT: OPENBOXSTATES = OPENBOXSTATES(2i32); pub const SPOB_SELECTED: OPENBOXSTATES = OPENBOXSTATES(3i32); pub const SPOB_DISABLED: OPENBOXSTATES = OPENBOXSTATES(4i32); pub const SPOB_FOCUSED: OPENBOXSTATES = OPENBOXSTATES(5i32); impl ::core::convert::From<i32> for OPENBOXSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OPENBOXSTATES { 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 OPEN_THEME_DATA_FLAGS(pub u32); pub const OTD_FORCE_RECT_SIZING: OPEN_THEME_DATA_FLAGS = OPEN_THEME_DATA_FLAGS(1u32); pub const OTD_NONCLIENT: OPEN_THEME_DATA_FLAGS = OPEN_THEME_DATA_FLAGS(2u32); impl ::core::convert::From<u32> for OPEN_THEME_DATA_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for OPEN_THEME_DATA_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for OPEN_THEME_DATA_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for OPEN_THEME_DATA_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for OPEN_THEME_DATA_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for OPEN_THEME_DATA_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for OPEN_THEME_DATA_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OpenThemeData<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hwnd: Param0, pszclasslist: Param1) -> isize { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OpenThemeData(hwnd: super::super::Foundation::HWND, pszclasslist: super::super::Foundation::PWSTR) -> isize; } ::core::mem::transmute(OpenThemeData(hwnd.into_param().abi(), pszclasslist.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn OpenThemeDataEx<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hwnd: Param0, pszclasslist: Param1, dwflags: OPEN_THEME_DATA_FLAGS) -> isize { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn OpenThemeDataEx(hwnd: super::super::Foundation::HWND, pszclasslist: super::super::Foundation::PWSTR, dwflags: OPEN_THEME_DATA_FLAGS) -> isize; } ::core::mem::transmute(OpenThemeDataEx(hwnd.into_param().abi(), pszclasslist.into_param().abi(), ::core::mem::transmute(dwflags))) } #[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 PAGEPARTS(pub i32); pub const PGRP_UP: PAGEPARTS = PAGEPARTS(1i32); pub const PGRP_DOWN: PAGEPARTS = PAGEPARTS(2i32); pub const PGRP_UPHORZ: PAGEPARTS = PAGEPARTS(3i32); pub const PGRP_DOWNHORZ: PAGEPARTS = PAGEPARTS(4i32); impl ::core::convert::From<i32> for PAGEPARTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for PAGEPARTS { type Abi = Self; } pub const PAGESETUPDLGORD: u32 = 1546u32; pub const PAGESETUPDLGORDMOTIF: u32 = 1550u32; pub const PBM_DELTAPOS: u32 = 1027u32; pub const PBM_GETBARCOLOR: u32 = 1039u32; pub const PBM_GETBKCOLOR: u32 = 1038u32; pub const PBM_GETPOS: u32 = 1032u32; pub const PBM_GETRANGE: u32 = 1031u32; pub const PBM_GETSTATE: u32 = 1041u32; pub const PBM_GETSTEP: u32 = 1037u32; pub const PBM_SETBARCOLOR: u32 = 1033u32; pub const PBM_SETBKCOLOR: u32 = 8193u32; pub const PBM_SETMARQUEE: u32 = 1034u32; pub const PBM_SETPOS: u32 = 1026u32; pub const PBM_SETRANGE: u32 = 1025u32; pub const PBM_SETRANGE32: u32 = 1030u32; pub const PBM_SETSTATE: u32 = 1040u32; pub const PBM_SETSTEP: u32 = 1028u32; pub const PBM_STEPIT: u32 = 1029u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct PBRANGE { pub iLow: i32, pub iHigh: i32, } impl PBRANGE {} impl ::core::default::Default for PBRANGE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for PBRANGE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("PBRANGE").field("iLow", &self.iLow).field("iHigh", &self.iHigh).finish() } } impl ::core::cmp::PartialEq for PBRANGE { fn eq(&self, other: &Self) -> bool { self.iLow == other.iLow && self.iHigh == other.iHigh } } impl ::core::cmp::Eq for PBRANGE {} unsafe impl ::windows::core::Abi for PBRANGE { type Abi = Self; } pub const PBST_ERROR: u32 = 2u32; pub const PBST_NORMAL: u32 = 1u32; pub const PBST_PAUSED: u32 = 3u32; pub const PBS_MARQUEE: u32 = 8u32; pub const PBS_SMOOTH: u32 = 1u32; pub const PBS_SMOOTHREVERSE: u32 = 16u32; pub const PBS_VERTICAL: u32 = 4u32; #[cfg(feature = "Win32_Foundation")] pub type PFNDACOMPARE = unsafe extern "system" fn(p1: *const ::core::ffi::c_void, p2: *const ::core::ffi::c_void, lparam: super::super::Foundation::LPARAM) -> i32; #[cfg(feature = "Win32_Foundation")] pub type PFNDACOMPARECONST = unsafe extern "system" fn(p1: *const ::core::ffi::c_void, p2: *const ::core::ffi::c_void, lparam: super::super::Foundation::LPARAM) -> i32; pub type PFNDAENUMCALLBACK = unsafe extern "system" fn(p: *const ::core::ffi::c_void, pdata: *const ::core::ffi::c_void) -> i32; pub type PFNDAENUMCALLBACKCONST = unsafe extern "system" fn(p: *const ::core::ffi::c_void, pdata: *const ::core::ffi::c_void) -> i32; #[cfg(feature = "Win32_Foundation")] pub type PFNDPAMERGE = unsafe extern "system" fn(umsg: DPAMM_MESSAGE, pvdest: *const ::core::ffi::c_void, pvsrc: *const ::core::ffi::c_void, lparam: super::super::Foundation::LPARAM) -> *mut ::core::ffi::c_void; #[cfg(feature = "Win32_Foundation")] pub type PFNDPAMERGECONST = unsafe extern "system" fn(umsg: DPAMM_MESSAGE, pvdest: *const ::core::ffi::c_void, pvsrc: *const ::core::ffi::c_void, lparam: super::super::Foundation::LPARAM) -> *mut ::core::ffi::c_void; #[cfg(feature = "Win32_System_Com")] pub type PFNDPASTREAM = unsafe extern "system" fn(pinfo: *const DPASTREAMINFO, pstream: ::windows::core::RawPtr, pvinstdata: *const ::core::ffi::c_void) -> ::windows::core::HRESULT; #[cfg(feature = "Win32_Foundation")] pub type PFNLVCOMPARE = unsafe extern "system" fn(param0: super::super::Foundation::LPARAM, param1: super::super::Foundation::LPARAM, param2: super::super::Foundation::LPARAM) -> i32; pub type PFNLVGROUPCOMPARE = unsafe extern "system" fn(param0: i32, param1: i32, param2: *mut ::core::ffi::c_void) -> i32; #[cfg(feature = "Win32_Foundation")] pub type PFNPROPSHEETCALLBACK = unsafe extern "system" fn(param0: super::super::Foundation::HWND, param1: u32, param2: super::super::Foundation::LPARAM) -> i32; #[cfg(feature = "Win32_Foundation")] pub type PFNTVCOMPARE = unsafe extern "system" fn(lparam1: super::super::Foundation::LPARAM, lparam2: super::super::Foundation::LPARAM, lparamsort: super::super::Foundation::LPARAM) -> i32; #[cfg(feature = "Win32_Foundation")] pub type PFTASKDIALOGCALLBACK = unsafe extern "system" fn(hwnd: super::super::Foundation::HWND, msg: u32, wparam: super::super::Foundation::WPARAM, lparam: super::super::Foundation::LPARAM, lprefdata: isize) -> ::windows::core::HRESULT; pub const PGB_BOTTOMORRIGHT: u32 = 1u32; pub const PGB_TOPORLEFT: u32 = 0u32; pub const PGF_DEPRESSED: u32 = 4u32; pub const PGF_GRAYED: u32 = 2u32; pub const PGF_HOT: u32 = 8u32; pub const PGF_INVISIBLE: u32 = 0u32; pub const PGF_NORMAL: u32 = 1u32; pub const PGM_FIRST: u32 = 5120u32; pub const PGM_FORWARDMOUSE: u32 = 5123u32; pub const PGM_GETBKCOLOR: u32 = 5125u32; pub const PGM_GETBORDER: u32 = 5127u32; pub const PGM_GETBUTTONSIZE: u32 = 5131u32; pub const PGM_GETBUTTONSTATE: u32 = 5132u32; pub const PGM_GETDROPTARGET: u32 = 8196u32; pub const PGM_GETPOS: u32 = 5129u32; pub const PGM_RECALCSIZE: u32 = 5122u32; pub const PGM_SETBKCOLOR: u32 = 5124u32; pub const PGM_SETBORDER: u32 = 5126u32; pub const PGM_SETBUTTONSIZE: u32 = 5130u32; pub const PGM_SETCHILD: u32 = 5121u32; pub const PGM_SETPOS: u32 = 5128u32; pub const PGM_SETSCROLLINFO: u32 = 5133u32; pub const PGS_AUTOSCROLL: u32 = 2u32; pub const PGS_DRAGNDROP: u32 = 4u32; pub const PGS_HORZ: u32 = 1u32; pub const PGS_VERT: u32 = 0u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct POINTER_DEVICE_CURSOR_INFO { pub cursorId: u32, pub cursor: POINTER_DEVICE_CURSOR_TYPE, } impl POINTER_DEVICE_CURSOR_INFO {} impl ::core::default::Default for POINTER_DEVICE_CURSOR_INFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for POINTER_DEVICE_CURSOR_INFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("POINTER_DEVICE_CURSOR_INFO").field("cursorId", &self.cursorId).field("cursor", &self.cursor).finish() } } impl ::core::cmp::PartialEq for POINTER_DEVICE_CURSOR_INFO { fn eq(&self, other: &Self) -> bool { self.cursorId == other.cursorId && self.cursor == other.cursor } } impl ::core::cmp::Eq for POINTER_DEVICE_CURSOR_INFO {} unsafe impl ::windows::core::Abi for POINTER_DEVICE_CURSOR_INFO { 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 POINTER_DEVICE_CURSOR_TYPE(pub i32); pub const POINTER_DEVICE_CURSOR_TYPE_UNKNOWN: POINTER_DEVICE_CURSOR_TYPE = POINTER_DEVICE_CURSOR_TYPE(0i32); pub const POINTER_DEVICE_CURSOR_TYPE_TIP: POINTER_DEVICE_CURSOR_TYPE = POINTER_DEVICE_CURSOR_TYPE(1i32); pub const POINTER_DEVICE_CURSOR_TYPE_ERASER: POINTER_DEVICE_CURSOR_TYPE = POINTER_DEVICE_CURSOR_TYPE(2i32); pub const POINTER_DEVICE_CURSOR_TYPE_MAX: POINTER_DEVICE_CURSOR_TYPE = POINTER_DEVICE_CURSOR_TYPE(-1i32); impl ::core::convert::From<i32> for POINTER_DEVICE_CURSOR_TYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for POINTER_DEVICE_CURSOR_TYPE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct POINTER_DEVICE_INFO { pub displayOrientation: u32, pub device: super::super::Foundation::HANDLE, pub pointerDeviceType: POINTER_DEVICE_TYPE, pub monitor: super::super::Graphics::Gdi::HMONITOR, pub startingCursorId: u32, pub maxActiveContacts: u16, pub productString: [u16; 520], } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl POINTER_DEVICE_INFO {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for POINTER_DEVICE_INFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for POINTER_DEVICE_INFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("POINTER_DEVICE_INFO") .field("displayOrientation", &self.displayOrientation) .field("device", &self.device) .field("pointerDeviceType", &self.pointerDeviceType) .field("monitor", &self.monitor) .field("startingCursorId", &self.startingCursorId) .field("maxActiveContacts", &self.maxActiveContacts) .field("productString", &self.productString) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for POINTER_DEVICE_INFO { fn eq(&self, other: &Self) -> bool { self.displayOrientation == other.displayOrientation && self.device == other.device && self.pointerDeviceType == other.pointerDeviceType && self.monitor == other.monitor && self.startingCursorId == other.startingCursorId && self.maxActiveContacts == other.maxActiveContacts && self.productString == other.productString } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for POINTER_DEVICE_INFO {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for POINTER_DEVICE_INFO { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct POINTER_DEVICE_PROPERTY { pub logicalMin: i32, pub logicalMax: i32, pub physicalMin: i32, pub physicalMax: i32, pub unit: u32, pub unitExponent: u32, pub usagePageId: u16, pub usageId: u16, } impl POINTER_DEVICE_PROPERTY {} impl ::core::default::Default for POINTER_DEVICE_PROPERTY { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for POINTER_DEVICE_PROPERTY { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("POINTER_DEVICE_PROPERTY") .field("logicalMin", &self.logicalMin) .field("logicalMax", &self.logicalMax) .field("physicalMin", &self.physicalMin) .field("physicalMax", &self.physicalMax) .field("unit", &self.unit) .field("unitExponent", &self.unitExponent) .field("usagePageId", &self.usagePageId) .field("usageId", &self.usageId) .finish() } } impl ::core::cmp::PartialEq for POINTER_DEVICE_PROPERTY { fn eq(&self, other: &Self) -> bool { self.logicalMin == other.logicalMin && self.logicalMax == other.logicalMax && self.physicalMin == other.physicalMin && self.physicalMax == other.physicalMax && self.unit == other.unit && self.unitExponent == other.unitExponent && self.usagePageId == other.usagePageId && self.usageId == other.usageId } } impl ::core::cmp::Eq for POINTER_DEVICE_PROPERTY {} unsafe impl ::windows::core::Abi for POINTER_DEVICE_PROPERTY { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct POINTER_DEVICE_TYPE(pub i32); pub const POINTER_DEVICE_TYPE_INTEGRATED_PEN: POINTER_DEVICE_TYPE = POINTER_DEVICE_TYPE(1i32); pub const POINTER_DEVICE_TYPE_EXTERNAL_PEN: POINTER_DEVICE_TYPE = POINTER_DEVICE_TYPE(2i32); pub const POINTER_DEVICE_TYPE_TOUCH: POINTER_DEVICE_TYPE = POINTER_DEVICE_TYPE(3i32); pub const POINTER_DEVICE_TYPE_TOUCH_PAD: POINTER_DEVICE_TYPE = POINTER_DEVICE_TYPE(4i32); pub const POINTER_DEVICE_TYPE_MAX: POINTER_DEVICE_TYPE = POINTER_DEVICE_TYPE(-1i32); impl ::core::convert::From<i32> for POINTER_DEVICE_TYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for POINTER_DEVICE_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 POINTER_FEEDBACK_MODE(pub i32); pub const POINTER_FEEDBACK_DEFAULT: POINTER_FEEDBACK_MODE = POINTER_FEEDBACK_MODE(1i32); pub const POINTER_FEEDBACK_INDIRECT: POINTER_FEEDBACK_MODE = POINTER_FEEDBACK_MODE(2i32); pub const POINTER_FEEDBACK_NONE: POINTER_FEEDBACK_MODE = POINTER_FEEDBACK_MODE(3i32); impl ::core::convert::From<i32> for POINTER_FEEDBACK_MODE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for POINTER_FEEDBACK_MODE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] pub struct POINTER_TYPE_INFO { pub r#type: super::WindowsAndMessaging::POINTER_INPUT_TYPE, pub Anonymous: POINTER_TYPE_INFO_0, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] impl POINTER_TYPE_INFO {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for POINTER_TYPE_INFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for POINTER_TYPE_INFO { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for POINTER_TYPE_INFO {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for POINTER_TYPE_INFO { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] pub union POINTER_TYPE_INFO_0 { pub touchInfo: super::Input::Pointer::POINTER_TOUCH_INFO, pub penInfo: super::Input::Pointer::POINTER_PEN_INFO, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] impl POINTER_TYPE_INFO_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for POINTER_TYPE_INFO_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for POINTER_TYPE_INFO_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for POINTER_TYPE_INFO_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_Input_Pointer", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for POINTER_TYPE_INFO_0 { type Abi = Self; } pub const PRINTDLGEXORD: u32 = 1549u32; pub const PRINTDLGORD: u32 = 1538u32; pub const PRNSETUPDLGORD: u32 = 1539u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct PROPERTYORIGIN(pub i32); pub const PO_STATE: PROPERTYORIGIN = PROPERTYORIGIN(0i32); pub const PO_PART: PROPERTYORIGIN = PROPERTYORIGIN(1i32); pub const PO_CLASS: PROPERTYORIGIN = PROPERTYORIGIN(2i32); pub const PO_GLOBAL: PROPERTYORIGIN = PROPERTYORIGIN(3i32); pub const PO_NOTFOUND: PROPERTYORIGIN = PROPERTYORIGIN(4i32); impl ::core::convert::From<i32> for PROPERTYORIGIN { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for PROPERTYORIGIN { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETHEADERA_V1 { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETHEADERA_V1 { pub dwSize: u32, pub dwFlags: u32, pub hwndParent: super::super::Foundation::HWND, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETHEADERA_V1_0, pub pszCaption: super::super::Foundation::PSTR, pub nPages: u32, pub Anonymous2: PROPSHEETHEADERA_V1_1, pub Anonymous3: PROPSHEETHEADERA_V1_2, pub pfnCallback: ::core::option::Option<PFNPROPSHEETCALLBACK>, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERA_V1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERA_V1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERA_V1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERA_V1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERA_V1 { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERA_V1_0 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERA_V1_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERA_V1_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERA_V1_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERA_V1_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERA_V1_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERA_V1_1 { pub nStartPage: u32, pub pStartPage: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERA_V1_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERA_V1_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERA_V1_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERA_V1_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERA_V1_1 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERA_V1_2 { pub ppsp: *mut ::core::mem::ManuallyDrop<PROPSHEETPAGEA>, pub phpage: *mut HPROPSHEETPAGE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERA_V1_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERA_V1_2 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERA_V1_2 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERA_V1_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERA_V1_2 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETHEADERA_V2 { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETHEADERA_V2 { pub dwSize: u32, pub dwFlags: u32, pub hwndParent: super::super::Foundation::HWND, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETHEADERA_V2_0, pub pszCaption: super::super::Foundation::PSTR, pub nPages: u32, pub Anonymous2: PROPSHEETHEADERA_V2_1, pub Anonymous3: PROPSHEETHEADERA_V2_2, pub pfnCallback: ::core::option::Option<PFNPROPSHEETCALLBACK>, pub Anonymous4: PROPSHEETHEADERA_V2_3, pub hplWatermark: super::super::Graphics::Gdi::HPALETTE, pub Anonymous5: PROPSHEETHEADERA_V2_4, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERA_V2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERA_V2 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERA_V2 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERA_V2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERA_V2 { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERA_V2_0 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERA_V2_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERA_V2_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERA_V2_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERA_V2_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERA_V2_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERA_V2_1 { pub nStartPage: u32, pub pStartPage: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERA_V2_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERA_V2_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERA_V2_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERA_V2_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERA_V2_1 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERA_V2_2 { pub ppsp: *mut ::core::mem::ManuallyDrop<PROPSHEETPAGEA>, pub phpage: *mut HPROPSHEETPAGE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERA_V2_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERA_V2_2 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERA_V2_2 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERA_V2_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERA_V2_2 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERA_V2_3 { pub hbmWatermark: super::super::Graphics::Gdi::HBITMAP, pub pszbmWatermark: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERA_V2_3 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERA_V2_3 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERA_V2_3 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERA_V2_3 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERA_V2_3 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERA_V2_4 { pub hbmHeader: super::super::Graphics::Gdi::HBITMAP, pub pszbmHeader: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERA_V2_4 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERA_V2_4 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERA_V2_4 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERA_V2_4 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERA_V2_4 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETHEADERW_V1 { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETHEADERW_V1 { pub dwSize: u32, pub dwFlags: u32, pub hwndParent: super::super::Foundation::HWND, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETHEADERW_V1_0, pub pszCaption: super::super::Foundation::PWSTR, pub nPages: u32, pub Anonymous2: PROPSHEETHEADERW_V1_1, pub Anonymous3: PROPSHEETHEADERW_V1_2, pub pfnCallback: ::core::option::Option<PFNPROPSHEETCALLBACK>, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERW_V1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERW_V1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERW_V1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERW_V1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERW_V1 { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERW_V1_0 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERW_V1_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERW_V1_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERW_V1_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERW_V1_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERW_V1_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERW_V1_1 { pub nStartPage: u32, pub pStartPage: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERW_V1_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERW_V1_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERW_V1_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERW_V1_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERW_V1_1 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERW_V1_2 { pub ppsp: *mut ::core::mem::ManuallyDrop<PROPSHEETPAGEW>, pub phpage: *mut HPROPSHEETPAGE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERW_V1_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERW_V1_2 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERW_V1_2 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERW_V1_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERW_V1_2 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETHEADERW_V2 { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETHEADERW_V2 { pub dwSize: u32, pub dwFlags: u32, pub hwndParent: super::super::Foundation::HWND, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETHEADERW_V2_0, pub pszCaption: super::super::Foundation::PWSTR, pub nPages: u32, pub Anonymous2: PROPSHEETHEADERW_V2_1, pub Anonymous3: PROPSHEETHEADERW_V2_2, pub pfnCallback: ::core::option::Option<PFNPROPSHEETCALLBACK>, pub Anonymous4: PROPSHEETHEADERW_V2_3, pub hplWatermark: super::super::Graphics::Gdi::HPALETTE, pub Anonymous5: PROPSHEETHEADERW_V2_4, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERW_V2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERW_V2 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERW_V2 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERW_V2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERW_V2 { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERW_V2_0 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERW_V2_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERW_V2_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERW_V2_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERW_V2_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERW_V2_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERW_V2_1 { pub nStartPage: u32, pub pStartPage: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERW_V2_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERW_V2_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERW_V2_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERW_V2_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERW_V2_1 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERW_V2_2 { pub ppsp: *mut ::core::mem::ManuallyDrop<PROPSHEETPAGEW>, pub phpage: *mut HPROPSHEETPAGE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERW_V2_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERW_V2_2 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERW_V2_2 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERW_V2_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERW_V2_2 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERW_V2_3 { pub hbmWatermark: super::super::Graphics::Gdi::HBITMAP, pub pszbmWatermark: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERW_V2_3 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERW_V2_3 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERW_V2_3 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERW_V2_3 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERW_V2_3 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETHEADERW_V2_4 { pub hbmHeader: super::super::Graphics::Gdi::HBITMAP, pub pszbmHeader: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETHEADERW_V2_4 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETHEADERW_V2_4 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETHEADERW_V2_4 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETHEADERW_V2_4 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETHEADERW_V2_4 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETPAGEA { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETPAGEA { pub dwSize: u32, pub dwFlags: u32, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETPAGEA_0, pub Anonymous2: PROPSHEETPAGEA_1, pub pszTitle: super::super::Foundation::PSTR, pub pfnDlgProc: ::core::option::Option<super::WindowsAndMessaging::DLGPROC>, pub lParam: super::super::Foundation::LPARAM, pub pfnCallback: ::core::option::Option<LPFNPSPCALLBACKA>, pub pcRefParent: *mut u32, pub pszHeaderTitle: super::super::Foundation::PSTR, pub pszHeaderSubTitle: super::super::Foundation::PSTR, pub hActCtx: super::super::Foundation::HANDLE, pub Anonymous3: PROPSHEETPAGEA_2, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEA_0 { pub pszTemplate: super::super::Foundation::PSTR, pub pResource: *mut super::WindowsAndMessaging::DLGTEMPLATE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEA_1 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_1 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEA_2 { pub hbmHeader: super::super::Graphics::Gdi::HBITMAP, pub pszbmHeader: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_2 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_2 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_2 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETPAGEA_V1 { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETPAGEA_V1 { pub dwSize: u32, pub dwFlags: u32, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETPAGEA_V1_0, pub Anonymous2: PROPSHEETPAGEA_V1_1, pub pszTitle: super::super::Foundation::PSTR, pub pfnDlgProc: ::core::option::Option<super::WindowsAndMessaging::DLGPROC>, pub lParam: super::super::Foundation::LPARAM, pub pfnCallback: ::core::option::Option<LPFNPSPCALLBACKA>, pub pcRefParent: *mut u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_V1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_V1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_V1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_V1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_V1 { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEA_V1_0 { pub pszTemplate: super::super::Foundation::PSTR, pub pResource: *mut super::WindowsAndMessaging::DLGTEMPLATE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_V1_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_V1_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_V1_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_V1_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_V1_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEA_V1_1 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_V1_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_V1_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_V1_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_V1_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_V1_1 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETPAGEA_V2 { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETPAGEA_V2 { pub dwSize: u32, pub dwFlags: u32, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETPAGEA_V2_0, pub Anonymous2: PROPSHEETPAGEA_V2_1, pub pszTitle: super::super::Foundation::PSTR, pub pfnDlgProc: ::core::option::Option<super::WindowsAndMessaging::DLGPROC>, pub lParam: super::super::Foundation::LPARAM, pub pfnCallback: ::core::option::Option<LPFNPSPCALLBACKA>, pub pcRefParent: *mut u32, pub pszHeaderTitle: super::super::Foundation::PSTR, pub pszHeaderSubTitle: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_V2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_V2 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_V2 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_V2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_V2 { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEA_V2_0 { pub pszTemplate: super::super::Foundation::PSTR, pub pResource: *mut super::WindowsAndMessaging::DLGTEMPLATE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_V2_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_V2_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_V2_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_V2_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_V2_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEA_V2_1 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_V2_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_V2_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_V2_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_V2_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_V2_1 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETPAGEA_V3 { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETPAGEA_V3 { pub dwSize: u32, pub dwFlags: u32, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETPAGEA_V3_0, pub Anonymous2: PROPSHEETPAGEA_V3_1, pub pszTitle: super::super::Foundation::PSTR, pub pfnDlgProc: ::core::option::Option<super::WindowsAndMessaging::DLGPROC>, pub lParam: super::super::Foundation::LPARAM, pub pfnCallback: ::core::option::Option<LPFNPSPCALLBACKA>, pub pcRefParent: *mut u32, pub pszHeaderTitle: super::super::Foundation::PSTR, pub pszHeaderSubTitle: super::super::Foundation::PSTR, pub hActCtx: super::super::Foundation::HANDLE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_V3 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_V3 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_V3 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_V3 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_V3 { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEA_V3_0 { pub pszTemplate: super::super::Foundation::PSTR, pub pResource: *mut super::WindowsAndMessaging::DLGTEMPLATE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_V3_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_V3_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_V3_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_V3_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_V3_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEA_V3_1 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEA_V3_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEA_V3_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEA_V3_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEA_V3_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEA_V3_1 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETPAGEW { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETPAGEW { pub dwSize: u32, pub dwFlags: u32, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETPAGEW_0, pub Anonymous2: PROPSHEETPAGEW_1, pub pszTitle: super::super::Foundation::PWSTR, pub pfnDlgProc: ::core::option::Option<super::WindowsAndMessaging::DLGPROC>, pub lParam: super::super::Foundation::LPARAM, pub pfnCallback: ::core::option::Option<LPFNPSPCALLBACKW>, pub pcRefParent: *mut u32, pub pszHeaderTitle: super::super::Foundation::PWSTR, pub pszHeaderSubTitle: super::super::Foundation::PWSTR, pub hActCtx: super::super::Foundation::HANDLE, pub Anonymous3: PROPSHEETPAGEW_2, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEW_0 { pub pszTemplate: super::super::Foundation::PWSTR, pub pResource: *mut super::WindowsAndMessaging::DLGTEMPLATE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEW_1 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_1 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEW_2 { pub hbmHeader: super::super::Graphics::Gdi::HBITMAP, pub pszbmHeader: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_2 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_2 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_2 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETPAGEW_V1 { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETPAGEW_V1 { pub dwSize: u32, pub dwFlags: u32, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETPAGEW_V1_0, pub Anonymous2: PROPSHEETPAGEW_V1_1, pub pszTitle: super::super::Foundation::PWSTR, pub pfnDlgProc: ::core::option::Option<super::WindowsAndMessaging::DLGPROC>, pub lParam: super::super::Foundation::LPARAM, pub pfnCallback: ::core::option::Option<LPFNPSPCALLBACKW>, pub pcRefParent: *mut u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_V1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_V1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_V1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_V1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_V1 { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEW_V1_0 { pub pszTemplate: super::super::Foundation::PWSTR, pub pResource: *mut super::WindowsAndMessaging::DLGTEMPLATE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_V1_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_V1_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_V1_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_V1_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_V1_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEW_V1_1 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_V1_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_V1_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_V1_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_V1_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_V1_1 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETPAGEW_V2 { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETPAGEW_V2 { pub dwSize: u32, pub dwFlags: u32, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETPAGEW_V2_0, pub Anonymous2: PROPSHEETPAGEW_V2_1, pub pszTitle: super::super::Foundation::PWSTR, pub pfnDlgProc: ::core::option::Option<super::WindowsAndMessaging::DLGPROC>, pub lParam: super::super::Foundation::LPARAM, pub pfnCallback: ::core::option::Option<LPFNPSPCALLBACKW>, pub pcRefParent: *mut u32, pub pszHeaderTitle: super::super::Foundation::PWSTR, pub pszHeaderSubTitle: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_V2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_V2 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_V2 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_V2 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_V2 { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEW_V2_0 { pub pszTemplate: super::super::Foundation::PWSTR, pub pResource: *mut super::WindowsAndMessaging::DLGTEMPLATE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_V2_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_V2_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_V2_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_V2_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_V2_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEW_V2_1 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_V2_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_V2_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_V2_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_V2_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_V2_1 { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for PROPSHEETPAGEW_V3 { fn clone(&self) -> Self { unimplemented!() } } #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub struct PROPSHEETPAGEW_V3 { pub dwSize: u32, pub dwFlags: u32, pub hInstance: super::super::Foundation::HINSTANCE, pub Anonymous1: PROPSHEETPAGEW_V3_0, pub Anonymous2: PROPSHEETPAGEW_V3_1, pub pszTitle: super::super::Foundation::PWSTR, pub pfnDlgProc: ::core::option::Option<super::WindowsAndMessaging::DLGPROC>, pub lParam: super::super::Foundation::LPARAM, pub pfnCallback: ::core::option::Option<LPFNPSPCALLBACKW>, pub pcRefParent: *mut u32, pub pszHeaderTitle: super::super::Foundation::PWSTR, pub pszHeaderSubTitle: super::super::Foundation::PWSTR, pub hActCtx: super::super::Foundation::HANDLE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_V3 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_V3 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_V3 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_V3 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_V3 { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEW_V3_0 { pub pszTemplate: super::super::Foundation::PWSTR, pub pResource: *mut super::WindowsAndMessaging::DLGTEMPLATE, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_V3_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_V3_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_V3_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_V3_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_V3_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] pub union PROPSHEETPAGEW_V3_1 { pub hIcon: super::WindowsAndMessaging::HICON, pub pszIcon: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl PROPSHEETPAGEW_V3_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for PROPSHEETPAGEW_V3_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for PROPSHEETPAGEW_V3_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for PROPSHEETPAGEW_V3_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for PROPSHEETPAGEW_V3_1 { type Abi = Self; } pub const PROP_LG_CXDLG: u32 = 252u32; pub const PROP_LG_CYDLG: u32 = 218u32; pub const PROP_MED_CXDLG: u32 = 227u32; pub const PROP_MED_CYDLG: u32 = 215u32; pub const PROP_SM_CXDLG: u32 = 212u32; pub const PROP_SM_CYDLG: u32 = 188u32; pub const PSBTN_APPLYNOW: u32 = 4u32; pub const PSBTN_BACK: u32 = 0u32; pub const PSBTN_CANCEL: u32 = 5u32; pub const PSBTN_FINISH: u32 = 2u32; pub const PSBTN_HELP: u32 = 6u32; pub const PSBTN_MAX: u32 = 6u32; pub const PSBTN_NEXT: u32 = 1u32; pub const PSBTN_OK: u32 = 3u32; pub const PSCB_BUTTONPRESSED: u32 = 3u32; pub const PSCB_INITIALIZED: u32 = 1u32; pub const PSCB_PRECREATE: u32 = 2u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct PSHNOTIFY { pub hdr: NMHDR, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl PSHNOTIFY {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for PSHNOTIFY { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for PSHNOTIFY { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("PSHNOTIFY").field("hdr", &self.hdr).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for PSHNOTIFY { fn eq(&self, other: &Self) -> bool { self.hdr == other.hdr && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for PSHNOTIFY {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for PSHNOTIFY { type Abi = Self; } pub const PSH_AEROWIZARD: u32 = 16384u32; pub const PSH_DEFAULT: u32 = 0u32; pub const PSH_HASHELP: u32 = 512u32; pub const PSH_HEADER: u32 = 524288u32; pub const PSH_HEADERBITMAP: u32 = 134217728u32; pub const PSH_MODELESS: u32 = 1024u32; pub const PSH_NOAPPLYNOW: u32 = 128u32; pub const PSH_NOCONTEXTHELP: u32 = 33554432u32; pub const PSH_NOMARGIN: u32 = 268435456u32; pub const PSH_PROPSHEETPAGE: u32 = 8u32; pub const PSH_PROPTITLE: u32 = 1u32; pub const PSH_RESIZABLE: u32 = 67108864u32; pub const PSH_RTLREADING: u32 = 2048u32; pub const PSH_STRETCHWATERMARK: u32 = 262144u32; pub const PSH_USECALLBACK: u32 = 256u32; pub const PSH_USEHBMHEADER: u32 = 1048576u32; pub const PSH_USEHBMWATERMARK: u32 = 65536u32; pub const PSH_USEHICON: u32 = 2u32; pub const PSH_USEHPLWATERMARK: u32 = 131072u32; pub const PSH_USEICONID: u32 = 4u32; pub const PSH_USEPAGELANG: u32 = 2097152u32; pub const PSH_USEPSTARTPAGE: u32 = 64u32; pub const PSH_WATERMARK: u32 = 32768u32; pub const PSH_WIZARD: u32 = 32u32; pub const PSH_WIZARD97: u32 = 8192u32; pub const PSH_WIZARDCONTEXTHELP: u32 = 4096u32; pub const PSH_WIZARDHASFINISH: u32 = 16u32; pub const PSH_WIZARD_LITE: u32 = 4194304u32; pub const PSM_ADDPAGE: u32 = 1127u32; pub const PSM_APPLY: u32 = 1134u32; pub const PSM_CANCELTOCLOSE: u32 = 1131u32; pub const PSM_CHANGED: u32 = 1128u32; pub const PSM_ENABLEWIZBUTTONS: u32 = 1163u32; pub const PSM_GETCURRENTPAGEHWND: u32 = 1142u32; pub const PSM_GETRESULT: u32 = 1159u32; pub const PSM_GETTABCONTROL: u32 = 1140u32; pub const PSM_HWNDTOINDEX: u32 = 1153u32; pub const PSM_IDTOINDEX: u32 = 1157u32; pub const PSM_INDEXTOHWND: u32 = 1154u32; pub const PSM_INDEXTOID: u32 = 1158u32; pub const PSM_INDEXTOPAGE: u32 = 1156u32; pub const PSM_INSERTPAGE: u32 = 1143u32; pub const PSM_ISDIALOGMESSAGE: u32 = 1141u32; pub const PSM_PAGETOINDEX: u32 = 1155u32; pub const PSM_PRESSBUTTON: u32 = 1137u32; pub const PSM_QUERYSIBLINGS: u32 = 1132u32; pub const PSM_REBOOTSYSTEM: u32 = 1130u32; pub const PSM_RECALCPAGESIZES: u32 = 1160u32; pub const PSM_REMOVEPAGE: u32 = 1126u32; pub const PSM_RESTARTWINDOWS: u32 = 1129u32; pub const PSM_SETBUTTONTEXT: u32 = 1164u32; pub const PSM_SETBUTTONTEXTW: u32 = 1164u32; pub const PSM_SETCURSEL: u32 = 1125u32; pub const PSM_SETCURSELID: u32 = 1138u32; pub const PSM_SETFINISHTEXT: u32 = 1145u32; pub const PSM_SETFINISHTEXTA: u32 = 1139u32; pub const PSM_SETFINISHTEXTW: u32 = 1145u32; pub const PSM_SETHEADERSUBTITLE: u32 = 1152u32; pub const PSM_SETHEADERSUBTITLEA: u32 = 1151u32; pub const PSM_SETHEADERSUBTITLEW: u32 = 1152u32; pub const PSM_SETHEADERTITLE: u32 = 1150u32; pub const PSM_SETHEADERTITLEA: u32 = 1149u32; pub const PSM_SETHEADERTITLEW: u32 = 1150u32; pub const PSM_SETNEXTTEXT: u32 = 1161u32; pub const PSM_SETNEXTTEXTW: u32 = 1161u32; pub const PSM_SETTITLE: u32 = 1144u32; pub const PSM_SETTITLEA: u32 = 1135u32; pub const PSM_SETTITLEW: u32 = 1144u32; pub const PSM_SETWIZBUTTONS: u32 = 1136u32; pub const PSM_SHOWWIZBUTTONS: u32 = 1162u32; pub const PSM_UNCHANGED: u32 = 1133u32; pub const PSNRET_INVALID: u32 = 1u32; pub const PSNRET_INVALID_NOCHANGEPAGE: u32 = 2u32; pub const PSNRET_MESSAGEHANDLED: u32 = 3u32; pub const PSNRET_NOERROR: u32 = 0u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct PSPCB_MESSAGE(pub u32); pub const PSPCB_ADDREF: PSPCB_MESSAGE = PSPCB_MESSAGE(0u32); pub const PSPCB_CREATE: PSPCB_MESSAGE = PSPCB_MESSAGE(2u32); pub const PSPCB_RELEASE: PSPCB_MESSAGE = PSPCB_MESSAGE(1u32); pub const PSPCB_SI_INITDIALOG: PSPCB_MESSAGE = PSPCB_MESSAGE(1025u32); impl ::core::convert::From<u32> for PSPCB_MESSAGE { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for PSPCB_MESSAGE { type Abi = Self; } impl ::core::ops::BitOr for PSPCB_MESSAGE { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for PSPCB_MESSAGE { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for PSPCB_MESSAGE { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for PSPCB_MESSAGE { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for PSPCB_MESSAGE { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const PSP_DEFAULT: u32 = 0u32; pub const PSP_DLGINDIRECT: u32 = 1u32; pub const PSP_HASHELP: u32 = 32u32; pub const PSP_HIDEHEADER: u32 = 2048u32; pub const PSP_PREMATURE: u32 = 1024u32; pub const PSP_RTLREADING: u32 = 16u32; pub const PSP_USECALLBACK: u32 = 128u32; pub const PSP_USEFUSIONCONTEXT: u32 = 16384u32; pub const PSP_USEHEADERSUBTITLE: u32 = 8192u32; pub const PSP_USEHEADERTITLE: u32 = 4096u32; pub const PSP_USEHICON: u32 = 2u32; pub const PSP_USEICONID: u32 = 4u32; pub const PSP_USEREFPARENT: u32 = 64u32; pub const PSP_USETITLE: u32 = 8u32; pub const PSWIZBF_ELEVATIONREQUIRED: u32 = 1u32; pub const PSWIZB_BACK: u32 = 1u32; pub const PSWIZB_CANCEL: u32 = 16u32; pub const PSWIZB_DISABLEDFINISH: u32 = 8u32; pub const PSWIZB_FINISH: u32 = 4u32; pub const PSWIZB_NEXT: u32 = 2u32; pub const PSWIZB_RESTORE: u32 = 1u32; pub const PSWIZB_SHOW: u32 = 0u32; #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn PackTouchHitTestingProximityEvaluation(phittestinginput: *const TOUCH_HIT_TESTING_INPUT, pproximityeval: *const TOUCH_HIT_TESTING_PROXIMITY_EVALUATION) -> super::super::Foundation::LRESULT { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn PackTouchHitTestingProximityEvaluation(phittestinginput: *const TOUCH_HIT_TESTING_INPUT, pproximityeval: *const TOUCH_HIT_TESTING_PROXIMITY_EVALUATION) -> super::super::Foundation::LRESULT; } ::core::mem::transmute(PackTouchHitTestingProximityEvaluation(::core::mem::transmute(phittestinginput), ::core::mem::transmute(pproximityeval))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn PropertySheetA(param0: *mut PROPSHEETHEADERA_V2) -> isize { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn PropertySheetA(param0: *mut ::core::mem::ManuallyDrop<PROPSHEETHEADERA_V2>) -> isize; } ::core::mem::transmute(PropertySheetA(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn PropertySheetW(param0: *mut PROPSHEETHEADERW_V2) -> isize { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn PropertySheetW(param0: *mut ::core::mem::ManuallyDrop<PROPSHEETHEADERW_V2>) -> isize; } ::core::mem::transmute(PropertySheetW(::core::mem::transmute(param0))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const RBAB_ADDBAND: u32 = 2u32; pub const RBAB_AUTOSIZE: u32 = 1u32; pub const RBBIM_BACKGROUND: u32 = 128u32; pub const RBBIM_CHEVRONLOCATION: u32 = 4096u32; pub const RBBIM_CHEVRONSTATE: u32 = 8192u32; pub const RBBIM_CHILD: u32 = 16u32; pub const RBBIM_CHILDSIZE: u32 = 32u32; pub const RBBIM_COLORS: u32 = 2u32; pub const RBBIM_HEADERSIZE: u32 = 2048u32; pub const RBBIM_ID: u32 = 256u32; pub const RBBIM_IDEALSIZE: u32 = 512u32; pub const RBBIM_IMAGE: u32 = 8u32; pub const RBBIM_LPARAM: u32 = 1024u32; pub const RBBIM_SIZE: u32 = 64u32; pub const RBBIM_STYLE: u32 = 1u32; pub const RBBIM_TEXT: u32 = 4u32; pub const RBBS_BREAK: u32 = 1u32; pub const RBBS_CHILDEDGE: u32 = 4u32; pub const RBBS_FIXEDBMP: u32 = 32u32; pub const RBBS_FIXEDSIZE: u32 = 2u32; pub const RBBS_GRIPPERALWAYS: u32 = 128u32; pub const RBBS_HIDDEN: u32 = 8u32; pub const RBBS_HIDETITLE: u32 = 1024u32; pub const RBBS_NOGRIPPER: u32 = 256u32; pub const RBBS_NOVERT: u32 = 16u32; pub const RBBS_TOPALIGN: u32 = 2048u32; pub const RBBS_USECHEVRON: u32 = 512u32; pub const RBBS_VARIABLEHEIGHT: u32 = 64u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct RBHITTESTINFO { pub pt: super::super::Foundation::POINT, pub flags: u32, pub iBand: i32, } #[cfg(feature = "Win32_Foundation")] impl RBHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for RBHITTESTINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for RBHITTESTINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("RBHITTESTINFO").field("pt", &self.pt).field("flags", &self.flags).field("iBand", &self.iBand).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for RBHITTESTINFO { fn eq(&self, other: &Self) -> bool { self.pt == other.pt && self.flags == other.flags && self.iBand == other.iBand } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for RBHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for RBHITTESTINFO { type Abi = Self; } pub const RBHT_CAPTION: u32 = 2u32; pub const RBHT_CHEVRON: u32 = 8u32; pub const RBHT_CLIENT: u32 = 3u32; pub const RBHT_GRABBER: u32 = 4u32; pub const RBHT_NOWHERE: u32 = 1u32; pub const RBHT_SPLITTER: u32 = 16u32; pub const RBIM_IMAGELIST: u32 = 1u32; pub const RBSTR_CHANGERECT: u32 = 1u32; pub const RBS_AUTOSIZE: u32 = 8192u32; pub const RBS_BANDBORDERS: u32 = 1024u32; pub const RBS_DBLCLKTOGGLE: u32 = 32768u32; pub const RBS_FIXEDORDER: u32 = 2048u32; pub const RBS_REGISTERDROP: u32 = 4096u32; pub const RBS_TOOLTIPS: u32 = 256u32; pub const RBS_VARHEIGHT: u32 = 512u32; pub const RBS_VERTICALGRIPPER: u32 = 16384u32; pub const RB_BEGINDRAG: u32 = 1048u32; pub const RB_DELETEBAND: u32 = 1026u32; pub const RB_DRAGMOVE: u32 = 1050u32; pub const RB_ENDDRAG: u32 = 1049u32; pub const RB_GETBANDBORDERS: u32 = 1058u32; pub const RB_GETBANDCOUNT: u32 = 1036u32; pub const RB_GETBANDINFO: u32 = 1052u32; pub const RB_GETBANDINFOA: u32 = 1053u32; pub const RB_GETBANDINFOW: u32 = 1052u32; pub const RB_GETBANDMARGINS: u32 = 1064u32; pub const RB_GETBARHEIGHT: u32 = 1051u32; pub const RB_GETBARINFO: u32 = 1027u32; pub const RB_GETBKCOLOR: u32 = 1044u32; pub const RB_GETCOLORSCHEME: u32 = 8195u32; pub const RB_GETDROPTARGET: u32 = 8196u32; pub const RB_GETEXTENDEDSTYLE: u32 = 1066u32; pub const RB_GETPALETTE: u32 = 1062u32; pub const RB_GETRECT: u32 = 1033u32; pub const RB_GETROWCOUNT: u32 = 1037u32; pub const RB_GETROWHEIGHT: u32 = 1038u32; pub const RB_GETTEXTCOLOR: u32 = 1046u32; pub const RB_GETTOOLTIPS: u32 = 1041u32; pub const RB_GETUNICODEFORMAT: u32 = 8198u32; pub const RB_HITTEST: u32 = 1032u32; pub const RB_IDTOINDEX: u32 = 1040u32; pub const RB_INSERTBAND: u32 = 1034u32; pub const RB_INSERTBANDA: u32 = 1025u32; pub const RB_INSERTBANDW: u32 = 1034u32; pub const RB_MAXIMIZEBAND: u32 = 1055u32; pub const RB_MINIMIZEBAND: u32 = 1054u32; pub const RB_MOVEBAND: u32 = 1063u32; pub const RB_PUSHCHEVRON: u32 = 1067u32; pub const RB_SETBANDINFO: u32 = 1035u32; pub const RB_SETBANDINFOA: u32 = 1030u32; pub const RB_SETBANDINFOW: u32 = 1035u32; pub const RB_SETBANDWIDTH: u32 = 1068u32; pub const RB_SETBARINFO: u32 = 1028u32; pub const RB_SETBKCOLOR: u32 = 1043u32; pub const RB_SETCOLORSCHEME: u32 = 8194u32; pub const RB_SETEXTENDEDSTYLE: u32 = 1065u32; pub const RB_SETPALETTE: u32 = 1061u32; pub const RB_SETPARENT: u32 = 1031u32; pub const RB_SETTEXTCOLOR: u32 = 1045u32; pub const RB_SETTOOLTIPS: u32 = 1042u32; pub const RB_SETUNICODEFORMAT: u32 = 8197u32; pub const RB_SETWINDOWTHEME: u32 = 8203u32; pub const RB_SHOWBAND: u32 = 1059u32; pub const RB_SIZETORECT: u32 = 1047u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct REBARBANDINFOA { pub cbSize: u32, pub fMask: u32, pub fStyle: u32, pub clrFore: u32, pub clrBack: u32, pub lpText: super::super::Foundation::PSTR, pub cch: u32, pub iImage: i32, pub hwndChild: super::super::Foundation::HWND, pub cxMinChild: u32, pub cyMinChild: u32, pub cx: u32, pub hbmBack: super::super::Graphics::Gdi::HBITMAP, pub wID: u32, pub cyChild: u32, pub cyMaxChild: u32, pub cyIntegral: u32, pub cxIdeal: u32, pub lParam: super::super::Foundation::LPARAM, pub cxHeader: u32, pub rcChevronLocation: super::super::Foundation::RECT, pub uChevronState: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl REBARBANDINFOA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for REBARBANDINFOA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for REBARBANDINFOA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("REBARBANDINFOA") .field("cbSize", &self.cbSize) .field("fMask", &self.fMask) .field("fStyle", &self.fStyle) .field("clrFore", &self.clrFore) .field("clrBack", &self.clrBack) .field("lpText", &self.lpText) .field("cch", &self.cch) .field("iImage", &self.iImage) .field("hwndChild", &self.hwndChild) .field("cxMinChild", &self.cxMinChild) .field("cyMinChild", &self.cyMinChild) .field("cx", &self.cx) .field("hbmBack", &self.hbmBack) .field("wID", &self.wID) .field("cyChild", &self.cyChild) .field("cyMaxChild", &self.cyMaxChild) .field("cyIntegral", &self.cyIntegral) .field("cxIdeal", &self.cxIdeal) .field("lParam", &self.lParam) .field("cxHeader", &self.cxHeader) .field("rcChevronLocation", &self.rcChevronLocation) .field("uChevronState", &self.uChevronState) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for REBARBANDINFOA { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.fMask == other.fMask && self.fStyle == other.fStyle && self.clrFore == other.clrFore && self.clrBack == other.clrBack && self.lpText == other.lpText && self.cch == other.cch && self.iImage == other.iImage && self.hwndChild == other.hwndChild && self.cxMinChild == other.cxMinChild && self.cyMinChild == other.cyMinChild && self.cx == other.cx && self.hbmBack == other.hbmBack && self.wID == other.wID && self.cyChild == other.cyChild && self.cyMaxChild == other.cyMaxChild && self.cyIntegral == other.cyIntegral && self.cxIdeal == other.cxIdeal && self.lParam == other.lParam && self.cxHeader == other.cxHeader && self.rcChevronLocation == other.rcChevronLocation && self.uChevronState == other.uChevronState } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for REBARBANDINFOA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for REBARBANDINFOA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub struct REBARBANDINFOW { pub cbSize: u32, pub fMask: u32, pub fStyle: u32, pub clrFore: u32, pub clrBack: u32, pub lpText: super::super::Foundation::PWSTR, pub cch: u32, pub iImage: i32, pub hwndChild: super::super::Foundation::HWND, pub cxMinChild: u32, pub cyMinChild: u32, pub cx: u32, pub hbmBack: super::super::Graphics::Gdi::HBITMAP, pub wID: u32, pub cyChild: u32, pub cyMaxChild: u32, pub cyIntegral: u32, pub cxIdeal: u32, pub lParam: super::super::Foundation::LPARAM, pub cxHeader: u32, pub rcChevronLocation: super::super::Foundation::RECT, pub uChevronState: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl REBARBANDINFOW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::default::Default for REBARBANDINFOW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::fmt::Debug for REBARBANDINFOW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("REBARBANDINFOW") .field("cbSize", &self.cbSize) .field("fMask", &self.fMask) .field("fStyle", &self.fStyle) .field("clrFore", &self.clrFore) .field("clrBack", &self.clrBack) .field("lpText", &self.lpText) .field("cch", &self.cch) .field("iImage", &self.iImage) .field("hwndChild", &self.hwndChild) .field("cxMinChild", &self.cxMinChild) .field("cyMinChild", &self.cyMinChild) .field("cx", &self.cx) .field("hbmBack", &self.hbmBack) .field("wID", &self.wID) .field("cyChild", &self.cyChild) .field("cyMaxChild", &self.cyMaxChild) .field("cyIntegral", &self.cyIntegral) .field("cxIdeal", &self.cxIdeal) .field("lParam", &self.lParam) .field("cxHeader", &self.cxHeader) .field("rcChevronLocation", &self.rcChevronLocation) .field("uChevronState", &self.uChevronState) .finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::PartialEq for REBARBANDINFOW { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.fMask == other.fMask && self.fStyle == other.fStyle && self.clrFore == other.clrFore && self.clrBack == other.clrBack && self.lpText == other.lpText && self.cch == other.cch && self.iImage == other.iImage && self.hwndChild == other.hwndChild && self.cxMinChild == other.cxMinChild && self.cyMinChild == other.cyMinChild && self.cx == other.cx && self.hbmBack == other.hbmBack && self.wID == other.wID && self.cyChild == other.cyChild && self.cyMaxChild == other.cyMaxChild && self.cyIntegral == other.cyIntegral && self.cxIdeal == other.cxIdeal && self.lParam == other.lParam && self.cxHeader == other.cxHeader && self.rcChevronLocation == other.rcChevronLocation && self.uChevronState == other.uChevronState } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] impl ::core::cmp::Eq for REBARBANDINFOW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] unsafe impl ::windows::core::Abi for REBARBANDINFOW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct REBARINFO { pub cbSize: u32, pub fMask: u32, pub himl: HIMAGELIST, } impl REBARINFO {} impl ::core::default::Default for REBARINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for REBARINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("REBARINFO").field("cbSize", &self.cbSize).field("fMask", &self.fMask).field("himl", &self.himl).finish() } } impl ::core::cmp::PartialEq for REBARINFO { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.fMask == other.fMask && self.himl == other.himl } } impl ::core::cmp::Eq for REBARINFO {} unsafe impl ::windows::core::Abi for REBARINFO { type Abi = Self; } pub const REPLACEDLGORD: u32 = 1541u32; pub const RUNDLGORD: u32 = 1545u32; #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn RegisterPointerDeviceNotifications<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(window: Param0, notifyrange: Param1) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn RegisterPointerDeviceNotifications(window: super::super::Foundation::HWND, notifyrange: super::super::Foundation::BOOL) -> super::super::Foundation::BOOL; } ::core::mem::transmute(RegisterPointerDeviceNotifications(window.into_param().abi(), notifyrange.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn RegisterTouchHitTestingWindow<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0, value: u32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn RegisterTouchHitTestingWindow(hwnd: super::super::Foundation::HWND, value: u32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(RegisterTouchHitTestingWindow(hwnd.into_param().abi(), ::core::mem::transmute(value))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } pub const SBARS_SIZEGRIP: u32 = 256u32; pub const SBARS_TOOLTIPS: u32 = 2048u32; pub const SBT_NOBORDERS: u32 = 256u32; pub const SBT_NOTABPARSING: u32 = 2048u32; pub const SBT_OWNERDRAW: u32 = 4096u32; pub const SBT_POPOUT: u32 = 512u32; pub const SBT_RTLREADING: u32 = 1024u32; pub const SBT_TOOLTIPS: u32 = 2048u32; pub const SB_GETBORDERS: u32 = 1031u32; pub const SB_GETICON: u32 = 1044u32; pub const SB_GETPARTS: u32 = 1030u32; pub const SB_GETRECT: u32 = 1034u32; pub const SB_GETTEXT: u32 = 1037u32; pub const SB_GETTEXTA: u32 = 1026u32; pub const SB_GETTEXTLENGTH: u32 = 1036u32; pub const SB_GETTEXTLENGTHA: u32 = 1027u32; pub const SB_GETTEXTLENGTHW: u32 = 1036u32; pub const SB_GETTEXTW: u32 = 1037u32; pub const SB_GETTIPTEXTA: u32 = 1042u32; pub const SB_GETTIPTEXTW: u32 = 1043u32; pub const SB_GETUNICODEFORMAT: u32 = 8198u32; pub const SB_ISSIMPLE: u32 = 1038u32; pub const SB_SETBKCOLOR: u32 = 8193u32; pub const SB_SETICON: u32 = 1039u32; pub const SB_SETMINHEIGHT: u32 = 1032u32; pub const SB_SETPARTS: u32 = 1028u32; pub const SB_SETTEXT: u32 = 1035u32; pub const SB_SETTEXTA: u32 = 1025u32; pub const SB_SETTEXTW: u32 = 1035u32; pub const SB_SETTIPTEXTA: u32 = 1040u32; pub const SB_SETTIPTEXTW: u32 = 1041u32; pub const SB_SETUNICODEFORMAT: u32 = 8197u32; pub const SB_SIMPLE: u32 = 1033u32; pub const SB_SIMPLEID: u32 = 255u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct SIZINGTYPE(pub i32); pub const ST_TRUESIZE: SIZINGTYPE = SIZINGTYPE(0i32); pub const ST_STRETCH: SIZINGTYPE = SIZINGTYPE(1i32); pub const ST_TILE: SIZINGTYPE = SIZINGTYPE(2i32); impl ::core::convert::From<i32> for SIZINGTYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for SIZINGTYPE { 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 SOFTWAREEXPLORERSTATES(pub i32); pub const SPSE_NORMAL: SOFTWAREEXPLORERSTATES = SOFTWAREEXPLORERSTATES(1i32); pub const SPSE_HOT: SOFTWAREEXPLORERSTATES = SOFTWAREEXPLORERSTATES(2i32); pub const SPSE_SELECTED: SOFTWAREEXPLORERSTATES = SOFTWAREEXPLORERSTATES(3i32); pub const SPSE_DISABLED: SOFTWAREEXPLORERSTATES = SOFTWAREEXPLORERSTATES(4i32); pub const SPSE_FOCUSED: SOFTWAREEXPLORERSTATES = SOFTWAREEXPLORERSTATES(5i32); impl ::core::convert::From<i32> for SOFTWAREEXPLORERSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for SOFTWAREEXPLORERSTATES { 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 STARTPANELPARTS(pub i32); pub const SPP_USERPANE: STARTPANELPARTS = STARTPANELPARTS(1i32); pub const SPP_MOREPROGRAMS: STARTPANELPARTS = STARTPANELPARTS(2i32); pub const SPP_MOREPROGRAMSARROW: STARTPANELPARTS = STARTPANELPARTS(3i32); pub const SPP_PROGLIST: STARTPANELPARTS = STARTPANELPARTS(4i32); pub const SPP_PROGLISTSEPARATOR: STARTPANELPARTS = STARTPANELPARTS(5i32); pub const SPP_PLACESLIST: STARTPANELPARTS = STARTPANELPARTS(6i32); pub const SPP_PLACESLISTSEPARATOR: STARTPANELPARTS = STARTPANELPARTS(7i32); pub const SPP_LOGOFF: STARTPANELPARTS = STARTPANELPARTS(8i32); pub const SPP_LOGOFFBUTTONS: STARTPANELPARTS = STARTPANELPARTS(9i32); pub const SPP_USERPICTURE: STARTPANELPARTS = STARTPANELPARTS(10i32); pub const SPP_PREVIEW: STARTPANELPARTS = STARTPANELPARTS(11i32); pub const SPP_MOREPROGRAMSTAB: STARTPANELPARTS = STARTPANELPARTS(12i32); pub const SPP_NSCHOST: STARTPANELPARTS = STARTPANELPARTS(13i32); pub const SPP_SOFTWAREEXPLORER: STARTPANELPARTS = STARTPANELPARTS(14i32); pub const SPP_OPENBOX: STARTPANELPARTS = STARTPANELPARTS(15i32); pub const SPP_SEARCHVIEW: STARTPANELPARTS = STARTPANELPARTS(16i32); pub const SPP_MOREPROGRAMSARROWBACK: STARTPANELPARTS = STARTPANELPARTS(17i32); pub const SPP_TOPMATCH: STARTPANELPARTS = STARTPANELPARTS(18i32); pub const SPP_LOGOFFSPLITBUTTONDROPDOWN: STARTPANELPARTS = STARTPANELPARTS(19i32); impl ::core::convert::From<i32> for STARTPANELPARTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for STARTPANELPARTS { 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 STATICPARTS(pub i32); pub const STAT_TEXT: STATICPARTS = STATICPARTS(1i32); impl ::core::convert::From<i32> for STATICPARTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for STATICPARTS { type Abi = Self; } pub const STD_COPY: u32 = 1u32; pub const STD_CUT: u32 = 0u32; pub const STD_DELETE: u32 = 5u32; pub const STD_FILENEW: u32 = 6u32; pub const STD_FILEOPEN: u32 = 7u32; pub const STD_FILESAVE: u32 = 8u32; pub const STD_FIND: u32 = 12u32; pub const STD_HELP: u32 = 11u32; pub const STD_PASTE: u32 = 2u32; pub const STD_PRINT: u32 = 14u32; pub const STD_PRINTPRE: u32 = 9u32; pub const STD_PROPERTIES: u32 = 10u32; pub const STD_REDOW: u32 = 4u32; pub const STD_REPLACE: u32 = 13u32; pub const STD_UNDO: u32 = 3u32; #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn SetScrollInfo<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(hwnd: Param0, nbar: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, lpsi: *const super::WindowsAndMessaging::SCROLLINFO, redraw: Param3) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SetScrollInfo(hwnd: super::super::Foundation::HWND, nbar: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, lpsi: *const super::WindowsAndMessaging::SCROLLINFO, redraw: super::super::Foundation::BOOL) -> i32; } ::core::mem::transmute(SetScrollInfo(hwnd.into_param().abi(), ::core::mem::transmute(nbar), ::core::mem::transmute(lpsi), redraw.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn SetScrollPos<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(hwnd: Param0, nbar: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, npos: i32, bredraw: Param3) -> i32 { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SetScrollPos(hwnd: super::super::Foundation::HWND, nbar: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, npos: i32, bredraw: super::super::Foundation::BOOL) -> i32; } ::core::mem::transmute(SetScrollPos(hwnd.into_param().abi(), ::core::mem::transmute(nbar), ::core::mem::transmute(npos), bredraw.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn SetScrollRange<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(hwnd: Param0, nbar: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, nminpos: i32, nmaxpos: i32, bredraw: Param4) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SetScrollRange(hwnd: super::super::Foundation::HWND, nbar: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, nminpos: i32, nmaxpos: i32, bredraw: super::super::Foundation::BOOL) -> super::super::Foundation::BOOL; } ::core::mem::transmute(SetScrollRange(hwnd.into_param().abi(), ::core::mem::transmute(nbar), ::core::mem::transmute(nminpos), ::core::mem::transmute(nmaxpos), bredraw.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[inline] pub unsafe fn SetThemeAppProperties(dwflags: u32) { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SetThemeAppProperties(dwflags: u32); } ::core::mem::transmute(SetThemeAppProperties(::core::mem::transmute(dwflags))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn SetWindowFeedbackSetting<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0, feedback: FEEDBACK_TYPE, dwflags: u32, size: u32, configuration: *const ::core::ffi::c_void) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SetWindowFeedbackSetting(hwnd: super::super::Foundation::HWND, feedback: FEEDBACK_TYPE, dwflags: u32, size: u32, configuration: *const ::core::ffi::c_void) -> super::super::Foundation::BOOL; } ::core::mem::transmute(SetWindowFeedbackSetting(hwnd.into_param().abi(), ::core::mem::transmute(feedback), ::core::mem::transmute(dwflags), ::core::mem::transmute(size), ::core::mem::transmute(configuration))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn SetWindowTheme<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(hwnd: Param0, pszsubappname: Param1, pszsubidlist: Param2) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SetWindowTheme(hwnd: super::super::Foundation::HWND, pszsubappname: super::super::Foundation::PWSTR, pszsubidlist: super::super::Foundation::PWSTR) -> ::windows::core::HRESULT; } SetWindowTheme(hwnd.into_param().abi(), pszsubappname.into_param().abi(), pszsubidlist.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn SetWindowThemeAttribute<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0, eattribute: WINDOWTHEMEATTRIBUTETYPE, pvattribute: *const ::core::ffi::c_void, cbattribute: u32) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn SetWindowThemeAttribute(hwnd: super::super::Foundation::HWND, eattribute: WINDOWTHEMEATTRIBUTETYPE, pvattribute: *const ::core::ffi::c_void, cbattribute: u32) -> ::windows::core::HRESULT; } SetWindowThemeAttribute(hwnd.into_param().abi(), ::core::mem::transmute(eattribute), ::core::mem::transmute(pvattribute), ::core::mem::transmute(cbattribute)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn ShowHideMenuCtl<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(hwnd: Param0, uflags: usize, lpinfo: *const i32) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ShowHideMenuCtl(hwnd: super::super::Foundation::HWND, uflags: usize, lpinfo: *const i32) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ShowHideMenuCtl(hwnd.into_param().abi(), ::core::mem::transmute(uflags), ::core::mem::transmute(lpinfo))) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn ShowScrollBar<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(hwnd: Param0, wbar: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, bshow: Param2) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn ShowScrollBar(hwnd: super::super::Foundation::HWND, wbar: super::WindowsAndMessaging::SCROLLBAR_CONSTANTS, bshow: super::super::Foundation::BOOL) -> super::super::Foundation::BOOL; } ::core::mem::transmute(ShowScrollBar(hwnd.into_param().abi(), ::core::mem::transmute(wbar), bshow.into_param().abi())) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn Str_SetPtrW<'a, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>(ppsz: *mut super::super::Foundation::PWSTR, psz: Param1) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn Str_SetPtrW(ppsz: *mut super::super::Foundation::PWSTR, psz: super::super::Foundation::PWSTR) -> super::super::Foundation::BOOL; } ::core::mem::transmute(Str_SetPtrW(::core::mem::transmute(ppsz), psz.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 TASKBANDPARTS(pub i32); pub const TDP_GROUPCOUNT: TASKBANDPARTS = TASKBANDPARTS(1i32); pub const TDP_FLASHBUTTON: TASKBANDPARTS = TASKBANDPARTS(2i32); pub const TDP_FLASHBUTTONGROUPMENU: TASKBANDPARTS = TASKBANDPARTS(3i32); impl ::core::convert::From<i32> for TASKBANDPARTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TASKBANDPARTS { 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 TASKBARPARTS(pub i32); pub const TBP_BACKGROUNDBOTTOM: TASKBARPARTS = TASKBARPARTS(1i32); pub const TBP_BACKGROUNDRIGHT: TASKBARPARTS = TASKBARPARTS(2i32); pub const TBP_BACKGROUNDTOP: TASKBARPARTS = TASKBARPARTS(3i32); pub const TBP_BACKGROUNDLEFT: TASKBARPARTS = TASKBARPARTS(4i32); pub const TBP_SIZINGBARBOTTOM: TASKBARPARTS = TASKBARPARTS(5i32); pub const TBP_SIZINGBARRIGHT: TASKBARPARTS = TASKBARPARTS(6i32); pub const TBP_SIZINGBARTOP: TASKBARPARTS = TASKBARPARTS(7i32); pub const TBP_SIZINGBARLEFT: TASKBARPARTS = TASKBARPARTS(8i32); impl ::core::convert::From<i32> for TASKBARPARTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TASKBARPARTS { type Abi = Self; } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::clone::Clone for TASKDIALOGCONFIG { fn clone(&self) -> Self { unimplemented!() } } #[repr(C, packed(1))] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub struct TASKDIALOGCONFIG { pub cbSize: u32, pub hwndParent: super::super::Foundation::HWND, pub hInstance: super::super::Foundation::HINSTANCE, pub dwFlags: TASKDIALOG_FLAGS, pub dwCommonButtons: TASKDIALOG_COMMON_BUTTON_FLAGS, pub pszWindowTitle: super::super::Foundation::PWSTR, pub Anonymous1: TASKDIALOGCONFIG_0, pub pszMainInstruction: super::super::Foundation::PWSTR, pub pszContent: super::super::Foundation::PWSTR, pub cButtons: u32, pub pButtons: *mut TASKDIALOG_BUTTON, pub nDefaultButton: i32, pub cRadioButtons: u32, pub pRadioButtons: *mut TASKDIALOG_BUTTON, pub nDefaultRadioButton: i32, pub pszVerificationText: super::super::Foundation::PWSTR, pub pszExpandedInformation: super::super::Foundation::PWSTR, pub pszExpandedControlText: super::super::Foundation::PWSTR, pub pszCollapsedControlText: super::super::Foundation::PWSTR, pub Anonymous2: TASKDIALOGCONFIG_1, pub pszFooter: super::super::Foundation::PWSTR, pub pfCallback: ::core::option::Option<PFTASKDIALOGCALLBACK>, pub lpCallbackData: isize, pub cxWidth: u32, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl TASKDIALOGCONFIG {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for TASKDIALOGCONFIG { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for TASKDIALOGCONFIG { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for TASKDIALOGCONFIG {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for TASKDIALOGCONFIG { type Abi = ::core::mem::ManuallyDrop<Self>; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C, packed(1))] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub union TASKDIALOGCONFIG_0 { pub hMainIcon: super::WindowsAndMessaging::HICON, pub pszMainIcon: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl TASKDIALOGCONFIG_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for TASKDIALOGCONFIG_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for TASKDIALOGCONFIG_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for TASKDIALOGCONFIG_0 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for TASKDIALOGCONFIG_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C, packed(1))] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] pub union TASKDIALOGCONFIG_1 { pub hFooterIcon: super::WindowsAndMessaging::HICON, pub pszFooterIcon: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl TASKDIALOGCONFIG_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::default::Default for TASKDIALOGCONFIG_1 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::PartialEq for TASKDIALOGCONFIG_1 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] impl ::core::cmp::Eq for TASKDIALOGCONFIG_1 {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] unsafe impl ::windows::core::Abi for TASKDIALOGCONFIG_1 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C, packed(1))] #[cfg(feature = "Win32_Foundation")] pub struct TASKDIALOG_BUTTON { pub nButtonID: i32, pub pszButtonText: super::super::Foundation::PWSTR, } #[cfg(feature = "Win32_Foundation")] impl TASKDIALOG_BUTTON {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TASKDIALOG_BUTTON { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TASKDIALOG_BUTTON { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TASKDIALOG_BUTTON {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TASKDIALOG_BUTTON { 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 TASKDIALOG_COMMON_BUTTON_FLAGS(pub i32); pub const TDCBF_OK_BUTTON: TASKDIALOG_COMMON_BUTTON_FLAGS = TASKDIALOG_COMMON_BUTTON_FLAGS(1i32); pub const TDCBF_YES_BUTTON: TASKDIALOG_COMMON_BUTTON_FLAGS = TASKDIALOG_COMMON_BUTTON_FLAGS(2i32); pub const TDCBF_NO_BUTTON: TASKDIALOG_COMMON_BUTTON_FLAGS = TASKDIALOG_COMMON_BUTTON_FLAGS(4i32); pub const TDCBF_CANCEL_BUTTON: TASKDIALOG_COMMON_BUTTON_FLAGS = TASKDIALOG_COMMON_BUTTON_FLAGS(8i32); pub const TDCBF_RETRY_BUTTON: TASKDIALOG_COMMON_BUTTON_FLAGS = TASKDIALOG_COMMON_BUTTON_FLAGS(16i32); pub const TDCBF_CLOSE_BUTTON: TASKDIALOG_COMMON_BUTTON_FLAGS = TASKDIALOG_COMMON_BUTTON_FLAGS(32i32); impl ::core::convert::From<i32> for TASKDIALOG_COMMON_BUTTON_FLAGS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TASKDIALOG_COMMON_BUTTON_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 TASKDIALOG_ELEMENTS(pub i32); pub const TDE_CONTENT: TASKDIALOG_ELEMENTS = TASKDIALOG_ELEMENTS(0i32); pub const TDE_EXPANDED_INFORMATION: TASKDIALOG_ELEMENTS = TASKDIALOG_ELEMENTS(1i32); pub const TDE_FOOTER: TASKDIALOG_ELEMENTS = TASKDIALOG_ELEMENTS(2i32); pub const TDE_MAIN_INSTRUCTION: TASKDIALOG_ELEMENTS = TASKDIALOG_ELEMENTS(3i32); impl ::core::convert::From<i32> for TASKDIALOG_ELEMENTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TASKDIALOG_ELEMENTS { 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 TASKDIALOG_FLAGS(pub i32); pub const TDF_ENABLE_HYPERLINKS: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(1i32); pub const TDF_USE_HICON_MAIN: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(2i32); pub const TDF_USE_HICON_FOOTER: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(4i32); pub const TDF_ALLOW_DIALOG_CANCELLATION: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(8i32); pub const TDF_USE_COMMAND_LINKS: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(16i32); pub const TDF_USE_COMMAND_LINKS_NO_ICON: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(32i32); pub const TDF_EXPAND_FOOTER_AREA: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(64i32); pub const TDF_EXPANDED_BY_DEFAULT: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(128i32); pub const TDF_VERIFICATION_FLAG_CHECKED: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(256i32); pub const TDF_SHOW_PROGRESS_BAR: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(512i32); pub const TDF_SHOW_MARQUEE_PROGRESS_BAR: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(1024i32); pub const TDF_CALLBACK_TIMER: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(2048i32); pub const TDF_POSITION_RELATIVE_TO_WINDOW: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(4096i32); pub const TDF_RTL_LAYOUT: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(8192i32); pub const TDF_NO_DEFAULT_RADIO_BUTTON: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(16384i32); pub const TDF_CAN_BE_MINIMIZED: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(32768i32); pub const TDF_NO_SET_FOREGROUND: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(65536i32); pub const TDF_SIZE_TO_CONTENT: TASKDIALOG_FLAGS = TASKDIALOG_FLAGS(16777216i32); impl ::core::convert::From<i32> for TASKDIALOG_FLAGS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TASKDIALOG_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 TASKDIALOG_ICON_ELEMENTS(pub i32); pub const TDIE_ICON_MAIN: TASKDIALOG_ICON_ELEMENTS = TASKDIALOG_ICON_ELEMENTS(0i32); pub const TDIE_ICON_FOOTER: TASKDIALOG_ICON_ELEMENTS = TASKDIALOG_ICON_ELEMENTS(1i32); impl ::core::convert::From<i32> for TASKDIALOG_ICON_ELEMENTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TASKDIALOG_ICON_ELEMENTS { 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 TASKDIALOG_MESSAGES(pub i32); pub const TDM_NAVIGATE_PAGE: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1125i32); pub const TDM_CLICK_BUTTON: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1126i32); pub const TDM_SET_MARQUEE_PROGRESS_BAR: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1127i32); pub const TDM_SET_PROGRESS_BAR_STATE: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1128i32); pub const TDM_SET_PROGRESS_BAR_RANGE: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1129i32); pub const TDM_SET_PROGRESS_BAR_POS: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1130i32); pub const TDM_SET_PROGRESS_BAR_MARQUEE: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1131i32); pub const TDM_SET_ELEMENT_TEXT: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1132i32); pub const TDM_CLICK_RADIO_BUTTON: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1134i32); pub const TDM_ENABLE_BUTTON: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1135i32); pub const TDM_ENABLE_RADIO_BUTTON: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1136i32); pub const TDM_CLICK_VERIFICATION: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1137i32); pub const TDM_UPDATE_ELEMENT_TEXT: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1138i32); pub const TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1139i32); pub const TDM_UPDATE_ICON: TASKDIALOG_MESSAGES = TASKDIALOG_MESSAGES(1140i32); impl ::core::convert::From<i32> for TASKDIALOG_MESSAGES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TASKDIALOG_MESSAGES { 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 TASKDIALOG_NOTIFICATIONS(pub i32); pub const TDN_CREATED: TASKDIALOG_NOTIFICATIONS = TASKDIALOG_NOTIFICATIONS(0i32); pub const TDN_NAVIGATED: TASKDIALOG_NOTIFICATIONS = TASKDIALOG_NOTIFICATIONS(1i32); pub const TDN_BUTTON_CLICKED: TASKDIALOG_NOTIFICATIONS = TASKDIALOG_NOTIFICATIONS(2i32); pub const TDN_HYPERLINK_CLICKED: TASKDIALOG_NOTIFICATIONS = TASKDIALOG_NOTIFICATIONS(3i32); pub const TDN_TIMER: TASKDIALOG_NOTIFICATIONS = TASKDIALOG_NOTIFICATIONS(4i32); pub const TDN_DESTROYED: TASKDIALOG_NOTIFICATIONS = TASKDIALOG_NOTIFICATIONS(5i32); pub const TDN_RADIO_BUTTON_CLICKED: TASKDIALOG_NOTIFICATIONS = TASKDIALOG_NOTIFICATIONS(6i32); pub const TDN_DIALOG_CONSTRUCTED: TASKDIALOG_NOTIFICATIONS = TASKDIALOG_NOTIFICATIONS(7i32); pub const TDN_VERIFICATION_CLICKED: TASKDIALOG_NOTIFICATIONS = TASKDIALOG_NOTIFICATIONS(8i32); pub const TDN_HELP: TASKDIALOG_NOTIFICATIONS = TASKDIALOG_NOTIFICATIONS(9i32); pub const TDN_EXPANDO_BUTTON_CLICKED: TASKDIALOG_NOTIFICATIONS = TASKDIALOG_NOTIFICATIONS(10i32); impl ::core::convert::From<i32> for TASKDIALOG_NOTIFICATIONS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TASKDIALOG_NOTIFICATIONS { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct TA_CUBIC_BEZIER { pub header: TA_TIMINGFUNCTION, pub rX0: f32, pub rY0: f32, pub rX1: f32, pub rY1: f32, } impl TA_CUBIC_BEZIER {} impl ::core::default::Default for TA_CUBIC_BEZIER { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for TA_CUBIC_BEZIER { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TA_CUBIC_BEZIER").field("header", &self.header).field("rX0", &self.rX0).field("rY0", &self.rY0).field("rX1", &self.rX1).field("rY1", &self.rY1).finish() } } impl ::core::cmp::PartialEq for TA_CUBIC_BEZIER { fn eq(&self, other: &Self) -> bool { self.header == other.header && self.rX0 == other.rX0 && self.rY0 == other.rY0 && self.rX1 == other.rX1 && self.rY1 == other.rY1 } } impl ::core::cmp::Eq for TA_CUBIC_BEZIER {} unsafe impl ::windows::core::Abi for TA_CUBIC_BEZIER { 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 TA_PROPERTY(pub i32); pub const TAP_FLAGS: TA_PROPERTY = TA_PROPERTY(0i32); pub const TAP_TRANSFORMCOUNT: TA_PROPERTY = TA_PROPERTY(1i32); pub const TAP_STAGGERDELAY: TA_PROPERTY = TA_PROPERTY(2i32); pub const TAP_STAGGERDELAYCAP: TA_PROPERTY = TA_PROPERTY(3i32); pub const TAP_STAGGERDELAYFACTOR: TA_PROPERTY = TA_PROPERTY(4i32); pub const TAP_ZORDER: TA_PROPERTY = TA_PROPERTY(5i32); impl ::core::convert::From<i32> for TA_PROPERTY { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TA_PROPERTY { type Abi = Self; } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct TA_PROPERTY_FLAG(pub u32); pub const TAPF_NONE: TA_PROPERTY_FLAG = TA_PROPERTY_FLAG(0u32); pub const TAPF_HASSTAGGER: TA_PROPERTY_FLAG = TA_PROPERTY_FLAG(1u32); pub const TAPF_ISRTLAWARE: TA_PROPERTY_FLAG = TA_PROPERTY_FLAG(2u32); pub const TAPF_ALLOWCOLLECTION: TA_PROPERTY_FLAG = TA_PROPERTY_FLAG(4u32); pub const TAPF_HASBACKGROUND: TA_PROPERTY_FLAG = TA_PROPERTY_FLAG(8u32); pub const TAPF_HASPERSPECTIVE: TA_PROPERTY_FLAG = TA_PROPERTY_FLAG(16u32); impl ::core::convert::From<u32> for TA_PROPERTY_FLAG { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TA_PROPERTY_FLAG { type Abi = Self; } impl ::core::ops::BitOr for TA_PROPERTY_FLAG { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for TA_PROPERTY_FLAG { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for TA_PROPERTY_FLAG { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for TA_PROPERTY_FLAG { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for TA_PROPERTY_FLAG { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct TA_TIMINGFUNCTION { pub eTimingFunctionType: TA_TIMINGFUNCTION_TYPE, } impl TA_TIMINGFUNCTION {} impl ::core::default::Default for TA_TIMINGFUNCTION { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for TA_TIMINGFUNCTION { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TA_TIMINGFUNCTION").field("eTimingFunctionType", &self.eTimingFunctionType).finish() } } impl ::core::cmp::PartialEq for TA_TIMINGFUNCTION { fn eq(&self, other: &Self) -> bool { self.eTimingFunctionType == other.eTimingFunctionType } } impl ::core::cmp::Eq for TA_TIMINGFUNCTION {} unsafe impl ::windows::core::Abi for TA_TIMINGFUNCTION { 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 TA_TIMINGFUNCTION_TYPE(pub i32); pub const TTFT_UNDEFINED: TA_TIMINGFUNCTION_TYPE = TA_TIMINGFUNCTION_TYPE(0i32); pub const TTFT_CUBIC_BEZIER: TA_TIMINGFUNCTION_TYPE = TA_TIMINGFUNCTION_TYPE(1i32); impl ::core::convert::From<i32> for TA_TIMINGFUNCTION_TYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TA_TIMINGFUNCTION_TYPE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct TA_TRANSFORM { pub eTransformType: TA_TRANSFORM_TYPE, pub dwTimingFunctionId: u32, pub dwStartTime: u32, pub dwDurationTime: u32, pub eFlags: TA_TRANSFORM_FLAG, } impl TA_TRANSFORM {} impl ::core::default::Default for TA_TRANSFORM { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for TA_TRANSFORM { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TA_TRANSFORM").field("eTransformType", &self.eTransformType).field("dwTimingFunctionId", &self.dwTimingFunctionId).field("dwStartTime", &self.dwStartTime).field("dwDurationTime", &self.dwDurationTime).field("eFlags", &self.eFlags).finish() } } impl ::core::cmp::PartialEq for TA_TRANSFORM { fn eq(&self, other: &Self) -> bool { self.eTransformType == other.eTransformType && self.dwTimingFunctionId == other.dwTimingFunctionId && self.dwStartTime == other.dwStartTime && self.dwDurationTime == other.dwDurationTime && self.eFlags == other.eFlags } } impl ::core::cmp::Eq for TA_TRANSFORM {} unsafe impl ::windows::core::Abi for TA_TRANSFORM { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct TA_TRANSFORM_2D { pub header: TA_TRANSFORM, pub rX: f32, pub rY: f32, pub rInitialX: f32, pub rInitialY: f32, pub rOriginX: f32, pub rOriginY: f32, } impl TA_TRANSFORM_2D {} impl ::core::default::Default for TA_TRANSFORM_2D { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for TA_TRANSFORM_2D { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TA_TRANSFORM_2D").field("header", &self.header).field("rX", &self.rX).field("rY", &self.rY).field("rInitialX", &self.rInitialX).field("rInitialY", &self.rInitialY).field("rOriginX", &self.rOriginX).field("rOriginY", &self.rOriginY).finish() } } impl ::core::cmp::PartialEq for TA_TRANSFORM_2D { fn eq(&self, other: &Self) -> bool { self.header == other.header && self.rX == other.rX && self.rY == other.rY && self.rInitialX == other.rInitialX && self.rInitialY == other.rInitialY && self.rOriginX == other.rOriginX && self.rOriginY == other.rOriginY } } impl ::core::cmp::Eq for TA_TRANSFORM_2D {} unsafe impl ::windows::core::Abi for TA_TRANSFORM_2D { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct TA_TRANSFORM_CLIP { pub header: TA_TRANSFORM, pub rLeft: f32, pub rTop: f32, pub rRight: f32, pub rBottom: f32, pub rInitialLeft: f32, pub rInitialTop: f32, pub rInitialRight: f32, pub rInitialBottom: f32, } impl TA_TRANSFORM_CLIP {} impl ::core::default::Default for TA_TRANSFORM_CLIP { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for TA_TRANSFORM_CLIP { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TA_TRANSFORM_CLIP") .field("header", &self.header) .field("rLeft", &self.rLeft) .field("rTop", &self.rTop) .field("rRight", &self.rRight) .field("rBottom", &self.rBottom) .field("rInitialLeft", &self.rInitialLeft) .field("rInitialTop", &self.rInitialTop) .field("rInitialRight", &self.rInitialRight) .field("rInitialBottom", &self.rInitialBottom) .finish() } } impl ::core::cmp::PartialEq for TA_TRANSFORM_CLIP { fn eq(&self, other: &Self) -> bool { self.header == other.header && self.rLeft == other.rLeft && self.rTop == other.rTop && self.rRight == other.rRight && self.rBottom == other.rBottom && self.rInitialLeft == other.rInitialLeft && self.rInitialTop == other.rInitialTop && self.rInitialRight == other.rInitialRight && self.rInitialBottom == other.rInitialBottom } } impl ::core::cmp::Eq for TA_TRANSFORM_CLIP {} unsafe impl ::windows::core::Abi for TA_TRANSFORM_CLIP { 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 TA_TRANSFORM_FLAG(pub i32); pub const TATF_NONE: TA_TRANSFORM_FLAG = TA_TRANSFORM_FLAG(0i32); pub const TATF_TARGETVALUES_USER: TA_TRANSFORM_FLAG = TA_TRANSFORM_FLAG(1i32); pub const TATF_HASINITIALVALUES: TA_TRANSFORM_FLAG = TA_TRANSFORM_FLAG(2i32); pub const TATF_HASORIGINVALUES: TA_TRANSFORM_FLAG = TA_TRANSFORM_FLAG(4i32); impl ::core::convert::From<i32> for TA_TRANSFORM_FLAG { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TA_TRANSFORM_FLAG { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct TA_TRANSFORM_OPACITY { pub header: TA_TRANSFORM, pub rOpacity: f32, pub rInitialOpacity: f32, } impl TA_TRANSFORM_OPACITY {} impl ::core::default::Default for TA_TRANSFORM_OPACITY { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for TA_TRANSFORM_OPACITY { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TA_TRANSFORM_OPACITY").field("header", &self.header).field("rOpacity", &self.rOpacity).field("rInitialOpacity", &self.rInitialOpacity).finish() } } impl ::core::cmp::PartialEq for TA_TRANSFORM_OPACITY { fn eq(&self, other: &Self) -> bool { self.header == other.header && self.rOpacity == other.rOpacity && self.rInitialOpacity == other.rInitialOpacity } } impl ::core::cmp::Eq for TA_TRANSFORM_OPACITY {} unsafe impl ::windows::core::Abi for TA_TRANSFORM_OPACITY { 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 TA_TRANSFORM_TYPE(pub i32); pub const TATT_TRANSLATE_2D: TA_TRANSFORM_TYPE = TA_TRANSFORM_TYPE(0i32); pub const TATT_SCALE_2D: TA_TRANSFORM_TYPE = TA_TRANSFORM_TYPE(1i32); pub const TATT_OPACITY: TA_TRANSFORM_TYPE = TA_TRANSFORM_TYPE(2i32); pub const TATT_CLIP: TA_TRANSFORM_TYPE = TA_TRANSFORM_TYPE(3i32); impl ::core::convert::From<i32> for TA_TRANSFORM_TYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TA_TRANSFORM_TYPE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TBADDBITMAP { pub hInst: super::super::Foundation::HINSTANCE, pub nID: usize, } #[cfg(feature = "Win32_Foundation")] impl TBADDBITMAP {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TBADDBITMAP { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TBADDBITMAP { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TBADDBITMAP").field("hInst", &self.hInst).field("nID", &self.nID).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TBADDBITMAP { fn eq(&self, other: &Self) -> bool { self.hInst == other.hInst && self.nID == other.nID } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TBADDBITMAP {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TBADDBITMAP { type Abi = Self; } pub const TBBF_LARGE: u32 = 1u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(any(target_arch = "x86_64", target_arch = "aarch64",))] pub struct TBBUTTON { pub iBitmap: i32, pub idCommand: i32, pub fsState: u8, pub fsStyle: u8, pub bReserved: [u8; 6], pub dwData: usize, pub iString: isize, } #[cfg(any(target_arch = "x86_64", target_arch = "aarch64",))] impl TBBUTTON {} #[cfg(any(target_arch = "x86_64", target_arch = "aarch64",))] impl ::core::default::Default for TBBUTTON { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(any(target_arch = "x86_64", target_arch = "aarch64",))] impl ::core::fmt::Debug for TBBUTTON { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TBBUTTON").field("iBitmap", &self.iBitmap).field("idCommand", &self.idCommand).field("fsState", &self.fsState).field("fsStyle", &self.fsStyle).field("bReserved", &self.bReserved).field("dwData", &self.dwData).field("iString", &self.iString).finish() } } #[cfg(any(target_arch = "x86_64", target_arch = "aarch64",))] impl ::core::cmp::PartialEq for TBBUTTON { fn eq(&self, other: &Self) -> bool { self.iBitmap == other.iBitmap && self.idCommand == other.idCommand && self.fsState == other.fsState && self.fsStyle == other.fsStyle && self.bReserved == other.bReserved && self.dwData == other.dwData && self.iString == other.iString } } #[cfg(any(target_arch = "x86_64", target_arch = "aarch64",))] impl ::core::cmp::Eq for TBBUTTON {} #[cfg(any(target_arch = "x86_64", target_arch = "aarch64",))] unsafe impl ::windows::core::Abi for TBBUTTON { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(any(target_arch = "x86",))] pub struct TBBUTTON { pub iBitmap: i32, pub idCommand: i32, pub fsState: u8, pub fsStyle: u8, pub bReserved: [u8; 2], pub dwData: usize, pub iString: isize, } #[cfg(any(target_arch = "x86",))] impl TBBUTTON {} #[cfg(any(target_arch = "x86",))] impl ::core::default::Default for TBBUTTON { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(any(target_arch = "x86",))] impl ::core::fmt::Debug for TBBUTTON { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TBBUTTON").field("iBitmap", &self.iBitmap).field("idCommand", &self.idCommand).field("fsState", &self.fsState).field("fsStyle", &self.fsStyle).field("bReserved", &self.bReserved).field("dwData", &self.dwData).field("iString", &self.iString).finish() } } #[cfg(any(target_arch = "x86",))] impl ::core::cmp::PartialEq for TBBUTTON { fn eq(&self, other: &Self) -> bool { self.iBitmap == other.iBitmap && self.idCommand == other.idCommand && self.fsState == other.fsState && self.fsStyle == other.fsStyle && self.bReserved == other.bReserved && self.dwData == other.dwData && self.iString == other.iString } } #[cfg(any(target_arch = "x86",))] impl ::core::cmp::Eq for TBBUTTON {} #[cfg(any(target_arch = "x86",))] unsafe impl ::windows::core::Abi for TBBUTTON { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TBBUTTONINFOA { pub cbSize: u32, pub dwMask: TBBUTTONINFOW_MASK, pub idCommand: i32, pub iImage: i32, pub fsState: u8, pub fsStyle: u8, pub cx: u16, pub lParam: usize, pub pszText: super::super::Foundation::PSTR, pub cchText: i32, } #[cfg(feature = "Win32_Foundation")] impl TBBUTTONINFOA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TBBUTTONINFOA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TBBUTTONINFOA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TBBUTTONINFOA") .field("cbSize", &self.cbSize) .field("dwMask", &self.dwMask) .field("idCommand", &self.idCommand) .field("iImage", &self.iImage) .field("fsState", &self.fsState) .field("fsStyle", &self.fsStyle) .field("cx", &self.cx) .field("lParam", &self.lParam) .field("pszText", &self.pszText) .field("cchText", &self.cchText) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TBBUTTONINFOA { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.dwMask == other.dwMask && self.idCommand == other.idCommand && self.iImage == other.iImage && self.fsState == other.fsState && self.fsStyle == other.fsStyle && self.cx == other.cx && self.lParam == other.lParam && self.pszText == other.pszText && self.cchText == other.cchText } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TBBUTTONINFOA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TBBUTTONINFOA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TBBUTTONINFOW { pub cbSize: u32, pub dwMask: TBBUTTONINFOW_MASK, pub idCommand: i32, pub iImage: i32, pub fsState: u8, pub fsStyle: u8, pub cx: u16, pub lParam: usize, pub pszText: super::super::Foundation::PWSTR, pub cchText: i32, } #[cfg(feature = "Win32_Foundation")] impl TBBUTTONINFOW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TBBUTTONINFOW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TBBUTTONINFOW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TBBUTTONINFOW") .field("cbSize", &self.cbSize) .field("dwMask", &self.dwMask) .field("idCommand", &self.idCommand) .field("iImage", &self.iImage) .field("fsState", &self.fsState) .field("fsStyle", &self.fsStyle) .field("cx", &self.cx) .field("lParam", &self.lParam) .field("pszText", &self.pszText) .field("cchText", &self.cchText) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TBBUTTONINFOW { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.dwMask == other.dwMask && self.idCommand == other.idCommand && self.iImage == other.iImage && self.fsState == other.fsState && self.fsStyle == other.fsStyle && self.cx == other.cx && self.lParam == other.lParam && self.pszText == other.pszText && self.cchText == other.cchText } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TBBUTTONINFOW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TBBUTTONINFOW { 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 TBBUTTONINFOW_MASK(pub u32); pub const TBIF_BYINDEX: TBBUTTONINFOW_MASK = TBBUTTONINFOW_MASK(2147483648u32); pub const TBIF_COMMAND: TBBUTTONINFOW_MASK = TBBUTTONINFOW_MASK(32u32); pub const TBIF_IMAGE: TBBUTTONINFOW_MASK = TBBUTTONINFOW_MASK(1u32); pub const TBIF_LPARAM: TBBUTTONINFOW_MASK = TBBUTTONINFOW_MASK(16u32); pub const TBIF_SIZE: TBBUTTONINFOW_MASK = TBBUTTONINFOW_MASK(64u32); pub const TBIF_STATE: TBBUTTONINFOW_MASK = TBBUTTONINFOW_MASK(4u32); pub const TBIF_STYLE: TBBUTTONINFOW_MASK = TBBUTTONINFOW_MASK(8u32); pub const TBIF_TEXT: TBBUTTONINFOW_MASK = TBBUTTONINFOW_MASK(2u32); impl ::core::convert::From<u32> for TBBUTTONINFOW_MASK { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TBBUTTONINFOW_MASK { type Abi = Self; } impl ::core::ops::BitOr for TBBUTTONINFOW_MASK { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for TBBUTTONINFOW_MASK { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for TBBUTTONINFOW_MASK { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for TBBUTTONINFOW_MASK { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for TBBUTTONINFOW_MASK { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const TBCDRF_BLENDICON: u32 = 2097152u32; pub const TBCDRF_HILITEHOTTRACK: u32 = 131072u32; pub const TBCDRF_NOBACKGROUND: u32 = 4194304u32; pub const TBCDRF_NOEDGES: u32 = 65536u32; pub const TBCDRF_NOETCHEDEFFECT: u32 = 1048576u32; pub const TBCDRF_NOMARK: u32 = 524288u32; pub const TBCDRF_NOOFFSET: u32 = 262144u32; pub const TBCDRF_USECDCOLORS: u32 = 8388608u32; pub const TBCD_CHANNEL: u32 = 3u32; pub const TBCD_THUMB: u32 = 2u32; pub const TBCD_TICS: u32 = 1u32; pub const TBDDRET_DEFAULT: u32 = 0u32; pub const TBDDRET_NODEFAULT: u32 = 1u32; pub const TBDDRET_TREATPRESSED: u32 = 2u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct TBINSERTMARK { pub iButton: i32, pub dwFlags: TBINSERTMARK_FLAGS, } impl TBINSERTMARK {} impl ::core::default::Default for TBINSERTMARK { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for TBINSERTMARK { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TBINSERTMARK").field("iButton", &self.iButton).field("dwFlags", &self.dwFlags).finish() } } impl ::core::cmp::PartialEq for TBINSERTMARK { fn eq(&self, other: &Self) -> bool { self.iButton == other.iButton && self.dwFlags == other.dwFlags } } impl ::core::cmp::Eq for TBINSERTMARK {} unsafe impl ::windows::core::Abi for TBINSERTMARK { 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 TBINSERTMARK_FLAGS(pub u32); pub const TBIMHT_NONE: TBINSERTMARK_FLAGS = TBINSERTMARK_FLAGS(0u32); pub const TBIMHT_AFTER: TBINSERTMARK_FLAGS = TBINSERTMARK_FLAGS(1u32); pub const TBIMHT_BACKGROUND: TBINSERTMARK_FLAGS = TBINSERTMARK_FLAGS(2u32); impl ::core::convert::From<u32> for TBINSERTMARK_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TBINSERTMARK_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for TBINSERTMARK_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for TBINSERTMARK_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for TBINSERTMARK_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for TBINSERTMARK_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for TBINSERTMARK_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct TBMETRICS { pub cbSize: u32, pub dwMask: u32, pub cxPad: i32, pub cyPad: i32, pub cxBarPad: i32, pub cyBarPad: i32, pub cxButtonSpacing: i32, pub cyButtonSpacing: i32, } impl TBMETRICS {} impl ::core::default::Default for TBMETRICS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for TBMETRICS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TBMETRICS") .field("cbSize", &self.cbSize) .field("dwMask", &self.dwMask) .field("cxPad", &self.cxPad) .field("cyPad", &self.cyPad) .field("cxBarPad", &self.cxBarPad) .field("cyBarPad", &self.cyBarPad) .field("cxButtonSpacing", &self.cxButtonSpacing) .field("cyButtonSpacing", &self.cyButtonSpacing) .finish() } } impl ::core::cmp::PartialEq for TBMETRICS { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.dwMask == other.dwMask && self.cxPad == other.cxPad && self.cyPad == other.cyPad && self.cxBarPad == other.cxBarPad && self.cyBarPad == other.cyBarPad && self.cxButtonSpacing == other.cxButtonSpacing && self.cyButtonSpacing == other.cyButtonSpacing } } impl ::core::cmp::Eq for TBMETRICS {} unsafe impl ::windows::core::Abi for TBMETRICS { type Abi = Self; } pub const TBMF_BARPAD: u32 = 2u32; pub const TBMF_BUTTONSPACING: u32 = 4u32; pub const TBMF_PAD: u32 = 1u32; pub const TBM_CLEARSEL: u32 = 1043u32; pub const TBM_CLEARTICS: u32 = 1033u32; pub const TBM_GETBUDDY: u32 = 1057u32; pub const TBM_GETCHANNELRECT: u32 = 1050u32; pub const TBM_GETLINESIZE: u32 = 1048u32; pub const TBM_GETNUMTICS: u32 = 1040u32; pub const TBM_GETPAGESIZE: u32 = 1046u32; pub const TBM_GETPTICS: u32 = 1038u32; pub const TBM_GETRANGEMAX: u32 = 1026u32; pub const TBM_GETRANGEMIN: u32 = 1025u32; pub const TBM_GETSELEND: u32 = 1042u32; pub const TBM_GETSELSTART: u32 = 1041u32; pub const TBM_GETTHUMBLENGTH: u32 = 1052u32; pub const TBM_GETTHUMBRECT: u32 = 1049u32; pub const TBM_GETTIC: u32 = 1027u32; pub const TBM_GETTICPOS: u32 = 1039u32; pub const TBM_GETTOOLTIPS: u32 = 1054u32; pub const TBM_GETUNICODEFORMAT: u32 = 8198u32; pub const TBM_SETBUDDY: u32 = 1056u32; pub const TBM_SETLINESIZE: u32 = 1047u32; pub const TBM_SETPAGESIZE: u32 = 1045u32; pub const TBM_SETPOS: u32 = 1029u32; pub const TBM_SETPOSNOTIFY: u32 = 1058u32; pub const TBM_SETRANGE: u32 = 1030u32; pub const TBM_SETRANGEMAX: u32 = 1032u32; pub const TBM_SETRANGEMIN: u32 = 1031u32; pub const TBM_SETSEL: u32 = 1034u32; pub const TBM_SETSELEND: u32 = 1036u32; pub const TBM_SETSELSTART: u32 = 1035u32; pub const TBM_SETTHUMBLENGTH: u32 = 1051u32; pub const TBM_SETTIC: u32 = 1028u32; pub const TBM_SETTICFREQ: u32 = 1044u32; pub const TBM_SETTIPSIDE: u32 = 1055u32; pub const TBM_SETTOOLTIPS: u32 = 1053u32; pub const TBM_SETUNICODEFORMAT: u32 = 8197u32; pub const TBNRF_ENDCUSTOMIZE: u32 = 2u32; pub const TBNRF_HIDEHELP: u32 = 1u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TBREPLACEBITMAP { pub hInstOld: super::super::Foundation::HINSTANCE, pub nIDOld: usize, pub hInstNew: super::super::Foundation::HINSTANCE, pub nIDNew: usize, pub nButtons: i32, } #[cfg(feature = "Win32_Foundation")] impl TBREPLACEBITMAP {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TBREPLACEBITMAP { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TBREPLACEBITMAP { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TBREPLACEBITMAP").field("hInstOld", &self.hInstOld).field("nIDOld", &self.nIDOld).field("hInstNew", &self.hInstNew).field("nIDNew", &self.nIDNew).field("nButtons", &self.nButtons).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TBREPLACEBITMAP { fn eq(&self, other: &Self) -> bool { self.hInstOld == other.hInstOld && self.nIDOld == other.nIDOld && self.hInstNew == other.hInstNew && self.nIDNew == other.nIDNew && self.nButtons == other.nButtons } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TBREPLACEBITMAP {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TBREPLACEBITMAP { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] pub struct TBSAVEPARAMSA { pub hkr: super::super::System::Registry::HKEY, pub pszSubKey: super::super::Foundation::PSTR, pub pszValueName: super::super::Foundation::PSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] impl TBSAVEPARAMSA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] impl ::core::default::Default for TBSAVEPARAMSA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] impl ::core::fmt::Debug for TBSAVEPARAMSA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TBSAVEPARAMSA").field("hkr", &self.hkr).field("pszSubKey", &self.pszSubKey).field("pszValueName", &self.pszValueName).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] impl ::core::cmp::PartialEq for TBSAVEPARAMSA { fn eq(&self, other: &Self) -> bool { self.hkr == other.hkr && self.pszSubKey == other.pszSubKey && self.pszValueName == other.pszValueName } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] impl ::core::cmp::Eq for TBSAVEPARAMSA {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] unsafe impl ::windows::core::Abi for TBSAVEPARAMSA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] pub struct TBSAVEPARAMSW { pub hkr: super::super::System::Registry::HKEY, pub pszSubKey: super::super::Foundation::PWSTR, pub pszValueName: super::super::Foundation::PWSTR, } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] impl TBSAVEPARAMSW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] impl ::core::default::Default for TBSAVEPARAMSW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] impl ::core::fmt::Debug for TBSAVEPARAMSW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TBSAVEPARAMSW").field("hkr", &self.hkr).field("pszSubKey", &self.pszSubKey).field("pszValueName", &self.pszValueName).finish() } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] impl ::core::cmp::PartialEq for TBSAVEPARAMSW { fn eq(&self, other: &Self) -> bool { self.hkr == other.hkr && self.pszSubKey == other.pszSubKey && self.pszValueName == other.pszValueName } } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] impl ::core::cmp::Eq for TBSAVEPARAMSW {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Registry"))] unsafe impl ::windows::core::Abi for TBSAVEPARAMSW { type Abi = Self; } pub const TBSTATE_CHECKED: u32 = 1u32; pub const TBSTATE_ELLIPSES: u32 = 64u32; pub const TBSTATE_ENABLED: u32 = 4u32; pub const TBSTATE_HIDDEN: u32 = 8u32; pub const TBSTATE_INDETERMINATE: u32 = 16u32; pub const TBSTATE_MARKED: u32 = 128u32; pub const TBSTATE_PRESSED: u32 = 2u32; pub const TBSTATE_WRAP: u32 = 32u32; pub const TBSTYLE_ALTDRAG: u32 = 1024u32; pub const TBSTYLE_AUTOSIZE: u32 = 16u32; pub const TBSTYLE_BUTTON: u32 = 0u32; pub const TBSTYLE_CHECK: u32 = 2u32; pub const TBSTYLE_CUSTOMERASE: u32 = 8192u32; pub const TBSTYLE_DROPDOWN: u32 = 8u32; pub const TBSTYLE_EX_DOUBLEBUFFER: u32 = 128u32; pub const TBSTYLE_EX_DRAWDDARROWS: u32 = 1u32; pub const TBSTYLE_EX_HIDECLIPPEDBUTTONS: u32 = 16u32; pub const TBSTYLE_EX_MIXEDBUTTONS: u32 = 8u32; pub const TBSTYLE_EX_MULTICOLUMN: u32 = 2u32; pub const TBSTYLE_EX_VERTICAL: u32 = 4u32; pub const TBSTYLE_FLAT: u32 = 2048u32; pub const TBSTYLE_GROUP: u32 = 4u32; pub const TBSTYLE_LIST: u32 = 4096u32; pub const TBSTYLE_NOPREFIX: u32 = 32u32; pub const TBSTYLE_REGISTERDROP: u32 = 16384u32; pub const TBSTYLE_SEP: u32 = 1u32; pub const TBSTYLE_TOOLTIPS: u32 = 256u32; pub const TBSTYLE_TRANSPARENT: u32 = 32768u32; pub const TBSTYLE_WRAPABLE: u32 = 512u32; pub const TBS_AUTOTICKS: u32 = 1u32; pub const TBS_BOTH: u32 = 8u32; pub const TBS_BOTTOM: u32 = 0u32; pub const TBS_DOWNISLEFT: u32 = 1024u32; pub const TBS_ENABLESELRANGE: u32 = 32u32; pub const TBS_FIXEDLENGTH: u32 = 64u32; pub const TBS_HORZ: u32 = 0u32; pub const TBS_LEFT: u32 = 4u32; pub const TBS_NOTHUMB: u32 = 128u32; pub const TBS_NOTICKS: u32 = 16u32; pub const TBS_NOTIFYBEFOREMOVE: u32 = 2048u32; pub const TBS_REVERSED: u32 = 512u32; pub const TBS_RIGHT: u32 = 0u32; pub const TBS_TOOLTIPS: u32 = 256u32; pub const TBS_TOP: u32 = 4u32; pub const TBS_TRANSPARENTBKGND: u32 = 4096u32; pub const TBS_VERT: u32 = 2u32; pub const TBTS_BOTTOM: u32 = 2u32; pub const TBTS_LEFT: u32 = 1u32; pub const TBTS_RIGHT: u32 = 3u32; pub const TBTS_TOP: u32 = 0u32; pub const TB_ADDBITMAP: u32 = 1043u32; pub const TB_ADDBUTTONS: u32 = 1092u32; pub const TB_ADDBUTTONSA: u32 = 1044u32; pub const TB_ADDBUTTONSW: u32 = 1092u32; pub const TB_ADDSTRING: u32 = 1101u32; pub const TB_ADDSTRINGA: u32 = 1052u32; pub const TB_ADDSTRINGW: u32 = 1101u32; pub const TB_AUTOSIZE: u32 = 1057u32; pub const TB_BOTTOM: u32 = 7u32; pub const TB_BUTTONCOUNT: u32 = 1048u32; pub const TB_BUTTONSTRUCTSIZE: u32 = 1054u32; pub const TB_CHANGEBITMAP: u32 = 1067u32; pub const TB_CHECKBUTTON: u32 = 1026u32; pub const TB_COMMANDTOINDEX: u32 = 1049u32; pub const TB_CUSTOMIZE: u32 = 1051u32; pub const TB_DELETEBUTTON: u32 = 1046u32; pub const TB_ENABLEBUTTON: u32 = 1025u32; pub const TB_ENDTRACK: u32 = 8u32; pub const TB_GETANCHORHIGHLIGHT: u32 = 1098u32; pub const TB_GETBITMAP: u32 = 1068u32; pub const TB_GETBITMAPFLAGS: u32 = 1065u32; pub const TB_GETBUTTON: u32 = 1047u32; pub const TB_GETBUTTONINFO: u32 = 1087u32; pub const TB_GETBUTTONINFOA: u32 = 1089u32; pub const TB_GETBUTTONINFOW: u32 = 1087u32; pub const TB_GETBUTTONSIZE: u32 = 1082u32; pub const TB_GETBUTTONTEXT: u32 = 1099u32; pub const TB_GETBUTTONTEXTA: u32 = 1069u32; pub const TB_GETBUTTONTEXTW: u32 = 1099u32; pub const TB_GETCOLORSCHEME: u32 = 8195u32; pub const TB_GETDISABLEDIMAGELIST: u32 = 1079u32; pub const TB_GETEXTENDEDSTYLE: u32 = 1109u32; pub const TB_GETHOTIMAGELIST: u32 = 1077u32; pub const TB_GETHOTITEM: u32 = 1095u32; pub const TB_GETIDEALSIZE: u32 = 1123u32; pub const TB_GETIMAGELIST: u32 = 1073u32; pub const TB_GETIMAGELISTCOUNT: u32 = 1122u32; pub const TB_GETINSERTMARK: u32 = 1103u32; pub const TB_GETINSERTMARKCOLOR: u32 = 1113u32; pub const TB_GETITEMDROPDOWNRECT: u32 = 1127u32; pub const TB_GETITEMRECT: u32 = 1053u32; pub const TB_GETMAXSIZE: u32 = 1107u32; pub const TB_GETMETRICS: u32 = 1125u32; pub const TB_GETOBJECT: u32 = 1086u32; pub const TB_GETPADDING: u32 = 1110u32; pub const TB_GETPRESSEDIMAGELIST: u32 = 1129u32; pub const TB_GETRECT: u32 = 1075u32; pub const TB_GETROWS: u32 = 1064u32; pub const TB_GETSTATE: u32 = 1042u32; pub const TB_GETSTRING: u32 = 1115u32; pub const TB_GETSTRINGA: u32 = 1116u32; pub const TB_GETSTRINGW: u32 = 1115u32; pub const TB_GETSTYLE: u32 = 1081u32; pub const TB_GETTEXTROWS: u32 = 1085u32; pub const TB_GETTOOLTIPS: u32 = 1059u32; pub const TB_GETUNICODEFORMAT: u32 = 8198u32; pub const TB_HASACCELERATOR: u32 = 1119u32; pub const TB_HIDEBUTTON: u32 = 1028u32; pub const TB_HITTEST: u32 = 1093u32; pub const TB_INDETERMINATE: u32 = 1029u32; pub const TB_INSERTBUTTON: u32 = 1091u32; pub const TB_INSERTBUTTONA: u32 = 1045u32; pub const TB_INSERTBUTTONW: u32 = 1091u32; pub const TB_INSERTMARKHITTEST: u32 = 1105u32; pub const TB_ISBUTTONCHECKED: u32 = 1034u32; pub const TB_ISBUTTONENABLED: u32 = 1033u32; pub const TB_ISBUTTONHIDDEN: u32 = 1036u32; pub const TB_ISBUTTONHIGHLIGHTED: u32 = 1038u32; pub const TB_ISBUTTONINDETERMINATE: u32 = 1037u32; pub const TB_ISBUTTONPRESSED: u32 = 1035u32; pub const TB_LINEDOWN: u32 = 1u32; pub const TB_LINEUP: u32 = 0u32; pub const TB_LOADIMAGES: u32 = 1074u32; pub const TB_MAPACCELERATOR: u32 = 1114u32; pub const TB_MAPACCELERATORA: u32 = 1102u32; pub const TB_MAPACCELERATORW: u32 = 1114u32; pub const TB_MARKBUTTON: u32 = 1030u32; pub const TB_MOVEBUTTON: u32 = 1106u32; pub const TB_PAGEDOWN: u32 = 3u32; pub const TB_PAGEUP: u32 = 2u32; pub const TB_PRESSBUTTON: u32 = 1027u32; pub const TB_REPLACEBITMAP: u32 = 1070u32; pub const TB_SAVERESTORE: u32 = 1100u32; pub const TB_SAVERESTOREA: u32 = 1050u32; pub const TB_SAVERESTOREW: u32 = 1100u32; pub const TB_SETANCHORHIGHLIGHT: u32 = 1097u32; pub const TB_SETBITMAPSIZE: u32 = 1056u32; pub const TB_SETBOUNDINGSIZE: u32 = 1117u32; pub const TB_SETBUTTONINFO: u32 = 1088u32; pub const TB_SETBUTTONINFOA: u32 = 1090u32; pub const TB_SETBUTTONINFOW: u32 = 1088u32; pub const TB_SETBUTTONSIZE: u32 = 1055u32; pub const TB_SETBUTTONWIDTH: u32 = 1083u32; pub const TB_SETCMDID: u32 = 1066u32; pub const TB_SETCOLORSCHEME: u32 = 8194u32; pub const TB_SETDISABLEDIMAGELIST: u32 = 1078u32; pub const TB_SETDRAWTEXTFLAGS: u32 = 1094u32; pub const TB_SETEXTENDEDSTYLE: u32 = 1108u32; pub const TB_SETHOTIMAGELIST: u32 = 1076u32; pub const TB_SETHOTITEM: u32 = 1096u32; pub const TB_SETHOTITEM2: u32 = 1118u32; pub const TB_SETIMAGELIST: u32 = 1072u32; pub const TB_SETINDENT: u32 = 1071u32; pub const TB_SETINSERTMARK: u32 = 1104u32; pub const TB_SETINSERTMARKCOLOR: u32 = 1112u32; pub const TB_SETLISTGAP: u32 = 1120u32; pub const TB_SETMAXTEXTROWS: u32 = 1084u32; pub const TB_SETMETRICS: u32 = 1126u32; pub const TB_SETPADDING: u32 = 1111u32; pub const TB_SETPARENT: u32 = 1061u32; pub const TB_SETPRESSEDIMAGELIST: u32 = 1128u32; pub const TB_SETROWS: u32 = 1063u32; pub const TB_SETSTATE: u32 = 1041u32; pub const TB_SETSTYLE: u32 = 1080u32; pub const TB_SETTOOLTIPS: u32 = 1060u32; pub const TB_SETUNICODEFORMAT: u32 = 8197u32; pub const TB_SETWINDOWTHEME: u32 = 8203u32; pub const TB_THUMBPOSITION: u32 = 4u32; pub const TB_THUMBTRACK: u32 = 5u32; pub const TB_TOP: u32 = 6u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TCHITTESTINFO { pub pt: super::super::Foundation::POINT, pub flags: TCHITTESTINFO_FLAGS, } #[cfg(feature = "Win32_Foundation")] impl TCHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TCHITTESTINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TCHITTESTINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TCHITTESTINFO").field("pt", &self.pt).field("flags", &self.flags).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TCHITTESTINFO { fn eq(&self, other: &Self) -> bool { self.pt == other.pt && self.flags == other.flags } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TCHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TCHITTESTINFO { 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 TCHITTESTINFO_FLAGS(pub u32); pub const TCHT_NOWHERE: TCHITTESTINFO_FLAGS = TCHITTESTINFO_FLAGS(1u32); pub const TCHT_ONITEM: TCHITTESTINFO_FLAGS = TCHITTESTINFO_FLAGS(6u32); pub const TCHT_ONITEMICON: TCHITTESTINFO_FLAGS = TCHITTESTINFO_FLAGS(2u32); pub const TCHT_ONITEMLABEL: TCHITTESTINFO_FLAGS = TCHITTESTINFO_FLAGS(4u32); impl ::core::convert::From<u32> for TCHITTESTINFO_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TCHITTESTINFO_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for TCHITTESTINFO_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for TCHITTESTINFO_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for TCHITTESTINFO_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for TCHITTESTINFO_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for TCHITTESTINFO_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const TCIS_BUTTONPRESSED: u32 = 1u32; pub const TCIS_HIGHLIGHTED: u32 = 2u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TCITEMA { pub mask: TCITEMHEADERA_MASK, pub dwState: u32, pub dwStateMask: u32, pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, pub iImage: i32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl TCITEMA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TCITEMA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TCITEMA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TCITEMA").field("mask", &self.mask).field("dwState", &self.dwState).field("dwStateMask", &self.dwStateMask).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("iImage", &self.iImage).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TCITEMA { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.dwState == other.dwState && self.dwStateMask == other.dwStateMask && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TCITEMA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TCITEMA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TCITEMHEADERA { pub mask: TCITEMHEADERA_MASK, pub lpReserved1: u32, pub lpReserved2: u32, pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, pub iImage: i32, } #[cfg(feature = "Win32_Foundation")] impl TCITEMHEADERA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TCITEMHEADERA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TCITEMHEADERA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TCITEMHEADERA").field("mask", &self.mask).field("lpReserved1", &self.lpReserved1).field("lpReserved2", &self.lpReserved2).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("iImage", &self.iImage).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TCITEMHEADERA { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.lpReserved1 == other.lpReserved1 && self.lpReserved2 == other.lpReserved2 && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TCITEMHEADERA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TCITEMHEADERA { 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 TCITEMHEADERA_MASK(pub u32); pub const TCIF_IMAGE: TCITEMHEADERA_MASK = TCITEMHEADERA_MASK(2u32); pub const TCIF_RTLREADING: TCITEMHEADERA_MASK = TCITEMHEADERA_MASK(4u32); pub const TCIF_TEXT: TCITEMHEADERA_MASK = TCITEMHEADERA_MASK(1u32); pub const TCIF_PARAM: TCITEMHEADERA_MASK = TCITEMHEADERA_MASK(8u32); pub const TCIF_STATE: TCITEMHEADERA_MASK = TCITEMHEADERA_MASK(16u32); impl ::core::convert::From<u32> for TCITEMHEADERA_MASK { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TCITEMHEADERA_MASK { type Abi = Self; } impl ::core::ops::BitOr for TCITEMHEADERA_MASK { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for TCITEMHEADERA_MASK { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for TCITEMHEADERA_MASK { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for TCITEMHEADERA_MASK { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for TCITEMHEADERA_MASK { 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 TCITEMHEADERW { pub mask: TCITEMHEADERA_MASK, pub lpReserved1: u32, pub lpReserved2: u32, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub iImage: i32, } #[cfg(feature = "Win32_Foundation")] impl TCITEMHEADERW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TCITEMHEADERW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TCITEMHEADERW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TCITEMHEADERW").field("mask", &self.mask).field("lpReserved1", &self.lpReserved1).field("lpReserved2", &self.lpReserved2).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("iImage", &self.iImage).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TCITEMHEADERW { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.lpReserved1 == other.lpReserved1 && self.lpReserved2 == other.lpReserved2 && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TCITEMHEADERW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TCITEMHEADERW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TCITEMW { pub mask: TCITEMHEADERA_MASK, pub dwState: u32, pub dwStateMask: u32, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub iImage: i32, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl TCITEMW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TCITEMW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TCITEMW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TCITEMW").field("mask", &self.mask).field("dwState", &self.dwState).field("dwStateMask", &self.dwStateMask).field("pszText", &self.pszText).field("cchTextMax", &self.cchTextMax).field("iImage", &self.iImage).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TCITEMW { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.dwState == other.dwState && self.dwStateMask == other.dwStateMask && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TCITEMW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TCITEMW { type Abi = Self; } pub const TCM_ADJUSTRECT: u32 = 4904u32; pub const TCM_DELETEALLITEMS: u32 = 4873u32; pub const TCM_DELETEITEM: u32 = 4872u32; pub const TCM_DESELECTALL: u32 = 4914u32; pub const TCM_FIRST: u32 = 4864u32; pub const TCM_GETCURFOCUS: u32 = 4911u32; pub const TCM_GETCURSEL: u32 = 4875u32; pub const TCM_GETEXTENDEDSTYLE: u32 = 4917u32; pub const TCM_GETIMAGELIST: u32 = 4866u32; pub const TCM_GETITEM: u32 = 4924u32; pub const TCM_GETITEMA: u32 = 4869u32; pub const TCM_GETITEMCOUNT: u32 = 4868u32; pub const TCM_GETITEMRECT: u32 = 4874u32; pub const TCM_GETITEMW: u32 = 4924u32; pub const TCM_GETROWCOUNT: u32 = 4908u32; pub const TCM_GETTOOLTIPS: u32 = 4909u32; pub const TCM_GETUNICODEFORMAT: u32 = 8198u32; pub const TCM_HIGHLIGHTITEM: u32 = 4915u32; pub const TCM_HITTEST: u32 = 4877u32; pub const TCM_INSERTITEM: u32 = 4926u32; pub const TCM_INSERTITEMA: u32 = 4871u32; pub const TCM_INSERTITEMW: u32 = 4926u32; pub const TCM_REMOVEIMAGE: u32 = 4906u32; pub const TCM_SETCURFOCUS: u32 = 4912u32; pub const TCM_SETCURSEL: u32 = 4876u32; pub const TCM_SETEXTENDEDSTYLE: u32 = 4916u32; pub const TCM_SETIMAGELIST: u32 = 4867u32; pub const TCM_SETITEM: u32 = 4925u32; pub const TCM_SETITEMA: u32 = 4870u32; pub const TCM_SETITEMEXTRA: u32 = 4878u32; pub const TCM_SETITEMSIZE: u32 = 4905u32; pub const TCM_SETITEMW: u32 = 4925u32; pub const TCM_SETMINTABWIDTH: u32 = 4913u32; pub const TCM_SETPADDING: u32 = 4907u32; pub const TCM_SETTOOLTIPS: u32 = 4910u32; pub const TCM_SETUNICODEFORMAT: u32 = 8197u32; pub const TCS_BOTTOM: u32 = 2u32; pub const TCS_BUTTONS: u32 = 256u32; pub const TCS_EX_FLATSEPARATORS: u32 = 1u32; pub const TCS_EX_REGISTERDROP: u32 = 2u32; pub const TCS_FIXEDWIDTH: u32 = 1024u32; pub const TCS_FLATBUTTONS: u32 = 8u32; pub const TCS_FOCUSNEVER: u32 = 32768u32; pub const TCS_FOCUSONBUTTONDOWN: u32 = 4096u32; pub const TCS_FORCEICONLEFT: u32 = 16u32; pub const TCS_FORCELABELLEFT: u32 = 32u32; pub const TCS_HOTTRACK: u32 = 64u32; pub const TCS_MULTILINE: u32 = 512u32; pub const TCS_MULTISELECT: u32 = 4u32; pub const TCS_OWNERDRAWFIXED: u32 = 8192u32; pub const TCS_RAGGEDRIGHT: u32 = 2048u32; pub const TCS_RIGHT: u32 = 2u32; pub const TCS_RIGHTJUSTIFY: u32 = 0u32; pub const TCS_SCROLLOPPOSITE: u32 = 1u32; pub const TCS_SINGLELINE: u32 = 0u32; pub const TCS_TABS: u32 = 0u32; pub const TCS_TOOLTIPS: u32 = 16384u32; pub const TCS_VERTICAL: u32 = 128u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct TEXTSHADOWTYPE(pub i32); pub const TST_NONE: TEXTSHADOWTYPE = TEXTSHADOWTYPE(0i32); pub const TST_SINGLE: TEXTSHADOWTYPE = TEXTSHADOWTYPE(1i32); pub const TST_CONTINUOUS: TEXTSHADOWTYPE = TEXTSHADOWTYPE(2i32); impl ::core::convert::From<i32> for TEXTSHADOWTYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TEXTSHADOWTYPE { 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 THEMESIZE(pub i32); pub const TS_MIN: THEMESIZE = THEMESIZE(0i32); pub const TS_TRUE: THEMESIZE = THEMESIZE(1i32); pub const TS_DRAW: THEMESIZE = THEMESIZE(2i32); impl ::core::convert::From<i32> for THEMESIZE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for THEMESIZE { 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 THEME_PROPERTY_SYMBOL_ID(pub u32); pub const TMT_RESERVEDLOW: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(0u32); pub const TMT_RESERVEDHIGH: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(7999u32); pub const TMT_DIBDATA: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2u32); pub const TMT_GLYPHDIBDATA: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(8u32); pub const TMT_ENUM: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(200u32); pub const TMT_STRING: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(201u32); pub const TMT_INT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(202u32); pub const TMT_BOOL: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(203u32); pub const TMT_COLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(204u32); pub const TMT_MARGINS: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(205u32); pub const TMT_FILENAME: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(206u32); pub const TMT_SIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(207u32); pub const TMT_POSITION: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(208u32); pub const TMT_RECT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(209u32); pub const TMT_FONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(210u32); pub const TMT_INTLIST: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(211u32); pub const TMT_HBITMAP: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(212u32); pub const TMT_DISKSTREAM: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(213u32); pub const TMT_STREAM: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(214u32); pub const TMT_BITMAPREF: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(215u32); pub const TMT_FLOAT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(216u32); pub const TMT_FLOATLIST: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(217u32); pub const TMT_COLORSCHEMES: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(401u32); pub const TMT_SIZES: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(402u32); pub const TMT_CHARSET: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(403u32); pub const TMT_NAME: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(600u32); pub const TMT_DISPLAYNAME: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(601u32); pub const TMT_TOOLTIP: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(602u32); pub const TMT_COMPANY: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(603u32); pub const TMT_AUTHOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(604u32); pub const TMT_COPYRIGHT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(605u32); pub const TMT_URL: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(606u32); pub const TMT_VERSION: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(607u32); pub const TMT_DESCRIPTION: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(608u32); pub const TMT_FIRST_RCSTRING_NAME: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(601u32); pub const TMT_LAST_RCSTRING_NAME: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(608u32); pub const TMT_CAPTIONFONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(801u32); pub const TMT_SMALLCAPTIONFONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(802u32); pub const TMT_MENUFONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(803u32); pub const TMT_STATUSFONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(804u32); pub const TMT_MSGBOXFONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(805u32); pub const TMT_ICONTITLEFONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(806u32); pub const TMT_HEADING1FONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(807u32); pub const TMT_HEADING2FONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(808u32); pub const TMT_BODYFONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(809u32); pub const TMT_FIRSTFONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(801u32); pub const TMT_LASTFONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(809u32); pub const TMT_FLATMENUS: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1001u32); pub const TMT_FIRSTBOOL: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1001u32); pub const TMT_LASTBOOL: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1001u32); pub const TMT_SIZINGBORDERWIDTH: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1201u32); pub const TMT_SCROLLBARWIDTH: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1202u32); pub const TMT_SCROLLBARHEIGHT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1203u32); pub const TMT_CAPTIONBARWIDTH: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1204u32); pub const TMT_CAPTIONBARHEIGHT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1205u32); pub const TMT_SMCAPTIONBARWIDTH: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1206u32); pub const TMT_SMCAPTIONBARHEIGHT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1207u32); pub const TMT_MENUBARWIDTH: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1208u32); pub const TMT_MENUBARHEIGHT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1209u32); pub const TMT_PADDEDBORDERWIDTH: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1210u32); pub const TMT_FIRSTSIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1201u32); pub const TMT_LASTSIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1210u32); pub const TMT_MINCOLORDEPTH: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1301u32); pub const TMT_FIRSTINT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1301u32); pub const TMT_LASTINT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1301u32); pub const TMT_CSSNAME: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1401u32); pub const TMT_XMLNAME: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1402u32); pub const TMT_LASTUPDATED: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1403u32); pub const TMT_ALIAS: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1404u32); pub const TMT_FIRSTSTRING: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1401u32); pub const TMT_LASTSTRING: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1404u32); pub const TMT_SCROLLBAR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1601u32); pub const TMT_BACKGROUND: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1602u32); pub const TMT_ACTIVECAPTION: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1603u32); pub const TMT_INACTIVECAPTION: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1604u32); pub const TMT_MENU: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1605u32); pub const TMT_WINDOW: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1606u32); pub const TMT_WINDOWFRAME: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1607u32); pub const TMT_MENUTEXT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1608u32); pub const TMT_WINDOWTEXT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1609u32); pub const TMT_CAPTIONTEXT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1610u32); pub const TMT_ACTIVEBORDER: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1611u32); pub const TMT_INACTIVEBORDER: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1612u32); pub const TMT_APPWORKSPACE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1613u32); pub const TMT_HIGHLIGHT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1614u32); pub const TMT_HIGHLIGHTTEXT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1615u32); pub const TMT_BTNFACE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1616u32); pub const TMT_BTNSHADOW: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1617u32); pub const TMT_GRAYTEXT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1618u32); pub const TMT_BTNTEXT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1619u32); pub const TMT_INACTIVECAPTIONTEXT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1620u32); pub const TMT_BTNHIGHLIGHT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1621u32); pub const TMT_DKSHADOW3D: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1622u32); pub const TMT_LIGHT3D: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1623u32); pub const TMT_INFOTEXT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1624u32); pub const TMT_INFOBK: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1625u32); pub const TMT_BUTTONALTERNATEFACE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1626u32); pub const TMT_HOTTRACKING: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1627u32); pub const TMT_GRADIENTACTIVECAPTION: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1628u32); pub const TMT_GRADIENTINACTIVECAPTION: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1629u32); pub const TMT_MENUHILIGHT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1630u32); pub const TMT_MENUBAR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1631u32); pub const TMT_FIRSTCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1601u32); pub const TMT_LASTCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1631u32); pub const TMT_FROMHUE1: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1801u32); pub const TMT_FROMHUE2: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1802u32); pub const TMT_FROMHUE3: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1803u32); pub const TMT_FROMHUE4: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1804u32); pub const TMT_FROMHUE5: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1805u32); pub const TMT_TOHUE1: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1806u32); pub const TMT_TOHUE2: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1807u32); pub const TMT_TOHUE3: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1808u32); pub const TMT_TOHUE4: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1809u32); pub const TMT_TOHUE5: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(1810u32); pub const TMT_FROMCOLOR1: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2001u32); pub const TMT_FROMCOLOR2: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2002u32); pub const TMT_FROMCOLOR3: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2003u32); pub const TMT_FROMCOLOR4: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2004u32); pub const TMT_FROMCOLOR5: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2005u32); pub const TMT_TOCOLOR1: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2006u32); pub const TMT_TOCOLOR2: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2007u32); pub const TMT_TOCOLOR3: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2008u32); pub const TMT_TOCOLOR4: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2009u32); pub const TMT_TOCOLOR5: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2010u32); pub const TMT_TRANSPARENT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2201u32); pub const TMT_AUTOSIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2202u32); pub const TMT_BORDERONLY: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2203u32); pub const TMT_COMPOSITED: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2204u32); pub const TMT_BGFILL: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2205u32); pub const TMT_GLYPHTRANSPARENT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2206u32); pub const TMT_GLYPHONLY: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2207u32); pub const TMT_ALWAYSSHOWSIZINGBAR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2208u32); pub const TMT_MIRRORIMAGE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2209u32); pub const TMT_UNIFORMSIZING: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2210u32); pub const TMT_INTEGRALSIZING: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2211u32); pub const TMT_SOURCEGROW: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2212u32); pub const TMT_SOURCESHRINK: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2213u32); pub const TMT_DRAWBORDERS: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2214u32); pub const TMT_NOETCHEDEFFECT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2215u32); pub const TMT_TEXTAPPLYOVERLAY: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2216u32); pub const TMT_TEXTGLOW: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2217u32); pub const TMT_TEXTITALIC: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2218u32); pub const TMT_COMPOSITEDOPAQUE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2219u32); pub const TMT_LOCALIZEDMIRRORIMAGE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2220u32); pub const TMT_IMAGECOUNT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2401u32); pub const TMT_ALPHALEVEL: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2402u32); pub const TMT_BORDERSIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2403u32); pub const TMT_ROUNDCORNERWIDTH: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2404u32); pub const TMT_ROUNDCORNERHEIGHT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2405u32); pub const TMT_GRADIENTRATIO1: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2406u32); pub const TMT_GRADIENTRATIO2: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2407u32); pub const TMT_GRADIENTRATIO3: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2408u32); pub const TMT_GRADIENTRATIO4: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2409u32); pub const TMT_GRADIENTRATIO5: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2410u32); pub const TMT_PROGRESSCHUNKSIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2411u32); pub const TMT_PROGRESSSPACESIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2412u32); pub const TMT_SATURATION: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2413u32); pub const TMT_TEXTBORDERSIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2414u32); pub const TMT_ALPHATHRESHOLD: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2415u32); pub const TMT_WIDTH: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2416u32); pub const TMT_HEIGHT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2417u32); pub const TMT_GLYPHINDEX: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2418u32); pub const TMT_TRUESIZESTRETCHMARK: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2419u32); pub const TMT_MINDPI1: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2420u32); pub const TMT_MINDPI2: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2421u32); pub const TMT_MINDPI3: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2422u32); pub const TMT_MINDPI4: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2423u32); pub const TMT_MINDPI5: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2424u32); pub const TMT_TEXTGLOWSIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2425u32); pub const TMT_FRAMESPERSECOND: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2426u32); pub const TMT_PIXELSPERFRAME: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2427u32); pub const TMT_ANIMATIONDELAY: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2428u32); pub const TMT_GLOWINTENSITY: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2429u32); pub const TMT_OPACITY: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2430u32); pub const TMT_COLORIZATIONCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2431u32); pub const TMT_COLORIZATIONOPACITY: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2432u32); pub const TMT_MINDPI6: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2433u32); pub const TMT_MINDPI7: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2434u32); pub const TMT_GLYPHFONT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(2601u32); pub const TMT_IMAGEFILE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3001u32); pub const TMT_IMAGEFILE1: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3002u32); pub const TMT_IMAGEFILE2: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3003u32); pub const TMT_IMAGEFILE3: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3004u32); pub const TMT_IMAGEFILE4: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3005u32); pub const TMT_IMAGEFILE5: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3006u32); pub const TMT_GLYPHIMAGEFILE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3008u32); pub const TMT_IMAGEFILE6: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3009u32); pub const TMT_IMAGEFILE7: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3010u32); pub const TMT_TEXT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3201u32); pub const TMT_CLASSICVALUE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3202u32); pub const TMT_OFFSET: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3401u32); pub const TMT_TEXTSHADOWOFFSET: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3402u32); pub const TMT_MINSIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3403u32); pub const TMT_MINSIZE1: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3404u32); pub const TMT_MINSIZE2: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3405u32); pub const TMT_MINSIZE3: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3406u32); pub const TMT_MINSIZE4: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3407u32); pub const TMT_MINSIZE5: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3408u32); pub const TMT_NORMALSIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3409u32); pub const TMT_MINSIZE6: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3410u32); pub const TMT_MINSIZE7: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3411u32); pub const TMT_SIZINGMARGINS: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3601u32); pub const TMT_CONTENTMARGINS: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3602u32); pub const TMT_CAPTIONMARGINS: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3603u32); pub const TMT_BORDERCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3801u32); pub const TMT_FILLCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3802u32); pub const TMT_TEXTCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3803u32); pub const TMT_EDGELIGHTCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3804u32); pub const TMT_EDGEHIGHLIGHTCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3805u32); pub const TMT_EDGESHADOWCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3806u32); pub const TMT_EDGEDKSHADOWCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3807u32); pub const TMT_EDGEFILLCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3808u32); pub const TMT_TRANSPARENTCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3809u32); pub const TMT_GRADIENTCOLOR1: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3810u32); pub const TMT_GRADIENTCOLOR2: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3811u32); pub const TMT_GRADIENTCOLOR3: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3812u32); pub const TMT_GRADIENTCOLOR4: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3813u32); pub const TMT_GRADIENTCOLOR5: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3814u32); pub const TMT_SHADOWCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3815u32); pub const TMT_GLOWCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3816u32); pub const TMT_TEXTBORDERCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3817u32); pub const TMT_TEXTSHADOWCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3818u32); pub const TMT_GLYPHTEXTCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3819u32); pub const TMT_GLYPHTRANSPARENTCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3820u32); pub const TMT_FILLCOLORHINT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3821u32); pub const TMT_BORDERCOLORHINT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3822u32); pub const TMT_ACCENTCOLORHINT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3823u32); pub const TMT_TEXTCOLORHINT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3824u32); pub const TMT_HEADING1TEXTCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3825u32); pub const TMT_HEADING2TEXTCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3826u32); pub const TMT_BODYTEXTCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(3827u32); pub const TMT_BGTYPE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4001u32); pub const TMT_BORDERTYPE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4002u32); pub const TMT_FILLTYPE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4003u32); pub const TMT_SIZINGTYPE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4004u32); pub const TMT_HALIGN: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4005u32); pub const TMT_CONTENTALIGNMENT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4006u32); pub const TMT_VALIGN: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4007u32); pub const TMT_OFFSETTYPE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4008u32); pub const TMT_ICONEFFECT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4009u32); pub const TMT_TEXTSHADOWTYPE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4010u32); pub const TMT_IMAGELAYOUT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4011u32); pub const TMT_GLYPHTYPE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4012u32); pub const TMT_IMAGESELECTTYPE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4013u32); pub const TMT_GLYPHFONTSIZINGTYPE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4014u32); pub const TMT_TRUESIZESCALINGTYPE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(4015u32); pub const TMT_USERPICTURE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(5001u32); pub const TMT_DEFAULTPANESIZE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(5002u32); pub const TMT_BLENDCOLOR: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(5003u32); pub const TMT_CUSTOMSPLITRECT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(5004u32); pub const TMT_ANIMATIONBUTTONRECT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(5005u32); pub const TMT_ANIMATIONDURATION: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(5006u32); pub const TMT_TRANSITIONDURATIONS: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(6000u32); pub const TMT_SCALEDBACKGROUND: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(7001u32); pub const TMT_ATLASIMAGE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(8000u32); pub const TMT_ATLASINPUTIMAGE: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(8001u32); pub const TMT_ATLASRECT: THEME_PROPERTY_SYMBOL_ID = THEME_PROPERTY_SYMBOL_ID(8002u32); impl ::core::convert::From<u32> for THEME_PROPERTY_SYMBOL_ID { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for THEME_PROPERTY_SYMBOL_ID { type Abi = Self; } impl ::core::ops::BitOr for THEME_PROPERTY_SYMBOL_ID { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for THEME_PROPERTY_SYMBOL_ID { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for THEME_PROPERTY_SYMBOL_ID { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for THEME_PROPERTY_SYMBOL_ID { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for THEME_PROPERTY_SYMBOL_ID { 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 TOUCH_HIT_TESTING_INPUT { pub pointerId: u32, pub point: super::super::Foundation::POINT, pub boundingBox: super::super::Foundation::RECT, pub nonOccludedBoundingBox: super::super::Foundation::RECT, pub orientation: u32, } #[cfg(feature = "Win32_Foundation")] impl TOUCH_HIT_TESTING_INPUT {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TOUCH_HIT_TESTING_INPUT { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TOUCH_HIT_TESTING_INPUT { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TOUCH_HIT_TESTING_INPUT").field("pointerId", &self.pointerId).field("point", &self.point).field("boundingBox", &self.boundingBox).field("nonOccludedBoundingBox", &self.nonOccludedBoundingBox).field("orientation", &self.orientation).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TOUCH_HIT_TESTING_INPUT { fn eq(&self, other: &Self) -> bool { self.pointerId == other.pointerId && self.point == other.point && self.boundingBox == other.boundingBox && self.nonOccludedBoundingBox == other.nonOccludedBoundingBox && self.orientation == other.orientation } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TOUCH_HIT_TESTING_INPUT {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TOUCH_HIT_TESTING_INPUT { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TOUCH_HIT_TESTING_PROXIMITY_EVALUATION { pub score: u16, pub adjustedPoint: super::super::Foundation::POINT, } #[cfg(feature = "Win32_Foundation")] impl TOUCH_HIT_TESTING_PROXIMITY_EVALUATION {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TOUCH_HIT_TESTING_PROXIMITY_EVALUATION { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TOUCH_HIT_TESTING_PROXIMITY_EVALUATION { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TOUCH_HIT_TESTING_PROXIMITY_EVALUATION").field("score", &self.score).field("adjustedPoint", &self.adjustedPoint).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TOUCH_HIT_TESTING_PROXIMITY_EVALUATION { fn eq(&self, other: &Self) -> bool { self.score == other.score && self.adjustedPoint == other.adjustedPoint } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TOUCH_HIT_TESTING_PROXIMITY_EVALUATION {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TOUCH_HIT_TESTING_PROXIMITY_EVALUATION { 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 TRAILINGGRIDCELLSTATES(pub i32); pub const MCTGC_HOT: TRAILINGGRIDCELLSTATES = TRAILINGGRIDCELLSTATES(1i32); pub const MCTGC_HASSTATE: TRAILINGGRIDCELLSTATES = TRAILINGGRIDCELLSTATES(2i32); pub const MCTGC_HASSTATEHOT: TRAILINGGRIDCELLSTATES = TRAILINGGRIDCELLSTATES(3i32); pub const MCTGC_TODAY: TRAILINGGRIDCELLSTATES = TRAILINGGRIDCELLSTATES(4i32); pub const MCTGC_TODAYSELECTED: TRAILINGGRIDCELLSTATES = TRAILINGGRIDCELLSTATES(5i32); pub const MCTGC_SELECTED: TRAILINGGRIDCELLSTATES = TRAILINGGRIDCELLSTATES(6i32); pub const MCTGC_SELECTEDHOT: TRAILINGGRIDCELLSTATES = TRAILINGGRIDCELLSTATES(7i32); impl ::core::convert::From<i32> for TRAILINGGRIDCELLSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TRAILINGGRIDCELLSTATES { 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 TRAILINGGRIDCELLUPPERSTATES(pub i32); pub const MCTGCU_HOT: TRAILINGGRIDCELLUPPERSTATES = TRAILINGGRIDCELLUPPERSTATES(1i32); pub const MCTGCU_HASSTATE: TRAILINGGRIDCELLUPPERSTATES = TRAILINGGRIDCELLUPPERSTATES(2i32); pub const MCTGCU_HASSTATEHOT: TRAILINGGRIDCELLUPPERSTATES = TRAILINGGRIDCELLUPPERSTATES(3i32); pub const MCTGCU_SELECTED: TRAILINGGRIDCELLUPPERSTATES = TRAILINGGRIDCELLUPPERSTATES(4i32); pub const MCTGCU_SELECTEDHOT: TRAILINGGRIDCELLUPPERSTATES = TRAILINGGRIDCELLUPPERSTATES(5i32); impl ::core::convert::From<i32> for TRAILINGGRIDCELLUPPERSTATES { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TRAILINGGRIDCELLUPPERSTATES { 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 TRAYNOTIFYPARTS(pub i32); pub const TNP_BACKGROUND: TRAYNOTIFYPARTS = TRAYNOTIFYPARTS(1i32); pub const TNP_ANIMBACKGROUND: TRAYNOTIFYPARTS = TRAYNOTIFYPARTS(2i32); impl ::core::convert::From<i32> for TRAYNOTIFYPARTS { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TRAYNOTIFYPARTS { 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 TRUESIZESCALINGTYPE(pub i32); pub const TSST_NONE: TRUESIZESCALINGTYPE = TRUESIZESCALINGTYPE(0i32); pub const TSST_SIZE: TRUESIZESCALINGTYPE = TRUESIZESCALINGTYPE(1i32); pub const TSST_DPI: TRUESIZESCALINGTYPE = TRUESIZESCALINGTYPE(2i32); impl ::core::convert::From<i32> for TRUESIZESCALINGTYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TRUESIZESCALINGTYPE { type Abi = Self; } pub const TTDT_AUTOMATIC: u32 = 0u32; pub const TTDT_AUTOPOP: u32 = 2u32; pub const TTDT_INITIAL: u32 = 3u32; pub const TTDT_RESHOW: u32 = 1u32; pub const TTF_DI_SETITEM: u32 = 32768u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TTGETTITLE { pub dwSize: u32, pub uTitleBitmap: u32, pub cch: u32, pub pszTitle: super::super::Foundation::PWSTR, } #[cfg(feature = "Win32_Foundation")] impl TTGETTITLE {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TTGETTITLE { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TTGETTITLE { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TTGETTITLE").field("dwSize", &self.dwSize).field("uTitleBitmap", &self.uTitleBitmap).field("cch", &self.cch).field("pszTitle", &self.pszTitle).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TTGETTITLE { fn eq(&self, other: &Self) -> bool { self.dwSize == other.dwSize && self.uTitleBitmap == other.uTitleBitmap && self.cch == other.cch && self.pszTitle == other.pszTitle } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TTGETTITLE {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TTGETTITLE { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TTHITTESTINFOA { pub hwnd: super::super::Foundation::HWND, pub pt: super::super::Foundation::POINT, pub ti: TTTOOLINFOA, } #[cfg(feature = "Win32_Foundation")] impl TTHITTESTINFOA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TTHITTESTINFOA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TTHITTESTINFOA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TTHITTESTINFOA").field("hwnd", &self.hwnd).field("pt", &self.pt).field("ti", &self.ti).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TTHITTESTINFOA { fn eq(&self, other: &Self) -> bool { self.hwnd == other.hwnd && self.pt == other.pt && self.ti == other.ti } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TTHITTESTINFOA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TTHITTESTINFOA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TTHITTESTINFOW { pub hwnd: super::super::Foundation::HWND, pub pt: super::super::Foundation::POINT, pub ti: TTTOOLINFOW, } #[cfg(feature = "Win32_Foundation")] impl TTHITTESTINFOW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TTHITTESTINFOW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TTHITTESTINFOW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TTHITTESTINFOW").field("hwnd", &self.hwnd).field("pt", &self.pt).field("ti", &self.ti).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TTHITTESTINFOW { fn eq(&self, other: &Self) -> bool { self.hwnd == other.hwnd && self.pt == other.pt && self.ti == other.ti } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TTHITTESTINFOW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TTHITTESTINFOW { type Abi = Self; } pub const TTM_ACTIVATE: u32 = 1025u32; pub const TTM_ADDTOOL: u32 = 1074u32; pub const TTM_ADDTOOLA: u32 = 1028u32; pub const TTM_ADDTOOLW: u32 = 1074u32; pub const TTM_ADJUSTRECT: u32 = 1055u32; pub const TTM_DELTOOL: u32 = 1075u32; pub const TTM_DELTOOLA: u32 = 1029u32; pub const TTM_DELTOOLW: u32 = 1075u32; pub const TTM_ENUMTOOLS: u32 = 1082u32; pub const TTM_ENUMTOOLSA: u32 = 1038u32; pub const TTM_ENUMTOOLSW: u32 = 1082u32; pub const TTM_GETBUBBLESIZE: u32 = 1054u32; pub const TTM_GETCURRENTTOOL: u32 = 1083u32; pub const TTM_GETCURRENTTOOLA: u32 = 1039u32; pub const TTM_GETCURRENTTOOLW: u32 = 1083u32; pub const TTM_GETDELAYTIME: u32 = 1045u32; pub const TTM_GETMARGIN: u32 = 1051u32; pub const TTM_GETMAXTIPWIDTH: u32 = 1049u32; pub const TTM_GETTEXT: u32 = 1080u32; pub const TTM_GETTEXTA: u32 = 1035u32; pub const TTM_GETTEXTW: u32 = 1080u32; pub const TTM_GETTIPBKCOLOR: u32 = 1046u32; pub const TTM_GETTIPTEXTCOLOR: u32 = 1047u32; pub const TTM_GETTITLE: u32 = 1059u32; pub const TTM_GETTOOLCOUNT: u32 = 1037u32; pub const TTM_GETTOOLINFO: u32 = 1077u32; pub const TTM_GETTOOLINFOA: u32 = 1032u32; pub const TTM_GETTOOLINFOW: u32 = 1077u32; pub const TTM_HITTEST: u32 = 1079u32; pub const TTM_HITTESTA: u32 = 1034u32; pub const TTM_HITTESTW: u32 = 1079u32; pub const TTM_NEWTOOLRECT: u32 = 1076u32; pub const TTM_NEWTOOLRECTA: u32 = 1030u32; pub const TTM_NEWTOOLRECTW: u32 = 1076u32; pub const TTM_POP: u32 = 1052u32; pub const TTM_POPUP: u32 = 1058u32; pub const TTM_RELAYEVENT: u32 = 1031u32; pub const TTM_SETDELAYTIME: u32 = 1027u32; pub const TTM_SETMARGIN: u32 = 1050u32; pub const TTM_SETMAXTIPWIDTH: u32 = 1048u32; pub const TTM_SETTIPBKCOLOR: u32 = 1043u32; pub const TTM_SETTIPTEXTCOLOR: u32 = 1044u32; pub const TTM_SETTITLE: u32 = 1057u32; pub const TTM_SETTITLEA: u32 = 1056u32; pub const TTM_SETTITLEW: u32 = 1057u32; pub const TTM_SETTOOLINFO: u32 = 1078u32; pub const TTM_SETTOOLINFOA: u32 = 1033u32; pub const TTM_SETTOOLINFOW: u32 = 1078u32; pub const TTM_SETWINDOWTHEME: u32 = 8203u32; pub const TTM_TRACKACTIVATE: u32 = 1041u32; pub const TTM_TRACKPOSITION: u32 = 1042u32; pub const TTM_UPDATE: u32 = 1053u32; pub const TTM_UPDATETIPTEXT: u32 = 1081u32; pub const TTM_UPDATETIPTEXTA: u32 = 1036u32; pub const TTM_UPDATETIPTEXTW: u32 = 1081u32; pub const TTM_WINDOWFROMPOINT: u32 = 1040u32; pub const TTS_ALWAYSTIP: u32 = 1u32; pub const TTS_BALLOON: u32 = 64u32; pub const TTS_CLOSE: u32 = 128u32; pub const TTS_NOANIMATE: u32 = 16u32; pub const TTS_NOFADE: u32 = 32u32; pub const TTS_NOPREFIX: u32 = 2u32; pub const TTS_USEVISUALSTYLE: u32 = 256u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TTTOOLINFOA { pub cbSize: u32, pub uFlags: TTTOOLINFO_FLAGS, pub hwnd: super::super::Foundation::HWND, pub uId: usize, pub rect: super::super::Foundation::RECT, pub hinst: super::super::Foundation::HINSTANCE, pub lpszText: super::super::Foundation::PSTR, pub lParam: super::super::Foundation::LPARAM, pub lpReserved: *mut ::core::ffi::c_void, } #[cfg(feature = "Win32_Foundation")] impl TTTOOLINFOA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TTTOOLINFOA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TTTOOLINFOA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TTTOOLINFOA") .field("cbSize", &self.cbSize) .field("uFlags", &self.uFlags) .field("hwnd", &self.hwnd) .field("uId", &self.uId) .field("rect", &self.rect) .field("hinst", &self.hinst) .field("lpszText", &self.lpszText) .field("lParam", &self.lParam) .field("lpReserved", &self.lpReserved) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TTTOOLINFOA { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.uFlags == other.uFlags && self.hwnd == other.hwnd && self.uId == other.uId && self.rect == other.rect && self.hinst == other.hinst && self.lpszText == other.lpszText && self.lParam == other.lParam && self.lpReserved == other.lpReserved } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TTTOOLINFOA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TTTOOLINFOA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TTTOOLINFOW { pub cbSize: u32, pub uFlags: TTTOOLINFO_FLAGS, pub hwnd: super::super::Foundation::HWND, pub uId: usize, pub rect: super::super::Foundation::RECT, pub hinst: super::super::Foundation::HINSTANCE, pub lpszText: super::super::Foundation::PWSTR, pub lParam: super::super::Foundation::LPARAM, pub lpReserved: *mut ::core::ffi::c_void, } #[cfg(feature = "Win32_Foundation")] impl TTTOOLINFOW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TTTOOLINFOW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TTTOOLINFOW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TTTOOLINFOW") .field("cbSize", &self.cbSize) .field("uFlags", &self.uFlags) .field("hwnd", &self.hwnd) .field("uId", &self.uId) .field("rect", &self.rect) .field("hinst", &self.hinst) .field("lpszText", &self.lpszText) .field("lParam", &self.lParam) .field("lpReserved", &self.lpReserved) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TTTOOLINFOW { fn eq(&self, other: &Self) -> bool { self.cbSize == other.cbSize && self.uFlags == other.uFlags && self.hwnd == other.hwnd && self.uId == other.uId && self.rect == other.rect && self.hinst == other.hinst && self.lpszText == other.lpszText && self.lParam == other.lParam && self.lpReserved == other.lpReserved } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TTTOOLINFOW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TTTOOLINFOW { 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 TTTOOLINFO_FLAGS(pub u32); pub const TTF_ABSOLUTE: TTTOOLINFO_FLAGS = TTTOOLINFO_FLAGS(128u32); pub const TTF_CENTERTIP: TTTOOLINFO_FLAGS = TTTOOLINFO_FLAGS(2u32); pub const TTF_IDISHWND: TTTOOLINFO_FLAGS = TTTOOLINFO_FLAGS(1u32); pub const TTF_PARSELINKS: TTTOOLINFO_FLAGS = TTTOOLINFO_FLAGS(4096u32); pub const TTF_RTLREADING: TTTOOLINFO_FLAGS = TTTOOLINFO_FLAGS(4u32); pub const TTF_SUBCLASS: TTTOOLINFO_FLAGS = TTTOOLINFO_FLAGS(16u32); pub const TTF_TRACK: TTTOOLINFO_FLAGS = TTTOOLINFO_FLAGS(32u32); pub const TTF_TRANSPARENT: TTTOOLINFO_FLAGS = TTTOOLINFO_FLAGS(256u32); impl ::core::convert::From<u32> for TTTOOLINFO_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TTTOOLINFO_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for TTTOOLINFO_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for TTTOOLINFO_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for TTTOOLINFO_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for TTTOOLINFO_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for TTTOOLINFO_FLAGS { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const TVCDRF_NOIMAGES: u32 = 65536u32; pub const TVC_BYKEYBOARD: u32 = 2u32; pub const TVC_BYMOUSE: u32 = 1u32; pub const TVC_UNKNOWN: u32 = 0u32; pub const TVE_COLLAPSE: u32 = 1u32; pub const TVE_COLLAPSERESET: u32 = 32768u32; pub const TVE_EXPAND: u32 = 2u32; pub const TVE_EXPANDPARTIAL: u32 = 16384u32; pub const TVE_TOGGLE: u32 = 3u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TVGETITEMPARTRECTINFO { pub hti: HTREEITEM, pub prc: *mut super::super::Foundation::RECT, pub partID: TVITEMPART, } #[cfg(feature = "Win32_Foundation")] impl TVGETITEMPARTRECTINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TVGETITEMPARTRECTINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TVGETITEMPARTRECTINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TVGETITEMPARTRECTINFO").field("hti", &self.hti).field("prc", &self.prc).field("partID", &self.partID).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TVGETITEMPARTRECTINFO { fn eq(&self, other: &Self) -> bool { self.hti == other.hti && self.prc == other.prc && self.partID == other.partID } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TVGETITEMPARTRECTINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TVGETITEMPARTRECTINFO { type Abi = Self; } pub const TVGN_CARET: u32 = 9u32; pub const TVGN_CHILD: u32 = 4u32; pub const TVGN_DROPHILITE: u32 = 8u32; pub const TVGN_FIRSTVISIBLE: u32 = 5u32; pub const TVGN_LASTVISIBLE: u32 = 10u32; pub const TVGN_NEXT: u32 = 1u32; pub const TVGN_NEXTSELECTED: u32 = 11u32; pub const TVGN_NEXTVISIBLE: u32 = 6u32; pub const TVGN_PARENT: u32 = 3u32; pub const TVGN_PREVIOUS: u32 = 2u32; pub const TVGN_PREVIOUSVISIBLE: u32 = 7u32; pub const TVGN_ROOT: u32 = 0u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TVHITTESTINFO { pub pt: super::super::Foundation::POINT, pub flags: TVHITTESTINFO_FLAGS, pub hItem: HTREEITEM, } #[cfg(feature = "Win32_Foundation")] impl TVHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TVHITTESTINFO { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TVHITTESTINFO { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TVHITTESTINFO").field("pt", &self.pt).field("flags", &self.flags).field("hItem", &self.hItem).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TVHITTESTINFO { fn eq(&self, other: &Self) -> bool { self.pt == other.pt && self.flags == other.flags && self.hItem == other.hItem } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TVHITTESTINFO {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TVHITTESTINFO { 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 TVHITTESTINFO_FLAGS(pub u32); pub const TVHT_ABOVE: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(256u32); pub const TVHT_BELOW: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(512u32); pub const TVHT_NOWHERE: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(1u32); pub const TVHT_ONITEM: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(70u32); pub const TVHT_ONITEMBUTTON: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(16u32); pub const TVHT_ONITEMICON: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(2u32); pub const TVHT_ONITEMINDENT: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(8u32); pub const TVHT_ONITEMLABEL: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(4u32); pub const TVHT_ONITEMRIGHT: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(32u32); pub const TVHT_ONITEMSTATEICON: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(64u32); pub const TVHT_TOLEFT: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(2048u32); pub const TVHT_TORIGHT: TVHITTESTINFO_FLAGS = TVHITTESTINFO_FLAGS(1024u32); impl ::core::convert::From<u32> for TVHITTESTINFO_FLAGS { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TVHITTESTINFO_FLAGS { type Abi = Self; } impl ::core::ops::BitOr for TVHITTESTINFO_FLAGS { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for TVHITTESTINFO_FLAGS { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for TVHITTESTINFO_FLAGS { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for TVHITTESTINFO_FLAGS { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for TVHITTESTINFO_FLAGS { 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 TVINSERTSTRUCTA { pub hParent: HTREEITEM, pub hInsertAfter: HTREEITEM, pub Anonymous: TVINSERTSTRUCTA_0, } #[cfg(feature = "Win32_Foundation")] impl TVINSERTSTRUCTA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TVINSERTSTRUCTA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TVINSERTSTRUCTA { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TVINSERTSTRUCTA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TVINSERTSTRUCTA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub union TVINSERTSTRUCTA_0 { pub itemex: TVITEMEXA, pub item: TVITEMA, } #[cfg(feature = "Win32_Foundation")] impl TVINSERTSTRUCTA_0 {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TVINSERTSTRUCTA_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TVINSERTSTRUCTA_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TVINSERTSTRUCTA_0 {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TVINSERTSTRUCTA_0 { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TVINSERTSTRUCTW { pub hParent: HTREEITEM, pub hInsertAfter: HTREEITEM, pub Anonymous: TVINSERTSTRUCTW_0, } #[cfg(feature = "Win32_Foundation")] impl TVINSERTSTRUCTW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TVINSERTSTRUCTW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TVINSERTSTRUCTW { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TVINSERTSTRUCTW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TVINSERTSTRUCTW { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub union TVINSERTSTRUCTW_0 { pub itemex: TVITEMEXW, pub item: TVITEMW, } #[cfg(feature = "Win32_Foundation")] impl TVINSERTSTRUCTW_0 {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TVINSERTSTRUCTW_0 { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TVINSERTSTRUCTW_0 { fn eq(&self, _other: &Self) -> bool { unimplemented!() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TVINSERTSTRUCTW_0 {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TVINSERTSTRUCTW_0 { type Abi = Self; } pub const TVIS_BOLD: u32 = 16u32; pub const TVIS_CUT: u32 = 4u32; pub const TVIS_DROPHILITED: u32 = 8u32; pub const TVIS_EXPANDED: u32 = 32u32; pub const TVIS_EXPANDEDONCE: u32 = 64u32; pub const TVIS_EXPANDPARTIAL: u32 = 128u32; pub const TVIS_EX_ALL: u32 = 2u32; pub const TVIS_EX_DISABLED: u32 = 2u32; pub const TVIS_EX_FLAT: u32 = 1u32; pub const TVIS_OVERLAYMASK: u32 = 3840u32; pub const TVIS_SELECTED: u32 = 2u32; pub const TVIS_STATEIMAGEMASK: u32 = 61440u32; pub const TVIS_USERMASK: u32 = 61440u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TVITEMA { pub mask: TVITEM_MASK, pub hItem: HTREEITEM, pub state: u32, pub stateMask: u32, pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, pub iImage: i32, pub iSelectedImage: i32, pub cChildren: TVITEMEXW_CHILDREN, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl TVITEMA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TVITEMA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TVITEMA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TVITEMA") .field("mask", &self.mask) .field("hItem", &self.hItem) .field("state", &self.state) .field("stateMask", &self.stateMask) .field("pszText", &self.pszText) .field("cchTextMax", &self.cchTextMax) .field("iImage", &self.iImage) .field("iSelectedImage", &self.iSelectedImage) .field("cChildren", &self.cChildren) .field("lParam", &self.lParam) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TVITEMA { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.hItem == other.hItem && self.state == other.state && self.stateMask == other.stateMask && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.iSelectedImage == other.iSelectedImage && self.cChildren == other.cChildren && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TVITEMA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TVITEMA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TVITEMEXA { pub mask: TVITEM_MASK, pub hItem: HTREEITEM, pub state: u32, pub stateMask: u32, pub pszText: super::super::Foundation::PSTR, pub cchTextMax: i32, pub iImage: i32, pub iSelectedImage: i32, pub cChildren: TVITEMEXW_CHILDREN, pub lParam: super::super::Foundation::LPARAM, pub iIntegral: i32, pub uStateEx: u32, pub hwnd: super::super::Foundation::HWND, pub iExpandedImage: i32, pub iReserved: i32, } #[cfg(feature = "Win32_Foundation")] impl TVITEMEXA {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TVITEMEXA { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TVITEMEXA { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TVITEMEXA") .field("mask", &self.mask) .field("hItem", &self.hItem) .field("state", &self.state) .field("stateMask", &self.stateMask) .field("pszText", &self.pszText) .field("cchTextMax", &self.cchTextMax) .field("iImage", &self.iImage) .field("iSelectedImage", &self.iSelectedImage) .field("cChildren", &self.cChildren) .field("lParam", &self.lParam) .field("iIntegral", &self.iIntegral) .field("uStateEx", &self.uStateEx) .field("hwnd", &self.hwnd) .field("iExpandedImage", &self.iExpandedImage) .field("iReserved", &self.iReserved) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TVITEMEXA { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.hItem == other.hItem && self.state == other.state && self.stateMask == other.stateMask && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.iSelectedImage == other.iSelectedImage && self.cChildren == other.cChildren && self.lParam == other.lParam && self.iIntegral == other.iIntegral && self.uStateEx == other.uStateEx && self.hwnd == other.hwnd && self.iExpandedImage == other.iExpandedImage && self.iReserved == other.iReserved } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TVITEMEXA {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TVITEMEXA { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TVITEMEXW { pub mask: TVITEM_MASK, pub hItem: HTREEITEM, pub state: u32, pub stateMask: u32, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub iImage: i32, pub iSelectedImage: i32, pub cChildren: TVITEMEXW_CHILDREN, pub lParam: super::super::Foundation::LPARAM, pub iIntegral: i32, pub uStateEx: u32, pub hwnd: super::super::Foundation::HWND, pub iExpandedImage: i32, pub iReserved: i32, } #[cfg(feature = "Win32_Foundation")] impl TVITEMEXW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TVITEMEXW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TVITEMEXW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TVITEMEXW") .field("mask", &self.mask) .field("hItem", &self.hItem) .field("state", &self.state) .field("stateMask", &self.stateMask) .field("pszText", &self.pszText) .field("cchTextMax", &self.cchTextMax) .field("iImage", &self.iImage) .field("iSelectedImage", &self.iSelectedImage) .field("cChildren", &self.cChildren) .field("lParam", &self.lParam) .field("iIntegral", &self.iIntegral) .field("uStateEx", &self.uStateEx) .field("hwnd", &self.hwnd) .field("iExpandedImage", &self.iExpandedImage) .field("iReserved", &self.iReserved) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TVITEMEXW { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.hItem == other.hItem && self.state == other.state && self.stateMask == other.stateMask && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.iSelectedImage == other.iSelectedImage && self.cChildren == other.cChildren && self.lParam == other.lParam && self.iIntegral == other.iIntegral && self.uStateEx == other.uStateEx && self.hwnd == other.hwnd && self.iExpandedImage == other.iExpandedImage && self.iReserved == other.iReserved } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TVITEMEXW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TVITEMEXW { 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 TVITEMEXW_CHILDREN(pub i32); pub const I_ZERO: TVITEMEXW_CHILDREN = TVITEMEXW_CHILDREN(0i32); pub const I_ONE_OR_MORE: TVITEMEXW_CHILDREN = TVITEMEXW_CHILDREN(1i32); pub const I_CHILDRENCALLBACK: TVITEMEXW_CHILDREN = TVITEMEXW_CHILDREN(-1i32); pub const I_CHILDRENAUTO: TVITEMEXW_CHILDREN = TVITEMEXW_CHILDREN(-2i32); impl ::core::convert::From<i32> for TVITEMEXW_CHILDREN { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TVITEMEXW_CHILDREN { 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 TVITEMPART(pub i32); pub const TVGIPR_BUTTON: TVITEMPART = TVITEMPART(1i32); impl ::core::convert::From<i32> for TVITEMPART { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TVITEMPART { type Abi = Self; } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TVITEMW { pub mask: TVITEM_MASK, pub hItem: HTREEITEM, pub state: u32, pub stateMask: u32, pub pszText: super::super::Foundation::PWSTR, pub cchTextMax: i32, pub iImage: i32, pub iSelectedImage: i32, pub cChildren: TVITEMEXW_CHILDREN, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl TVITEMW {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TVITEMW { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TVITEMW { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TVITEMW") .field("mask", &self.mask) .field("hItem", &self.hItem) .field("state", &self.state) .field("stateMask", &self.stateMask) .field("pszText", &self.pszText) .field("cchTextMax", &self.cchTextMax) .field("iImage", &self.iImage) .field("iSelectedImage", &self.iSelectedImage) .field("cChildren", &self.cChildren) .field("lParam", &self.lParam) .finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TVITEMW { fn eq(&self, other: &Self) -> bool { self.mask == other.mask && self.hItem == other.hItem && self.state == other.state && self.stateMask == other.stateMask && self.pszText == other.pszText && self.cchTextMax == other.cchTextMax && self.iImage == other.iImage && self.iSelectedImage == other.iSelectedImage && self.cChildren == other.cChildren && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TVITEMW {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TVITEMW { 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 TVITEM_MASK(pub u32); pub const TVIF_CHILDREN: TVITEM_MASK = TVITEM_MASK(64u32); pub const TVIF_DI_SETITEM: TVITEM_MASK = TVITEM_MASK(4096u32); pub const TVIF_HANDLE: TVITEM_MASK = TVITEM_MASK(16u32); pub const TVIF_IMAGE: TVITEM_MASK = TVITEM_MASK(2u32); pub const TVIF_PARAM: TVITEM_MASK = TVITEM_MASK(4u32); pub const TVIF_SELECTEDIMAGE: TVITEM_MASK = TVITEM_MASK(32u32); pub const TVIF_STATE: TVITEM_MASK = TVITEM_MASK(8u32); pub const TVIF_TEXT: TVITEM_MASK = TVITEM_MASK(1u32); pub const TVIF_EXPANDEDIMAGE: TVITEM_MASK = TVITEM_MASK(512u32); pub const TVIF_INTEGRAL: TVITEM_MASK = TVITEM_MASK(128u32); pub const TVIF_STATEEX: TVITEM_MASK = TVITEM_MASK(256u32); impl ::core::convert::From<u32> for TVITEM_MASK { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for TVITEM_MASK { type Abi = Self; } impl ::core::ops::BitOr for TVITEM_MASK { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for TVITEM_MASK { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for TVITEM_MASK { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for TVITEM_MASK { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for TVITEM_MASK { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } pub const TVI_FIRST: HTREEITEM = HTREEITEM(-65535i32 as _); pub const TVI_LAST: HTREEITEM = HTREEITEM(-65534i32 as _); pub const TVI_ROOT: HTREEITEM = HTREEITEM(-65536i32 as _); pub const TVI_SORT: HTREEITEM = HTREEITEM(-65533i32 as _); pub const TVM_CREATEDRAGIMAGE: u32 = 4370u32; pub const TVM_DELETEITEM: u32 = 4353u32; pub const TVM_EDITLABEL: u32 = 4417u32; pub const TVM_EDITLABELA: u32 = 4366u32; pub const TVM_EDITLABELW: u32 = 4417u32; pub const TVM_ENDEDITLABELNOW: u32 = 4374u32; pub const TVM_ENSUREVISIBLE: u32 = 4372u32; pub const TVM_EXPAND: u32 = 4354u32; pub const TVM_GETBKCOLOR: u32 = 4383u32; pub const TVM_GETCOUNT: u32 = 4357u32; pub const TVM_GETEDITCONTROL: u32 = 4367u32; pub const TVM_GETEXTENDEDSTYLE: u32 = 4397u32; pub const TVM_GETIMAGELIST: u32 = 4360u32; pub const TVM_GETINDENT: u32 = 4358u32; pub const TVM_GETINSERTMARKCOLOR: u32 = 4390u32; pub const TVM_GETISEARCHSTRING: u32 = 4416u32; pub const TVM_GETISEARCHSTRINGA: u32 = 4375u32; pub const TVM_GETISEARCHSTRINGW: u32 = 4416u32; pub const TVM_GETITEM: u32 = 4414u32; pub const TVM_GETITEMA: u32 = 4364u32; pub const TVM_GETITEMHEIGHT: u32 = 4380u32; pub const TVM_GETITEMPARTRECT: u32 = 4424u32; pub const TVM_GETITEMRECT: u32 = 4356u32; pub const TVM_GETITEMSTATE: u32 = 4391u32; pub const TVM_GETITEMW: u32 = 4414u32; pub const TVM_GETLINECOLOR: u32 = 4393u32; pub const TVM_GETNEXTITEM: u32 = 4362u32; pub const TVM_GETSCROLLTIME: u32 = 4386u32; pub const TVM_GETSELECTEDCOUNT: u32 = 4422u32; pub const TVM_GETTEXTCOLOR: u32 = 4384u32; pub const TVM_GETTOOLTIPS: u32 = 4377u32; pub const TVM_GETUNICODEFORMAT: u32 = 8198u32; pub const TVM_GETVISIBLECOUNT: u32 = 4368u32; pub const TVM_HITTEST: u32 = 4369u32; pub const TVM_INSERTITEM: u32 = 4402u32; pub const TVM_INSERTITEMA: u32 = 4352u32; pub const TVM_INSERTITEMW: u32 = 4402u32; pub const TVM_MAPACCIDTOHTREEITEM: u32 = 4394u32; pub const TVM_MAPHTREEITEMTOACCID: u32 = 4395u32; pub const TVM_SELECTITEM: u32 = 4363u32; pub const TVM_SETAUTOSCROLLINFO: u32 = 4411u32; pub const TVM_SETBKCOLOR: u32 = 4381u32; pub const TVM_SETBORDER: u32 = 4387u32; pub const TVM_SETEXTENDEDSTYLE: u32 = 4396u32; pub const TVM_SETHOT: u32 = 4410u32; pub const TVM_SETIMAGELIST: u32 = 4361u32; pub const TVM_SETINDENT: u32 = 4359u32; pub const TVM_SETINSERTMARK: u32 = 4378u32; pub const TVM_SETINSERTMARKCOLOR: u32 = 4389u32; pub const TVM_SETITEM: u32 = 4415u32; pub const TVM_SETITEMA: u32 = 4365u32; pub const TVM_SETITEMHEIGHT: u32 = 4379u32; pub const TVM_SETITEMW: u32 = 4415u32; pub const TVM_SETLINECOLOR: u32 = 4392u32; pub const TVM_SETSCROLLTIME: u32 = 4385u32; pub const TVM_SETTEXTCOLOR: u32 = 4382u32; pub const TVM_SETTOOLTIPS: u32 = 4376u32; pub const TVM_SETUNICODEFORMAT: u32 = 8197u32; pub const TVM_SHOWINFOTIP: u32 = 4423u32; pub const TVM_SORTCHILDREN: u32 = 4371u32; pub const TVM_SORTCHILDRENCB: u32 = 4373u32; pub const TVNRET_DEFAULT: u32 = 0u32; pub const TVNRET_SKIPNEW: u32 = 2u32; pub const TVNRET_SKIPOLD: u32 = 1u32; pub const TVSBF_XBORDER: u32 = 1u32; pub const TVSBF_YBORDER: u32 = 2u32; pub const TVSIL_NORMAL: u32 = 0u32; pub const TVSIL_STATE: u32 = 2u32; pub const TVSI_NOSINGLEEXPAND: u32 = 32768u32; #[derive(:: core :: clone :: Clone)] #[repr(C)] #[cfg(feature = "Win32_Foundation")] pub struct TVSORTCB { pub hParent: HTREEITEM, pub lpfnCompare: ::core::option::Option<PFNTVCOMPARE>, pub lParam: super::super::Foundation::LPARAM, } #[cfg(feature = "Win32_Foundation")] impl TVSORTCB {} #[cfg(feature = "Win32_Foundation")] impl ::core::default::Default for TVSORTCB { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } #[cfg(feature = "Win32_Foundation")] impl ::core::fmt::Debug for TVSORTCB { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("TVSORTCB").field("hParent", &self.hParent).field("lParam", &self.lParam).finish() } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::PartialEq for TVSORTCB { fn eq(&self, other: &Self) -> bool { self.hParent == other.hParent && self.lpfnCompare.map(|f| f as usize) == other.lpfnCompare.map(|f| f as usize) && self.lParam == other.lParam } } #[cfg(feature = "Win32_Foundation")] impl ::core::cmp::Eq for TVSORTCB {} #[cfg(feature = "Win32_Foundation")] unsafe impl ::windows::core::Abi for TVSORTCB { type Abi = ::core::mem::ManuallyDrop<Self>; } pub const TVS_CHECKBOXES: u32 = 256u32; pub const TVS_DISABLEDRAGDROP: u32 = 16u32; pub const TVS_EDITLABELS: u32 = 8u32; pub const TVS_EX_AUTOHSCROLL: u32 = 32u32; pub const TVS_EX_DIMMEDCHECKBOXES: u32 = 512u32; pub const TVS_EX_DOUBLEBUFFER: u32 = 4u32; pub const TVS_EX_DRAWIMAGEASYNC: u32 = 1024u32; pub const TVS_EX_EXCLUSIONCHECKBOXES: u32 = 256u32; pub const TVS_EX_FADEINOUTEXPANDOS: u32 = 64u32; pub const TVS_EX_MULTISELECT: u32 = 2u32; pub const TVS_EX_NOINDENTSTATE: u32 = 8u32; pub const TVS_EX_NOSINGLECOLLAPSE: u32 = 1u32; pub const TVS_EX_PARTIALCHECKBOXES: u32 = 128u32; pub const TVS_EX_RICHTOOLTIP: u32 = 16u32; pub const TVS_FULLROWSELECT: u32 = 4096u32; pub const TVS_HASBUTTONS: u32 = 1u32; pub const TVS_HASLINES: u32 = 2u32; pub const TVS_INFOTIP: u32 = 2048u32; pub const TVS_LINESATROOT: u32 = 4u32; pub const TVS_NOHSCROLL: u32 = 32768u32; pub const TVS_NONEVENHEIGHT: u32 = 16384u32; pub const TVS_NOSCROLL: u32 = 8192u32; pub const TVS_NOTOOLTIPS: u32 = 128u32; pub const TVS_RTLREADING: u32 = 64u32; pub const TVS_SHOWSELALWAYS: u32 = 32u32; pub const TVS_SINGLEEXPAND: u32 = 1024u32; pub const TVS_TRACKSELECT: u32 = 512u32; pub const TV_FIRST: u32 = 4352u32; #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn TaskDialog<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param1: ::windows::core::IntoParam<'a, super::super::Foundation::HINSTANCE>, Param2: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param4: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>, Param6: ::windows::core::IntoParam<'a, super::super::Foundation::PWSTR>>( hwndowner: Param0, hinstance: Param1, pszwindowtitle: Param2, pszmaininstruction: Param3, pszcontent: Param4, dwcommonbuttons: TASKDIALOG_COMMON_BUTTON_FLAGS, pszicon: Param6, ) -> ::windows::core::Result<i32> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn TaskDialog(hwndowner: super::super::Foundation::HWND, hinstance: super::super::Foundation::HINSTANCE, pszwindowtitle: super::super::Foundation::PWSTR, pszmaininstruction: super::super::Foundation::PWSTR, pszcontent: super::super::Foundation::PWSTR, dwcommonbuttons: TASKDIALOG_COMMON_BUTTON_FLAGS, pszicon: super::super::Foundation::PWSTR, pnbutton: *mut i32) -> ::windows::core::HRESULT; } let mut result__: <i32 as ::windows::core::Abi>::Abi = ::core::mem::zeroed(); TaskDialog(hwndowner.into_param().abi(), hinstance.into_param().abi(), pszwindowtitle.into_param().abi(), pszmaininstruction.into_param().abi(), pszcontent.into_param().abi(), ::core::mem::transmute(dwcommonbuttons), pszicon.into_param().abi(), &mut result__).from_abi::<i32>(result__) } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(all(feature = "Win32_Foundation", feature = "Win32_UI_WindowsAndMessaging"))] #[inline] pub unsafe fn TaskDialogIndirect(ptaskconfig: *const TASKDIALOGCONFIG, pnbutton: *mut i32, pnradiobutton: *mut i32, pfverificationflagchecked: *mut super::super::Foundation::BOOL) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn TaskDialogIndirect(ptaskconfig: *const ::core::mem::ManuallyDrop<TASKDIALOGCONFIG>, pnbutton: *mut i32, pnradiobutton: *mut i32, pfverificationflagchecked: *mut super::super::Foundation::BOOL) -> ::windows::core::HRESULT; } TaskDialogIndirect(::core::mem::transmute(ptaskconfig), ::core::mem::transmute(pnbutton), ::core::mem::transmute(pnradiobutton), ::core::mem::transmute(pfverificationflagchecked)).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct UDACCEL { pub nSec: u32, pub nInc: u32, } impl UDACCEL {} impl ::core::default::Default for UDACCEL { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for UDACCEL { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("UDACCEL").field("nSec", &self.nSec).field("nInc", &self.nInc).finish() } } impl ::core::cmp::PartialEq for UDACCEL { fn eq(&self, other: &Self) -> bool { self.nSec == other.nSec && self.nInc == other.nInc } } impl ::core::cmp::Eq for UDACCEL {} unsafe impl ::windows::core::Abi for UDACCEL { type Abi = Self; } pub const UDM_GETACCEL: u32 = 1132u32; pub const UDM_GETBASE: u32 = 1134u32; pub const UDM_GETBUDDY: u32 = 1130u32; pub const UDM_GETPOS: u32 = 1128u32; pub const UDM_GETPOS32: u32 = 1138u32; pub const UDM_GETRANGE: u32 = 1126u32; pub const UDM_GETRANGE32: u32 = 1136u32; pub const UDM_GETUNICODEFORMAT: u32 = 8198u32; pub const UDM_SETACCEL: u32 = 1131u32; pub const UDM_SETBASE: u32 = 1133u32; pub const UDM_SETBUDDY: u32 = 1129u32; pub const UDM_SETPOS: u32 = 1127u32; pub const UDM_SETPOS32: u32 = 1137u32; pub const UDM_SETRANGE: u32 = 1125u32; pub const UDM_SETRANGE32: u32 = 1135u32; pub const UDM_SETUNICODEFORMAT: u32 = 8197u32; pub const UDS_ALIGNLEFT: u32 = 8u32; pub const UDS_ALIGNRIGHT: u32 = 4u32; pub const UDS_ARROWKEYS: u32 = 32u32; pub const UDS_AUTOBUDDY: u32 = 16u32; pub const UDS_HORZ: u32 = 64u32; pub const UDS_HOTTRACK: u32 = 256u32; pub const UDS_NOTHOUSANDS: u32 = 128u32; pub const UDS_SETBUDDYINT: u32 = 2u32; pub const UDS_WRAP: u32 = 1u32; pub const UD_MAXVAL: u32 = 32767u32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct USAGE_PROPERTIES { pub level: u16, pub page: u16, pub usage: u16, pub logicalMinimum: i32, pub logicalMaximum: i32, pub unit: u16, pub exponent: u16, pub count: u8, pub physicalMinimum: i32, pub physicalMaximum: i32, } impl USAGE_PROPERTIES {} impl ::core::default::Default for USAGE_PROPERTIES { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for USAGE_PROPERTIES { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("USAGE_PROPERTIES") .field("level", &self.level) .field("page", &self.page) .field("usage", &self.usage) .field("logicalMinimum", &self.logicalMinimum) .field("logicalMaximum", &self.logicalMaximum) .field("unit", &self.unit) .field("exponent", &self.exponent) .field("count", &self.count) .field("physicalMinimum", &self.physicalMinimum) .field("physicalMaximum", &self.physicalMaximum) .finish() } } impl ::core::cmp::PartialEq for USAGE_PROPERTIES { fn eq(&self, other: &Self) -> bool { self.level == other.level && self.page == other.page && self.usage == other.usage && self.logicalMinimum == other.logicalMinimum && self.logicalMaximum == other.logicalMaximum && self.unit == other.unit && self.exponent == other.exponent && self.count == other.count && self.physicalMinimum == other.physicalMinimum && self.physicalMaximum == other.physicalMaximum } } impl ::core::cmp::Eq for USAGE_PROPERTIES {} unsafe impl ::windows::core::Abi for USAGE_PROPERTIES { type Abi = Self; } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn UninitializeFlatSB<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>>(param0: Param0) -> ::windows::core::Result<()> { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn UninitializeFlatSB(param0: super::super::Foundation::HWND) -> ::windows::core::HRESULT; } UninitializeFlatSB(param0.into_param().abi()).ok() } #[cfg(not(windows))] unimplemented!("Unsupported target OS"); } #[cfg(feature = "Win32_Foundation")] #[inline] pub unsafe fn UpdatePanningFeedback<'a, Param0: ::windows::core::IntoParam<'a, super::super::Foundation::HWND>, Param3: ::windows::core::IntoParam<'a, super::super::Foundation::BOOL>>(hwnd: Param0, ltotaloverpanoffsetx: i32, ltotaloverpanoffsety: i32, fininertia: Param3) -> super::super::Foundation::BOOL { #[cfg(windows)] { #[link(name = "windows")] extern "system" { fn UpdatePanningFeedback(hwnd: super::super::Foundation::HWND, ltotaloverpanoffsetx: i32, ltotaloverpanoffsety: i32, fininertia: super::super::Foundation::BOOL) -> super::super::Foundation::BOOL; } ::core::mem::transmute(UpdatePanningFeedback(hwnd.into_param().abi(), ::core::mem::transmute(ltotaloverpanoffsetx), ::core::mem::transmute(ltotaloverpanoffsety), fininertia.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 VALIGN(pub i32); pub const VA_TOP: VALIGN = VALIGN(0i32); pub const VA_CENTER: VALIGN = VALIGN(1i32); pub const VA_BOTTOM: VALIGN = VALIGN(2i32); impl ::core::convert::From<i32> for VALIGN { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for VALIGN { type Abi = Self; } pub const VIEW_DETAILS: u32 = 3u32; pub const VIEW_LARGEICONS: u32 = 0u32; pub const VIEW_LIST: u32 = 2u32; pub const VIEW_NETCONNECT: u32 = 9u32; pub const VIEW_NETDISCONNECT: u32 = 10u32; pub const VIEW_NEWFOLDER: u32 = 11u32; pub const VIEW_PARENTFOLDER: u32 = 8u32; pub const VIEW_SMALLICONS: u32 = 1u32; pub const VIEW_SORTDATE: u32 = 6u32; pub const VIEW_SORTNAME: u32 = 4u32; pub const VIEW_SORTSIZE: u32 = 5u32; pub const VIEW_SORTTYPE: u32 = 7u32; pub const VIEW_VIEWMENU: u32 = 12u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct WINDOWTHEMEATTRIBUTETYPE(pub i32); pub const WTA_NONCLIENT: WINDOWTHEMEATTRIBUTETYPE = WINDOWTHEMEATTRIBUTETYPE(1i32); impl ::core::convert::From<i32> for WINDOWTHEMEATTRIBUTETYPE { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for WINDOWTHEMEATTRIBUTETYPE { type Abi = Self; } pub const WIZ_BODYCX: u32 = 184u32; pub const WIZ_BODYX: u32 = 92u32; pub const WIZ_CXBMP: u32 = 80u32; pub const WIZ_CXDLG: u32 = 276u32; pub const WIZ_CYDLG: u32 = 140u32; pub const WM_CTLCOLOR: u32 = 25u32; pub const WM_MOUSEHOVER: u32 = 673u32; pub const WM_MOUSELEAVE: u32 = 675u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct WORD_BREAK_ACTION(pub u32); pub const WB_CLASSIFY: WORD_BREAK_ACTION = WORD_BREAK_ACTION(3u32); pub const WB_ISDELIMITER: WORD_BREAK_ACTION = WORD_BREAK_ACTION(2u32); pub const WB_LEFT: WORD_BREAK_ACTION = WORD_BREAK_ACTION(0u32); pub const WB_LEFTBREAK: WORD_BREAK_ACTION = WORD_BREAK_ACTION(6u32); pub const WB_MOVEWORDLEFT: WORD_BREAK_ACTION = WORD_BREAK_ACTION(4u32); pub const WB_MOVEWORDRIGHT: WORD_BREAK_ACTION = WORD_BREAK_ACTION(5u32); pub const WB_RIGHT: WORD_BREAK_ACTION = WORD_BREAK_ACTION(1u32); pub const WB_RIGHTBREAK: WORD_BREAK_ACTION = WORD_BREAK_ACTION(7u32); impl ::core::convert::From<u32> for WORD_BREAK_ACTION { fn from(value: u32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for WORD_BREAK_ACTION { type Abi = Self; } impl ::core::ops::BitOr for WORD_BREAK_ACTION { type Output = Self; fn bitor(self, rhs: Self) -> Self { Self(self.0 | rhs.0) } } impl ::core::ops::BitAnd for WORD_BREAK_ACTION { type Output = Self; fn bitand(self, rhs: Self) -> Self { Self(self.0 & rhs.0) } } impl ::core::ops::BitOrAssign for WORD_BREAK_ACTION { fn bitor_assign(&mut self, rhs: Self) { self.0.bitor_assign(rhs.0) } } impl ::core::ops::BitAndAssign for WORD_BREAK_ACTION { fn bitand_assign(&mut self, rhs: Self) { self.0.bitand_assign(rhs.0) } } impl ::core::ops::Not for WORD_BREAK_ACTION { type Output = Self; fn not(self) -> Self { Self(self.0.not()) } } #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct WSB_PROP(pub i32); pub const WSB_PROP_CXHSCROLL: WSB_PROP = WSB_PROP(2i32); pub const WSB_PROP_CXHTHUMB: WSB_PROP = WSB_PROP(16i32); pub const WSB_PROP_CXVSCROLL: WSB_PROP = WSB_PROP(8i32); pub const WSB_PROP_CYHSCROLL: WSB_PROP = WSB_PROP(4i32); pub const WSB_PROP_CYVSCROLL: WSB_PROP = WSB_PROP(1i32); pub const WSB_PROP_CYVTHUMB: WSB_PROP = WSB_PROP(32i32); pub const WSB_PROP_HBKGCOLOR: WSB_PROP = WSB_PROP(128i32); pub const WSB_PROP_HSTYLE: WSB_PROP = WSB_PROP(512i32); pub const WSB_PROP_PALETTE: WSB_PROP = WSB_PROP(2048i32); pub const WSB_PROP_VBKGCOLOR: WSB_PROP = WSB_PROP(64i32); pub const WSB_PROP_VSTYLE: WSB_PROP = WSB_PROP(256i32); pub const WSB_PROP_WINSTYLE: WSB_PROP = WSB_PROP(1024i32); impl ::core::convert::From<i32> for WSB_PROP { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for WSB_PROP { type Abi = Self; } pub const WSB_PROP_MASK: i32 = 4095i32; #[derive(:: core :: clone :: Clone, :: core :: marker :: Copy)] #[repr(C)] pub struct WTA_OPTIONS { pub dwFlags: u32, pub dwMask: u32, } impl WTA_OPTIONS {} impl ::core::default::Default for WTA_OPTIONS { fn default() -> Self { unsafe { ::core::mem::zeroed() } } } impl ::core::fmt::Debug for WTA_OPTIONS { fn fmt(&self, fmt: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { fmt.debug_struct("WTA_OPTIONS").field("dwFlags", &self.dwFlags).field("dwMask", &self.dwMask).finish() } } impl ::core::cmp::PartialEq for WTA_OPTIONS { fn eq(&self, other: &Self) -> bool { self.dwFlags == other.dwFlags && self.dwMask == other.dwMask } } impl ::core::cmp::Eq for WTA_OPTIONS {} unsafe impl ::windows::core::Abi for WTA_OPTIONS { type Abi = Self; } pub const WTNCA_NODRAWCAPTION: u32 = 1u32; pub const WTNCA_NODRAWICON: u32 = 2u32; pub const WTNCA_NOMIRRORHELP: u32 = 8u32; pub const WTNCA_NOSYSMENU: u32 = 4u32; #[derive(:: core :: cmp :: PartialEq, :: core :: cmp :: Eq, :: core :: marker :: Copy, :: core :: clone :: Clone, :: core :: default :: Default, :: core :: fmt :: Debug)] #[repr(transparent)] pub struct _LI_METRIC(pub i32); pub const LIM_SMALL: _LI_METRIC = _LI_METRIC(0i32); pub const LIM_LARGE: _LI_METRIC = _LI_METRIC(1i32); impl ::core::convert::From<i32> for _LI_METRIC { fn from(value: i32) -> Self { Self(value) } } unsafe impl ::windows::core::Abi for _LI_METRIC { type Abi = Self; }
extern crate json_typegen_shared; use std::os::raw::c_char; use std::ffi::CStr; use std::ffi::CString; fn my_string_safe(i: *mut c_char) -> String { unsafe { CStr::from_ptr(i).to_string_lossy().into_owned() } } #[no_mangle] pub fn uppercase(i: *mut c_char) -> *mut c_char { let input = my_string_safe(i); let output = input.to_uppercase(); CString::new(output.as_str()).unwrap().into_raw() } #[no_mangle] pub fn codegen(i: *mut c_char) -> *mut c_char { let input = my_string_safe(i); let output = json_typegen_shared::codegen_from_macro(&input); match output { Ok(code) => CString::new(code.as_str()).unwrap().into_raw(), Err(err) => { let err_as_string: String = format!("{}", err); CString::new(err_as_string).unwrap().into_raw() } } } fn main() {}
use monitor::file; use os; use std::io; use std::io::Error; use std::process::{Command, Child}; use serde_json; type CmdArgs = Vec<Vec<String>>; type CmdEnv = Vec<Vec<String>>; #[derive(Debug, Clone, Deserialize, Serialize)] pub struct ProcessData { pub name: String, pub cmd: String, #[serde(default)] pub monitor_pid: i32, #[serde(default)] pub child_pid: i32, #[serde(default)] pub args: CmdArgs, #[serde(default)] pub env: CmdEnv, #[serde(default)] pub retries: i32, #[serde(default)] pub max_retries: i32, } pub struct Process { pub data: ProcessData, } impl Process { pub fn spawn(&mut self) -> Result<Child, Error> { let mut command = Command::new(self.data.cmd.clone()); let args = self.data.args.clone(); let env = self.data.env.clone(); build_args(&mut command, args); build_env_vars(&mut command, env); match command.spawn() { Ok(child) => { let child_pid = child.id() as i32; let current_pid = os::current_pid(); self.monitor_pid(current_pid.clone()); self.child_pid(child_pid.clone()); self.save_state()?; println!("Started child process with PID: {}", child.id().clone()); Ok(child) }, Err(err) => Err(err), } } pub fn kill(&self) -> os::Result<()> { os::kill(self.data.monitor_pid) } pub fn monitor_pid(&mut self, pid: i32) { self.data.monitor_pid = pid; } pub fn child_pid(&mut self, pid: i32) { self.data.child_pid = pid; } pub fn increment_retries(&mut self) { self.data.retries = self.data.retries + 1; } pub fn should_retry(&self) -> bool { self.data.retries <= self.data.max_retries } pub fn is_active(&self) -> bool { match os::ps(self.data.monitor_pid) { Some(_) => true, None => false } } pub fn save_state(&self) -> io::Result<()> { println!("saving state"); file::save(file::path_from_name(self.data.name.clone()), &self) } pub fn serialize(&self) -> serde_json::Result<String> { serde_json::to_string(&self.data.clone()) } } impl From<String> for Process { fn from(data: String) -> Process { Process::from(data.as_str()) } } impl<'a> From<&'a str> for Process { fn from(data: &'a str) -> Process { let process_data: ProcessData = serde_json::from_str(&data).unwrap(); Process{ data: process_data, } } } fn build_args(cmd: &mut Command, args: CmdArgs) { for a in args { cmd.args(&a); } } fn build_env_vars(cmd: &mut Command, vars: CmdEnv) { println!("{:?}", vars); for v in vars { let key = v[0].clone(); let value = v[1].clone(); cmd.env(key, value); } }
use libc; extern "C" { #[no_mangle] fn __assert_rtn( _: *const libc::c_char, _: *const libc::c_char, _: libc::c_int, _: *const libc::c_char, ) -> !; #[no_mangle] fn memcmp(_: *const libc::c_void, _: *const libc::c_void, _: libc::c_ulong) -> libc::c_int; #[no_mangle] fn memcpy( __dst: *mut libc::c_void, __src: *const libc::c_void, __n: size_t, ) -> *mut libc::c_void; #[no_mangle] fn cbor_value_advance_fixed(it: *mut CborValue_0) -> CborError_0; #[no_mangle] fn cbor_value_enter_container( it: *const CborValue_0, recursed: *mut CborValue_0, ) -> CborError_0; #[no_mangle] fn cbor_value_leave_container( it: *mut CborValue_0, recursed: *const CborValue_0, ) -> CborError_0; #[no_mangle] fn _cbor_value_decode_int64_internal(value: *const CborValue_0) -> uint64_t; #[no_mangle] fn cbor_value_skip_tag(it: *mut CborValue_0) -> CborError_0; #[no_mangle] fn cbor_value_get_half_float( value: *const CborValue_0, result: *mut libc::c_void, ) -> CborError_0; #[no_mangle] fn ldexp(_: libc::c_double, _: libc::c_int) -> libc::c_double; #[no_mangle] fn __fpclassifyl(_: libc::c_double) -> libc::c_int; #[no_mangle] fn __fpclassifyd(_: libc::c_double) -> libc::c_int; #[no_mangle] fn __fpclassifyf(_: libc::c_float) -> libc::c_int; #[no_mangle] fn _cbor_value_get_string_chunk( value: *const CborValue_0, bufferptr: *mut *const libc::c_void, len: *mut size_t, next: *mut CborValue_0, ) -> CborError_0; #[no_mangle] fn _cbor_value_extract_number( ptr: *mut *const uint8_t, end: *const uint8_t, len: *mut uint64_t, ) -> CborError_0; #[no_mangle] fn _cbor_value_prepare_string_iteration(it: *mut CborValue_0) -> CborError_0; } pub type ptrdiff_t = libc::c_long; pub type size_t = libc::c_ulong; pub type uint8_t = libc::c_uchar; pub type uint16_t = libc::c_ushort; pub type uint32_t = libc::c_uint; pub type uint64_t = libc::c_ulonglong; /* *************************************************************************** ** ** Copyright (C) 2017 Intel Corporation ** ** 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. ** ****************************************************************************/ pub type CborType = libc::c_uint; /* equivalent to the break byte, so it will never be used */ pub const CborInvalidType: CborType = 255; pub const CborDoubleType: CborType = 251; pub const CborFloatType: CborType = 250; pub const CborHalfFloatType: CborType = 249; pub const CborUndefinedType: CborType = 247; pub const CborNullType: CborType = 246; pub const CborBooleanType: CborType = 245; pub const CborSimpleType: CborType = 224; pub const CborTagType: CborType = 192; pub const CborMapType: CborType = 160; pub const CborArrayType: CborType = 128; pub const CborTextStringType: CborType = 96; pub const CborByteStringType: CborType = 64; pub const CborIntegerType: CborType = 0; pub type CborType_0 = CborType; pub type CborTag = uint64_t; /* #define the constants so we can check with #ifdef */ /* Error API */ pub type CborError = libc::c_int; /* INT_MAX on two's complement machines */ pub const CborErrorInternalError: CborError = 2147483647; pub const CborErrorOutOfMemory: CborError = -2147483648; pub const CborErrorJsonNotImplemented: CborError = 1282; pub const CborErrorJsonObjectKeyNotString: CborError = 1281; /* errors in converting to JSON */ pub const CborErrorJsonObjectKeyIsAggregate: CborError = 1280; pub const CborErrorUnsupportedType: CborError = 1026; pub const CborErrorNestingTooDeep: CborError = 1025; /* internal implementation errors */ pub const CborErrorDataTooLarge: CborError = 1024; pub const CborErrorTooFewItems: CborError = 769; /* encoder errors */ pub const CborErrorTooManyItems: CborError = 768; pub const CborErrorMapKeysNotUnique: CborError = 523; pub const CborErrorMapNotSorted: CborError = 522; pub const CborErrorMapKeyNotString: CborError = 521; pub const CborErrorOverlongEncoding: CborError = 520; pub const CborErrorImproperValue: CborError = 519; pub const CborErrorExcludedValue: CborError = 518; pub const CborErrorExcludedType: CborError = 517; pub const CborErrorInvalidUtf8TextString: CborError = 516; pub const CborErrorDuplicateObjectKeys: CborError = 515; pub const CborErrorInappropriateTagForType: CborError = 514; pub const CborErrorUnknownTag: CborError = 513; /* parser errors in strict mode parsing only */ pub const CborErrorUnknownSimpleType: CborError = 512; /* types of value less than 32 encoded in two bytes */ pub const CborErrorIllegalSimpleType: CborError = 262; pub const CborErrorIllegalNumber: CborError = 261; /* type not allowed here */ pub const CborErrorIllegalType: CborError = 260; /* can only happen in major type 7 */ pub const CborErrorUnknownType: CborError = 259; pub const CborErrorUnexpectedBreak: CborError = 258; pub const CborErrorUnexpectedEOF: CborError = 257; /* parser errors streaming errors */ pub const CborErrorGarbageAtEnd: CborError = 256; pub const CborErrorIO: CborError = 4; pub const CborErrorAdvancePastEOF: CborError = 3; /* request for length in array, map, or string with indeterminate length */ pub const CborErrorUnknownLength: CborError = 2; /* errors in all modes */ pub const CborUnknownError: CborError = 1; pub const CborNoError: CborError = 0; pub type CborError_0 = CborError; /* Parser API */ pub type CborParserIteratorFlags = libc::c_uint; pub const CborIteratorFlag_ContainerIsMap: CborParserIteratorFlags = 32; pub const CborIteratorFlag_UnknownLength: CborParserIteratorFlags = 4; pub const CborIteratorFlag_IteratingStringChunks: CborParserIteratorFlags = 2; pub const CborIteratorFlag_NegativeInteger: CborParserIteratorFlags = 2; pub const CborIteratorFlag_IntegerValueTooLarge: CborParserIteratorFlags = 1; #[derive(Copy, Clone)] #[repr(C)] pub struct CborParser { pub end: *const uint8_t, pub flags: uint32_t, } pub type CborParser_0 = CborParser; #[derive(Copy, Clone)] #[repr(C)] pub struct CborValue { pub parser: *const CborParser_0, pub ptr: *const uint8_t, pub remaining: uint32_t, pub extra: uint16_t, pub type_0: uint8_t, pub flags: uint8_t, } pub type CborValue_0 = CborValue; /* Validation API */ pub type CborValidationFlags = libc::c_int; pub const CborValidateBasic: CborValidationFlags = 0; pub const CborValidateStrictest: CborValidationFlags = -1; pub const CborValidateCompleteData: CborValidationFlags = -2147483648; pub const CborValidateNoUnknownTags: CborValidationFlags = 1879048192; pub const CborValidateNoUnknownTagsSR: CborValidationFlags = 805306368; pub const CborValidateNoUnknownTagsSA: CborValidationFlags = 268435456; pub const CborValidateNoUnknownSimpleTypes: CborValidationFlags = 201326592; /* unused = 0x1000000, */ /* unused = 0x2000000, */ pub const CborValidateNoUnknownSimpleTypesSA: CborValidationFlags = 67108864; pub const CborValidateFiniteFloatingPoint: CborValidationFlags = 8388608; pub const CborValidateNoTags: CborValidationFlags = 4194304; pub const CborValidateNoUndefined: CborValidationFlags = 2097152; pub const CborValidateMapKeysAreString: CborValidationFlags = 1048576; pub const CborValidateStrictMode: CborValidationFlags = 1048320; pub const CborValidateUtf8: CborValidationFlags = 16384; pub const CborValidateTagUse: CborValidationFlags = 8192; pub const CborValidateMapKeysAreUnique: CborValidationFlags = 4864; pub const CborValidateCanonicalFormat: CborValidationFlags = 4095; pub const CborValidateMapIsSorted: CborValidationFlags = 768; pub const CborValidateNoIndeterminateLength: CborValidationFlags = 256; pub const CborValidateShortestNumbers: CborValidationFlags = 3; pub const CborValidateShortestFloatingPoint: CborValidationFlags = 2; /* Bit mapping: * bits 0-7 (8 bits): canonical format * bits 8-11 (4 bits): canonical format & strict mode * bits 12-20 (8 bits): strict mode * bits 21-31 (10 bits): other */ pub const CborValidateShortestIntegrals: CborValidationFlags = 1; /* *************************************************************************** ** ** Copyright (C) 2017 Intel Corporation ** ** 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. ** ****************************************************************************/ /* * * \addtogroup CborParsing * @{ */ /* * * \enum CborValidationFlags * The CborValidationFlags enum contains flags that control the validation of a * CBOR stream. * * \value CborValidateBasic Validates only the syntactic correctedness of the stream. * \value CborValidateCanonical Validates that the stream is in canonical format, according to * RFC 7049 section 3.9. * \value CborValidateStrictMode Performs strict validation, according to RFC 7049 section 3.10. * \value CborValidateStrictest Attempt to perform the strictest validation we know of. * * \value CborValidateShortestIntegrals (Canonical) Validate that integral numbers and lengths are * enconded in their shortest form possible. * \value CborValidateShortestFloatingPoint (Canonical) Validate that floating-point numbers are encoded * in their shortest form possible. * \value CborValidateShortestNumbers (Canonical) Validate both integral and floating-point numbers * are in their shortest form possible. * \value CborValidateNoIndeterminateLength (Canonical) Validate that no string, array or map uses * indeterminate length encoding. * \value CborValidateMapIsSorted (Canonical & Strict mode) Validate that map keys appear in * sorted order. * \value CborValidateMapKeysAreUnique (Strict mode) Validate that map keys are unique. * \value CborValidateTagUse (Strict mode) Validate that known tags are used with the * correct types. This does not validate that the content of * those types is syntactically correct. For example, this * option validates that tag 1 (DateTimeString) is used with * a Text String, but it does not validate that the string is * a valid date/time representation. * \value CborValidateUtf8 (Strict mode) Validate that text strings are appropriately * encoded in UTF-8. * \value CborValidateMapKeysAreString Validate that all map keys are text strings. * \value CborValidateNoUndefined Validate that no elements of type "undefined" are present. * \value CborValidateNoTags Validate that no tags are used. * \value CborValidateFiniteFloatingPoint Validate that all floating point numbers are finite (no NaN or * infinities are allowed). * \value CborValidateCompleteData Validate that the stream is complete and there is no more data * in the buffer. * \value CborValidateNoUnknownSimpleTypesSA Validate that all Standards Action simple types are registered * with IANA. * \value CborValidateNoUnknownSimpleTypes Validate that all simple types used are registered with IANA. * \value CborValidateNoUnknownTagsSA Validate that all Standard Actions tags are registered with IANA. * \value CborValidateNoUnknownTagsSR Validate that all Standard Actions and Specification Required tags * are registered with IANA (see below for limitations). * \value CborValidateNoUnkonwnTags Validate that all tags are registered with IANA * (see below for limitations). * * \par Simple type registry * The CBOR specification requires that registration for use of the first 19 * simple types must be done by way of Standards Action. The rest of the simple * types only require a specification. The official list can be obtained from * https://www.iana.org/assignments/cbor-simple-values/cbor-simple-values.xhtml. * * \par * There are no registered simple types recognized by this release of TinyCBOR * (beyond those defined by RFC 7049). * * \par Tag registry * The CBOR specification requires that registration for use of the first 23 * tags must be done by way of Standards Action. The next up to tag 255 only * require a specification. Finally, all other tags can be registered on a * first-come-first-serve basis. The official list can be ontained from * https://www.iana.org/assignments/cbor-tags/cbor-tags.xhtml. * * \par * Given the variability of this list, TinyCBOR cannot recognize all tags * registered with IANA. Instead, the implementation only recognizes tags * that are backed by an RFC. * * \par * These are the tags known to the current TinyCBOR release: <table> <tr> <th>Tag</th> <th>Data Item</th> <th>Semantics</th> </tr> <tr> <td>0</td> <td>UTF-8 text string</td> <td>Standard date/time string</td> </td> <tr> <td>1</td> <td>integer</td> <td>Epoch-based date/time</td> </td> <tr> <td>2</td> <td>byte string</td> <td>Positive bignum</td> </td> <tr> <td>3</td> <td>byte string</td> <td>Negative bignum</td> </td> <tr> <td>4</td> <td>array</td> <td>Decimal fraction</td> </td> <tr> <td>5</td> <td>array</td> <td>Bigfloat</td> </td> <tr> <td>16</td> <td>array</td> <td>COSE Single Recipient Encrypted Data Object (RFC 8152)</td> </td> <tr> <td>17</td> <td>array</td> <td>COSE Mac w/o Recipients Object (RFC 8152)</td> </td> <tr> <td>18</td> <td>array</td> <td>COSE Single Signer Data Object (RFC 8162)</td> </td> <tr> <td>21</td> <td>byte string, array, map</td> <td>Expected conversion to base64url encoding</td> </td> <tr> <td>22</td> <td>byte string, array, map</td> <td>Expected conversion to base64 encoding</td> </td> <tr> <td>23</td> <td>byte string, array, map</td> <td>Expected conversion to base16 encoding</td> </td> <tr> <td>24</td> <td>byte string</td> <td>Encoded CBOR data item</td> </td> <tr> <td>32</td> <td>UTF-8 text string</td> <td>URI</td> </td> <tr> <td>33</td> <td>UTF-8 text string</td> <td>base64url</td> </td> <tr> <td>34</td> <td>UTF-8 text string</td> <td>base64</td> </td> <tr> <td>35</td> <td>UTF-8 text string</td> <td>Regular expression</td> </td> <tr> <td>36</td> <td>UTF-8 text string</td> <td>MIME message</td> </td> <tr> <td>96</td> <td>array</td> <td>COSE Encrypted Data Object (RFC 8152)</td> </td> <tr> <td>97</td> <td>array</td> <td>COSE MACed Data Object (RFC 8152)</td> </td> <tr> <td>98</td> <td>array</td> <td>COSE Signed Data Object (RFC 8152)</td> </td> <tr> <td>55799</td> <td>any</td> <td>Self-describe CBOR</td> </td> </table> */ #[derive(Copy, Clone)] #[repr(C)] pub struct KnownTagData { pub tag: uint32_t, pub types: uint32_t, } pub const Value8Bit: unnamed = 24; pub type unnamed = libc::c_int; pub const BreakByte: unnamed = 255; pub const MajorTypeMask: unnamed = -32; pub const MajorTypeShift: unnamed = 5; pub const IndefiniteLength: unnamed = 31; pub const Value64Bit: unnamed = 27; pub const Value32Bit: unnamed = 26; pub const Value16Bit: unnamed = 25; /* 31 */ pub const SmallValueMask: unnamed = 31; pub const SmallValueBitLength: unnamed = 5; unsafe extern "C" fn cbor_value_at_end(mut it: *const CborValue_0) -> bool { return (*it).remaining == 0i32 as libc::c_uint; } unsafe extern "C" fn cbor_value_get_next_byte(mut it: *const CborValue_0) -> *const uint8_t { return (*it).ptr; } unsafe extern "C" fn _cbor_value_extract_int64_helper(mut value: *const CborValue_0) -> uint64_t { return if 0 != (*value).flags as libc::c_int & CborIteratorFlag_IntegerValueTooLarge as libc::c_int { _cbor_value_decode_int64_internal(value) } else { (*value).extra as libc::c_ulonglong }; } unsafe extern "C" fn cbor_value_get_type(mut value: *const CborValue_0) -> CborType_0 { return (*value).type_0 as CborType_0; } /* Simple types */ unsafe extern "C" fn cbor_value_is_simple_type(mut value: *const CborValue_0) -> bool { return (*value).type_0 as libc::c_int == CborSimpleType as libc::c_int; } unsafe extern "C" fn cbor_value_get_simple_type( mut value: *const CborValue_0, mut result: *mut uint8_t, ) -> CborError_0 { if 0 != !cbor_value_is_simple_type(value) as libc::c_int as libc::c_long { __assert_rtn( (*::std::mem::transmute::<&[u8; 27], &[libc::c_char; 27]>( b"cbor_value_get_simple_type\x00", )).as_ptr(), b"./src/cbor.h\x00" as *const u8 as *const libc::c_char, 342i32, b"cbor_value_is_simple_type(value)\x00" as *const u8 as *const libc::c_char, ); } else { }; *result = (*value).extra as uint8_t; return CborNoError; } /* Integers */ unsafe extern "C" fn cbor_value_is_integer(mut value: *const CborValue_0) -> bool { return (*value).type_0 as libc::c_int == CborIntegerType as libc::c_int; } unsafe extern "C" fn cbor_value_get_raw_integer( mut value: *const CborValue_0, mut result: *mut uint64_t, ) -> CborError_0 { if 0 != !cbor_value_is_integer(value) as libc::c_int as libc::c_long { __assert_rtn( (*::std::mem::transmute::<&[u8; 27], &[libc::c_char; 27]>( b"cbor_value_get_raw_integer\x00", )).as_ptr(), b"./src/cbor.h\x00" as *const u8 as *const libc::c_char, 357i32, b"cbor_value_is_integer(value)\x00" as *const u8 as *const libc::c_char, ); } else { }; *result = _cbor_value_extract_int64_helper(value); return CborNoError; } unsafe extern "C" fn cbor_value_is_length_known(mut value: *const CborValue_0) -> bool { return (*value).flags as libc::c_int & CborIteratorFlag_UnknownLength as libc::c_int == 0i32; } /* Tags */ unsafe extern "C" fn cbor_value_is_tag(mut value: *const CborValue_0) -> bool { return (*value).type_0 as libc::c_int == CborTagType as libc::c_int; } unsafe extern "C" fn cbor_value_get_tag( mut value: *const CborValue_0, mut result: *mut CborTag, ) -> CborError_0 { if 0 != !cbor_value_is_tag(value) as libc::c_int as libc::c_long { __assert_rtn( (*::std::mem::transmute::<&[u8; 19], &[libc::c_char; 19]>(b"cbor_value_get_tag\x00")) .as_ptr(), b"./src/cbor.h\x00" as *const u8 as *const libc::c_char, 398i32, b"cbor_value_is_tag(value)\x00" as *const u8 as *const libc::c_char, ); } else { }; *result = _cbor_value_extract_int64_helper(value); return CborNoError; } unsafe extern "C" fn cbor_value_is_float(mut value: *const CborValue_0) -> bool { return (*value).type_0 as libc::c_int == CborFloatType as libc::c_int; } unsafe extern "C" fn cbor_value_get_float( mut value: *const CborValue_0, mut result: *mut libc::c_float, ) -> CborError_0 { let mut data: uint32_t = 0; if 0 != !cbor_value_is_float(value) as libc::c_int as libc::c_long { __assert_rtn( (*::std::mem::transmute::<&[u8; 21], &[libc::c_char; 21]>(b"cbor_value_get_float\x00")) .as_ptr(), b"./src/cbor.h\x00" as *const u8 as *const libc::c_char, 502i32, b"cbor_value_is_float(value)\x00" as *const u8 as *const libc::c_char, ); } else { }; if 0 != (0 == (*value).flags as libc::c_int & CborIteratorFlag_IntegerValueTooLarge as libc::c_int) as libc::c_int as libc::c_long { __assert_rtn( (*::std::mem::transmute::<&[u8; 21], &[libc::c_char; 21]>(b"cbor_value_get_float\x00")) .as_ptr(), b"./src/cbor.h\x00" as *const u8 as *const libc::c_char, 503i32, b"value->flags & CborIteratorFlag_IntegerValueTooLarge\x00" as *const u8 as *const libc::c_char, ); } else { }; data = _cbor_value_decode_int64_internal(value) as uint32_t; memcpy( result as *mut libc::c_void, &mut data as *mut uint32_t as *const libc::c_void, ::std::mem::size_of::<libc::c_float>() as libc::c_ulong, ); return CborNoError; } unsafe extern "C" fn cbor_value_is_double(mut value: *const CborValue_0) -> bool { return (*value).type_0 as libc::c_int == CborDoubleType as libc::c_int; } unsafe extern "C" fn cbor_value_get_double( mut value: *const CborValue_0, mut result: *mut libc::c_double, ) -> CborError_0 { let mut data: uint64_t = 0; if 0 != !cbor_value_is_double(value) as libc::c_int as libc::c_long { __assert_rtn( (*::std::mem::transmute::<&[u8; 22], &[libc::c_char; 22]>( b"cbor_value_get_double\x00", )).as_ptr(), b"./src/cbor.h\x00" as *const u8 as *const libc::c_char, 514i32, b"cbor_value_is_double(value)\x00" as *const u8 as *const libc::c_char, ); } else { }; if 0 != (0 == (*value).flags as libc::c_int & CborIteratorFlag_IntegerValueTooLarge as libc::c_int) as libc::c_int as libc::c_long { __assert_rtn( (*::std::mem::transmute::<&[u8; 22], &[libc::c_char; 22]>( b"cbor_value_get_double\x00", )).as_ptr(), b"./src/cbor.h\x00" as *const u8 as *const libc::c_char, 515i32, b"value->flags & CborIteratorFlag_IntegerValueTooLarge\x00" as *const u8 as *const libc::c_char, ); } else { }; data = _cbor_value_decode_int64_internal(value); memcpy( result as *mut libc::c_void, &mut data as *mut uint64_t as *const libc::c_void, ::std::mem::size_of::<libc::c_double>() as libc::c_ulong, ); return CborNoError; } #[no_mangle] pub unsafe extern "C" fn cbor_value_validate( mut it: *const CborValue_0, mut flags: uint32_t, ) -> CborError_0 { let mut value: CborValue_0 = *it; let mut err: CborError_0 = validate_value(&mut value, flags, 1024i32); if 0 != err as u64 { return err; } else if 0 != flags & CborValidateCompleteData as libc::c_int as libc::c_uint && (*it).ptr != (*(*it).parser).end { return CborErrorGarbageAtEnd; } else { return CborNoError; }; } unsafe extern "C" fn validate_value( mut it: *mut CborValue_0, mut flags: uint32_t, mut recursionLeft: libc::c_int, ) -> CborError_0 { let mut err: CborError_0 = CborNoError; let mut type_0: CborType_0 = cbor_value_get_type(it); if cbor_value_is_length_known(it) { err = validate_number(it, type_0, flags); if 0 != err as u64 { return err; } } else if 0 != flags & CborValidateNoIndeterminateLength as libc::c_int as libc::c_uint { return CborErrorUnknownLength; } match type_0 as libc::c_uint { 128 | 160 => { /* recursive type */ let mut recursed: CborValue_0 = CborValue { parser: 0 as *const CborParser_0, ptr: 0 as *const uint8_t, remaining: 0, extra: 0, type_0: 0, flags: 0, }; err = cbor_value_enter_container(it, &mut recursed); if 0 == err as u64 { err = validate_container( &mut recursed, type_0 as libc::c_int, flags, recursionLeft - 1i32, ) } if 0 != err as u64 { (*it).ptr = recursed.ptr; return err; } else { err = cbor_value_leave_container(it, &mut recursed); if 0 != err as u64 { return err; } else { return CborNoError; } } } 0 => { let mut val: uint64_t = 0; err = cbor_value_get_raw_integer(it, &mut val); /* can't fail */ if 0 != !(err as libc::c_int == CborNoError as libc::c_int) as libc::c_int as libc::c_long { __assert_rtn( (*::std::mem::transmute::<&[u8; 15], &[libc::c_char; 15]>( b"validate_value\x00", )).as_ptr(), b"src/cborvalidation.c\x00" as *const u8 as *const libc::c_char, 549i32, b"err == CborNoError\x00" as *const u8 as *const libc::c_char, ); } else { }; } 64 | 96 => { let mut n: size_t = 0i32 as size_t; let mut ptr: *const libc::c_void = 0 as *const libc::c_void; err = _cbor_value_prepare_string_iteration(it); if 0 != err as u64 { return err; } else { loop { err = validate_number(it, type_0, flags); if 0 != err as u64 { return err; } else { err = _cbor_value_get_string_chunk(it, &mut ptr, &mut n, it); if 0 != err as u64 { return err; } else { if ptr.is_null() { break; } if !(type_0 as libc::c_uint == CborTextStringType as libc::c_int as libc::c_uint && 0 != flags & CborValidateUtf8 as libc::c_int as libc::c_uint) { continue; } err = validate_utf8_string(ptr, n); if !(0 != err as u64) { continue; } return err; } } } return CborNoError; } } 192 => { let mut tag: CborTag = 0; err = cbor_value_get_tag(it, &mut tag); /* can't fail */ if 0 != !(err as libc::c_int == CborNoError as libc::c_int) as libc::c_int as libc::c_long { __assert_rtn( (*::std::mem::transmute::<&[u8; 15], &[libc::c_char; 15]>( b"validate_value\x00", )).as_ptr(), b"src/cborvalidation.c\x00" as *const u8 as *const libc::c_char, 587i32, b"err == CborNoError\x00" as *const u8 as *const libc::c_char, ); } else { }; err = cbor_value_advance_fixed(it); if 0 != err as u64 { return err; } else { err = validate_tag(it, tag, flags, recursionLeft - 1i32); if 0 != err as u64 { return err; } else { return CborNoError; } } } 224 => { let mut simple_type: uint8_t = 0; err = cbor_value_get_simple_type(it, &mut simple_type); /* can't fail */ if 0 != !(err as libc::c_int == CborNoError as libc::c_int) as libc::c_int as libc::c_long { __assert_rtn( (*::std::mem::transmute::<&[u8; 15], &[libc::c_char; 15]>( b"validate_value\x00", )).as_ptr(), b"src/cborvalidation.c\x00" as *const u8 as *const libc::c_char, 602i32, b"err == CborNoError\x00" as *const u8 as *const libc::c_char, ); } else { }; err = validate_simple_type(simple_type, flags); if 0 != err as u64 { return err; } } 247 => { if 0 != flags & CborValidateNoUndefined as libc::c_int as libc::c_uint { return CborErrorExcludedType; } } 249 | 250 | 251 => { err = validate_floating_point(it, type_0, flags); if 0 != err as u64 { return err; } } 255 => return CborErrorUnknownType, 246 | 245 | _ => {} } err = cbor_value_advance_fixed(it); return err; } unsafe extern "C" fn validate_floating_point( mut it: *mut CborValue_0, mut type_0: CborType_0, mut flags: uint32_t, ) -> CborError_0 { let mut err: CborError_0 = CborNoError; let mut r: libc::c_int = 0; let mut val: libc::c_double = 0.; let mut valf: libc::c_float = 0.; let mut valf16: uint16_t = 0; if type_0 as libc::c_uint != CborDoubleType as libc::c_int as libc::c_uint { if type_0 as libc::c_uint == CborFloatType as libc::c_int as libc::c_uint { err = cbor_value_get_float(it, &mut valf); val = valf as libc::c_double } else { err = cbor_value_get_half_float(it, &mut valf16 as *mut uint16_t as *mut libc::c_void); val = decode_half(valf16) } } else { err = cbor_value_get_double(it, &mut val) } /* can't fail */ if 0 != !(err as libc::c_int == CborNoError as libc::c_int) as libc::c_int as libc::c_long { __assert_rtn( (*::std::mem::transmute::<&[u8; 24], &[libc::c_char; 24]>( b"validate_floating_point\x00", )).as_ptr(), b"src/cborvalidation.c\x00" as *const u8 as *const libc::c_char, 401i32, b"err == CborNoError\x00" as *const u8 as *const libc::c_char, ); } else { }; r = if ::std::mem::size_of::<libc::c_double>() as libc::c_ulong == ::std::mem::size_of::<libc::c_float>() as libc::c_ulong { __fpclassifyf(val as libc::c_float) } else if ::std::mem::size_of::<libc::c_double>() as libc::c_ulong == ::std::mem::size_of::<libc::c_double>() as libc::c_ulong { __fpclassifyd(val) } else { __fpclassifyl(val as libc::c_double) }; if r == 1i32 || r == 2i32 { if 0 != flags & CborValidateFiniteFloatingPoint as libc::c_int as libc::c_uint { return CborErrorExcludedValue; } else if 0 != flags & CborValidateShortestFloatingPoint as libc::c_int as libc::c_uint { if type_0 as libc::c_uint == CborDoubleType as libc::c_int as libc::c_uint { return CborErrorOverlongEncoding; } else if type_0 as libc::c_uint == CborFloatType as libc::c_int as libc::c_uint { return CborErrorOverlongEncoding; } else if r == 1i32 && valf16 as libc::c_int != 0x7e00i32 { return CborErrorImproperValue; } else if r == 2i32 && valf16 as libc::c_int != 0x7c00i32 && valf16 as libc::c_int != 0xfc00i32 { return CborErrorImproperValue; } } } if 0 != flags & CborValidateShortestFloatingPoint as libc::c_int as libc::c_uint && type_0 as libc::c_uint > CborHalfFloatType as libc::c_int as libc::c_uint { if type_0 as libc::c_uint == CborDoubleType as libc::c_int as libc::c_uint { valf = val as libc::c_float; if valf as libc::c_double == val { return CborErrorOverlongEncoding; } } if type_0 as libc::c_uint == CborFloatType as libc::c_int as libc::c_uint { valf16 = encode_half(valf as libc::c_double); if valf as libc::c_double == decode_half(valf16) { return CborErrorOverlongEncoding; } } } return CborNoError; } /* this function was copied & adapted from RFC 7049 Appendix D */ unsafe extern "C" fn decode_half(mut half: libc::c_ushort) -> libc::c_double { let mut exp: libc::c_int = half as libc::c_int >> 10i32 & 0x1fi32; let mut mant: libc::c_int = half as libc::c_int & 0x3ffi32; let mut val: libc::c_double = 0.; if exp == 0i32 { val = ldexp(mant as libc::c_double, -24i32) } else if exp != 31i32 { val = ldexp((mant + 1024i32) as libc::c_double, exp - 25i32) } else { val = (if mant == 0i32 { ::std::f32::INFINITY } else { ::std::f32::NAN }) as libc::c_double } return if 0 != half as libc::c_int & 0x8000i32 { -val } else { val }; } /* *************************************************************************** ** ** Copyright (C) 2017 Intel Corporation ** ** 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. ** ****************************************************************************/ /* software implementation of float-to-fp16 conversions */ unsafe extern "C" fn encode_half(mut val: libc::c_double) -> libc::c_ushort { let mut v: uint64_t = 0; let mut sign: libc::c_int = 0; let mut exp: libc::c_int = 0; let mut mant: libc::c_int = 0; memcpy( &mut v as *mut uint64_t as *mut libc::c_void, &mut val as *mut libc::c_double as *const libc::c_void, ::std::mem::size_of::<uint64_t>() as libc::c_ulong, ); sign = (v >> 63i32 << 15i32) as libc::c_int; exp = (v >> 52i32 & 0x7ffi32 as libc::c_ulonglong) as libc::c_int; /* keep only the 11 most significant bits of the mantissa */ mant = (v << 12i32 >> 12i32 >> 53i32 - 11i32) as libc::c_int; exp -= 1023i32; if exp == 1024i32 { /* infinity or NaN */ exp = 16i32; mant >>= 1i32 } else if exp >= 16i32 { /* overflow, as largest number */ exp = 15i32; mant = 1023i32 } else if !(exp >= -14i32) { /* regular normal */ if exp >= -24i32 { /* subnormal */ mant |= 1024i32; mant >>= -(exp + 14i32); exp = -15i32 } else { return 0i32 as libc::c_ushort; } } /* safe cast here as bit operations above guarantee not to overflow */ return (sign | exp + 15i32 << 10i32 | mant) as libc::c_ushort; } unsafe extern "C" fn validate_simple_type( mut simple_type: uint8_t, mut flags: uint32_t, ) -> CborError_0 { /* At current time, all known simple types are those from RFC 7049, * which are parsed by the parser into different CBOR types. * That means that if we've got here, the type is unknown */ if (simple_type as libc::c_int) < 32i32 { return (if 0 != flags & CborValidateNoUnknownSimpleTypesSA as libc::c_int as libc::c_uint { CborErrorUnknownSimpleType as libc::c_int } else { CborNoError as libc::c_int }) as CborError_0; } else { return (if flags & CborValidateNoUnknownSimpleTypes as libc::c_int as libc::c_uint == CborValidateNoUnknownSimpleTypes as libc::c_int as libc::c_uint { CborErrorUnknownSimpleType as libc::c_int } else { CborNoError as libc::c_int }) as CborError_0; }; } unsafe extern "C" fn validate_tag( mut it: *mut CborValue_0, mut tag: CborTag, mut flags: uint32_t, mut recursionLeft: libc::c_int, ) -> CborError_0 { let mut type_0: CborType_0 = cbor_value_get_type(it); let knownTagCount: size_t = (::std::mem::size_of::<[KnownTagData; 22]>() as libc::c_ulong) .wrapping_div(::std::mem::size_of::<KnownTagData>() as libc::c_ulong); let mut tagData: *const KnownTagData = knownTagData.as_ptr(); let knownTagDataEnd: *const KnownTagData = knownTagData.as_ptr().offset(knownTagCount as isize); if 0 == recursionLeft { return CborErrorNestingTooDeep; } else if 0 != flags & CborValidateNoTags as libc::c_int as libc::c_uint { return CborErrorExcludedType; } else { /* find the tag data, if any */ while tagData != knownTagDataEnd { if ((*tagData).tag as libc::c_ulonglong) < tag { tagData = tagData.offset(1isize) } else { if !((*tagData).tag as libc::c_ulonglong > tag) { break; } tagData = 0 as *const KnownTagData; break; } } if tagData == knownTagDataEnd { tagData = 0 as *const KnownTagData } if 0 != flags & CborValidateNoUnknownTags as libc::c_int as libc::c_uint && tagData.is_null() { /* tag not found */ if 0 != flags & CborValidateNoUnknownTagsSA as libc::c_int as libc::c_uint && tag < 24i32 as libc::c_ulonglong { return CborErrorUnknownTag; } else if flags & CborValidateNoUnknownTagsSR as libc::c_int as libc::c_uint == CborValidateNoUnknownTagsSR as libc::c_int as libc::c_uint && tag < 256i32 as libc::c_ulonglong { return CborErrorUnknownTag; } else if flags & CborValidateNoUnknownTags as libc::c_int as libc::c_uint == CborValidateNoUnknownTags as libc::c_int as libc::c_uint { return CborErrorUnknownTag; } } if 0 != flags & CborValidateTagUse as libc::c_int as libc::c_uint && !tagData.is_null() && 0 != (*tagData).types { let mut allowedTypes: uint32_t = (*tagData).types; /* correct Integer so it's not zero */ if type_0 as libc::c_uint == CborIntegerType as libc::c_int as libc::c_uint { type_0 = (type_0 as libc::c_uint).wrapping_add(1i32 as libc::c_uint) as CborType_0 } while 0 != allowedTypes { if (allowedTypes & 0xffi32 as libc::c_uint) as uint8_t as libc::c_uint == type_0 as libc::c_uint { break; } allowedTypes >>= 8i32 } if 0 == allowedTypes { return CborErrorInappropriateTagForType; } } return validate_value(it, flags, recursionLeft); }; } static mut knownTagData: [KnownTagData; 22] = [ KnownTagData { tag: 0i32 as uint32_t, types: CborTextStringType as libc::c_int as uint32_t, }, KnownTagData { tag: 1i32 as uint32_t, types: (CborIntegerType as libc::c_int + 1i32) as uint32_t, }, KnownTagData { tag: 2i32 as uint32_t, types: CborByteStringType as libc::c_int as uint32_t, }, KnownTagData { tag: 3i32 as uint32_t, types: CborByteStringType as libc::c_int as uint32_t, }, KnownTagData { tag: 4i32 as uint32_t, types: CborArrayType as libc::c_int as uint32_t, }, KnownTagData { tag: 5i32 as uint32_t, types: CborArrayType as libc::c_int as uint32_t, }, KnownTagData { tag: 16i32 as uint32_t, types: CborArrayType as libc::c_int as uint32_t, }, KnownTagData { tag: 17i32 as uint32_t, types: CborArrayType as libc::c_int as uint32_t, }, KnownTagData { tag: 18i32 as uint32_t, types: CborArrayType as libc::c_int as uint32_t, }, KnownTagData { tag: 21i32 as uint32_t, types: CborByteStringType as libc::c_int as uint32_t | (CborArrayType as libc::c_int as uint32_t) << 8i32 | (CborMapType as libc::c_int as uint32_t) << 16i32, }, KnownTagData { tag: 22i32 as uint32_t, types: CborByteStringType as libc::c_int as uint32_t | (CborArrayType as libc::c_int as uint32_t) << 8i32 | (CborMapType as libc::c_int as uint32_t) << 16i32, }, KnownTagData { tag: 23i32 as uint32_t, types: CborByteStringType as libc::c_int as uint32_t | (CborArrayType as libc::c_int as uint32_t) << 8i32 | (CborMapType as libc::c_int as uint32_t) << 16i32, }, KnownTagData { tag: 24i32 as uint32_t, types: CborByteStringType as libc::c_int as uint32_t, }, KnownTagData { tag: 32i32 as uint32_t, types: CborTextStringType as libc::c_int as uint32_t, }, KnownTagData { tag: 33i32 as uint32_t, types: CborTextStringType as libc::c_int as uint32_t, }, KnownTagData { tag: 34i32 as uint32_t, types: CborTextStringType as libc::c_int as uint32_t, }, KnownTagData { tag: 35i32 as uint32_t, types: CborTextStringType as libc::c_int as uint32_t, }, KnownTagData { tag: 36i32 as uint32_t, types: CborTextStringType as libc::c_int as uint32_t, }, KnownTagData { tag: 96i32 as uint32_t, types: CborArrayType as libc::c_int as uint32_t, }, KnownTagData { tag: 97i32 as uint32_t, types: CborArrayType as libc::c_int as uint32_t, }, KnownTagData { tag: 98i32 as uint32_t, types: CborArrayType as libc::c_int as uint32_t, }, KnownTagData { tag: 55799i32 as uint32_t, types: 0u32, }, ]; unsafe extern "C" fn validate_utf8_string( mut ptr: *const libc::c_void, mut n: size_t, ) -> CborError_0 { let mut buffer: *const uint8_t = ptr as *const uint8_t; let end: *const uint8_t = buffer.offset(n as isize); while buffer < end { let mut uc: uint32_t = get_utf8(&mut buffer, end); if !(uc == !0u32) { continue; } return CborErrorInvalidUtf8TextString; } return CborNoError; } /* *************************************************************************** ** ** Copyright (C) 2017 Intel Corporation ** ** 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. ** ****************************************************************************/ unsafe extern "C" fn get_utf8( mut buffer: *mut *const uint8_t, mut end: *const uint8_t, ) -> uint32_t { let mut charsNeeded: libc::c_int = 0; let mut uc: uint32_t = 0; let mut min_uc: uint32_t = 0; let mut b: uint8_t = 0; let mut n: ptrdiff_t = end.wrapping_offset_from(*buffer) as libc::c_long; if n == 0i32 as libc::c_long { return !0u32; } else { let fresh0 = *buffer; *buffer = (*buffer).offset(1); uc = *fresh0 as uint32_t; if uc < 0x80i32 as libc::c_uint { /* single-byte UTF-8 */ return uc; } else if 0 != (uc <= 0xc1i32 as libc::c_uint) as libc::c_int as libc::c_long { return !0u32; } else { if uc < 0xe0i32 as libc::c_uint { /* two-byte UTF-8 */ charsNeeded = 2i32; min_uc = 0x80i32 as uint32_t; uc &= 0x1fi32 as libc::c_uint } else if uc < 0xf0i32 as libc::c_uint { /* three-byte UTF-8 */ charsNeeded = 3i32; min_uc = 0x800i32 as uint32_t; uc &= 0xfi32 as libc::c_uint } else if uc < 0xf5i32 as libc::c_uint { /* four-byte UTF-8 */ charsNeeded = 4i32; min_uc = 0x10000i32 as uint32_t; uc &= 0x7i32 as libc::c_uint } else { return !0u32; } if n < charsNeeded as libc::c_long { return !0u32; } else { /* first continuation character */ let fresh1 = *buffer; *buffer = (*buffer).offset(1); b = *fresh1; if b as libc::c_int & 0xc0i32 != 0x80i32 { return !0u32; } else { uc <<= 6i32; uc |= (b as libc::c_int & 0x3fi32) as libc::c_uint; if charsNeeded > 2i32 { /* second continuation character */ let fresh2 = *buffer; *buffer = (*buffer).offset(1); b = *fresh2; if b as libc::c_int & 0xc0i32 != 0x80i32 { return !0u32; } else { uc <<= 6i32; uc |= (b as libc::c_int & 0x3fi32) as libc::c_uint; if charsNeeded > 3i32 { /* third continuation character */ let fresh3 = *buffer; *buffer = (*buffer).offset(1); b = *fresh3; if b as libc::c_int & 0xc0i32 != 0x80i32 { return !0u32; } else { uc <<= 6i32; uc |= (b as libc::c_int & 0x3fi32) as libc::c_uint } } } } /* overlong sequence? surrogate pair? out or range? */ if uc < min_uc || uc.wrapping_sub(0xd800u32) < 2048u32 || uc > 0x10ffffi32 as libc::c_uint { return !0u32; } else { return uc; } } } } }; } unsafe extern "C" fn validate_number( mut it: *const CborValue_0, mut type_0: CborType_0, mut flags: uint32_t, ) -> CborError_0 { let mut err: CborError_0 = CborNoError; let mut ptr: *const uint8_t = (*it).ptr; let mut bytesUsed: size_t = 0; let mut bytesNeeded: size_t = 0; let mut value: uint64_t = 0; if flags & CborValidateShortestIntegrals as libc::c_int as libc::c_uint == 0i32 as libc::c_uint { return err; } else if type_0 as libc::c_uint >= CborHalfFloatType as libc::c_int as libc::c_uint && type_0 as libc::c_uint <= CborDoubleType as libc::c_int as libc::c_uint { /* checked elsewhere */ return err; } else { err = _cbor_value_extract_number(&mut ptr, (*(*it).parser).end, &mut value); if 0 != err as u64 { return err; } else { bytesUsed = (ptr.wrapping_offset_from((*it).ptr) as libc::c_long - 1i32 as libc::c_long) as size_t; bytesNeeded = 0i32 as size_t; if value >= Value8Bit as libc::c_int as libc::c_ulonglong { bytesNeeded = bytesNeeded.wrapping_add(1) } if value > 0xffu32 as libc::c_ulonglong { bytesNeeded = bytesNeeded.wrapping_add(1) } if value > 0xffffu32 as libc::c_ulonglong { bytesNeeded = (bytesNeeded as libc::c_ulong).wrapping_add(2i32 as libc::c_ulong) as size_t as size_t } if value > 0xffffffffu32 as libc::c_ulonglong { bytesNeeded = (bytesNeeded as libc::c_ulong).wrapping_add(4i32 as libc::c_ulong) as size_t as size_t } if bytesNeeded < bytesUsed { return CborErrorOverlongEncoding; } else { return CborNoError; } } }; } unsafe extern "C" fn validate_container( mut it: *mut CborValue_0, mut containerType: libc::c_int, mut flags: uint32_t, mut recursionLeft: libc::c_int, ) -> CborError_0 { let mut err: CborError_0 = CborNoError; let mut previous: *const uint8_t = 0 as *const uint8_t; let mut previous_end: *const uint8_t = 0 as *const uint8_t; if 0 == recursionLeft { return CborErrorNestingTooDeep; } else { while !cbor_value_at_end(it) { let mut current: *const uint8_t = cbor_value_get_next_byte(it); if containerType == CborMapType as libc::c_int { if 0 != flags & CborValidateMapKeysAreString as libc::c_int as libc::c_uint { let mut type_0: CborType_0 = cbor_value_get_type(it); if type_0 as libc::c_uint == CborTagType as libc::c_int as libc::c_uint { /* skip the tags */ let mut copy: CborValue_0 = *it; err = cbor_value_skip_tag(&mut copy); if 0 != err as u64 { return err; } else { type_0 = cbor_value_get_type(&mut copy) } } if type_0 as libc::c_uint != CborTextStringType as libc::c_int as libc::c_uint { return CborErrorMapKeyNotString; } } } err = validate_value(it, flags, recursionLeft); if 0 != err as u64 { return err; } else { if containerType != CborMapType as libc::c_int { continue; } if 0 != flags & CborValidateMapIsSorted as libc::c_int as libc::c_uint { if !previous.is_null() { let mut len1: uint64_t = 0; let mut len2: uint64_t = 0; let mut ptr: *const uint8_t = 0 as *const uint8_t; /* extract the two lengths */ ptr = previous; _cbor_value_extract_number(&mut ptr, (*(*it).parser).end, &mut len1); ptr = current; _cbor_value_extract_number(&mut ptr, (*(*it).parser).end, &mut len2); if len1 > len2 { return CborErrorMapNotSorted; } else if len1 == len2 { let mut bytelen1: size_t = previous_end.wrapping_offset_from(previous) as libc::c_long as size_t; let mut bytelen2: size_t = (*it).ptr.wrapping_offset_from(current) as libc::c_long as size_t; let mut r: libc::c_int = memcmp( previous as *const libc::c_void, current as *const libc::c_void, if bytelen1 <= bytelen2 { bytelen1 } else { bytelen2 }, ); if r == 0i32 && bytelen1 != bytelen2 { r = if bytelen1 < bytelen2 { -1i32 } else { 1i32 } } if r > 0i32 { return CborErrorMapNotSorted; } else if r == 0i32 && flags & CborValidateMapKeysAreUnique as libc::c_int as libc::c_uint == CborValidateMapKeysAreUnique as libc::c_int as libc::c_uint { return CborErrorMapKeysNotUnique; } } } previous = current; previous_end = (*it).ptr } /* map: that was the key, so get the value */ err = validate_value(it, flags, recursionLeft); if !(0 != err as u64) { continue; } return err; } } return CborNoError; }; }
pub use self::sin::SinSource; mod sin; pub use self::xor::XORSource; mod xor; use af::{Dim4, Array, DType}; use std::cell::{RefCell, Cell}; use utils; #[derive(Clone)] pub struct Data { pub input: RefCell<Box<Array>>, pub target: RefCell<Box<Array>>, } #[derive(PartialEq, Clone, Debug)] pub struct DataParams { pub input_dims: Dim4, // [batch_size, feature_x, feature_y, time] pub target_dims: Dim4, // [batch_size, feature_x, feature_y, time] pub shuffle: bool, // whether the data is shuffled pub normalize: bool, // whether the data is normalized pub current_epoch: Cell<u64>, // for internal tracking of what the current epoch is pub dtype: DType, // the type of data generated pub num_samples: u64, pub num_train: u64, pub num_test: u64, pub num_validation: Option<u64>, } /// A DataSource needs to provide these basic features /// /// 1) It gives information regarding the source /// 2) It provides a train iterator that returns a minibatch /// 3) It provides a test iterator that returns a minibatch /// 4) It (optionally)provides a validation iterator that returns a minibatch pub trait DataSource { fn info(&self) -> DataParams; fn get_train_iter(&self, num_batch: u64) -> Data; fn get_test_iter(&self, num_batch: u64) -> Data; fn get_validation_iter(&self, num_batch: u64) -> Option<Data>; } /// Trait that describes a normalization operation pub trait Normalize { fn normalize(&mut self, num_std: f32); } // TODO: Implement whitening via SVD // pub trait Whiten { // fn whiten(&self); // } /// Trait that describes a shuffling operation pub trait Shuffle { fn shuffle(&mut self); } // TODO: Implement this impl Shuffle for Data { fn shuffle(&mut self) { //utils::shuffle_array(&mut[data.input.m, target], idims[0]) //data.clone() println!("WARNING: shuffle not yet implemented"); } } /// Implementation of the Normalize operation for Data /// /// Currently only mean subtraction & std-deviation /// division are supported. In the future we can /// add whitening, etc. impl Normalize for Data { fn normalize(&mut self, num_std: f32){ let normalized_inputs = utils::normalize_array(&self.input.borrow(), num_std); let normalized_target = utils::normalize_array(&self.target.borrow(), num_std); self.input = RefCell::new(Box::new(normalized_inputs)); self.target = RefCell::new(Box::new(normalized_target)); } }
use mtree::MTree; /// Parses string and construct MTree. /// BNF syntax: /// <Value> ::= Character /// <Node> ::= <Value> <Children> /// <Children> ::= '^' | <Node> <Children> pub fn str_to_tree(s: &str) -> MTree { fn parse_node(s: &str) -> (MTree, &str) { let (c, last) = next_token(s); let (children, rem) = parse_children(last); (MTree::node(c, children), rem) } fn parse_children(s: &str) -> (Vec<MTree>, &str) { let (c, last) = next_token(s); match c { '^' => (vec![], last), _ => { let mut res = vec![]; let (node, rem) = parse_node(s); res.push(node); let (children, rem) = parse_children(rem); res.extend_from_slice(&children); (res, rem) } } } fn next_token(s: &str) -> (char, &str) { let (first, last) = s.split_at(1); let c = first.chars().nth(0).unwrap(); (c, last) } parse_node(s).0 } /// Converts Mtree to string representation pub fn tree_to_str(tree: &MTree) -> String { fn tree_to_str_inner(tree: &MTree, acc: &mut String) { acc.push(tree.get_value()); for child in tree.get_children() { tree_to_str_inner(child, acc); } acc.push('^'); // add backtrack mark } let mut res = String::new(); tree_to_str_inner(tree, &mut res); res } #[cfg(test)] mod tests { use super::*; #[test] fn test_str_to_tree() { assert_eq!(str_to_tree("a^"), MTree::leaf('a')); assert_eq!( str_to_tree("ab^^"), MTree::node('a', vec![MTree::leaf('b')]) ); assert_eq!( str_to_tree("ab^c^d^^"), MTree::node( 'a', vec![MTree::leaf('b'), MTree::leaf('c'), MTree::leaf('d')] ) ); assert_eq!( str_to_tree("abc^^^"), MTree::node('a', vec![MTree::node('b', vec![MTree::leaf('c')])]) ); assert_eq!( str_to_tree("afg^^c^bd^e^^^"), MTree::node( 'a', vec![ MTree::node('f', vec![MTree::leaf('g')]), MTree::leaf('c'), MTree::node('b', vec![MTree::leaf('d'), MTree::leaf('e')]) ] ) ); } #[test] fn test_tree_to_str() { assert_eq!(tree_to_str(&MTree::leaf('a')), "a^"); assert_eq!( tree_to_str(&MTree::node('a', vec![MTree::leaf('b')])), "ab^^" ); assert_eq!( tree_to_str(&MTree::node( 'a', vec![MTree::leaf('b'), MTree::leaf('c'), MTree::leaf('d')] )), "ab^c^d^^" ); assert_eq!( tree_to_str(&MTree::node( 'a', vec![MTree::node('b', vec![MTree::leaf('c')])] )), "abc^^^" ); assert_eq!( tree_to_str(&MTree::node( 'a', vec![ MTree::node('f', vec![MTree::leaf('g')]), MTree::leaf('c'), MTree::node('b', vec![MTree::leaf('d'), MTree::leaf('e')]) ] )), "afg^^c^bd^e^^^" ); } }
use std::{ fmt::{Debug, Display}, sync::Arc, }; use async_trait::async_trait; use datafusion::{error::DataFusionError, physical_plan::ExecutionPlan}; pub mod panic; pub mod planner_v1; mod query_chunk; use crate::{partition_info::PartitionInfo, plan_ir::PlanIR}; /// Creates an [`ExecutionPlan`] for a [`PlanIR`] that compacts some /// number of input files together #[async_trait] pub trait DataFusionPlanner: Debug + Display + Send + Sync { async fn plan( &self, ir: &PlanIR, partition: Arc<PartitionInfo>, ) -> Result<Arc<dyn ExecutionPlan>, DataFusionError>; }
use anyhow::Error; use futures::prelude::*; use rskafka::{Consumer, ConsumerConfig}; use tokio::signal; #[tokio::main] async fn main() -> Result<(), Error> { env_logger::Builder::new() .parse_filters("rskafka::consumer=trace,rskafka::fetch=trace,info") // .init(); let config = ConsumerConfig { client_id: "rskafka-example".into(), group_id: "rskafka-example".into(), topics: vec!["rskafka-test".into()], }; let consumer = Consumer::bootstrap("localhost:9092", config).await?; let (killswitch, assignment_stream) = consumer.split(); // Register graceful shutdown procedure tokio::spawn(async { signal::ctrl_c().await?; killswitch.shutdown().await; Ok::<(), anyhow::Error>(()) }); let result = assignment_stream .try_for_each(|assignment| async move { println!("Assignment received"); let committer = assignment.commit_sink(); assignment .into_message_stream() .then(|msg| async move { println!("{:#?}", msg); msg.into_offset() }) .map(Ok) .forward(committer) .await?; // Commit sink cannot really fail for now println!("Assignment revoked"); Ok(()) }) .await .map_err(|e| e.0); match result { Ok(_) => println!("Finished"), Err(e) => eprintln!("{:?}", e), } Ok(()) }
#[doc = r"Value to write to the register"] pub struct W { bits: u8, } impl super::CSRL0 { #[doc = r"Writes to the register"] #[inline(always)] pub fn write<F>(&self, f: F) where F: FnOnce(&mut W) -> &mut W, { self.register.set( f(&mut W { bits: Self::reset_value(), }) .bits, ); } #[doc = r"Reset value of the register"] #[inline(always)] pub const fn reset_value() -> u8 { 0 } #[doc = r"Writes the reset value to the register"] #[inline(always)] pub fn reset(&self) { self.register.set(Self::reset_value()) } } #[doc = r"Proxy"] pub struct _USB_CSRL0_RXRDYW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_RXRDYW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 0); self.w.bits |= ((value as u8) & 1) << 0; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_TXRDYW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_TXRDYW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 1); self.w.bits |= ((value as u8) & 1) << 1; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_STALLEDW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_STALLEDW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 2); self.w.bits |= ((value as u8) & 1) << 2; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_DATAENDW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_DATAENDW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 3); self.w.bits |= ((value as u8) & 1) << 3; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_SETENDW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_SETENDW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 4); self.w.bits |= ((value as u8) & 1) << 4; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_STALLW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_STALLW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 5); self.w.bits |= ((value as u8) & 1) << 5; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_RXRDYCW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_RXRDYCW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 6); self.w.bits |= ((value as u8) & 1) << 6; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_SETENDCW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_SETENDCW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 7); self.w.bits |= ((value as u8) & 1) << 7; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_SETUPW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_SETUPW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 3); self.w.bits |= ((value as u8) & 1) << 3; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_ERRORW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_ERRORW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 4); self.w.bits |= ((value as u8) & 1) << 4; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_REQPKTW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_REQPKTW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 5); self.w.bits |= ((value as u8) & 1) << 5; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_STATUSW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_STATUSW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 6); self.w.bits |= ((value as u8) & 1) << 6; self.w } } #[doc = r"Proxy"] pub struct _USB_CSRL0_NAKTOW<'a> { w: &'a mut W, } impl<'a> _USB_CSRL0_NAKTOW<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 7); self.w.bits |= ((value as u8) & 1) << 7; self.w } } impl W { #[doc = r"Writes raw bits to the register"] #[inline(always)] pub unsafe fn bits(&mut self, bits: u8) -> &mut Self { self.bits = bits; self } #[doc = "Bit 0 - Receive Packet Ready"] #[inline(always)] pub fn usb_csrl0_rxrdy(&mut self) -> _USB_CSRL0_RXRDYW { _USB_CSRL0_RXRDYW { w: self } } #[doc = "Bit 1 - Transmit Packet Ready"] #[inline(always)] pub fn usb_csrl0_txrdy(&mut self) -> _USB_CSRL0_TXRDYW { _USB_CSRL0_TXRDYW { w: self } } #[doc = "Bit 2 - Endpoint Stalled"] #[inline(always)] pub fn usb_csrl0_stalled(&mut self) -> _USB_CSRL0_STALLEDW { _USB_CSRL0_STALLEDW { w: self } } #[doc = "Bit 3 - Data End"] #[inline(always)] pub fn usb_csrl0_dataend(&mut self) -> _USB_CSRL0_DATAENDW { _USB_CSRL0_DATAENDW { w: self } } #[doc = "Bit 4 - Setup End"] #[inline(always)] pub fn usb_csrl0_setend(&mut self) -> _USB_CSRL0_SETENDW { _USB_CSRL0_SETENDW { w: self } } #[doc = "Bit 5 - Send Stall"] #[inline(always)] pub fn usb_csrl0_stall(&mut self) -> _USB_CSRL0_STALLW { _USB_CSRL0_STALLW { w: self } } #[doc = "Bit 6 - RXRDY Clear"] #[inline(always)] pub fn usb_csrl0_rxrdyc(&mut self) -> _USB_CSRL0_RXRDYCW { _USB_CSRL0_RXRDYCW { w: self } } #[doc = "Bit 7 - Setup End Clear"] #[inline(always)] pub fn usb_csrl0_setendc(&mut self) -> _USB_CSRL0_SETENDCW { _USB_CSRL0_SETENDCW { w: self } } #[doc = "Bit 3 - Setup Packet"] #[inline(always)] pub fn usb_csrl0_setup(&mut self) -> _USB_CSRL0_SETUPW { _USB_CSRL0_SETUPW { w: self } } #[doc = "Bit 4 - Error"] #[inline(always)] pub fn usb_csrl0_error(&mut self) -> _USB_CSRL0_ERRORW { _USB_CSRL0_ERRORW { w: self } } #[doc = "Bit 5 - Request Packet"] #[inline(always)] pub fn usb_csrl0_reqpkt(&mut self) -> _USB_CSRL0_REQPKTW { _USB_CSRL0_REQPKTW { w: self } } #[doc = "Bit 6 - STATUS Packet"] #[inline(always)] pub fn usb_csrl0_status(&mut self) -> _USB_CSRL0_STATUSW { _USB_CSRL0_STATUSW { w: self } } #[doc = "Bit 7 - NAK Timeout"] #[inline(always)] pub fn usb_csrl0_nakto(&mut self) -> _USB_CSRL0_NAKTOW { _USB_CSRL0_NAKTOW { w: self } } }
#[path = "div_2/with_big_integer_dividend.rs"] mod with_big_integer_dividend; #[path = "div_2/with_small_integer_dividend.rs"] mod with_small_integer_dividend; test_stdout!(without_integer_dividend_errors_badarith, "{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n"); test_stdout!( with_integer_dividend_without_integer_divisor_errors_badarith, "{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n{caught, error, badarith}\n" ); test_stdout!( with_integer_dividend_with_zero_divisor_errors_badarith, "{caught, error, badarith}\n{caught, error, badarith}\n" );
use crate::models::{CanGetHash, DieselResult, User}; use crate::schema::*; use crate::MySqlPooledConnection; use chrono::NaiveDateTime; use model::{HashSha256, PlayMode, ScoreId}; use std::str::FromStr; #[derive(Debug, Clone, Queryable, Insertable)] #[diesel(table_name = score_snaps)] pub struct ScoreSnap { pub id: i32, pub user_id: i32, pub sha256: String, pub mode: i32, pub date: NaiveDateTime, pub clear: i32, pub score: i32, pub combo: i32, pub min_bp: i32, } impl ScoreSnap { pub fn by_user_id( connection: &mut MySqlPooledConnection, query_id: i32, ) -> DieselResult<Vec<ScoreSnap>> { use crate::schema::score_snaps::dsl::*; score_snaps.filter(user_id.eq(query_id)).load(connection) } pub fn by_user_id_and_score_id( connection: &mut MySqlPooledConnection, query_id: i32, query_hash: &str, query_mode: i32, ) -> DieselResult<Vec<ScoreSnap>> { use crate::schema::score_snaps::dsl::*; score_snaps .filter(user_id.eq(query_id)) .filter(sha256.eq(query_hash)) .filter(mode.eq(query_mode)) .load(connection) } pub fn delete_by_user( connection: &mut MySqlPooledConnection, user: &User, ) -> DieselResult<usize> { use crate::schema::score_snaps::dsl::*; diesel::delete(score_snaps.filter(user_id.eq(user.id))).execute(connection) } pub fn by_sha256( connection: &mut MySqlPooledConnection, query_hash: &str, ) -> DieselResult<Vec<ScoreSnap>> { use crate::schema::score_snaps::dsl::*; score_snaps.filter(sha256.eq(query_hash)).load(connection) } pub fn get_score_id(&self) -> model::ScoreId { ScoreId::new( HashSha256::from_str(&self.sha256).unwrap(), PlayMode::from(self.mode), ) } } #[derive(Debug, Clone, Insertable)] #[diesel(table_name = score_snaps)] pub struct ScoreSnapForUpdate { pub user_id: i32, pub sha256: String, pub mode: i32, pub date: NaiveDateTime, pub clear: i32, pub score: i32, pub combo: i32, pub min_bp: i32, } impl CanGetHash for ScoreSnapForUpdate { fn hash_sha256(&self) -> String { self.sha256.clone() } }
use rand::Rng; use crate::{ networking::state_transition_engine::State, smb2::requests::{echo::Echo, RequestType}, }; pub mod close_fuzzer; pub mod create_fuzzer; pub mod handshake; pub mod query_info_fuzzer; /// The fuzzing directive tells the fuzzer which message to fuzz with which /// fuzzing strategy in which state how many times. #[derive(Debug, PartialEq, Eq, Clone)] pub struct FuzzingDirective { /// Defines the message type to be fuzzed. pub message: Option<RequestType>, /// Defines the number of iterations of the fuzzing process. pub iterations: u32, /// Defines the underlying fuzzing strategy for the corresponding packet. pub fuzzing_strategy: Option<FuzzingStrategy>, /// Defines the desired state of the SMB protocol that is to be reached /// before the fuzzing process begins. pub state: Option<State>, } impl FuzzingDirective { /// Creates a new instance of the fuzzing directive. pub fn default() -> Self { FuzzingDirective { message: None, iterations: 100, fuzzing_strategy: None, state: None, } } } /// Defines the fuzzing strategy for a packet. /// To add further strategies, the corresponding fuzzing methods /// have to be implemented for the packets. #[derive(Debug, PartialEq, Eq, Clone)] pub enum FuzzingStrategy { /// The predefined fuzzing strategy samples from the predefined /// values of some fields and leaves the remaining fields valid. Predefined, RandomFields, CompletelyRandom, } impl FuzzingStrategy { /// Maps a user input string to a fuzzing strategy. pub fn map_string_to_fuzzing_strategy(strategy: &str) -> FuzzingStrategy { match strategy { "-pre" | "--predefined" | "--Predefined" => FuzzingStrategy::Predefined, "-rf" | "--random_fields" | "--Random_fields" => FuzzingStrategy::RandomFields, "-cran" | "--completely_random" | "--Completely_random" => { FuzzingStrategy::CompletelyRandom } _ => panic!("Invalid Fuzzing Strategy."), } } } /// Creates a random byte array of predefined length for Random Fields Fuzzing. pub fn create_random_byte_array_of_predefined_length(length: u32) -> Vec<u8> { let mut random_bytes: Vec<u8> = Vec::new(); for _ in 0..length { random_bytes.push(rand::random::<u8>()); } random_bytes } /// Creates a random byte array of random length for Random Fields Fuzzing. pub fn create_random_byte_array_with_random_length() -> Vec<u8> { let mut random_bytes: Vec<u8> = Vec::new(); for _ in 0..rand::thread_rng().gen_range(0..10000) { random_bytes.push(rand::random::<u8>()); } random_bytes } /// Fuzzes the echo request with predefined values. pub fn fuzz_echo_with_predefined_values() -> Echo { Echo::default() } /// Fuzzes the echo request with a random byte array of length 2. pub fn fuzz_echo_with_random_fields() -> Echo { let mut echo = Echo::default(); echo.reserved = create_random_byte_array_of_predefined_length(2); echo } /// Fuzzes the echo request with a random byte array of random length. pub fn fuzz_echo_completely_random() -> Echo { let mut echo = Echo::default(); echo.reserved = create_random_byte_array_with_random_length(); echo } #[cfg(test)] mod tests { use super::*; #[test] fn test_create_random_byte_array_of_predefined_length() { assert_eq!(8, create_random_byte_array_of_predefined_length(8).len()); } }
#[derive(Debug)] enum UsState { Alabama, Alaska, California, Washington, } enum Coin { Penny, Nickel, Dime, Quarter(UsState), } fn value_in_cents(coin: Coin) -> u32 { match coin { Coin::Penny => 1, Coin::Nickel => 5, Coin::Dime => 10, Coin::Quarter(state) => { println!("State quarter from {:?}!", state); 25 }, } } #[derive(Debug)] enum IpAddrKind { V4, V6 } #[derive(Debug)] struct IpAddr { kind: IpAddrKind, address: String, } fn plus_one(x: Option<i32>) -> Option<i32> { match x { None => None, Some(i) => Some(i + 1), } } fn main() { let home = IpAddr { kind: IpAddrKind::V4, address: String::from("127.0.0.1"), }; let loopback = IpAddr { kind: IpAddrKind::V6, address: String::from("::1"), }; println!("home is {:#?}, loopback is {:#?}", home, loopback); let coin = Coin::Quarter(UsState::California); println!("{}", value_in_cents(coin)); let some_u8_value = 0u8; match some_u8_value { 1 => println!("one"), 3 => println!("three"), 5 => println!("five"), 7 => println!("seven"), _ => (), } let five = Some(5); let six = plus_one(five); let none = plus_one(None); if let Some(6) = six { println!("Six"); } if let None = none { println!("None"); } let mut count = 0; let coin = Coin::Quarter(UsState::California); match coin { Coin::Quarter(state) => println!("State quarter from {:?}!", state), _ => count += 1, } println!("Count = {}", count); }
pub mod exp_log; pub mod exterior_product; pub mod geometric_product; pub mod inner_product; pub mod matrix; pub mod sandwich; pub mod sse;
use minigrep::{run, Config}; use std::{env, process}; fn main() { // 注意 std::env::args 在其任何参数包含无效 Unicode 字符时会 panic。 // 如果你需要接受包含无效 Unicode 字符的参数,使用 std::env::args_os 代替。 // 这个函数返回 OsString 值而不是 String 值 // collect 是一个经常需要注明类型的函数 let args: Vec<String> = env::args().collect(); // println!("{:?}", args); // unwrap_or_else 在 Err 时会调用一个 closure let config = Config::new(env::args()).unwrap_or_else(|err| { // 将错误信息输出到 stderr eprintln!("Problem parsing arguments: {}", err); process::exit(1); }); if let Err(e) = run(config) { eprintln!("Application error: {}", e); process::exit(1); } }
use climer::Timer; #[derive(Default)] pub struct TimerRes(pub Option<Timer>); impl TimerRes { pub fn add_timer(&mut self) { self.0 = Some(Timer::new( None, // Some(Output::new::<char, char>(None, None, None)), None, )); } pub fn remove_timer(&mut self) { self.0 = None; } }
pub mod service; pub mod files;
pub mod tuples; pub mod matrices; pub mod transformations; pub mod geometry; pub mod image; pub mod raytracer; pub mod material; pub mod light; use image::*; use transformations::*; use tuples::*; use geometry::*; use raytracer::*; use light::*; use material::*; fn main() { println!("Ray Tracer!"); let floor = Plane::new( 0, Transformation::identity(), Material::new(Color::new(1.0, 0.9, 0.9), 0.1, 0.9, 0.0, 200.0, 0.5) ); let left_wall = Plane::new( 1, Transformation::chain(&vec![ Transformation::translation(Tuple4D::new_vector(0.0, 0.0, 5.0)), Transformation::rotate_y((- std::f64::consts::PI / 4.0).to_degrees()), Transformation::rotate_x(( std::f64::consts::PI / 2.0).to_degrees()), ]), Material::new(Color::new(1.0, 0.9, 0.9), 0.1, 0.9, 0.0, 200.0, 0.5) ); let right_wall = Plane::new( 2, Transformation::chain(&vec![ Transformation::translation(Tuple4D::new_vector(0.0, 0.0, 5.0)), Transformation::rotate_y((std::f64::consts::PI / 4.0).to_degrees()), Transformation::rotate_x((std::f64::consts::PI / 2.0).to_degrees()), ]), Material::new(Color::new(1.0, 0.9, 0.9), 0.1, 0.9, 0.0, 200.0, 0.5) ); let middle = UnitSphere::new( 3, Transformation::chain(&vec![ Transformation::translation(Tuple4D::new_vector(-0.5, 1.0, 0.5)) ]), Material::new(Color::new(0.1, 1.0, 0.5), 0.1, 0.7, 0.3, 200.0, 0.0) ); let right = UnitSphere::new( 4, Transformation::chain(&vec![ Transformation::translation(Tuple4D::new_vector(1.5, 0.5, -1.5)), Transformation::scale(Tuple4D::new_vector(0.5, 0.5, 0.5)) ]), Material::new(Color::new(0.1, 1.0, 0.5), 0.1, 0.7, 0.3, 200.0, 0.0) ); let left = UnitSphere::new( 5, Transformation::chain(&vec![ Transformation::translation(Tuple4D::new_vector(-1.5, 0.33, -0.75)), Transformation::scale(Tuple4D::new_vector(0.33, 0.33, 0.33)) ]), Material::new(Color::new(1.0, 0.8, 0.1), 0.1, 0.7, 0.3, 200.0, 0.0) ); let light = PointLight::new( Color::new(1.0, 1.0, 1.0), Tuple4D::new_point(-10.0, 10.0, -10.0)); let cam = Camera::new( 512.0, 256.0, (std::f64::consts::PI / 3.0).to_degrees(), Transformation::view( Tuple4D::new_point(0.0, 2.5, -8.0), Tuple4D::new_point(0.0, 1.0, 0.0), Tuple4D::new_vector(0.0, 1.0, 0.0) ) ); let world = World::new( vec![ Box::from(floor), Box::from(left_wall), Box::from(right_wall), Box::from(middle), Box::from(right), Box::from(left) ], vec![light] ); let tracer = RayTracer::new(cam, world); let img = tracer.trace(5); img.write_ppm("scene.png".to_string()); }
// Copyright 2022 Datafuse Labs. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use std::sync::Arc; use common_catalog::table_context::TableContext; use common_exception::ErrorCode; use crate::optimizer::PhysicalProperty; use crate::optimizer::RelExpr; use crate::optimizer::RelationalProperty; use crate::optimizer::RequiredProperty; use crate::plans::Operator; use crate::plans::RelOp; #[derive(Clone, Debug, PartialEq, Eq, Hash)] pub struct PatternPlan { pub plan_type: RelOp, } impl Operator for PatternPlan { fn rel_op(&self) -> RelOp { self.plan_type.clone() } fn is_pattern(&self) -> bool { true } fn derive_relational_prop( &self, _rel_expr: &RelExpr, ) -> common_exception::Result<RelationalProperty> { Err(ErrorCode::Internal( "Cannot derive relational property for pattern plan", )) } fn derive_physical_prop( &self, _rel_expr: &RelExpr, ) -> common_exception::Result<PhysicalProperty> { Err(ErrorCode::Internal( "Cannot derive physical property for pattern plan", )) } fn compute_required_prop_child( &self, _ctx: Arc<dyn TableContext>, _rel_expr: &RelExpr, _child_index: usize, _required: &RequiredProperty, ) -> common_exception::Result<RequiredProperty> { unreachable!() } }
use super::poke_type::{TypeInteraction, TypeFactor}; use std::collections::HashMap; use csv::ReaderBuilder; use serde::Deserialize; #[derive(Deserialize)] struct TypeName{ name: String } #[derive(Deserialize)] struct SerializeTypeFactor{ type_one: String, type_two: String, factor: String } pub fn generate_type_table() -> Option<HashMap<String, TypeInteraction>> { let types = include_str!("static/types.csv"); let type_weaknesses = include_str!("static/weaknesses.csv"); let mut reader = ReaderBuilder::new().delimiter(b',').from_reader(types.as_bytes()); let mut poke_types_map: HashMap<String, TypeInteraction> = HashMap::new(); for record in reader.records(){ let poke_types_map: &mut HashMap<String, TypeInteraction> = &mut poke_types_map; match record { Ok(typename) => { let typename: TypeName = typename.deserialize(None).unwrap(); poke_types_map.insert(typename.name.clone(), TypeInteraction::new()); }, Err(_) => println!("Couldn't parse type") }; } let mut reader = ReaderBuilder::new().delimiter(b',').from_reader(type_weaknesses.as_bytes()); for record in reader.records(){ match record{ Ok(serialized_typefactor) => { let poke_types_map: &mut HashMap<String, TypeInteraction> = &mut poke_types_map; let serialized_typefactor: SerializeTypeFactor = match serialized_typefactor.deserialize(None) { Ok(t) => t, Err(_) => continue }; let type_one = serialized_typefactor.type_one; let type_two = serialized_typefactor.type_two; let factor = serialized_typefactor.factor; match factor.as_str() { "2" => match poke_types_map.get_mut(&type_one){ Some(t) => t.add_type_factor(TypeFactor::Weakness(type_two)), None => { println!("{}", type_one); continue; } }, "0.5" => match poke_types_map.get_mut(&type_one){ Some(t) => t.add_type_factor(TypeFactor::Strength(type_two)), None => { println!("{}", type_one); continue; } }, "0" => match poke_types_map.get_mut(&type_one){ Some(t) => t.add_type_factor(TypeFactor::Ineffective(type_two)), None => { println!("{}", type_one); continue; } }, _ => continue }; }, Err(_) => println!("Couldn't serialize typefactor") }; } Some(poke_types_map) }
extern crate clap; use ansi_term::Colour; use clap::{Arg, Command}; use futures::{stream, StreamExt}; use reqwest::header::{HeaderValue, LOCATION}; use reqwest::{redirect, Response, Url}; use std::collections::HashMap; use std::fs::File; use std::io::prelude::*; use std::io::Write; use std::path::{Path,PathBuf}; use std::process; use std::{io, time};use tokio::time::sleep; #[tokio::main] async fn main() { #[cfg(target_os = "windows")] let _ = ansi_term::enable_ansi_support(); let argsmatches = Command::new("waybackrust") .version("0.2.11") .author("Neolex <hascoet.kevin@neolex-security.fr>") .about("Wayback machine tool for bug bounty") .subcommand( Command::new("urls") .about("Get all urls for a domain") .arg(Arg::new("domain") .value_name("domain.com or file.txt or stdin") .help("domain name or file with domains") .required(true)) .arg( Arg::new("subs") .short('s') .long("subs") .help("Get subdomains too") .action(clap::ArgAction::SetFalse), ) .arg( Arg::new("silent") .long("silent") .help("Disable informations prints") .action(clap::ArgAction::SetFalse), ) .arg( Arg::new("nocheck") .short('n') .long("nocheck") .help("Don't check the HTTP status") .action(clap::ArgAction::SetFalse), ) .arg( Arg::new("delay") .short('d') .long("delay") .help("Make a delay between each request") .value_name("delay in milliseconds") .value_parser(clap::value_parser!(u64)) ) .arg( Arg::new("threads") .short('t') .long("threads") .help("Number of concurrent requests (default: 24)") .value_name("Number of concurrent requests") ) .arg( Arg::new("nocolor") .short('p') .long("nocolor") .help("Don't colorize HTTP status") .action(clap::ArgAction::SetFalse), ) .arg( Arg::new("output_filepath") .short('o') .long("output-file") .value_name("FILE") .value_parser(clap::value_parser!(PathBuf)) .help( "Name of the file to write the list of urls (default: print on stdout)", ) ).arg( Arg::new("blacklist") .short('b') .long("blacklist") .value_name("extensions to blacklist") .help("The extensions you want to blacklist (ie: -b png,jpg,txt)") ).arg( Arg::new("whitelist") .short('w') .long("whitelist") .value_name("extensions to whitelist") .help("The extensions you want to whitelist (ie: -w png,jpg,txt)") ).arg( Arg::new("blacklist code") .short('z') .long("blacklist-code") .value_name("codes to blacklist") .help("The status codes you want to blacklist (ie: --blacklist-code 404,403,500)") ).arg( Arg::new("whitelist code") .short('c') .long("whitelist-code") .value_name("codes to whitelist") .help("The status codes you want to blacklist (ie: --whitelist-code 404,403,500)") ) ) .subcommand( Command::new("robots") .about("Get all disallowed entries from robots.txt") .arg(Arg::new("domain") .value_name("domain.com or file.txt or stdin") .help("domain name or file with domains") .required(true)) .arg( Arg::new("output_filepath") .short('o').long("output-file").value_name("FILE") .help("Name of the file to write the list of uniq paths (default: print on stdout)")) .arg( Arg::new("silent") .long("silent") .help("Disable informations prints") .action(clap::ArgAction::SetFalse), ), ) .subcommand( Command::new("unify") .about("Get the content of all archives for a given url") .arg(Arg::new("url") .value_name("url or file") .help("url or file with urls") .required(true)) .arg( Arg::new("output_filepath") .short('o') .long("output-file") .value_name("FILE") .help("Name of the file to write contents of archives (default: print on stdout)")) .arg( Arg::new("silent") .long("silent") .help("Disable informations prints"), ), ).get_matches(); // get all urls responses codes if let Some(argsmatches) = argsmatches.subcommand_matches("urls") { let domain_or_file = argsmatches.get_one::<String>("domain").unwrap(); let domains = get_domains(domain_or_file); let output_filepath = argsmatches.get_one::<PathBuf>("output_filepath"); let subs = argsmatches.get_flag("subs"); let check = argsmatches.get_flag("nocheck"); let color = argsmatches.get_flag("nocolor"); let verbose = argsmatches.get_flag("silent"); let delay = argsmatches.get_one::<u64>("delay").unwrap_or(&0); let workers = match argsmatches.get_one::<usize>("threads") { Some(d) => { if delay > &0 { println!( "{} you set a delay and a number of threads, there will only be one thread.", Colour::RGB(255, 165, 0) .bold() .paint("Warning:") .to_string() ); &0 } else { d } } None => &24, }; if delay > &0 && !check { println!( "{} delay is useless when --nocheck is used.", Colour::RGB(255, 165, 0) .bold() .paint("Warning:") .to_string() ); } let blacklist: Vec<String> = match argsmatches.get_one::<String>("blacklist") { Some(arg) => arg.split(',').map(|ext| [".", ext].concat()).collect(), None => Vec::new(), }; let blacklist_code: Vec<u16> = match argsmatches.get_one::<String>("blacklist code" ) { Some(arg) => arg.split(',').map(|code| code.parse::<u16>().unwrap()).collect::<Vec<u16>>(), None => Vec::new(), }; let whitelist_code: Vec<u16> = match argsmatches.get_one::<String>("whitelist code" ) { Some(arg) => arg.split(',').map(|code| code.parse::<u16>().unwrap()).collect::<Vec<u16>>(), None => Vec::new(), }; let whitelist: Vec<String> = match argsmatches.get_one::<String>("whitelist") { Some(arg) => arg.split(',').map(|ext| [".", ext].concat()).collect(), None => Vec::new(), }; if !blacklist.is_empty() && !whitelist.is_empty() { println!( "{} You set a blacklist and a whitelist. Only the whitelist will be used.", Colour::RGB(255, 165, 0) .bold() .paint("Warning:") .to_string() ); } run_urls( domains, subs, check, output_filepath , *delay, color, verbose, blacklist, whitelist, *workers,blacklist_code,whitelist_code ) .await; } // get all disallow robots if let Some(argsmatches) = argsmatches.subcommand_matches("robots") { let output_filepath = argsmatches.get_one::<PathBuf>("output_filepath"); let domain_or_file = argsmatches.get_one::<String>("domain").unwrap(); let domains = get_domains(domain_or_file); let verbose = argsmatches.get_flag("silent"); run_robots(domains, output_filepath , verbose).await; } if let Some(argsmatches) = argsmatches.subcommand_matches("unify") { let output_filepath = argsmatches.get_one::<PathBuf>("output_filepath "); let url_or_file = argsmatches.get_one::<String>("url").unwrap(); let urls = get_domains(url_or_file); let verbose = argsmatches.get_flag("silent"); run_unify(urls, output_filepath , verbose).await; } } fn get_domains(domain_or_file: &String) -> Vec<String> { if domain_or_file.ne("stdin") { if Path::new(domain_or_file).is_file() { let path = Path::new(domain_or_file); let display = path.display(); // Open the path in read-only mode, returns `io::Result<File>` let mut file = match File::open(&path) { // The `description` method of `io::Error` returns a string that // describes the error Err(why) => panic!("couldn't open {}: {}", display, why), Ok(file) => file, }; // Read the file contents into a string, returns `io::Result<usize>` let mut s = String::new(); let content: String = match file.read_to_string(&mut s) { Err(why) => panic!("couldn't read {}: {}", display, why), Ok(_) => s, }; content.lines().map(String::from).collect() } else { vec![domain_or_file.to_string()] } } else { let mut s = String::new(); let content: String = match io::stdin().read_to_string(&mut s) { Err(why) => panic!("couldn't read stdin {}", why), Ok(_) => s, }; content.lines().map(String::from).collect() } } async fn run_urls( domains: Vec<String>, subs: bool, check: bool, output_filepath : Option<&PathBuf>, delay: u64, color: bool, verbose: bool, blacklist: Vec<String>, whitelist: Vec<String>, workers: usize, blacklist_code: Vec<u16>, whitelist_code: Vec<u16> ) { let mut join_handles = Vec::with_capacity(domains.len()); for domain in domains { let black = blacklist.clone(); let white = whitelist.clone(); let blacklist_code = blacklist_code.clone(); let whitelist_code = whitelist_code.clone(); join_handles.push(tokio::spawn(async move { run_url( domain, subs, check, delay, color, verbose, black, white, workers,blacklist_code,whitelist_code ) .await })); } let mut output_string = String::new(); for handle in join_handles { let ret_url = handle.await.expect("fail"); output_string.push_str(ret_url.as_str()); } if let Some(path) = output_filepath { write_string_to_file(output_string, path); if verbose { println!("urls saved to {}", path.display()) }; } } fn get_path(url: &str) -> String { match Url::parse(&url) { Ok(parsed) => parsed.path().to_string(), Err(_) => "".to_string(), } } async fn run_url( domain: String, subs: bool, check: bool, delay: u64, color: bool, verbose: bool, blacklist: Vec<String>, whitelist: Vec<String>, workers: usize, blacklist_code: Vec<u16>, whitelist_code: Vec<u16> ) -> String { let pattern = if subs { format!("*.{}%2F*", domain) } else { format!("{}%2F*", domain) }; let url = format!( "http://web.archive.org/cdx/search/cdx?url={}&output_filepath =text&fl=original&collapse=urlkey", pattern ); let response = match reqwest::get(url.as_str()).await { Ok(res) => res, Err(e) => { eprintln!("{}", e); process::exit(-1) } }; let response_text = match response.text().await { Ok(txt) => txt, Err(e) => { eprintln!("{}", e); process::exit(-1) } }; let lines = response_text.lines().map(|item| item.to_string()); let urls: Vec<String> = if !whitelist.is_empty() { lines .filter(|url| whitelist.iter().any(|ext| get_path(url).ends_with(ext))) .collect() } else { lines .filter(|url| !blacklist.iter().any(|ext| get_path(url).ends_with(ext))) .collect() }; if check { if delay > 0 { http_status_urls_delay(urls, delay, color, verbose, blacklist_code,whitelist_code).await } else { http_status_urls_no_delay(urls, color, verbose, workers, blacklist_code,whitelist_code).await } } else { println!("{}", urls.join("\n")); urls.join("\n") } } async fn run_robots(domains: Vec<String>, output_filepath : Option<&PathBuf>, verbose: bool) { let mut output_string = String::new(); for domain in domains { output_string.push_str(run_robot(domain, verbose).await.as_str()); } if let Some(path) = output_filepath { write_string_to_file(output_string, path); if verbose { println!("urls saved to {}", path.display()) } } } async fn run_robot(domain: String, verbose: bool) -> String { let url = format!("{}/robots.txt", domain); let archives = get_archives(url.as_str(), verbose).await; get_all_robot_content(archives, verbose).await } async fn run_unify(urls: Vec<String>, output_filepath : Option<&PathBuf>, verbose: bool) { let mut output_string = String::new(); for url in urls { let archives = get_archives(url.as_str(), verbose).await; let unify_output = get_all_archives_content(archives, verbose).await; output_string.push_str(unify_output.as_str()); } if let Some(path) = output_filepath { write_string_to_file(output_string, path); if verbose { println!("urls saved to {}", path.display()) }; } } fn write_string_to_file(string: String, filename: &Path) { let mut file = File::create(filename).expect("Error creating the file"); file.write_all(string.as_bytes()) .expect("Error writing content to the file"); } async fn get_archives(url: &str, verbose: bool) -> HashMap<String, String> { if verbose { println!("Looking for archives for {}...", url) }; let to_fetch= format!("https://web.archive.org/cdx/search/cdx?url={}&output_filepath=text&fl=timestamp,original&filter=statuscode:200&collapse=digest", url); let lines: Vec<String> = reqwest::get(to_fetch.as_str()) .await .expect("Error in GET request") .text() .await .expect("Error parsing response") .lines() .map(|x| x.to_owned()) .collect(); let mut data = HashMap::new(); for line in lines { match line.split_whitespace().collect::<Vec<&str>>().as_slice() { [s1, s2] => { data.insert((*s1).to_string(), (*s2).to_string()); } _ => { panic!("Invalid Value for archive. line : {}", line); } } } data } async fn get_all_archives_content(archives: HashMap<String, String>, verbose: bool) -> String { if verbose { println!("Getting {} archives...", archives.len()) }; let mut all_text = String::new(); for (timestamp, url) in archives { let content = get_archive_content(url, timestamp).await; if verbose { println!("{}", content); } all_text.push_str(content.as_str()); } all_text.clone() } async fn get_all_robot_content(archives: HashMap<String, String>, verbose: bool) -> String { if verbose { println!("Getting {} archives...", archives.len()) }; let mut output_string = String::new(); for (timestamp, url) in archives { let archive_content = get_archive_content(url, timestamp).await; let disallowed_lines: Vec<String> = archive_content .lines() .filter(|line| line.contains("low:")) .map(|s| s.replace("Disallow:", "").replace("Allow:", "")) .collect(); for line in disallowed_lines { if !output_string.contains(&line) { output_string.push_str(format!("{}\n", line).as_str()); if verbose { println!("{}", line.trim()); } } } } output_string } async fn get_archive_content(url: String, timestamp: String) -> String { let timestampurl = format!("https://web.archive.org/web/{}/{}", timestamp, url); match reqwest::get(timestampurl.as_str()).await { Ok(resp) => resp.text().await.unwrap_or_else(|_| "".to_string()), Err(err) => { eprintln!( "Error while parsing response for {} ({})", timestampurl, err ); String::from("") } } } async fn http_status_urls_delay( urls: Vec<String>, delay: u64, color: bool, verbose: bool, blacklist_code: Vec<u16>, whitelist_code: Vec<u16> ) -> String { if verbose { println!("We're checking status of {} urls... ", urls.len()) }; let mut ret: String = String::new(); let client = reqwest::ClientBuilder::new() .redirect(redirect::Policy::none()) .build() .unwrap(); for url in urls { match client.get(&url).send().await { Ok(response) => { if delay > 0 { let delay_time = time::Duration::from_millis(delay); sleep(delay_time).await; } if whitelist_code.is_empty() || (&whitelist_code).into_iter().any(|code| *code == response.status().as_u16()) { if !(&blacklist_code).into_iter().any(|code| *code == response.status().as_u16()) { let str_output = if color { format!("{} {}\n", &url, colorize(&response)) } else if response.status().is_redirection() { format!( "{} {} to {}\n", &url, &response.status(), &response .headers() .get(LOCATION) .unwrap_or(&HeaderValue::from_str("").unwrap()) .to_str() .unwrap() ) } else { format!("{} {}\n", &url, &response.status()) }; print!("{}", str_output); ret.push_str(&str_output); } } } Err(_e) => { } } } ret } async fn http_status_urls_no_delay( urls: Vec<String>, color: bool, verbose: bool, workers: usize, blacklist_code: Vec<u16>, whitelist_code: Vec<u16> ) -> String { if verbose { println!("We're checking status of {} urls... ", urls.len()) }; let client = reqwest::ClientBuilder::new() .redirect(redirect::Policy::none()) .build() .unwrap(); let mut bodies = stream::iter(urls) .map(|url| async { (client.get(&url).send().await, url) }) .buffer_unordered(workers); let mut ret: String = String::new(); while let Some(b) = bodies.next().await { match b.0 { Ok(response) => { if whitelist_code.is_empty() || (&whitelist_code).into_iter().any(|code| *code == response.status().as_u16()) { if !(&blacklist_code).into_iter().any(|code| *code == response.status().as_u16()) { let str_output = if color { format!("{} {}\n", &b.1, colorize(&response)) } else if response.status().is_redirection() { format!( "{} {} to {}\n", &b.1, &response.status(), &response .headers() .get(LOCATION) .unwrap_or(&HeaderValue::from_str("").unwrap()) .to_str() .unwrap() ) } else { format!("{} {}\n", &b.1, &response.status()) }; print!("{}", str_output); ret.push_str(&str_output); } } } Err(e) => { eprintln!("error geting : {}", e); } } } ret } fn colorize(response: &Response) -> String { let status = response.status().to_string(); let status_col = match status.as_str() { "200 OK" => Colour::Green.bold().paint(&status).to_string(), "404 Not Found" => Colour::Red.bold().paint(&status).to_string(), "403 Forbidden" => Colour::Purple.bold().paint(&status).to_string(), _ => Colour::RGB(255, 165, 0).bold().paint(&status).to_string(), }; if response.status().is_redirection() { format!( "{} to {}", status_col, &response .headers() .get(LOCATION) .unwrap_or(&HeaderValue::from_str("").unwrap()) .to_str() .unwrap_or("") ) } else { status_col } }
use aoc2018::*; use std::fmt; #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct Pos(i64, i64); type Order = (i64, i64); pub type UnitId = usize; impl Pos { /// Get the order of the given position. pub fn order(self) -> Order { let Pos(x, y) = self; (y, x) } /// Get a collection of neighbours based on the current position. pub fn neighs(self) -> impl Iterator<Item = Pos> { let Pos(x, y) = self; vec![Pos(x, y - 1), Pos(x - 1, y), Pos(x + 1, y), Pos(x, y + 1)].into_iter() } /// The difference between this compared to another position. pub fn delta(self, other: Pos) -> (i64, i64) { let Pos(x0, y0) = self; let Pos(x1, y1) = other; ((x1 - x0).abs(), (y1 - y0).abs()) } /// The distance between two points. pub fn distance(self, other: Pos) -> i64 { let (x, y) = self.delta(other); x + y } } #[derive(Debug, Clone, Default)] pub struct State { position_by_unit: HashMap<UnitId, Pos>, unit_by_position: HashMap<Pos, UnitId>, walls: HashSet<Pos>, units: HashMap<UnitId, Unit>, width: i64, height: i64, debug: bool, sleep: u64, title: Option<String>, killed: BTreeMap<Kind, u64>, } impl State { /// Load state from the given string. pub fn load(input: &str) -> Result<State, Error> { let mut state = Self::default(); state.sleep = 50; for (y, line) in input.lines().enumerate() { for (x, c) in line.chars().enumerate() { let pos = Pos(x as i64, y as i64); state.width = i64::max(state.width, pos.0); state.height = i64::max(state.height, pos.1); let kind = match c { '#' => { state.walls.insert(pos); continue; } 'G' => Kind::Goblin, 'E' => Kind::Elf, '.' => continue, c => bail!("unsupported: {}", c), }; let unit = Unit::new(kind); let id = state.units.len(); state.units.insert(id, unit); state.position_by_unit.insert(id, pos); state.unit_by_position.insert(pos, id); } } Ok(state) } /// Enable more verbose debugging. pub fn debug(mut self) -> Self { self.debug = true; self } /// Remove a unit by ID. pub fn remove_unit(&mut self, id: UnitId) -> Result<(), Error> { if self.units.remove(&id).is_none() { bail!("no such unit: {}", id); } let pos = match self.position_by_unit.remove(&id) { Some(pos) => pos, None => bail!("no position for unit: {}", id), }; let old_id = match self.unit_by_position.remove(&pos) { Some(id) => id, None => bail!("no unit for position: {:?}", pos), }; if old_id != id { bail!("wrong unit for position: {:?}", pos); } Ok(()) } /// Moves a unit from one position to another. pub fn move_unit(&mut self, from: Pos, to: Pos) -> Result<(), Error> { let id = match self.unit_by_position.remove(&from) { Some(id) => id, None => bail!("no unit at position: {:?}", from), }; if let Some(other_id) = self.unit_by_position.insert(to, id) { bail!( "there was already a unit at position {:?}: {}", to, other_id ); } if let Some(old_pos) = self.position_by_unit.insert(id, to) { if old_pos != from { bail!( "wrong position `{:?}` recorded for unit `{}`, expected: {:?}", old_pos, id, from ); } } Ok(()) } /// Find the position of a unit. fn find_unit_position(&self, id: UnitId) -> Result<Pos, Error> { match self.position_by_unit.get(&id) { Some(pos) => Ok(*pos), None => bail!("no position for unit: {}", id), } } /// Find all units to perform actions based on their order. pub fn find_priority_units(&self) -> Vec<UnitId> { let mut units = self .position_by_unit .iter() .map(|(id, p)| (*id, *p)) .collect::<Vec<_>>(); units.sort_by_key(|(_, p)| p.order()); units.into_iter().map(|(id, _)| id).collect::<Vec<_>>() } /// Find the given unit by its position. pub fn find_unit_by_position(&self, pos: Pos) -> Option<&Unit> { let id = match self.unit_by_position.get(&pos).cloned() { Some(id) => id, None => return None, }; self.units.get(&id) } /// Get unit data. pub fn find_unit(&self, id: UnitId) -> Result<&Unit, Error> { match self.units.get(&id) { None => bail!("no unit by id: {}", id), Some(unit) => Ok(unit), } } pub fn find_mut_unit(&mut self, id: UnitId) -> Result<&mut Unit, Error> { match self.units.get_mut(&id) { None => bail!("no unit by id: {}", id), Some(unit) => Ok(unit), } } /// Find the target that is closest, or `None` if none if they are not reachable. fn find_next_step(&self, from: Pos, targets: impl IntoIterator<Item = Pos>) -> Option<Pos> { use self::hash_map::Entry; let targets = targets.into_iter().collect::<HashSet<_>>(); let found = { let mut queue = VecDeque::new(); queue.push_back((from, 0)); let mut visited = HashSet::new(); let mut found = None; while let Some((p, d)) = queue.pop_front() { if !visited.insert(p) { continue; } if targets.contains(&p) { found = Some((p, d)); break; } if p != from { if self.is_unit_at(p) || self.is_wall(p) { continue; } } queue.extend(p.neighs().map(|n| (n, d + 1))); } found }; let (target, target_distance) = match found { Some(found) => found, None => return None, }; let mut dist = HashMap::new(); let mut queue = VecDeque::new(); queue.push_back((target, 0)); while let Some((p, d)) = queue.pop_front() { if p != target { if self.is_unit_at(p) || self.is_wall(p) { continue; } } match dist.entry(p) { Entry::Vacant(e) => { e.insert(d); } Entry::Occupied(mut e) => { if *e.get() <= d { continue; } e.insert(d); } } queue.extend(p.neighs().map(|n| (n, d + 1))); } let mut candidates = Vec::new(); for n in from.neighs() { if let Some(d) = dist.get(&n).cloned() { if d == target_distance - 1 { candidates.push(n); } } } candidates.sort_by_key(|c| c.order()); candidates.into_iter().next() } /// Find targets to attack. fn find_attack_target(&self, my_id: UnitId) -> Result<Option<UnitId>, Error> { let me = self.find_unit(my_id)?; let my_pos = self.find_unit_position(my_id)?; let mut attack = None; for target_id in self.find_priority_units() { let target_unit = self.find_unit(target_id)?; if !me.is_target(target_unit) { continue; } let other_pos = self.find_unit_position(target_id)?; if my_pos.distance(other_pos) == 1 { attack = match attack { Some((_, hit_points)) if hit_points > target_unit.hit_points => { Some((target_id, target_unit.hit_points)) } None => Some((target_id, target_unit.hit_points)), other => other, }; } } Ok(attack.map(|(id, _)| id)) } /// Is the given grid position empty. fn is_wall(&self, pos: Pos) -> bool { self.walls.get(&pos).is_some() } /// Test if the given position has a unit. pub fn is_unit_at(&self, pos: Pos) -> bool { self.unit_by_position.contains_key(&pos) } /// Test if the given id is a unit. pub fn is_unit(&self, id: UnitId) -> bool { self.units.contains_key(&id) } pub fn simulate(&mut self) -> Result<u64, Error> { use std::io::{self, Write}; let stdout = io::stdout(); let mut out = stdout.lock(); // execute turns for tick in 0u64.. { if self.debug { writeln!(out, "[ENTER] to progress...")?; let mut s = String::new(); std::io::stdin().read_line(&mut s)?; } else { if self.sleep > 0 { std::thread::sleep(std::time::Duration::from_millis(self.sleep)); } write!(out, "{}[2J", 27 as char)?; } writeln!(out, "{}", Display(&self))?; if let Some(title) = self.title.as_ref() { writeln!(out, "{}", title)?; } writeln!(out, "Killed: {:?}", self.killed)?; writeln!(out, "Tick: {}", tick)?; let prioritized_units = self.find_priority_units(); for my_id in prioritized_units.iter().cloned() { if !self.is_unit(my_id) { continue; } let me = self.find_unit(my_id)?; // units to attack. let mut attack = self.find_attack_target(my_id)?; // if there is nothing to attack, then move. if attack.is_none() { // units to target. let mut targets = Vec::new(); for target_id in prioritized_units.iter().cloned().filter(|id| my_id != *id) { if !self.is_unit(target_id) { continue; } let other_pos = self.find_unit_position(target_id)?; let target = self.find_unit(target_id)?; if !me.is_target(target) { continue; } targets.push(other_pos); } let my_pos = self.find_unit_position(my_id)?; if let Some(next_pos) = self.find_next_step(my_pos, targets) { self.move_unit(my_pos, next_pos)?; attack = self.find_attack_target(my_id)?; } } if let Some(enemy_id) = attack { let attack_power = self.find_unit(my_id)?.attack_power; let enemy = self.find_mut_unit(enemy_id)?; enemy.hit_points = enemy.hit_points.saturating_sub(attack_power); if enemy.hit_points == 0 { let killed_kind = enemy.kind; self.remove_unit(enemy_id)?; *self.killed.entry(killed_kind).or_default() += 1; } continue; } } let mut kinds = HashSet::new(); let mut hit_points = 0; for my_id in prioritized_units.iter().cloned() { if !self.is_unit(my_id) { continue; } let unit = self.find_unit(my_id)?; if self.debug { println!("{:?}", unit); } kinds.insert(unit.kind); hit_points += unit.hit_points; } if kinds.len() == 1 { return Ok(tick * hit_points); } } bail!("could not find a result"); } } #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub enum Kind { Goblin, Elf, } #[derive(Debug, Clone)] pub struct Unit { kind: Kind, hit_points: u64, attack_power: u64, } impl Unit { pub fn new(kind: Kind) -> Self { Self { kind, hit_points: 200, attack_power: 3, } } /// Test if other unit is a valid target. pub fn is_target(&self, other: &Unit) -> bool { match (self.kind, other.kind) { (Kind::Elf, Kind::Elf) => false, (Kind::Goblin, Kind::Goblin) => false, (_, _) => true, } } } fn save_the_elves(mut original: State) -> Result<u64, Error> { original.sleep = 20; for ap in 4.. { let mut state = original.clone(); state.title = Some(format!("Attack Power: {}", ap)); for u in state.units.values_mut() { if let Kind::Elf = u.kind { u.attack_power = ap; } } let result = state.simulate()?; if state.killed.get(&Kind::Elf).cloned() == None { return Ok(result); } } bail!("no result :("); } fn main() -> Result<(), Error> { assert_eq!(State::load(input_str!("day15a.txt"))?.simulate()?, 36334); assert_eq!(State::load(input_str!("day15b.txt"))?.simulate()?, 39514); assert_eq!(State::load(input_str!("day15c.txt"))?.simulate()?, 27755); assert_eq!(State::load(input_str!("day15d.txt"))?.simulate()?, 28944); assert_eq!(State::load(input_str!("day15e.txt"))?.simulate()?, 18740); assert_eq!(State::load(input_str!("day15.txt"))?.simulate()?, 207059); assert_eq!( save_the_elves(State::load(input_str!("day15.txt"))?)?, 49120 ); Ok(()) } pub struct Display<'a>(&'a State); impl fmt::Display for Display<'_> { fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { let Display(state) = *self; for y in 0..=state.height { for x in 0..=state.width { let p = Pos(x, y); match state.walls.contains(&p) { true => "🧱".fmt(fmt)?, false => match state.find_unit_by_position(p) { Some(unit) => match unit.kind { Kind::Goblin => "👹".fmt(fmt)?, Kind::Elf => "🧝".fmt(fmt)?, }, None => "⬛".fmt(fmt)?, }, } } writeln!(fmt, "")?; } Ok(()) } }
//! A category that contains data about its collection. //! These are the main stores of the data used by Way Cooler and its clients. use std::ops::{Deref, DerefMut}; use std::collections::hash_map::HashMap; use rustc_serialize::json::{Json}; /// The main data mapping between a key and some Json. pub type DataMap = HashMap<String, Json>; /// A category that has a canonical name, and some data. /// /// The `Category` can be used exactly like a hash map. #[derive(Clone, Debug)] pub struct Category { name: String, data: HashMap<String, Json> } impl PartialEq for Category { fn eq(&self, other: &Category) -> bool { self.name == other.name } } impl Eq for Category {} impl Category { /// Makes a new category that has some name. /// Data mapping is initially empty. pub fn new(name: String) -> Self { Category { name: name, data: HashMap::new() } } /// Gets the name of the Category. pub fn name(&self) -> &str { self.name.as_str() } } impl Deref for Category { type Target = DataMap; fn deref(&self) -> &Self::Target { &self.data } } impl DerefMut for Category { fn deref_mut(&mut self) -> &mut DataMap { &mut self.data } }
#[macro_use] extern crate criterion; use criterion::Criterion; fn linked_hash_map_benchmark(c: &mut Criterion) { use linked_hash_map::LinkedHashMap; let mut map = LinkedHashMap::new(); c.bench_function("linked-hash-map_insert/pop-front", move |b| { b.iter(|| { for i in 0usize..1000 { map.insert(i, i); } for _ in 0usize..1000 { assert!(map.pop_front().is_some()); } }) }); let mut map = LinkedHashMap::new(); c.bench_function("linked-hash-map_insert/pop-back", move |b| { b.iter(|| { for i in 0usize..1000 { map.insert(i, i); } for _ in 0usize..1000 { assert!(map.pop_back().is_some()); } }) }); } fn cache_linked_hash_map_benchmark(c: &mut Criterion) { use cache::map::LinkedHashMap; let mut map = LinkedHashMap::new(); c.bench_function("cache-linked-hash-map_insert/pop-front", move |b| { b.iter(|| { for i in 0usize..1000 { map.push_front(i, i); } for _ in 0usize..1000 { assert!(map.pop_front().is_some()); } }) }); let mut map = LinkedHashMap::new(); c.bench_function("cache-linked-hash-map_insert/pop-back", move |b| { b.iter(|| { for i in 0usize..1000 { map.push_front(i, i); } for _ in 0usize..1000 { assert!(map.pop_back().is_some()); } }) }); } criterion_group!( benches, linked_hash_map_benchmark, cache_linked_hash_map_benchmark ); criterion_main!(benches);
// Copyright 2018 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. // revisions:cfail1 cfail2 cfail3 // compile-flags: -Z query-dep-graph --test // compile-pass #![feature(rustc_attrs)] #![crate_type = "rlib"] #![rustc_partition_codegened(module="issue_49595-__test", cfg="cfail2")] #![rustc_partition_codegened(module="issue_49595-lit_test", cfg="cfail3")] mod tests { #[cfg_attr(not(cfail1), ignore)] #[test] fn test() { } } // Checks that changing a string literal without changing its span // takes effect. // replacing a module to have a stable span #[cfg_attr(not(cfail3), path = "auxiliary/lit_a.rs")] #[cfg_attr(cfail3, path = "auxiliary/lit_b.rs")] mod lit; pub mod lit_test { #[test] fn lit_test() { println!("{}", ::lit::A); } }
use sink::Sink; use {Poll, StartSend, Stream}; /// Sink for the `Sink::sink_map_err` combinator. #[derive(Clone,Debug)] #[must_use = "sinks do nothing unless polled"] pub struct SinkMapErr<S, F> { sink: S, f: Option<F>, } pub fn new<S, F>(s: S, f: F) -> SinkMapErr<S, F> { SinkMapErr { sink: s, f: Some(f) } } impl<S, E> SinkMapErr<S, E> { /// Get a shared reference to the inner sink. pub fn get_ref(&self) -> &S { &self.sink } /// Get a mutable reference to the inner sink. pub fn get_mut(&mut self) -> &mut S { &mut self.sink } /// Consumes this combinator, returning the underlying sink. /// /// Note that this may discard intermediate state of this combinator, so /// care should be taken to avoid losing resources when this is called. pub fn into_inner(self) -> S { self.sink } } impl<S, F, E> Sink for SinkMapErr<S, F> where S: Sink, F: FnOnce(S::SinkError) -> E, { type SinkItem = S::SinkItem; type SinkError = E; fn start_send(&mut self, item: Self::SinkItem) -> StartSend<Self::SinkItem, Self::SinkError> { self.sink.start_send(item).map_err(|e| self.f.take().expect("cannot use MapErr after an error")(e)) } fn poll_complete(&mut self) -> Poll<(), Self::SinkError> { self.sink.poll_complete().map_err(|e| self.f.take().expect("cannot use MapErr after an error")(e)) } fn close(&mut self) -> Poll<(), Self::SinkError> { self.sink.close().map_err(|e| self.f.take().expect("cannot use MapErr after an error")(e)) } } impl<S: Stream, F> Stream for SinkMapErr<S, F> { type Item = S::Item; type Error = S::Error; fn poll(&mut self) -> Poll<Option<S::Item>, S::Error> { self.sink.poll() } }