82 |
@interface SKKModeTips : NSObject { |
@interface SKKModeTips : NSObject { |
83 |
InputModeWindow* window_; |
InputModeWindow* window_; |
84 |
SKKLayoutManager* layout_; |
SKKLayoutManager* layout_; |
|
SKKInputMode mode_; |
|
85 |
BOOL active_; |
BOOL active_; |
86 |
} |
} |
87 |
|
|
88 |
- (id)initWithLayoutManager:(SKKLayoutManager*)layout; |
- (id)initWithLayoutManager:(SKKLayoutManager*)layout; |
89 |
- (void)show:(SKKInputMode)mode; |
- (void)changeMode:(SKKInputMode)mode; |
90 |
|
- (void)show; |
91 |
- (void)hide; |
- (void)hide; |
92 |
@end |
@end |
93 |
|
|
104 |
std::bind2nd(std::ptr_fun(CGRectContainsPoint), cursor)); |
std::bind2nd(std::ptr_fun(CGRectContainsPoint), cursor)); |
105 |
if(!count) return; |
if(!count) return; |
106 |
|
|
|
[window_ changeMode:mode_]; |
|
107 |
[window_ showAt:pt level:layout_->WindowLevel()]; |
[window_ showAt:pt level:layout_->WindowLevel()]; |
108 |
active_ = NO; |
active_ = NO; |
109 |
} |
} |
118 |
window_ = [InputModeWindow sharedWindow]; |
window_ = [InputModeWindow sharedWindow]; |
119 |
layout_ = layout; |
layout_ = layout; |
120 |
active_ = NO; |
active_ = NO; |
121 |
|
[self changeMode:HirakanaInputMode]; |
122 |
} |
} |
123 |
|
|
124 |
return self; |
return self; |
125 |
} |
} |
126 |
|
|
127 |
- (void)show:(SKKInputMode)mode { |
- (void)changeMode:(SKKInputMode)mode { |
128 |
|
[window_ changeMode:mode]; |
129 |
|
} |
130 |
|
|
131 |
|
- (void)show { |
132 |
if(active_) return; |
if(active_) return; |
133 |
|
|
134 |
active_ = YES; |
active_ = YES; |
135 |
[self cancel]; |
[self cancel]; |
|
mode_ = mode; |
|
136 |
[self performSelector:@selector(activate:) withObject:self afterDelay:0.1]; |
[self performSelector:@selector(activate:) withObject:self afterDelay:0.1]; |
137 |
} |
} |
138 |
|
|
147 |
// MacInputModeWindow |
// MacInputModeWindow |
148 |
// ---------------------------------------------------------------------- |
// ---------------------------------------------------------------------- |
149 |
|
|
150 |
MacInputModeWindow::MacInputModeWindow(SKKLayoutManager* layout) |
MacInputModeWindow::MacInputModeWindow(SKKLayoutManager* layout) { |
|
: mode_(HirakanaInputMode) { |
|
151 |
tips_ = [[SKKModeTips alloc] initWithLayoutManager:layout]; |
tips_ = [[SKKModeTips alloc] initWithLayoutManager:layout]; |
152 |
} |
} |
153 |
|
|
156 |
} |
} |
157 |
|
|
158 |
void MacInputModeWindow::SelectInputMode(SKKInputMode mode) { |
void MacInputModeWindow::SelectInputMode(SKKInputMode mode) { |
159 |
mode_ = mode; |
[tips_ changeMode:mode]; |
160 |
} |
} |
161 |
|
|
162 |
// ---------------------------------------------------------------------- |
// ---------------------------------------------------------------------- |
172 |
void MacInputModeWindow::SKKWidgetShow() { |
void MacInputModeWindow::SKKWidgetShow() { |
173 |
if(!enabled()) return; |
if(!enabled()) return; |
174 |
|
|
175 |
[tips_ show:mode_]; |
[tips_ show]; |
176 |
} |
} |
177 |
|
|
178 |
void MacInputModeWindow::SKKWidgetHide() { |
void MacInputModeWindow::SKKWidgetHide() { |