annotate Renderer/test_render/Button.cpp @ 503:516d5c91d5b4 draft double-linked-task-list

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