annotate Renderer/Engine/Button.cc @ 539:3bc98f6d31ff draft

Reorganization..
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 12 Oct 2009 09:39:35 +0900
parents
children d8eca90afa21
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
539
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include "Button.h"
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 /**
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 * ボタン押下時に push, hold, release の状態を変更する
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 * push は押した瞬間にだけ 1 を持つ
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 * hold の状態では 0 を持つ
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 */
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 void
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 Button::push_work(void)
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 {
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 push = (!hold);
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 hold = 1;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 release = 0;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 }
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
15
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 /**
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 * ボタンを離した時に push, hold, release の状態を変更する
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 */
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 void
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 Button::release_work(void)
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 {
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 push = 0;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 hold = 0;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 release = 1;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 }
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 /**
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
28 * @retval 1 ボタンが押された(このフレームのみ)
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 * @retval 0 押されていない
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
30 */
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 int
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
32 Button::isPush(void)
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 {
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 return push;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35 }
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 /**
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38 * @retval 1 ボタンは押され続けている
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 * @retval 0 ボタンは押されていない
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40 */
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 int
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 Button::isHold(void)
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43 {
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 return hold;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 }
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
46
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 /**
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 * @retval 1 ボタンは押されていない
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 * @retval 0 ボタンが押されている
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 */
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 int
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 Button::isRelease(void)
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 {
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 return release;
3bc98f6d31ff Reorganization..
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 }