2023-07-29 00:33:03 +02:00
|
|
|
use icrate::Foundation::{NSObject, NSString};
|
|
|
|
|
use objc2::rc::Id;
|
|
|
|
|
use objc2::{extern_class, extern_methods, mutability, ClassType};
|
2022-09-08 16:45:29 +02:00
|
|
|
|
|
|
|
|
type NSTextInputSourceIdentifier = NSString;
|
|
|
|
|
|
|
|
|
|
extern_class!(
|
|
|
|
|
/// Main-Thread-Only!
|
|
|
|
|
#[derive(Debug, PartialEq, Eq, Hash)]
|
|
|
|
|
pub(crate) struct NSTextInputContext;
|
|
|
|
|
|
|
|
|
|
unsafe impl ClassType for NSTextInputContext {
|
|
|
|
|
type Super = NSObject;
|
2023-07-29 00:33:03 +02:00
|
|
|
type Mutability = mutability::InteriorMutable;
|
2022-09-08 16:45:29 +02:00
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
extern_methods!(
|
|
|
|
|
unsafe impl NSTextInputContext {
|
2023-07-29 00:33:03 +02:00
|
|
|
#[method(invalidateCharacterCoordinates)]
|
2022-09-08 16:45:29 +02:00
|
|
|
pub fn invalidateCharacterCoordinates(&self);
|
|
|
|
|
|
2023-07-29 00:33:03 +02:00
|
|
|
#[method(discardMarkedText)]
|
2022-09-08 16:45:29 +02:00
|
|
|
pub fn discardMarkedText(&self);
|
|
|
|
|
|
2023-07-29 00:33:03 +02:00
|
|
|
#[method_id(selectedKeyboardInputSource)]
|
|
|
|
|
pub fn selectedKeyboardInputSource(&self) -> Option<Id<NSTextInputSourceIdentifier>>;
|
2022-09-08 16:45:29 +02:00
|
|
|
}
|
|
|
|
|
);
|