オープンソース・ソフトウェアの開発とダウンロード

Subversion リポジトリの参照

Diff of /aquaskk/trunk/platform/mac/src/server/MacInputModeWindow.mm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 126 by t-suwa, Sat Oct 10 13:07:15 2009 UTC revision 134 by t-suwa, Thu Oct 29 13:15:16 2009 UTC
# Line 82  namespace { Line 82  namespace {
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    
# Line 104  namespace { Line 104  namespace {
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  }  }
# Line 119  namespace { Line 118  namespace {
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    
# Line 144  namespace { Line 147  namespace {
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    
# Line 154  MacInputModeWindow::~MacInputModeWindow( Line 156  MacInputModeWindow::~MacInputModeWindow(
156  }  }
157    
158  void MacInputModeWindow::SelectInputMode(SKKInputMode mode) {  void MacInputModeWindow::SelectInputMode(SKKInputMode mode) {
159      mode_ = mode;      [tips_ changeMode:mode];
160  }  }
161    
162  // ----------------------------------------------------------------------  // ----------------------------------------------------------------------
# Line 170  bool MacInputModeWindow::enabled() const Line 172  bool MacInputModeWindow::enabled() const
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() {

Legend:
Removed from v.126  
changed lines
  Added in v.134

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26