refactor(input): rename internal capture requests
This commit is contained in:
@@ -25,7 +25,7 @@ pub struct InputMethod {
|
|||||||
handler_aliases: AliasList,
|
handler_aliases: AliasList,
|
||||||
handler_field_aliases: AliasList,
|
handler_field_aliases: AliasList,
|
||||||
pub(super) handler_order: Mutex<Vec<Weak<InputHandler>>>,
|
pub(super) handler_order: Mutex<Vec<Weak<InputHandler>>>,
|
||||||
pub capture_requests: Registry<InputHandler>,
|
pub internal_capture_requests: Registry<InputHandler>,
|
||||||
pub captures: Registry<InputHandler>,
|
pub captures: Registry<InputHandler>,
|
||||||
}
|
}
|
||||||
impl InputMethod {
|
impl InputMethod {
|
||||||
@@ -42,7 +42,7 @@ impl InputMethod {
|
|||||||
handler_aliases: AliasList::default(),
|
handler_aliases: AliasList::default(),
|
||||||
handler_field_aliases: AliasList::default(),
|
handler_field_aliases: AliasList::default(),
|
||||||
handler_order: Mutex::new(Vec::new()),
|
handler_order: Mutex::new(Vec::new()),
|
||||||
capture_requests: Registry::new(),
|
internal_capture_requests: Registry::new(),
|
||||||
captures: Registry::new(),
|
captures: Registry::new(),
|
||||||
};
|
};
|
||||||
<InputMethod as InputMethodRefAspect>::add_node_members(node);
|
<InputMethod as InputMethodRefAspect>::add_node_members(node);
|
||||||
@@ -167,7 +167,9 @@ impl InputMethodRefAspect for InputMethod {
|
|||||||
let input_method = node.get_aspect::<InputMethod>()?;
|
let input_method = node.get_aspect::<InputMethod>()?;
|
||||||
let input_handler = handler.get_aspect::<InputHandler>()?;
|
let input_handler = handler.get_aspect::<InputHandler>()?;
|
||||||
|
|
||||||
input_method.capture_requests.add_raw(&input_handler);
|
input_method
|
||||||
|
.internal_capture_requests
|
||||||
|
.add_raw(&input_handler);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,6 +145,6 @@ pub fn process_input() {
|
|||||||
let _ = input_handler_client::input(&handler_node, &methods, &datas);
|
let _ = input_handler_client::input(&handler_node, &methods, &datas);
|
||||||
}
|
}
|
||||||
for method in methods {
|
for method in methods {
|
||||||
method.capture_requests.clear();
|
method.internal_capture_requests.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ impl MousePointer {
|
|||||||
if let Some(capture) = &self.capture {
|
if let Some(capture) = &self.capture {
|
||||||
if !self
|
if !self
|
||||||
.pointer
|
.pointer
|
||||||
.capture_requests
|
.internal_capture_requests
|
||||||
.get_valid_contents()
|
.get_valid_contents()
|
||||||
.contains(capture)
|
.contains(capture)
|
||||||
{
|
{
|
||||||
@@ -161,7 +161,7 @@ impl MousePointer {
|
|||||||
if self.capture.is_none() {
|
if self.capture.is_none() {
|
||||||
if let Some(new_capture) = self
|
if let Some(new_capture) = self
|
||||||
.pointer
|
.pointer
|
||||||
.capture_requests
|
.internal_capture_requests
|
||||||
.get_valid_contents()
|
.get_valid_contents()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|h| {
|
.map(|h| {
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ impl SkController {
|
|||||||
if let Some(capture) = &self.capture {
|
if let Some(capture) = &self.capture {
|
||||||
if !self
|
if !self
|
||||||
.input
|
.input
|
||||||
.capture_requests
|
.internal_capture_requests
|
||||||
.get_valid_contents()
|
.get_valid_contents()
|
||||||
.contains(capture)
|
.contains(capture)
|
||||||
{
|
{
|
||||||
@@ -115,7 +115,7 @@ impl SkController {
|
|||||||
if self.capture.is_none() {
|
if self.capture.is_none() {
|
||||||
self.capture = self
|
self.capture = self
|
||||||
.input
|
.input
|
||||||
.capture_requests
|
.internal_capture_requests
|
||||||
.get_valid_contents()
|
.get_valid_contents()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|handler| {
|
.map(|handler| {
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ impl SkHand {
|
|||||||
if let Some(capture) = &self.capture {
|
if let Some(capture) = &self.capture {
|
||||||
if !self
|
if !self
|
||||||
.input
|
.input
|
||||||
.capture_requests
|
.internal_capture_requests
|
||||||
.get_valid_contents()
|
.get_valid_contents()
|
||||||
.contains(capture)
|
.contains(capture)
|
||||||
{
|
{
|
||||||
@@ -150,7 +150,7 @@ impl SkHand {
|
|||||||
if self.capture.is_none() {
|
if self.capture.is_none() {
|
||||||
self.capture = self
|
self.capture = self
|
||||||
.input
|
.input
|
||||||
.capture_requests
|
.internal_capture_requests
|
||||||
.get_valid_contents()
|
.get_valid_contents()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|handler| (handler.clone(), self.compare_distance(&handler.field).abs()))
|
.map(|handler| (handler.clone(), self.compare_distance(&handler.field).abs()))
|
||||||
|
|||||||
Reference in New Issue
Block a user