Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[InputMethodKit] Remove existing code for InputMethodKit. #19462

Merged
merged 3 commits into from
Nov 20, 2023

Conversation

rolfbjarne
Copy link
Member

No InputMethodKit bindings are included in the build, so just remove the
bindings we have, since it's confusing to have code we don't build/use.

See also #7487.

No InputMethodKit bindings are included in the build, so just remove the
bindings we have, since it's confusing to have code we don't build/use.

See also dotnet#7487.
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

1 similar comment
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻

All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [PR Build] Tests on macOS M1 - Mac Ventura (13.0) passed 💻

All tests on macOS M1 - Mac Ventura (13.0) passed.

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build] Windows Integration Tests passed 💻

All Windows Integration Tests passed.

Pipeline on Agent
Hash: f7adb659acbec3276ec738d116286b7280157a1c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • iOS (no change detected)
  • tvOS (no change detected)
  • watchOS (no change detected)
  • macOS (no change detected)
NET (empty diffs)
  • iOS: (empty diff detected)
  • tvOS: (empty diff detected)
  • MacCatalyst: (empty diff detected)
  • macOS: (empty diff detected)

✅ API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: f7adb659acbec3276ec738d116286b7280157a1c [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build] Test results 🚀

Test results

✅ All tests passed on VSTS: simulator tests.

🎉 All 235 tests passed 🎉

Tests counts

✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 6 tests passed. Html Report (VSDrops) Download
✅ monotouch: All 41 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: f7adb659acbec3276ec738d116286b7280157a1c [PR build]

@rolfbjarne rolfbjarne merged commit 8cd685d into dotnet:main Nov 20, 2023
@rolfbjarne rolfbjarne deleted the remove-inputmethodkit-bindings branch November 20, 2023 06:55
@ShikiSuen
Copy link

Is there any instructions for how to bind this module and make it work?
The missing of InputMethodKti support makes it impossible to use C# to write an input method for macOS.

@rolfbjarne
Copy link
Member Author

Is there any instructions for how to bind this module and make it work?

You could probably create a binding project and bind the APIs you need that way.

@ShikiSuen
Copy link

ShikiSuen commented Feb 21, 2024

@rolfbjarne I was told (years ago) that IMK is not the supported case:
image
#16070 (comment)

@ShikiSuen
Copy link

ShikiSuen commented Feb 21, 2024

@rolfbjarne I have tried creating a project here.

  1. Create a new "Bindings Library" project in VS mac v17.6.9.
  2. Use Sharpie to extract headers by the following command:
sharpie bind -output Binding -sdk macosx -scope /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/InputMethodKit.framework/Versions/A/Headers/ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/InputMethodKit.framework/Versions/A/Headers/IMKCandidates.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/InputMethodKit.framework/Versions/A/Headers/IMKInputController.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/InputMethodKit.framework/Versions/A/Headers/IMKServer.h /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/InputMethodKit.framework/Versions/A/Headers/InputMethodKit.h -c -Ibuild/Headers -arch arm64
  1. Copy the contents of the extracted file above to replace the content of the ApiDefinition.cs file in the newly created project.
  2. Add a native reference for this file:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/InputMethodKit.framework

Now the things get stucked at this step:
image

I uploaded the project to this repo:
https://github.com/ShikiSuen/InputMethodKit_CSharp

Could you please show me some further steps I should do?

@rolfbjarne
Copy link
Member Author

Could you please show me some further steps I should do?

You can't reference the InputMethodKit namespace with a using clause, because you're basically creating it yourself.

So instead of:

using InputMethodKit;

[Static]
[Verify(ConstantsInterfaceAssociation)]
partial interface Constants {
[...]

do:

namespace InputMethodKit {
    [Static]
    [Verify(ConstantsInterfaceAssociation)]
    partial interface Constants {

@ShikiSuen
Copy link

@rolfbjarne Thank you for mentioning that. I pushed the commit of this fix.

Now the rest problems are summarized as follows:

ApiDefinition.cs(242,6): warning CS0618: 'MacAttribute' is obsolete: 'Use [Introduced|Deprecated|Obsoleted|Unavailable] attributes with PlatformName.'
ApiDefinition.cs(43,6): warning CS0618: 'MacAttribute' is obsolete: 'Use [Introduced|Deprecated|Obsoleted|Unavailable] attributes with PlatformName.'
ApiDefinition.cs(49,6): warning CS0618: 'MacAttribute' is obsolete: 'Use [Introduced|Deprecated|Obsoleted|Unavailable] attributes with PlatformName.'
BTOUCH : error BI0002: bgen: Could not compile the API bindings.
ApiDefinition.cs(28,25): error CS0246: The type or namespace name 'IIMKServerProxy' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(183,34): error CS0246: The type or namespace name 'IIMKStateSetting' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(183,52): error CS0246: The type or namespace name 'IIMKMouseHandling' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(11,4): error CS0246: The type or namespace name 'VerifyAttribute' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(11,4): error CS0246: The type or namespace name 'Verify' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(56,4): error CS0246: The type or namespace name 'VerifyAttribute' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(56,4): error CS0246: The type or namespace name 'Verify' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(11,11): error CS0103: The name 'ConstantsInterfaceAssociation' does not exist in the current context
ApiDefinition.cs(56,11): error CS0103: The name 'ConstantsInterfaceAssociation' does not exist in the current context
ApiDefinition.cs(55,4): error CS0579: Duplicate 'Static' attribute
ApiDefinition.cs(31,5): error CS0246: The type or namespace name 'NativeHandle' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(186,5): error CS0246: The type or namespace name 'NativeHandle' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(35,5): error CS0246: The type or namespace name 'NativeHandle' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(239,5): error CS0308: The non-generic type 'NSObject' cannot be used with type arguments
ApiDefinition.cs(239,14): error CS0246: The type or namespace name 'IMKTextInput' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(39,6): error CS0246: The type or namespace name 'VerifyAttribute' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(39,6): error CS0246: The type or namespace name 'Verify' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(39,13): error CS0103: The name 'MethodToProperty' does not exist in the current context
ApiDefinition.cs(202,6): error CS0246: The type or namespace name 'VerifyAttribute' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(202,6): error CS0246: The type or namespace name 'Verify' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(202,13): error CS0103: The name 'MethodToProperty' does not exist in the current context
ApiDefinition.cs(207,6): error CS0246: The type or namespace name 'VerifyAttribute' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(207,6): error CS0246: The type or namespace name 'Verify' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(207,13): error CS0103: The name 'MethodToProperty' does not exist in the current context
ApiDefinition.cs(101,6): error CS0246: The type or namespace name 'VerifyAttribute' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(101,6): error CS0246: The type or namespace name 'Verify' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(101,13): error CS0103: The name 'StronglyTypedNSArray' does not exist in the current context
ApiDefinition.cs(224,6): error CS0246: The type or namespace name 'VerifyAttribute' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(224,6): error CS0246: The type or namespace name 'Verify' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(224,13): error CS0103: The name 'MethodToProperty' does not exist in the current context
ApiDefinition.cs(230,6): error CS0246: The type or namespace name 'VerifyAttribute' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(230,6): error CS0246: The type or namespace name 'Verify' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(230,13): error CS0103: The name 'MethodToProperty' does not exist in the current context
ApiDefinition.cs(45,6): error CS0246: The type or namespace name 'VerifyAttribute' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(45,6): error CS0246: The type or namespace name 'Verify' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(45,13): error CS0103: The name 'MethodToProperty' does not exist in the current context
ApiDefinition.cs(51,6): error CS0246: The type or namespace name 'VerifyAttribute' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(51,6): error CS0246: The type or namespace name 'Verify' could not be found (are you missing a using directive or an assembly reference?)
ApiDefinition.cs(51,13): error CS0103: The name 'MethodToProperty' does not exist in the current context

Also, regarding the Availability attribute, should I fix it as follows?

// Before:
[Mac(10, 7)]
// After:
[Introduced(PlatformName.MacOSX, 10, 7)]

@rolfbjarne
Copy link
Member Author

The type or namespace name 'NativeHandle'

This needs a using ObjCRuntime; at the top of the file.

The type or namespace name 'VerifyAttribute'

Verify if the generated code is correct, then remove the attribute.

Also, regarding the Availability attribute, should I fix it as follows?

Since this is just for yourself, the easiest would be to just delete them all.

@ShikiSuen
Copy link

@rolfbjarne Thank you for your response.

The using ObjCRuntime; is already there. I managed to fix the NativeHandle by introducing:

#if !NET
using NativeHandle = System.IntPtr;
#endif

I'll troubleshoot this further. Looks like one or more IMK internal headers are missed in the Sharpie command.

@ShikiSuen
Copy link

ShikiSuen commented Feb 21, 2024

I finally made it. Thanks to Rolf for his suggestions above.

This works fine even if the native reference is pointed to "/System/Library/Frameworks/InputMethodKit.framework".

The ApiDefinition.cs is now written as follows:

// (c) 2024 and onwards The vChewing Project (MIT License).
// ====================
// This code is released under the MIT license (SPDX-License-Identifier: MIT)

using System;
using AppKit;
using Foundation;
using ObjCRuntime;
using CoreGraphics;

#if !NET
using NativeHandle = System.IntPtr;
#endif

namespace InputMethodKit {
[BaseType(typeof(NSObject))]
[Protocol, Model]
public interface NSObject_IMKServerProxy {
  // extern const NSString * IMKModeDictionary;
  [Export("IMKModeDictionary")]
  public NSString IMKModeDictionary { get; }

  // extern const NSString * IMKControllerClass;
  [Export("IMKControllerClass")]
  public NSString IMKControllerClass { get; }

  // extern const NSString * IMKDelegateClass;
  [Export("IMKDelegateClass")]
  public NSString IMKDelegateClass { get; }
}

// @interface IMKServer : NSObject <IMKServerProxy>
[BaseType(typeof(NSObject))]
[Protocol, Model]
public interface IMKServer : NSObject_IMKServerProxy {
  // -(id)initWithName:(NSString *)name bundleIdentifier:(NSString *)bundleIdentifier;
  [Export("initWithName:bundleIdentifier:")]
  public NativeHandle Constructor(string name, string bundleIdentifier);

  // -(id)initWithName:(NSString *)name controllerClass:(Class)controllerClassID delegateClass:(Class)delegateClassID;
  [Export("initWithName:controllerClass:delegateClass:")]
  public NativeHandle Constructor(string name, Class controllerClassID, Class delegateClassID);

  // -(NSBundle *)bundle;
  [Export("bundle")]
  public NSBundle Bundle { get; }

  // -(BOOL)paletteWillTerminate __attribute__((availability(macos, introduced=10.7)));
  [Introduced(PlatformName.MacOSX, 10, 7)]
  [Export("paletteWillTerminate")]
  public bool PaletteWillTerminate {
    get;
  }

  // -(BOOL)lastKeyEventWasDeadKey __attribute__((availability(macos, introduced=10.7)));
  [Introduced(PlatformName.MacOSX, 10, 7)]
  [Export("lastKeyEventWasDeadKey")]
  public bool LastKeyEventWasDeadKey {
    get;
  }
}

public partial interface Constants {
  // extern const NSString * kIMKCommandMenuItemName;
  [Export("kIMKCommandMenuItemName")]
  public NSString kIMKCommandMenuItemName { get; }

  // extern const NSString * kIMKCommandClientName;
  [Export("kIMKCommandClientName")]
  public NSString kIMKCommandClientName { get; }
}

// @interface IMKServerInput (NSObject)
[BaseType(typeof(NSObject))]
[Protocol, Model]
public interface NSObject_IMKServerInput {
  // -(BOOL)inputText:(NSString *)string key:(NSInteger)keyCode modifiers:(NSUInteger)flags client:(id)sender;
  [Export("inputText:key:modifiers:client:")]
  public bool InputText(string @string, nint keyCode, nuint flags, NSObject sender);

  // -(BOOL)inputText:(NSString *)string client:(id)sender;
  [Export("inputText:client:")]
  public bool InputText(string @string, NSObject sender);

  // -(BOOL)handleEvent:(NSEvent *)event client:(id)sender;
  [Export("handleEvent:client:")]
  public bool HandleEvent(NSEvent @event, NSObject sender);

  // -(BOOL)didCommandBySelector:(SEL)aSelector client:(id)sender;
  [Export("didCommandBySelector:client:")]
  public bool DidCommandBySelector(Selector aSelector, NSObject sender);

  // -(id)composedString:(id)sender;
  [Export("composedString:")]
  public NSObject ComposedString(NSObject sender);

  // -(NSAttributedString *)originalString:(id)sender;
  [Export("originalString:")]
  public NSAttributedString OriginalString(NSObject sender);

  // -(void)commitComposition:(id)sender;
  [Export("commitComposition:")]
  public void CommitComposition(NSObject sender);

  // -(NSArray *)candidates:(id)sender;
  [Export("candidates:")]
  public NSAttributedString[] Candidates(NSObject sender);
}

// @protocol IMKStateSetting
[Protocol]
public interface IMKStateSetting {
  // @required -(void)activateServer:(id)sender;
  [Abstract]
  [Export("activateServer:")]
  public void ActivateServer(NSObject sender);

  // @required -(void)deactivateServer:(id)sender;
  [Abstract]
  [Export("deactivateServer:")]
  public void DeactivateServer(NSObject sender);

  // @required -(id)valueForTag:(long)tag client:(id)sender;
  [Abstract]
  [Export("valueForTag:client:")]
  public NSObject ValueForTag(nint tag, NSObject sender);

  // @required -(void)setValue:(id)value forTag:(long)tag client:(id)sender;
  [Abstract]
  [Export("setValue:forTag:client:")]
  public void SetValue(NSObject value, nint tag, NSObject sender);

  // @required -(NSDictionary *)modes:(id)sender;
  [Abstract]
  [Export("modes:")]
  public NSDictionary Modes(NSObject sender);

  // @required -(NSUInteger)recognizedEvents:(id)sender;
  [Abstract]
  [Export("recognizedEvents:")]
  public nuint RecognizedEvents(NSObject sender);

  // @required -(void)showPreferences:(id)sender;
  [Abstract]
  [Export("showPreferences:")]
  public void ShowPreferences(NSObject sender);
}

// @protocol IMKMouseHandling
[Protocol]
public interface IMKMouseHandling {
  // @required -(BOOL)mouseDownOnCharacterIndex:(NSUInteger)index coordinate:(NSPoint)point
  // withModifier:(NSUInteger)flags continueTracking:(BOOL *)keepTracking client:(id)sender;

  [Abstract]
  [Export("mouseDownOnCharacterIndex:coordinate:withModifier:continueTracking:client:")]
  public bool MouseDownOnCharacterIndex(nuint index, CGPoint point, nuint flags, ref bool keepTracking,
                                        NSObject sender);

  // @required -(BOOL)mouseUpOnCharacterIndex:(NSUInteger)index coordinate:(NSPoint)point withModifier:(NSUInteger)flags
  // client:(id)sender;
  [Abstract]
  [Export("mouseUpOnCharacterIndex:coordinate:withModifier:client:")]
  public bool MouseUpOnCharacterIndex(nuint index, CGPoint point, nuint flags, NSObject sender);

  // @required -(BOOL)mouseMovedOnCharacterIndex:(NSUInteger)index coordinate:(NSPoint)point
  // withModifier:(NSUInteger)flags client:(id)sender;
  [Abstract]
  [Export("mouseMovedOnCharacterIndex:coordinate:withModifier:client:")]
  public bool MouseMovedOnCharacterIndex(nuint index, CGPoint point, nuint flags, NSObject sender);
}

// @interface IMKInputController : NSObject <IMKStateSetting, IMKMouseHandling>
[BaseType(typeof(NSObject))]
public interface IMKInputController : IMKStateSetting, IMKMouseHandling {
  // -(id)initWithServer:(IMKServer *)server delegate:(id)delegate client:(id)inputClient;
  [Export("initWithServer:delegate:client:")]
  public NativeHandle Constructor(IMKServer server, NSObject @delegate, NSObject inputClient);

  // -(void)updateComposition;
  [Export("updateComposition")]
  public void UpdateComposition();

  // -(void)cancelComposition;
  [Export("cancelComposition")]
  public void CancelComposition();

  // -(NSMutableDictionary *)compositionAttributesAtRange:(NSRange)range;
  [Export("compositionAttributesAtRange:")]
  public NSMutableDictionary CompositionAttributesAtRange(NSRange range);

  // -(NSRange)selectionRange;
  [Export("selectionRange")]
  public NSRange SelectionRange { get; }

  // -(NSRange)replacementRange;
  [Export("replacementRange")]
  public NSRange ReplacementRange {
    get;
  }

  // -(NSDictionary *)markForStyle:(NSInteger)style atRange:(NSRange)range;
  [Export("markForStyle:atRange:")]
  public NSDictionary MarkForStyle(nint style, NSRange range);

  // -(void)doCommandBySelector:(SEL)aSelector commandDictionary:(NSDictionary *)infoDictionary;
  [Export("doCommandBySelector:commandDictionary:")]
  public void DoCommandBySelector(Selector aSelector, NSDictionary infoDictionary);

  // -(void)hidePalettes;
  [Export("hidePalettes")]
  public void HidePalettes();

  // -(NSMenu *)menu;
  [Export("menu")]
  public NSMenu Menu { get; }

  // -(id)delegate;
  // -(void)setDelegate:(id)newDelegate;
  [Export("delegate")]
  public NSObject Delegate {
    get; set;
  }

  // -(IMKServer *)server;
  [Export("server")]
  public IMKServer Server();

  // -(id<IMKTextInput,NSObject>)client;
  [Export("client")]
  public IMKTextInput Client();

  // -(void)inputControllerWillClose __attribute__((availability(macos, introduced=10.7)));
  [Introduced(PlatformName.MacOSX, 10, 7)]
  [Export("inputControllerWillClose")]
  public void InputControllerWillClose();

  // -(void)annotationSelected:(NSAttributedString *)annotationString forCandidate:(NSAttributedString
  // *)candidateString;
  [Export("annotationSelected:forCandidate:")]
  public void AnnotationSelected(NSAttributedString annotationString, NSAttributedString candidateString);

  // -(void)candidateSelectionChanged:(NSAttributedString *)candidateString;
  [Export("candidateSelectionChanged:")]
  public void CandidateSelectionChanged(NSAttributedString candidateString);

  // -(void)candidateSelected:(NSAttributedString *)candidateString;
  [Export("candidateSelected:")]
  public void CandidateSelected(NSAttributedString candidateString);
}

[BaseType(typeof(NSObject))]
[Protocol, Model]
public interface IMKTextInput {
  // @required -(struct CGRect)firstRectForCharacterRange:(struct _NSRange)arg1 actualRange:(struct _NSRange *)arg2;
  [Abstract]
  [Export("firstRectForCharacterRange:actualRange:")]
  public CGRect FirstRectForCharacterRange(NSRange arg1, ref NSRange arg2);

  // @required -(NSString *)stringFromRange:(struct _NSRange)arg1 actualRange:(struct _NSRange *)arg2;
  [Abstract]
  [Export("stringFromRange:actualRange:")]
  public string StringFromRange(NSRange arg1, ref NSRange arg2);

  // @required -(NSString *)uniqueClientIdentifierString;
  [Abstract]
  [Export("uniqueClientIdentifierString")]
  public string UniqueClientIdentifierString { get; }

  // @required -(id)supportsProperty:(unsigned int)arg1;
  [Abstract]
  [Export("supportsProperty:")]
  public NSObject SupportsProperty(uint arg1);

  // @required -(int)windowLevel;
  [Abstract]
  [Export("windowLevel")]
  public int WindowLevel { get; }

  // @required -(NSString *)bundleIdentifier;
  [Abstract]
  [Export("bundleIdentifier")]
  public string BundleIdentifier { get; }

  // @required -(id)supportsUnicode;
  [Abstract]
  [Export("supportsUnicode")]
  public NSObject SupportsUnicode { get; }

  // @required -(void)selectInputMode:(NSString *)arg1;
  [Abstract]
  [Export("selectInputMode:")]
  public void SelectInputMode(string arg1);

  // @required -(void)overrideKeyboardWithKeyboardNamed:(NSString *)arg1;
  [Abstract]
  [Export("overrideKeyboardWithKeyboardNamed:")]
  public void OverrideKeyboardWithKeyboardNamed(string arg1);

  // @required -(NSArray *)validAttributesForMarkedText;
  [Abstract]
  [Export("validAttributesForMarkedText")]
  public NSObject[] ValidAttributesForMarkedText { get; }

  // @required -(NSDictionary *)attributesForCharacterIndex:(unsigned long long)arg1 lineHeightRectangle:(struct CGRect
  // *)arg2;
  [Abstract]
  [Export("attributesForCharacterIndex:lineHeightRectangle:")]
  public NSDictionary AttributesForCharacterIndex(ulong arg1, ref CGRect arg2);

  // @required -(long long)characterIndexForPoint:(struct CGPoint)arg1 tracking:(long long)arg2 inMarkedRange:(char
  // *)arg3;
  [Abstract]
  [Export("characterIndexForPoint:tracking:inMarkedRange:")]
  public long CharacterIndexForPoint(CGPoint arg1, long arg2, ref CGRect arg3);
  // @required -(long long)length;
  [Abstract]
  [Export("length")]
  public long Length { get; }

  // @required -(NSAttributedString *)attributedSubstringFromRange:(struct _NSRange)arg1;
  [Abstract]
  [Export("attributedSubstringFromRange:")]
  public NSAttributedString AttributedSubstringFromRange(NSRange arg1);

  // @required -(struct _NSRange)markedRange;
  [Abstract]
  [Export("markedRange")]
  public NSRange MarkedRange { get; }

  // @required -(struct _NSRange)selectedRange;
  [Abstract]
  [Export("selectedRange")]
  public NSRange SelectedRange { get; }

  // @required -(void)setMarkedText:(id)arg1 selectionRange:(struct _NSRange)arg2 replacementRange:(struct
  // _NSRange)arg3;
  [Abstract]
  [Export("setMarkedText:selectionRange:replacementRange:")]
  public void SetMarkedText(NSObject arg1, NSRange arg2, NSRange arg3);

  // @required -(void)insertText:(id)arg1 replacementRange:(struct _NSRange)arg2;
  [Abstract]
  [Export("insertText:replacementRange:")]
  public void InsertText(NSObject arg1, NSRange arg2);
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants