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

Subversion リポジトリの参照

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5 - (show annotations) (download) (as text)
Sun Jun 29 05:41:50 2008 UTC (15 years, 10 months ago) by t-suwa
File MIME type: text/x-objcsrc
File size: 1742 byte(s)
 r328@milonga:  t_suwa | 2008-06-29 14:14:18 +0900
 - src/platform を platform に移動
 
 r329@milonga:  t_suwa | 2008-06-29 14:15:36 +0900
 - platform/mac/src を作成
 
 r330@milonga:  t_suwa | 2008-06-29 14:16:33 +0900
 - platform/mac/{gui,server,preferences} を platform/mac/src に移動
 
 r331@milonga:  t_suwa | 2008-06-29 14:17:52 +0900
 - proj を platform/mac/ に移動
 
 r332@milonga:  t_suwa | 2008-06-29 14:18:30 +0900
 - Makefile を platform/mac/ に移動
 
 r333@milonga:  t_suwa | 2008-06-29 14:22:14 +0900
 - plist を platform/mac/ に移動
 
 r334@milonga:  t_suwa | 2008-06-29 14:40:49 +0900
 - ファイルパス変更に伴うプロジェクト変更
 

1 /* -*- ObjC -*-
2
3 MacOS X implementation of the SKK input method.
4
5 Copyright (C) 2008 Tomotaka SUWA <t.suwa@mac.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
21 */
22
23 #include "MacInputModeWindow.h"
24 #include "SKKFrontEnd.h"
25 #include "InputModeWindowController.h"
26 #include <iostream>
27
28 MacInputModeWindow::MacInputModeWindow(SKKFrontEnd* frontend)
29 : active_(false),
30 frontend_(frontend),
31 mode_(HirakanaInputMode) {
32 controller_ = [InputModeWindowController sharedController];
33 [controller_ changeMode:mode_];
34 }
35
36 void MacInputModeWindow::SelectInputMode(SKKInputMode mode) {
37 if(mode_ != mode) {
38 mode_ = mode;
39
40 if(active_) Activate();
41 }
42 }
43
44 void MacInputModeWindow::Show() {
45 Activate();
46 }
47
48 void MacInputModeWindow::Activate() {
49 active_ = true;
50
51 std::pair<int, int> position = frontend_->WindowPosition();
52 int level = frontend_->WindowLevel();
53
54 [controller_ changeMode:mode_];
55 [controller_ show:NSMakePoint(position.first, position.second) level:level];
56 }
57
58 void MacInputModeWindow::Deactivate() {
59 [controller_ hide];
60
61 active_ = false;
62 }

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