;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; scim-bridge.el and scim-bridge Japanese Input config
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;(setq jaime "mozc")
(setq jaime "scim-bridge")

(cond

; iBus-mozc config
 ((string= jaime "mozc")
  (cond (window-system
	 (require 'ibus)
	 (add-hook 'after-init-hook 'ibus-mode-on)
	 (setq ibus-prediction-window-position t)
	 (ibus-define-preedit-key 'C-henkan t)

;; C-SPC is Set Mark
	 (ibus-define-common-key ?\C-\s nil)

;; C-/ is Undo
	 (ibus-define-common-key ?\C-/ nil)

;; C-:;lkj is Han,Zen,alphabet mode tongle
	 (ibus-define-common-key ?\C-: t)
	 (ibus-define-common-key ?\C-\; t)
	 (ibus-define-common-key ?\C-l t)
	 (ibus-define-common-key ?\C-k t)
	 (ibus-define-common-key ?\C-j t)
	 
;; iBus status cursor color change
	 (setq ibus-cursor-color '("red" "blue" "limegreen"))

	 (setq ibus-use-kana-onbiki-key t)
	 (setq ibus-kana-onbiki-x-keysym "bar"
	       ibus-kana-onbiki-key-symbol nil)
	 ))
 )

; scim-bridge config
 ((string= jaime "scim-bridge")
  (cond (window-system
; require lisp file (langage type)
	 (require 'scim-bridge)
;	 (require 'scim-bridge-ja)
;	 (require 'scim-bridge-zh-si)
;	 (require 'scim-bridge-zh-tr)
	 (add-hook 'after-init-hook 'scim-mode-on)

;; C-SPC is Set Mark
	 (scim-define-common-key ?\C-\s nil)
;; C-/ is Undo
	 (scim-define-common-key ?\C-/ nil)

;; SCIM status cursor color change
	 (setq scim-cursor-color '("red" "blue" "limegreen"))

;; C-j is Han,Zen,alphabet mode tongle
	 (scim-define-common-key ?\C-j t)

;; C-n is Canna on KANA Input tongle
	 (scim-define-common-key ?\C-n t)

;; When SCIM has input a Romaji as off, I can begin pre-editing again
	 (global-set-key [C-henkan] 'scim-transfer-romaji-into-preedit)
	 ))
 )
)
