1 #pragma once
2 #include "ffi/FromRustToCpp.h"
3 #include <array>
4 #include <cassert>
5 #include <cstddef>
6 #include <cstdint>
7 #include <iterator>
8 #include <new>
9 #include <stdexcept>
10 #include <string>
11 #include <type_traits>
12 #include <utility>
13 
14 namespace rust {
15 inline namespace cxxbridge1 {
16 // #include "rust/cxx.h"
17 
18 #ifndef CXXBRIDGE1_PANIC
19 #define CXXBRIDGE1_PANIC
20 template <typename Exception>
21 void panic [[noreturn]] (const char *msg);
22 #endif // CXXBRIDGE1_PANIC
23 
24 struct unsafe_bitcopy_t;
25 
26 namespace {
27 template <typename T>
28 class impl;
29 } // namespace
30 
31 template <typename T>
32 ::std::size_t size_of();
33 template <typename T>
34 ::std::size_t align_of();
35 
36 #ifndef CXXBRIDGE1_RUST_STRING
37 #define CXXBRIDGE1_RUST_STRING
38 class String final {
39 public:
40   String() noexcept;
41   String(const String &) noexcept;
42   String(String &&) noexcept;
43   ~String() noexcept;
44 
45   String(const std::string &);
46   String(const char *);
47   String(const char *, std::size_t);
48   String(const char16_t *);
49   String(const char16_t *, std::size_t);
50 
51   static String lossy(const std::string &) noexcept;
52   static String lossy(const char *) noexcept;
53   static String lossy(const char *, std::size_t) noexcept;
54   static String lossy(const char16_t *) noexcept;
55   static String lossy(const char16_t *, std::size_t) noexcept;
56 
57   String &operator=(const String &) &noexcept;
58   String &operator=(String &&) &noexcept;
59 
60   explicit operator std::string() const;
61 
62   const char *data() const noexcept;
63   std::size_t size() const noexcept;
64   std::size_t length() const noexcept;
65   bool empty() const noexcept;
66 
67   const char *c_str() noexcept;
68 
69   std::size_t capacity() const noexcept;
70   void reserve(size_t new_cap) noexcept;
71 
72   using iterator = char *;
73   iterator begin() noexcept;
74   iterator end() noexcept;
75 
76   using const_iterator = const char *;
77   const_iterator begin() const noexcept;
78   const_iterator end() const noexcept;
79   const_iterator cbegin() const noexcept;
80   const_iterator cend() const noexcept;
81 
82   bool operator==(const String &) const noexcept;
83   bool operator!=(const String &) const noexcept;
84   bool operator<(const String &) const noexcept;
85   bool operator<=(const String &) const noexcept;
86   bool operator>(const String &) const noexcept;
87   bool operator>=(const String &) const noexcept;
88 
89   void swap(String &) noexcept;
90 
91   String(unsafe_bitcopy_t, const String &) noexcept;
92 
93 private:
94   struct lossy_t;
95   String(lossy_t, const char *, std::size_t) noexcept;
96   String(lossy_t, const char16_t *, std::size_t) noexcept;
swap(String & lhs,String & rhs)97   friend void swap(String &lhs, String &rhs) noexcept { lhs.swap(rhs); }
98 
99   std::array<std::uintptr_t, 3> repr;
100 };
101 #endif // CXXBRIDGE1_RUST_STRING
102 
103 #ifndef CXXBRIDGE1_RUST_STR
104 #define CXXBRIDGE1_RUST_STR
105 class Str final {
106 public:
107   Str() noexcept;
108   Str(const String &) noexcept;
109   Str(const std::string &);
110   Str(const char *);
111   Str(const char *, std::size_t);
112 
113   Str &operator=(const Str &) &noexcept = default;
114 
115   explicit operator std::string() const;
116 
117   const char *data() const noexcept;
118   std::size_t size() const noexcept;
119   std::size_t length() const noexcept;
120   bool empty() const noexcept;
121 
122   Str(const Str &) noexcept = default;
123   ~Str() noexcept = default;
124 
125   using iterator = const char *;
126   using const_iterator = const char *;
127   const_iterator begin() const noexcept;
128   const_iterator end() const noexcept;
129   const_iterator cbegin() const noexcept;
130   const_iterator cend() const noexcept;
131 
132   bool operator==(const Str &) const noexcept;
133   bool operator!=(const Str &) const noexcept;
134   bool operator<(const Str &) const noexcept;
135   bool operator<=(const Str &) const noexcept;
136   bool operator>(const Str &) const noexcept;
137   bool operator>=(const Str &) const noexcept;
138 
139   void swap(Str &) noexcept;
140 
141 private:
142   class uninit;
143   Str(uninit) noexcept;
144   friend impl<Str>;
145 
146   std::array<std::uintptr_t, 2> repr;
147 };
148 #endif // CXXBRIDGE1_RUST_STR
149 
150 #ifndef CXXBRIDGE1_RUST_SLICE
151 #define CXXBRIDGE1_RUST_SLICE
152 namespace detail {
153 template <bool>
154 struct copy_assignable_if {};
155 
156 template <>
157 struct copy_assignable_if<false> {
158   copy_assignable_if() noexcept = default;
159   copy_assignable_if(const copy_assignable_if &) noexcept = default;
160   copy_assignable_if &operator=(const copy_assignable_if &) &noexcept = delete;
161   copy_assignable_if &operator=(copy_assignable_if &&) &noexcept = default;
162 };
163 } // namespace detail
164 
165 template <typename T>
166 class Slice final
167     : private detail::copy_assignable_if<std::is_const<T>::value> {
168 public:
169   using value_type = T;
170 
171   Slice() noexcept;
172   Slice(T *, std::size_t count) noexcept;
173 
174   Slice &operator=(const Slice<T> &) &noexcept = default;
175   Slice &operator=(Slice<T> &&) &noexcept = default;
176 
177   T *data() const noexcept;
178   std::size_t size() const noexcept;
179   std::size_t length() const noexcept;
180   bool empty() const noexcept;
181 
182   T &operator[](std::size_t n) const noexcept;
183   T &at(std::size_t n) const;
184   T &front() const noexcept;
185   T &back() const noexcept;
186 
187   Slice(const Slice<T> &) noexcept = default;
188   ~Slice() noexcept = default;
189 
190   class iterator;
191   iterator begin() const noexcept;
192   iterator end() const noexcept;
193 
194   void swap(Slice &) noexcept;
195 
196 private:
197   class uninit;
198   Slice(uninit) noexcept;
199   friend impl<Slice>;
200   friend void sliceInit(void *, const void *, std::size_t) noexcept;
201   friend void *slicePtr(const void *) noexcept;
202   friend std::size_t sliceLen(const void *) noexcept;
203 
204   std::array<std::uintptr_t, 2> repr;
205 };
206 
207 template <typename T>
208 class Slice<T>::iterator final {
209 public:
210   using iterator_category = std::random_access_iterator_tag;
211   using value_type = T;
212   using difference_type = std::ptrdiff_t;
213   using pointer = typename std::add_pointer<T>::type;
214   using reference = typename std::add_lvalue_reference<T>::type;
215 
216   reference operator*() const noexcept;
217   pointer operator->() const noexcept;
218   reference operator[](difference_type) const noexcept;
219 
220   iterator &operator++() noexcept;
221   iterator operator++(int) noexcept;
222   iterator &operator--() noexcept;
223   iterator operator--(int) noexcept;
224 
225   iterator &operator+=(difference_type) noexcept;
226   iterator &operator-=(difference_type) noexcept;
227   iterator operator+(difference_type) const noexcept;
228   iterator operator-(difference_type) const noexcept;
229   difference_type operator-(const iterator &) const noexcept;
230 
231   bool operator==(const iterator &) const noexcept;
232   bool operator!=(const iterator &) const noexcept;
233   bool operator<(const iterator &) const noexcept;
234   bool operator<=(const iterator &) const noexcept;
235   bool operator>(const iterator &) const noexcept;
236   bool operator>=(const iterator &) const noexcept;
237 
238 private:
239   friend class Slice;
240   void *pos;
241   std::size_t stride;
242 };
243 
244 template <typename T>
245 Slice<T>::Slice() noexcept {
246   sliceInit(this, reinterpret_cast<void *>(align_of<T>()), 0);
247 }
248 
249 template <typename T>
250 Slice<T>::Slice(T *s, std::size_t count) noexcept {
251   assert(s != nullptr || count == 0);
252   sliceInit(this,
253             s == nullptr && count == 0
254                 ? reinterpret_cast<void *>(align_of<T>())
255                 : const_cast<typename std::remove_const<T>::type *>(s),
256             count);
257 }
258 
259 template <typename T>
260 T *Slice<T>::data() const noexcept {
261   return reinterpret_cast<T *>(slicePtr(this));
262 }
263 
264 template <typename T>
265 std::size_t Slice<T>::size() const noexcept {
266   return sliceLen(this);
267 }
268 
269 template <typename T>
270 std::size_t Slice<T>::length() const noexcept {
271   return this->size();
272 }
273 
274 template <typename T>
275 bool Slice<T>::empty() const noexcept {
276   return this->size() == 0;
277 }
278 
279 template <typename T>
280 T &Slice<T>::operator[](std::size_t n) const noexcept {
281   assert(n < this->size());
282   auto ptr = static_cast<char *>(slicePtr(this)) + size_of<T>() * n;
283   return *reinterpret_cast<T *>(ptr);
284 }
285 
286 template <typename T>
287 T &Slice<T>::at(std::size_t n) const {
288   if (n >= this->size()) {
289     panic<std::out_of_range>("rust::Slice index out of range");
290   }
291   return (*this)[n];
292 }
293 
294 template <typename T>
295 T &Slice<T>::front() const noexcept {
296   assert(!this->empty());
297   return (*this)[0];
298 }
299 
300 template <typename T>
301 T &Slice<T>::back() const noexcept {
302   assert(!this->empty());
303   return (*this)[this->size() - 1];
304 }
305 
306 template <typename T>
307 typename Slice<T>::iterator::reference
308 Slice<T>::iterator::operator*() const noexcept {
309   return *static_cast<T *>(this->pos);
310 }
311 
312 template <typename T>
313 typename Slice<T>::iterator::pointer
314 Slice<T>::iterator::operator->() const noexcept {
315   return static_cast<T *>(this->pos);
316 }
317 
318 template <typename T>
319 typename Slice<T>::iterator::reference Slice<T>::iterator::operator[](
320     typename Slice<T>::iterator::difference_type n) const noexcept {
321   auto ptr = static_cast<char *>(this->pos) + this->stride * n;
322   return *reinterpret_cast<T *>(ptr);
323 }
324 
325 template <typename T>
326 typename Slice<T>::iterator &Slice<T>::iterator::operator++() noexcept {
327   this->pos = static_cast<char *>(this->pos) + this->stride;
328   return *this;
329 }
330 
331 template <typename T>
332 typename Slice<T>::iterator Slice<T>::iterator::operator++(int) noexcept {
333   auto ret = iterator(*this);
334   this->pos = static_cast<char *>(this->pos) + this->stride;
335   return ret;
336 }
337 
338 template <typename T>
339 typename Slice<T>::iterator &Slice<T>::iterator::operator--() noexcept {
340   this->pos = static_cast<char *>(this->pos) - this->stride;
341   return *this;
342 }
343 
344 template <typename T>
345 typename Slice<T>::iterator Slice<T>::iterator::operator--(int) noexcept {
346   auto ret = iterator(*this);
347   this->pos = static_cast<char *>(this->pos) - this->stride;
348   return ret;
349 }
350 
351 template <typename T>
352 typename Slice<T>::iterator &Slice<T>::iterator::operator+=(
353     typename Slice<T>::iterator::difference_type n) noexcept {
354   this->pos = static_cast<char *>(this->pos) + this->stride * n;
355   return *this;
356 }
357 
358 template <typename T>
359 typename Slice<T>::iterator &Slice<T>::iterator::operator-=(
360     typename Slice<T>::iterator::difference_type n) noexcept {
361   this->pos = static_cast<char *>(this->pos) - this->stride * n;
362   return *this;
363 }
364 
365 template <typename T>
366 typename Slice<T>::iterator Slice<T>::iterator::operator+(
367     typename Slice<T>::iterator::difference_type n) const noexcept {
368   auto ret = iterator(*this);
369   ret.pos = static_cast<char *>(this->pos) + this->stride * n;
370   return ret;
371 }
372 
373 template <typename T>
374 typename Slice<T>::iterator Slice<T>::iterator::operator-(
375     typename Slice<T>::iterator::difference_type n) const noexcept {
376   auto ret = iterator(*this);
377   ret.pos = static_cast<char *>(this->pos) - this->stride * n;
378   return ret;
379 }
380 
381 template <typename T>
382 typename Slice<T>::iterator::difference_type
383 Slice<T>::iterator::operator-(const iterator &other) const noexcept {
384   auto diff = std::distance(static_cast<char *>(other.pos),
385                             static_cast<char *>(this->pos));
386   return diff / static_cast<typename Slice<T>::iterator::difference_type>(
387                     this->stride);
388 }
389 
390 template <typename T>
391 bool Slice<T>::iterator::operator==(const iterator &other) const noexcept {
392   return this->pos == other.pos;
393 }
394 
395 template <typename T>
396 bool Slice<T>::iterator::operator!=(const iterator &other) const noexcept {
397   return this->pos != other.pos;
398 }
399 
400 template <typename T>
401 bool Slice<T>::iterator::operator<(const iterator &other) const noexcept {
402   return this->pos < other.pos;
403 }
404 
405 template <typename T>
406 bool Slice<T>::iterator::operator<=(const iterator &other) const noexcept {
407   return this->pos <= other.pos;
408 }
409 
410 template <typename T>
411 bool Slice<T>::iterator::operator>(const iterator &other) const noexcept {
412   return this->pos > other.pos;
413 }
414 
415 template <typename T>
416 bool Slice<T>::iterator::operator>=(const iterator &other) const noexcept {
417   return this->pos >= other.pos;
418 }
419 
420 template <typename T>
421 typename Slice<T>::iterator Slice<T>::begin() const noexcept {
422   iterator it;
423   it.pos = slicePtr(this);
424   it.stride = size_of<T>();
425   return it;
426 }
427 
428 template <typename T>
429 typename Slice<T>::iterator Slice<T>::end() const noexcept {
430   iterator it = this->begin();
431   it.pos = static_cast<char *>(it.pos) + it.stride * this->size();
432   return it;
433 }
434 
435 template <typename T>
436 void Slice<T>::swap(Slice &rhs) noexcept {
437   std::swap(*this, rhs);
438 }
439 #endif // CXXBRIDGE1_RUST_SLICE
440 
441 #ifndef CXXBRIDGE1_RUST_BOX
442 #define CXXBRIDGE1_RUST_BOX
443 template <typename T>
444 class Box final {
445 public:
446   using element_type = T;
447   using const_pointer =
448       typename std::add_pointer<typename std::add_const<T>::type>::type;
449   using pointer = typename std::add_pointer<T>::type;
450 
451   Box() = delete;
452   Box(Box &&) noexcept;
453   ~Box() noexcept;
454 
455   explicit Box(const T &);
456   explicit Box(T &&);
457 
458   Box &operator=(Box &&) &noexcept;
459 
460   const T *operator->() const noexcept;
461   const T &operator*() const noexcept;
462   T *operator->() noexcept;
463   T &operator*() noexcept;
464 
465   template <typename... Fields>
466   static Box in_place(Fields &&...);
467 
468   void swap(Box &) noexcept;
469 
470   static Box from_raw(T *) noexcept;
471 
472   T *into_raw() noexcept;
473 
474   /* Deprecated */ using value_type = element_type;
475 
476 private:
477   class uninit;
478   class allocation;
479   Box(uninit) noexcept;
480   void drop() noexcept;
481 
482   friend void swap(Box &lhs, Box &rhs) noexcept { lhs.swap(rhs); }
483 
484   T *ptr;
485 };
486 
487 template <typename T>
488 class Box<T>::uninit {};
489 
490 template <typename T>
491 class Box<T>::allocation {
492   static T *alloc() noexcept;
493   static void dealloc(T *) noexcept;
494 
495 public:
496   allocation() noexcept : ptr(alloc()) {}
497   ~allocation() noexcept {
498     if (this->ptr) {
499       dealloc(this->ptr);
500     }
501   }
502   T *ptr;
503 };
504 
505 template <typename T>
506 Box<T>::Box(Box &&other) noexcept : ptr(other.ptr) {
507   other.ptr = nullptr;
508 }
509 
510 template <typename T>
511 Box<T>::Box(const T &val) {
512   allocation alloc;
513   ::new (alloc.ptr) T(val);
514   this->ptr = alloc.ptr;
515   alloc.ptr = nullptr;
516 }
517 
518 template <typename T>
519 Box<T>::Box(T &&val) {
520   allocation alloc;
521   ::new (alloc.ptr) T(std::move(val));
522   this->ptr = alloc.ptr;
523   alloc.ptr = nullptr;
524 }
525 
526 template <typename T>
527 Box<T>::~Box() noexcept {
528   if (this->ptr) {
529     this->drop();
530   }
531 }
532 
533 template <typename T>
534 Box<T> &Box<T>::operator=(Box &&other) &noexcept {
535   if (this->ptr) {
536     this->drop();
537   }
538   this->ptr = other.ptr;
539   other.ptr = nullptr;
540   return *this;
541 }
542 
543 template <typename T>
544 const T *Box<T>::operator->() const noexcept {
545   return this->ptr;
546 }
547 
548 template <typename T>
549 const T &Box<T>::operator*() const noexcept {
550   return *this->ptr;
551 }
552 
553 template <typename T>
554 T *Box<T>::operator->() noexcept {
555   return this->ptr;
556 }
557 
558 template <typename T>
559 T &Box<T>::operator*() noexcept {
560   return *this->ptr;
561 }
562 
563 template <typename T>
564 template <typename... Fields>
565 Box<T> Box<T>::in_place(Fields &&...fields) {
566   allocation alloc;
567   auto ptr = alloc.ptr;
568   ::new (ptr) T{std::forward<Fields>(fields)...};
569   alloc.ptr = nullptr;
570   return from_raw(ptr);
571 }
572 
573 template <typename T>
574 void Box<T>::swap(Box &rhs) noexcept {
575   using std::swap;
576   swap(this->ptr, rhs.ptr);
577 }
578 
579 template <typename T>
580 Box<T> Box<T>::from_raw(T *raw) noexcept {
581   Box box = uninit{};
582   box.ptr = raw;
583   return box;
584 }
585 
586 template <typename T>
587 T *Box<T>::into_raw() noexcept {
588   T *raw = this->ptr;
589   this->ptr = nullptr;
590   return raw;
591 }
592 
593 template <typename T>
594 Box<T>::Box(uninit) noexcept {}
595 #endif // CXXBRIDGE1_RUST_BOX
596 
597 #ifndef CXXBRIDGE1_RUST_OPAQUE
598 #define CXXBRIDGE1_RUST_OPAQUE
599 class Opaque {
600 public:
601   Opaque() = delete;
602   Opaque(const Opaque &) = delete;
603   ~Opaque() = delete;
604 };
605 #endif // CXXBRIDGE1_RUST_OPAQUE
606 
607 #ifndef CXXBRIDGE1_IS_COMPLETE
608 #define CXXBRIDGE1_IS_COMPLETE
609 namespace detail {
610 namespace {
611 template <typename T, typename = std::size_t>
612 struct is_complete : std::false_type {};
613 template <typename T>
614 struct is_complete<T, decltype(sizeof(T))> : std::true_type {};
615 } // namespace
616 } // namespace detail
617 #endif // CXXBRIDGE1_IS_COMPLETE
618 
619 #ifndef CXXBRIDGE1_LAYOUT
620 #define CXXBRIDGE1_LAYOUT
621 class layout {
622   template <typename T>
623   friend std::size_t size_of();
624   template <typename T>
625   friend std::size_t align_of();
626   template <typename T>
627   static typename std::enable_if<std::is_base_of<Opaque, T>::value,
628                                  std::size_t>::type
629   do_size_of() {
630     return T::layout::size();
631   }
632   template <typename T>
633   static typename std::enable_if<!std::is_base_of<Opaque, T>::value,
634                                  std::size_t>::type
635   do_size_of() {
636     return sizeof(T);
637   }
638   template <typename T>
639   static
640       typename std::enable_if<detail::is_complete<T>::value, std::size_t>::type
641       size_of() {
642     return do_size_of<T>();
643   }
644   template <typename T>
645   static typename std::enable_if<std::is_base_of<Opaque, T>::value,
646                                  std::size_t>::type
647   do_align_of() {
648     return T::layout::align();
649   }
650   template <typename T>
651   static typename std::enable_if<!std::is_base_of<Opaque, T>::value,
652                                  std::size_t>::type
653   do_align_of() {
654     return alignof(T);
655   }
656   template <typename T>
657   static
658       typename std::enable_if<detail::is_complete<T>::value, std::size_t>::type
659       align_of() {
660     return do_align_of<T>();
661   }
662 };
663 
664 template <typename T>
665 std::size_t size_of() {
666   return layout::size_of<T>();
667 }
668 
669 template <typename T>
670 std::size_t align_of() {
671   return layout::align_of<T>();
672 }
673 #endif // CXXBRIDGE1_LAYOUT
674 } // namespace cxxbridge1
675 } // namespace rust
676 
677 namespace android {
678   namespace input {
679     struct RustPointerProperties;
680     struct RustInputDeviceIdentifier;
681     namespace verifier {
682       struct InputVerifier;
683     }
684     namespace keyboardClassifier {
685       struct KeyboardClassifier;
686     }
687   }
688 }
689 
690 namespace android {
691 namespace input {
692 namespace verifier {
693 #ifndef CXXBRIDGE1_STRUCT_android$input$verifier$InputVerifier
694 #define CXXBRIDGE1_STRUCT_android$input$verifier$InputVerifier
695 // Used to validate the incoming motion stream.
696 // This class is not thread-safe.
697 // State is stored in the "InputVerifier" object
698 // that can be created via the 'create' method.
699 // Usage:
700 //
701 // ```ignore
702 // Box<InputVerifier> verifier = create("inputChannel name");
703 // result = process_movement(verifier, ...);
704 // if (result) {
705 //    crash(result.error_message());
706 // }
707 // ```
708 struct InputVerifier final : public ::rust::Opaque {
709   ~InputVerifier() = delete;
710 
711 private:
712   friend ::rust::layout;
713   struct layout {
714     static ::std::size_t size() noexcept;
715     static ::std::size_t align() noexcept;
716   };
717 };
718 #endif // CXXBRIDGE1_STRUCT_android$input$verifier$InputVerifier
719 } // namespace verifier
720 
721 namespace keyboardClassifier {
722 #ifndef CXXBRIDGE1_STRUCT_android$input$keyboardClassifier$KeyboardClassifier
723 #define CXXBRIDGE1_STRUCT_android$input$keyboardClassifier$KeyboardClassifier
724 // Used to classify a keyboard into alphabetic and non-alphabetic
725 struct KeyboardClassifier final : public ::rust::Opaque {
726   ~KeyboardClassifier() = delete;
727 
728 private:
729   friend ::rust::layout;
730   struct layout {
731     static ::std::size_t size() noexcept;
732     static ::std::size_t align() noexcept;
733   };
734 };
735 #endif // CXXBRIDGE1_STRUCT_android$input$keyboardClassifier$KeyboardClassifier
736 } // namespace keyboardClassifier
737 
738 #ifndef CXXBRIDGE1_STRUCT_android$input$RustPointerProperties
739 #define CXXBRIDGE1_STRUCT_android$input$RustPointerProperties
740 struct RustPointerProperties final {
741   ::std::int32_t id;
742 
743   bool operator==(RustPointerProperties const &) const noexcept;
744   bool operator!=(RustPointerProperties const &) const noexcept;
745   using IsRelocatable = ::std::true_type;
746 };
747 #endif // CXXBRIDGE1_STRUCT_android$input$RustPointerProperties
748 
749 #ifndef CXXBRIDGE1_STRUCT_android$input$RustInputDeviceIdentifier
750 #define CXXBRIDGE1_STRUCT_android$input$RustInputDeviceIdentifier
751 struct RustInputDeviceIdentifier final {
752   ::rust::String name;
753   ::rust::String location;
754   ::rust::String unique_id;
755   ::std::uint16_t bus;
756   ::std::uint16_t vendor;
757   ::std::uint16_t product;
758   ::std::uint16_t version;
759   ::rust::String descriptor;
760 
761   using IsRelocatable = ::std::true_type;
762 };
763 #endif // CXXBRIDGE1_STRUCT_android$input$RustInputDeviceIdentifier
764 
765 namespace verifier {
766 ::rust::Box<::android::input::verifier::InputVerifier> create(::rust::String name) noexcept;
767 
768 ::rust::String process_movement(::android::input::verifier::InputVerifier &verifier, ::std::int32_t device_id, ::std::uint32_t source, ::std::uint32_t action, ::rust::Slice<::android::input::RustPointerProperties const> pointer_properties, ::std::uint32_t flags) noexcept;
769 
770 void reset_device(::android::input::verifier::InputVerifier &verifier, ::std::int32_t device_id) noexcept;
771 } // namespace verifier
772 
773 namespace keyboardClassifier {
774 ::rust::Box<::android::input::keyboardClassifier::KeyboardClassifier> create() noexcept;
775 
776 void notifyKeyboardChanged(::android::input::keyboardClassifier::KeyboardClassifier &classifier, ::std::int32_t device_id, ::android::input::RustInputDeviceIdentifier identifier, ::std::uint32_t device_classes) noexcept;
777 
778 ::std::uint32_t getKeyboardType(::android::input::keyboardClassifier::KeyboardClassifier &classifier, ::std::int32_t device_id) noexcept;
779 
780 bool isFinalized(::android::input::keyboardClassifier::KeyboardClassifier &classifier, ::std::int32_t device_id) noexcept;
781 
782 void processKey(::android::input::keyboardClassifier::KeyboardClassifier &classifier, ::std::int32_t device_id, ::std::int32_t evdev_code, ::std::uint32_t modifier_state) noexcept;
783 } // namespace keyboardClassifier
784 } // namespace input
785 } // namespace android
786