Permalink
Browse files

client type Any! -> Any

  • Loading branch information...
youknowone committed Jan 9, 2019
1 parent 2f539c1 commit 23ecef473df30605449b384a61e8cf30908091d4
@@ -36,7 +36,7 @@ class CIMBaseComposer {
return nil
}

public func input(controller: CIMInputController!, command string: String!, key keyCode: Int, modifier flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
public func input(controller: CIMInputController!, command string: String!, key keyCode: Int, modifier flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
return CIMInputTextProcessResult.notProcessed
}
}
@@ -24,7 +24,7 @@ public protocol CIMInputTextDelegate {
@return 입력 처리 여부. YES를 반환하면 이미 처리된 입력으로 보고 NO를 반환하면 외부에서 입력을 다시 처리한다.
@see IMKServerInput
*/
func input(controller: CIMInputController, inputText: String?, key: Int, modifiers: NSEvent.ModifierFlags, client: Any!) -> CIMInputTextProcessResult
func input(controller: CIMInputController, inputText: String?, key: Int, modifiers: NSEvent.ModifierFlags, client: Any) -> CIMInputTextProcessResult
}


@@ -61,7 +61,7 @@ public protocol CIMComposerDelegate: CIMInputTextDelegate {
//! @brief 변환 후보 문자열 변경
func candidateSelectionChanged(_ candidateString: NSAttributedString)

func input(controller: CIMInputController, command string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client: Any!) -> CIMInputTextProcessResult
func input(controller: CIMInputController, command string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client: Any) -> CIMInputTextProcessResult

}

@@ -119,11 +119,11 @@ public class CIMComposer: NSObject, CIMComposerDelegate {
return delegate.candidateSelectionChanged(candidateString)
}

public func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
public func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
return delegate.input(controller: controller, inputText: string, key: keyCode, modifiers: flags, client: sender)
}

public func input(controller: CIMInputController, command string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
public func input(controller: CIMInputController, command string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
return delegate.input(controller: controller, command: string, key: keyCode, modifiers: flags, client: sender)
}
}
@@ -150,7 +150,7 @@ - (NSUInteger)recognizedEvents:(_Null_unspecified id)sender {
}

//! @brief 자판 전환을 감지한다.
- (void)setValue:(_Null_unspecified id)value forTag:(long)tag client:(_Null_unspecified id)sender {
- (void)setValue:(id)value forTag:(long)tag client:(id)sender {
[self._receiver setValue:value forTag:tag client:sender controller:(id)self];
}

@@ -64,7 +64,7 @@ extension CIMInputController { // IMKServerInputHandleEvent

/*
extension CIMInputController { // IMKServerInputTextData
open override func inputText(_ string: String!, key keyCode: Int, modifiers flags: Int, client sender: Any!) -> Bool {
open override func inputText(_ string: String!, key keyCode: Int, modifiers flags: Int, client sender: Any) -> Bool {
dlog(DEBUG_INPUTCONTROLLER, "** CIMInputController -inputText:key:modifiers:client with string: %@ / keyCode: %ld / modifier flags: %lu / client: %@", string, keyCode, flags, self.client()?.bundleIdentifier() ?? "nil")
let processed = self.receiver.input(controller: self, inputText: string, key: keyCode, modifiers: NSEvent.ModifierFlags(rawValue: UInt(flags)), client: sender).rawValue > CIMInputTextProcessResult.notProcessed.rawValue
return processed
@@ -73,12 +73,12 @@ extension CIMInputController { // IMKServerInputTextData
*/
/*
extension CIMInputController { // IMKServerInputKeyBinding
open override func inputText(_ string: String!, client sender: Any!) -> Bool {
open override func inputText(_ string: String!, client sender: Any) -> Bool {
// dlog(DEBUG_INPUTCONTROLLER, "** CIMInputController -inputText:client: with string: %@ / client: %@", string, sender)
return false
}
open override func didCommand(by aSelector: Selector!, client sender: Any!) -> Bool {
open override func didCommand(by aSelector: Selector!, client sender: Any) -> Bool {
// dlog(DEBUG_INPUTCONTROLLER, "** CIMInputController -didCommandBySelector: with selector: %@", aSelector)
return false
}
@@ -92,7 +92,7 @@ extension CIMInputController { // IMKStateSetting
}

//! @brief 자판 전환을 감지한다.
open override func setValue(_ value: Any!, forTag tag: Int, client sender: Any!) {
open override func setValue(_ value: Any, forTag tag: Int, client sender: Any) {
self.receiver.setValue(value, forTag: tag, client: sender, controller: self)
}
}
@@ -101,7 +101,7 @@ extension CIMInputController { // IMKMouseHandling
/*!
@brief 마우스 입력 발생을 커서 옮기기로 간주하고 조합 중지. 만일 마우스 입력 발생을 감지하는 대신 커서 옮기기를 직접 알아낼 수 있으면 이 부분은 제거한다.
*/
open override func mouseDown(onCharacterIndex index: Int, coordinate point: NSPoint, withModifier flags: Int, continueTracking keepTracking: UnsafeMutablePointer<ObjCBool>!, client sender: Any!) -> Bool {
open override func mouseDown(onCharacterIndex index: Int, coordinate point: NSPoint, withModifier flags: Int, continueTracking keepTracking: UnsafeMutablePointer<ObjCBool>!, client sender: Any) -> Bool {
dlog(DEBUG_LOGGING, "LOGGING::EVENT::MOUSEDOWN")
let _ = self.receiver.commitCompositionEvent(sender, controller: self)
return false
@@ -195,7 +195,7 @@ extension CIMInputController { // IMKServerInput
}

extension CIMMockInputController {
@objc override func inputText(_ string: String!, key keyCode: Int, modifiers flags: Int, client sender: Any!) -> Bool {
@objc override func inputText(_ string: String!, key keyCode: Int, modifiers flags: Int, client sender: Any) -> Bool {
let client = self.client() as AnyObject
print("** CIMInputController -inputText:key:modifiers:client with string: \(string ?? "(nil)") / keyCode: \(keyCode) / modifier flags: \(flags) / client: \(String(describing: client.bundleIdentifier)) client class: \(String(describing: client.class))")
let v1 = (self._receiver.input(controller: self, inputText: string, key: keyCode, modifiers: NSEvent.ModifierFlags(rawValue: NSEvent.ModifierFlags.RawValue(flags)), client: sender).rawValue)
@@ -93,7 +93,7 @@ public class CIMInputManager: NSObject, CIMInputTextDelegate {
// MARK: - IMKServerInputTextData
// 일단 받은 입력은 모두 핸들러로 넘겨준다.
public func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
public func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
assert(controller.className.hasSuffix("InputController"))

// 입력기용 특수 커맨드 처리
@@ -26,7 +26,7 @@ import Cocoa
}

// IMKServerInput 프로토콜에 대한 공용 핸들러
public func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
public func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
dlog(DEBUG_LOGGING, "LOGGING::KEY::(%@)(%ld)(%lu)", string?.replacingOccurrences(of: "\n", with: "\\n") ?? "(nil)", keyCode, flags.rawValue)

let hadComposedString = !self._internalComposedString.isEmpty
@@ -177,7 +177,7 @@ extension CIMInputReceiver { // IMKStateSetting
}

//! @brief 자판 전환을 감지한다.
open func setValue(_ value: Any!, forTag tag: Int, client sender: Any!, controller: CIMInputController) {
open func setValue(_ value: Any, forTag tag: Int, client sender: Any, controller: CIMInputController) {
dlog(DEBUG_LOGGING, "LOGGING::EVENT::CHANGE-%lu-%@", tag, value as? String ?? "(nonstring)")
dlog(DEBUG_INPUTCONTROLLER, "** CIMInputController -setValue:forTag:client: with value: %@ / tag: %lx / client: %@", value as? String ?? "(nonstring)", tag, String(describing: controller.client as AnyObject))
switch tag {
@@ -188,15 +188,13 @@ extension CIMInputReceiver { // IMKStateSetting
break
}
if value != self.composer.inputMode {
assert(sender != nil)
self.commitComposition(sender, controller:controller)
self.composer.inputMode = value
}
default:
dlog(true, "**** UNKNOWN TAG %ld !!! ****", tag)
}

dlog(true, "==== source")
return

// 미국자판으로 기본자판 잡는 것도 임시로 포기
@@ -162,7 +162,7 @@ public class EmoticonComposer: CIMComposer {
dlog(DEBUG_EMOTICON, "DEBUG 6, [update] MSG: after updateEmoticonCandidates")
}

override public func input(controller: CIMInputController, inputText string: String!, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
override public func input(controller: CIMInputController, inputText string: String!, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
dlog(DEBUG_EMOTICON, "DEBUG 1, [inputController] MSG: %@, [[%d]]", string, keyCode)
var result: CIMInputTextProcessResult = self.delegate.input(controller: controller, inputText: string, key: keyCode, modifiers: flags, client: sender)

@@ -118,7 +118,7 @@ public class GureumComposer: CIMComposer {
}
}

override public func input(controller: CIMInputController, command string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
override public func input(controller: CIMInputController, command string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
let configuration = GureumConfiguration.shared
let inputModifier = flags.intersection(NSEvent.ModifierFlags.deviceIndependentFlagsMask).intersection(NSEvent.ModifierFlags(rawValue: ~NSEvent.ModifierFlags.capsLock.rawValue))
var need_exchange = false
@@ -214,10 +214,14 @@ public class GureumComposer: CIMComposer {
self.delegate.cancelComposition()
if (self.delegate as? CIMComposer) === romanComposer {
let lastHangulInputMode = GureumConfiguration.shared.lastHangulInputMode
(sender as AnyObject).selectMode(lastHangulInputMode)
if let sender = sender as? IMKTextInput {
sender.selectMode(lastHangulInputMode)
}
} else {
let lastRomanInputMode = GureumConfiguration.shared.lastRomanInputMode
(sender as AnyObject).selectMode(lastRomanInputMode)
if let sender = sender as? IMKTextInput {
sender.selectMode(lastRomanInputMode)
}
}
return CIMInputTextProcessResult.processed
}
@@ -97,7 +97,7 @@ public class HangulComposer: NSObject, CIMComposerDelegate {

// CIMComposerDelegate
public func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
public func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
// libhangul은 backspace를 키로 받지 않고 별도로 처리한다.
if (keyCode == kVK_Delete) {
return self.inputContext.backspace() ? CIMInputTextProcessResult.processed : CIMInputTextProcessResult.notProcessed
@@ -133,7 +133,7 @@ public class HangulComposer: NSObject, CIMComposerDelegate {
return handled ? .processed : .notProcessedAndNeedsCancel
}

public func input(controller: CIMInputController, command string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
public func input(controller: CIMInputController, command string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
assert(false)
return .notProcessed
}
@@ -101,7 +101,7 @@ class HanjaComposer: CIMComposer {
// }
}

override func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
override func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
switch keyCode {
// Arrow
case kVK_DownArrow, kVK_UpArrow:
@@ -52,7 +52,7 @@ class QwertyComposer: CIMComposer {
return nil
}

override func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
override func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
guard let string = string else {
assert(false)
return .notProcessed
@@ -139,7 +139,7 @@ class RomanDataComposer: CIMComposer {
return nil
}

override func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any!) -> CIMInputTextProcessResult {
override func input(controller: CIMInputController, inputText string: String?, key keyCode: Int, modifiers flags: NSEvent.ModifierFlags, client sender: Any) -> CIMInputTextProcessResult {
guard let string = string else {
assert(false)
return .notProcessed

0 comments on commit 23ecef4

Please sign in to comment.