reflexion 0.2.1 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.doc/ext/reflex/application.cpp +1 -1
  3. data/.doc/ext/reflex/capture_event.cpp +1 -1
  4. data/.doc/ext/reflex/contact_event.cpp +1 -1
  5. data/.doc/ext/reflex/draw_event.cpp +1 -1
  6. data/.doc/ext/reflex/ellipse_shape.cpp +1 -1
  7. data/.doc/ext/reflex/event.cpp +1 -1
  8. data/.doc/ext/reflex/filter.cpp +1 -1
  9. data/.doc/ext/reflex/focus_event.cpp +1 -1
  10. data/.doc/ext/reflex/frame_event.cpp +1 -1
  11. data/.doc/ext/reflex/image_view.cpp +1 -1
  12. data/.doc/ext/reflex/key_event.cpp +74 -69
  13. data/.doc/ext/reflex/line_shape.cpp +1 -1
  14. data/.doc/ext/reflex/motion_event.cpp +1 -1
  15. data/.doc/ext/reflex/pointer.cpp +1 -1
  16. data/.doc/ext/reflex/pointer_event.cpp +1 -1
  17. data/.doc/ext/reflex/polygon_shape.cpp +1 -1
  18. data/.doc/ext/reflex/rect_shape.cpp +1 -1
  19. data/.doc/ext/reflex/reflex.cpp +58 -50
  20. data/.doc/ext/reflex/screen.cpp +1 -1
  21. data/.doc/ext/reflex/scroll_event.cpp +1 -1
  22. data/.doc/ext/reflex/selector.cpp +2 -2
  23. data/.doc/ext/reflex/shape.cpp +1 -1
  24. data/.doc/ext/reflex/style.cpp +1 -1
  25. data/.doc/ext/reflex/style_length.cpp +2 -2
  26. data/.doc/ext/reflex/timer.cpp +1 -1
  27. data/.doc/ext/reflex/timer_event.cpp +1 -1
  28. data/.doc/ext/reflex/update_event.cpp +1 -1
  29. data/.doc/ext/reflex/view.cpp +1 -1
  30. data/.doc/ext/reflex/wheel_event.cpp +1 -1
  31. data/.doc/ext/reflex/window.cpp +1 -1
  32. data/.github/workflows/release-gem.yml +1 -1
  33. data/.github/workflows/test.yml +3 -0
  34. data/ChangeLog.md +5 -0
  35. data/Rakefile +1 -1
  36. data/VERSION +1 -1
  37. data/ext/reflex/application.cpp +1 -1
  38. data/ext/reflex/capture_event.cpp +1 -1
  39. data/ext/reflex/contact_event.cpp +1 -1
  40. data/ext/reflex/defs.h +2 -0
  41. data/ext/reflex/draw_event.cpp +1 -1
  42. data/ext/reflex/ellipse_shape.cpp +1 -1
  43. data/ext/reflex/event.cpp +1 -1
  44. data/ext/reflex/extconf.rb +4 -4
  45. data/ext/reflex/filter.cpp +1 -1
  46. data/ext/reflex/focus_event.cpp +1 -1
  47. data/ext/reflex/frame_event.cpp +1 -1
  48. data/ext/reflex/image_view.cpp +1 -1
  49. data/ext/reflex/key_event.cpp +74 -69
  50. data/ext/reflex/line_shape.cpp +1 -1
  51. data/ext/reflex/motion_event.cpp +1 -1
  52. data/ext/reflex/pointer.cpp +1 -1
  53. data/ext/reflex/pointer_event.cpp +1 -1
  54. data/ext/reflex/polygon_shape.cpp +1 -1
  55. data/ext/reflex/rect_shape.cpp +1 -1
  56. data/ext/reflex/reflex.cpp +58 -50
  57. data/ext/reflex/screen.cpp +1 -1
  58. data/ext/reflex/scroll_event.cpp +1 -1
  59. data/ext/reflex/selector.cpp +2 -2
  60. data/ext/reflex/shape.cpp +1 -1
  61. data/ext/reflex/style.cpp +1 -1
  62. data/ext/reflex/style_length.cpp +2 -2
  63. data/ext/reflex/timer.cpp +1 -1
  64. data/ext/reflex/timer_event.cpp +1 -1
  65. data/ext/reflex/update_event.cpp +1 -1
  66. data/ext/reflex/view.cpp +1 -1
  67. data/ext/reflex/wheel_event.cpp +1 -1
  68. data/ext/reflex/window.cpp +1 -1
  69. data/include/reflex/defs.h +204 -187
  70. data/include/reflex/reflex.h +1 -0
  71. data/include/reflex/ruby/application.h +2 -2
  72. data/include/reflex/ruby/event.h +26 -26
  73. data/include/reflex/ruby/exception.h +3 -3
  74. data/include/reflex/ruby/filter.h +2 -2
  75. data/include/reflex/ruby/image_view.h +2 -2
  76. data/include/reflex/ruby/pointer.h +2 -2
  77. data/include/reflex/ruby/reflex.h +1 -1
  78. data/include/reflex/ruby/screen.h +2 -2
  79. data/include/reflex/ruby/selector.h +2 -2
  80. data/include/reflex/ruby/shape.h +10 -10
  81. data/include/reflex/ruby/style.h +4 -4
  82. data/include/reflex/ruby/timer.h +2 -2
  83. data/include/reflex/ruby/view.h +2 -2
  84. data/include/reflex/ruby/window.h +2 -2
  85. data/lib/reflex/extension.rb +4 -0
  86. data/reflex.gemspec +4 -4
  87. data/src/event.cpp +7 -3
  88. data/src/event.h +2 -0
  89. data/src/ios/event.mm +21 -27
  90. data/src/shape.cpp +2 -2
  91. data/src/view.cpp +1 -0
  92. data/src/win32/application.cpp +48 -35
  93. data/src/win32/device.cpp +18 -0
  94. data/src/win32/event.cpp +221 -0
  95. data/src/win32/event.h +50 -0
  96. data/src/win32/opengl.cpp +54 -27
  97. data/src/win32/opengl.h +15 -13
  98. data/src/win32/reflex.cpp +10 -16
  99. data/src/win32/screen.cpp +61 -0
  100. data/src/win32/screen.h +21 -0
  101. data/src/win32/window.cpp +445 -240
  102. data/src/window.cpp +1 -0
  103. data/test/test_window.rb +24 -21
  104. metadata +14 -11
  105. data/src/win32/defs.cpp +0 -303
  106. data/src/win32/defs.h +0 -34
data/src/window.cpp CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
 
4
4
  #include <assert.h>
5
+ #include <algorithm>
5
6
  #include <set>
6
7
  #include "reflex/exception.h"
7
8
  #include "view.h"
data/test/test_window.rb CHANGED
@@ -47,27 +47,30 @@ class TestWindow < Test::Unit::TestCase
47
47
  b = w.frame.dup
48
48
  assert_equal b, w.frame
49
49
 
50
- w.frame = 1; assert_equal [0, 0, 1, 1], w.frame.to_a
51
- w.frame = [1]; assert_equal [0, 0, 1, 1], w.frame.to_a
52
- w.frame = [1, 2]; assert_equal [0, 0, 1, 2], w.frame.to_a
53
- w.frame = [1, 2, 3]; assert_equal [0, 0, 1, 2], w.frame.to_a
54
- w.frame = [1, 2, 3]; assert_equal [0, 0, 0, 1, 2, 0], w.frame.to_a(3)
55
- w.frame = [1, 2, 3, 4]; assert_equal [1, 2, 3, 4], w.frame.to_a
56
- w.frame = [1, 2, 3, 4]; assert_equal [1, 2, 0, 3, 4, 0], w.frame.to_a(3)
57
- w.frame = [1, 2, 3, 4, 5, 6]; assert_equal [1, 2, 4, 5], w.frame.to_a
58
- w.frame = [1, 2, 3, 4, 5, 6]; assert_equal [1, 2, 0, 4, 5, 0], w.frame.to_a(3)
59
-
60
- w.frame = point(1); assert_equal [0, 0, 1, 1], w.frame.to_a
61
- w.frame = [point(1)]; assert_equal [0, 0, 1, 1], w.frame.to_a
62
- w.frame = point(1, 2); assert_equal [0, 0, 1, 2], w.frame.to_a
63
- w.frame = [point(1, 2)]; assert_equal [0, 0, 1, 2], w.frame.to_a
64
- w.frame = [point(1, 2), point(3, 4)]; assert_equal [1, 2, 3, 4], w.frame.to_a
65
- w.frame = [point(1, 2), point(3, 4)]; assert_equal [1, 2, 0, 3, 4, 0], w.frame.to_a(3)
66
- w.frame = [point(1, 2, 3), point(4, 5, 6)]; assert_equal [1, 2, 4, 5], w.frame.to_a
67
- w.frame = [point(1, 2, 3), point(4, 5, 6)]; assert_equal [1, 2, 0, 4, 5, 0], w.frame.to_a(3)
68
-
69
- w.frame = bounds(1, 2, 3, 4, 5, 6); assert_equal [1, 2, 0, 4, 5, 0], w.frame.to_a(3)
70
- w.frame = [bounds(1, 2, 3, 4, 5, 6)]; assert_equal [1, 2, 0, 4, 5, 0], w.frame.to_a(3)
50
+ min_width = w.frame.width
51
+ minw = -> value {[min_width, value].max}
52
+
53
+ w.frame = 1; assert_equal [0, 0, minw[1], 1], w.frame.to_a
54
+ w.frame = [1]; assert_equal [0, 0, minw[1], 1], w.frame.to_a
55
+ w.frame = [1, 2]; assert_equal [0, 0, minw[1], 2], w.frame.to_a
56
+ w.frame = [1, 2, 3]; assert_equal [0, 0, minw[1], 2], w.frame.to_a
57
+ w.frame = [1, 2, 3]; assert_equal [0, 0, 0, minw[1], 2, 0], w.frame.to_a(3)
58
+ w.frame = [1, 2, 3, 4]; assert_equal [1, 2, minw[3], 4], w.frame.to_a
59
+ w.frame = [1, 2, 3, 4]; assert_equal [1, 2, 0, minw[3], 4, 0], w.frame.to_a(3)
60
+ w.frame = [1, 2, 3, 4, 5, 6]; assert_equal [1, 2, minw[4], 5], w.frame.to_a
61
+ w.frame = [1, 2, 3, 4, 5, 6]; assert_equal [1, 2, 0, minw[4], 5, 0], w.frame.to_a(3)
62
+
63
+ w.frame = point(1); assert_equal [0, 0, minw[1], 1], w.frame.to_a
64
+ w.frame = [point(1)]; assert_equal [0, 0, minw[1], 1], w.frame.to_a
65
+ w.frame = point(1, 2); assert_equal [0, 0, minw[1], 2], w.frame.to_a
66
+ w.frame = [point(1, 2)]; assert_equal [0, 0, minw[1], 2], w.frame.to_a
67
+ w.frame = [point(1, 2), point(3, 4)]; assert_equal [1, 2, minw[3], 4], w.frame.to_a
68
+ w.frame = [point(1, 2), point(3, 4)]; assert_equal [1, 2, 0, minw[3], 4, 0], w.frame.to_a(3)
69
+ w.frame = [point(1, 2, 3), point(4, 5, 6)]; assert_equal [1, 2, minw[4], 5], w.frame.to_a
70
+ w.frame = [point(1, 2, 3), point(4, 5, 6)]; assert_equal [1, 2, 0, minw[4], 5, 0], w.frame.to_a(3)
71
+
72
+ w.frame = bounds(1, 2, 3, 4, 5, 6); assert_equal [1, 2, 0, minw[4], 5, 0], w.frame.to_a(3)
73
+ w.frame = [bounds(1, 2, 3, 4, 5, 6)]; assert_equal [1, 2, 0, minw[4], 5, 0], w.frame.to_a(3)
71
74
  end
72
75
 
73
76
  def test_closable?()
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reflexion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.1
19
+ version: '0.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.1
26
+ version: '0.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rucy
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.2.1
33
+ version: '0.3'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.2.1
40
+ version: '0.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: beeps
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.2.1
47
+ version: '0.3'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.2.1
54
+ version: '0.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rays
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.2.1
61
+ version: '0.3'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.2.1
68
+ version: '0.3'
69
69
  description: This library helps you to develop interactive graphical user interface.
70
70
  email: xordog@gmail.com
71
71
  executables: []
@@ -369,11 +369,14 @@ files:
369
369
  - src/view.cpp
370
370
  - src/view.h
371
371
  - src/win32/application.cpp
372
- - src/win32/defs.cpp
373
- - src/win32/defs.h
372
+ - src/win32/device.cpp
373
+ - src/win32/event.cpp
374
+ - src/win32/event.h
374
375
  - src/win32/opengl.cpp
375
376
  - src/win32/opengl.h
376
377
  - src/win32/reflex.cpp
378
+ - src/win32/screen.cpp
379
+ - src/win32/screen.h
377
380
  - src/win32/window.cpp
378
381
  - src/window.cpp
379
382
  - src/window.h
data/src/win32/defs.cpp DELETED
@@ -1,303 +0,0 @@
1
- #include "defs.h"
2
-
3
-
4
- #include <windowsx.h>
5
-
6
-
7
- #ifndef VK_BROWSER_BACK
8
- #define VK_BROWSER_BACK 0xa6
9
- #define VK_BROWSER_FORWARD 0xa7
10
- #define VK_BROWSER_REFRESH 0xa8
11
- #define VK_BROWSER_STOP 0xa9
12
- #define VK_BROWSER_SEARCH 0xaa
13
- #define VK_BROWSER_FAVORITES 0xab
14
- #define VK_BROWSER_HOME 0xac
15
- #define VK_VOLUME_MUTE 0xad
16
- #define VK_VOLUME_DOWN 0xae
17
- #define VK_VOLUME_UP 0xaf
18
- #define VK_MEDIA_NEXT_TRACK 0xb0
19
- #define VK_MEDIA_PREV_TRACK 0xb1
20
- #define VK_MEDIA_STOP 0xb2
21
- #define VK_MEDIA_PLAY_PAUSE 0xb3
22
- #define VK_LAUNCH_MAIL 0xb4
23
- #define VK_LAUNCH_MEDIA_SELECT 0xb5
24
- #define VK_LAUNCH_APP1 0xb6
25
- #define VK_LAUNCH_APP2 0xb7
26
- #endif
27
-
28
-
29
- namespace Reflex
30
- {
31
-
32
-
33
- static bool
34
- get_modifiers (uint* modifiers)
35
- {
36
- if (!modifiers) return false;
37
-
38
- *modifiers |=
39
- GetKeyState(VK_SHIFT) ? MOD_SHIFT : 0 |
40
- GetKeyState(VK_CONTROL) ? MOD_CONTROL : 0 |
41
- GetKeyState(VK_MENU) ? MOD_ALT : 0 |
42
- GetKeyState(VK_LWIN) ? MOD_WIN : 0 |
43
- GetKeyState(VK_RWIN) ? MOD_WIN : 0 |
44
- GetKeyState(VK_CAPITAL) ? MOD_CAPS : 0 |
45
- GetKeyState(VK_NUMLOCK) ? MOD_NUMPAD : 0;
46
-
47
- return true;
48
- }
49
-
50
- static bool
51
- get_keypress (Key* key, UINT msg, WPARAM wp, LPARAM lp)
52
- {
53
- if (!key) return false;
54
-
55
- String& s = key->chars;
56
- int& c = key->code;
57
- uint& m = key->modifiers;
58
-
59
- switch (wp)
60
- {
61
- case VK_CANCEL: c = KEY_BREAK; return true;
62
- case VK_BACK: c = KEY_BACKSPACE; return true;
63
- case VK_TAB: c = KEY_TAB; return true;
64
- case VK_CLEAR: c = KEY_CLEAR; return true;
65
- case VK_RETURN: c = KEY_RETURN; return true;
66
- case VK_SHIFT: c = KEY_SHIFT; return true;
67
- case VK_CONTROL: c = KEY_CONTROL; return true;
68
- case VK_MENU: c = KEY_ALT; return true;
69
- case VK_PAUSE: c = KEY_PAUSE; return true;
70
- case VK_CAPITAL: c = KEY_CAPSLOCK; return true;
71
- case VK_KANA: c = KEY_IME_KANA; return true;
72
- case VK_JUNJA: c = KEY_IME_JUNJA; return true;
73
- case VK_FINAL: c = KEY_IME_FINAL; return true;
74
- case VK_KANJI: c = KEY_IME_KANJI; return true;
75
- case VK_ESCAPE: c = KEY_ESCAPE; return true;
76
- case VK_CONVERT: c = KEY_IME_CONVERT; return true;
77
- case VK_NONCONVERT: c = KEY_IME_NONCONVERT; return true;
78
- case VK_ACCEPT: c = KEY_IME_ACCEPT; return true;
79
- case VK_MODECHANGE: c = KEY_IME_MODECHANGE; return true;
80
- case VK_SPACE: c = KEY_SPACE; return true;
81
- case VK_PRIOR: c = KEY_PAGEUP; return true;
82
- case VK_NEXT: c = KEY_PAGEDOWN; return true;
83
- case VK_END: c = KEY_END; return true;
84
- case VK_HOME: c = KEY_HOME; return true;
85
- case VK_LEFT: c = KEY_LEFT; return true;
86
- case VK_UP: c = KEY_UP; return true;
87
- case VK_RIGHT: c = KEY_RIGHT; return true;
88
- case VK_DOWN: c = KEY_DOWN; return true;
89
- case VK_SELECT: c = KEY_SELECT; return true;
90
- case VK_PRINT: c = KEY_PRINT; return true;
91
- case VK_EXECUTE: c = KEY_EXECUTE; return true;
92
- case VK_SNAPSHOT: c = KEY_PRINTSCREEN; return true;
93
- case VK_INSERT: c = KEY_INSERT; return true;
94
- case VK_DELETE: c = KEY_DELETE; return true;
95
- case VK_HELP: c = KEY_HELP; return true;
96
- case VK_LWIN: c = KEY_LWIN; return true;
97
- case VK_RWIN: c = KEY_RWIN; return true;
98
- case VK_APPS: c = KEY_APPS; return true;
99
- case VK_SLEEP: c = KEY_SLEEP; return true;
100
- case VK_NUMPAD0: s = "0"; m = MOD_NUMPAD; return true;
101
- case VK_NUMPAD1: s = "1"; m = MOD_NUMPAD; return true;
102
- case VK_NUMPAD2: s = "2"; m = MOD_NUMPAD; return true;
103
- case VK_NUMPAD3: s = "3"; m = MOD_NUMPAD; return true;
104
- case VK_NUMPAD4: s = "4"; m = MOD_NUMPAD; return true;
105
- case VK_NUMPAD5: s = "5"; m = MOD_NUMPAD; return true;
106
- case VK_NUMPAD6: s = "6"; m = MOD_NUMPAD; return true;
107
- case VK_NUMPAD7: s = "7"; m = MOD_NUMPAD; return true;
108
- case VK_NUMPAD8: s = "8"; m = MOD_NUMPAD; return true;
109
- case VK_NUMPAD9: s = "9"; m = MOD_NUMPAD; return true;
110
- case VK_MULTIPLY: s = "*"; m = MOD_NUMPAD; return true;
111
- case VK_ADD: s = "+"; m = MOD_NUMPAD; return true;
112
- case VK_SEPARATOR: s = ":"; m = MOD_NUMPAD; return true;
113
- case VK_SUBTRACT: s = "-"; m = MOD_NUMPAD; return true;
114
- case VK_DECIMAL: s = "."; m = MOD_NUMPAD; return true;
115
- case VK_DIVIDE: s = "/"; m = MOD_NUMPAD; return true;
116
- case VK_F1: c = KEY_F1; m = MOD_FUNCTION; return true;
117
- case VK_F2: c = KEY_F2; m = MOD_FUNCTION; return true;
118
- case VK_F3: c = KEY_F3; m = MOD_FUNCTION; return true;
119
- case VK_F4: c = KEY_F4; m = MOD_FUNCTION; return true;
120
- case VK_F5: c = KEY_F5; m = MOD_FUNCTION; return true;
121
- case VK_F6: c = KEY_F6; m = MOD_FUNCTION; return true;
122
- case VK_F7: c = KEY_F7; m = MOD_FUNCTION; return true;
123
- case VK_F8: c = KEY_F8; m = MOD_FUNCTION; return true;
124
- case VK_F9: c = KEY_F9; m = MOD_FUNCTION; return true;
125
- case VK_F10: c = KEY_F10; m = MOD_FUNCTION; return true;
126
- case VK_F11: c = KEY_F11; m = MOD_FUNCTION; return true;
127
- case VK_F12: c = KEY_F12; m = MOD_FUNCTION; return true;
128
- case VK_F13: c = KEY_F13; m = MOD_FUNCTION; return true;
129
- case VK_F14: c = KEY_F14; m = MOD_FUNCTION; return true;
130
- case VK_F15: c = KEY_F15; m = MOD_FUNCTION; return true;
131
- case VK_F16: c = KEY_F16; m = MOD_FUNCTION; return true;
132
- case VK_F17: c = KEY_F17; m = MOD_FUNCTION; return true;
133
- case VK_F18: c = KEY_F18; m = MOD_FUNCTION; return true;
134
- case VK_F19: c = KEY_F19; m = MOD_FUNCTION; return true;
135
- case VK_F20: c = KEY_F20; m = MOD_FUNCTION; return true;
136
- case VK_F21: c = KEY_F21; m = MOD_FUNCTION; return true;
137
- case VK_F22: c = KEY_F22; m = MOD_FUNCTION; return true;
138
- case VK_F23: c = KEY_F23; m = MOD_FUNCTION; return true;
139
- case VK_F24: c = KEY_F24; m = MOD_FUNCTION; return true;
140
- case VK_NUMLOCK: c = KEY_NUMLOCK; return true;
141
- case VK_SCROLL: c = KEY_SCROLLLOCK; return true;
142
- case VK_LSHIFT: c = KEY_LSHIFT; return true;
143
- case VK_RSHIFT: c = KEY_RSHIFT; return true;
144
- case VK_LCONTROL: c = KEY_LCONTROL; return true;
145
- case VK_RCONTROL: c = KEY_RCONTROL; return true;
146
- case VK_LMENU: c = KEY_LALT; return true;
147
- case VK_RMENU: c = KEY_RALT; return true;
148
- case VK_BROWSER_BACK: c = KEY_BROWSER_BACK; return true;
149
- case VK_BROWSER_FORWARD: c = KEY_BROWSER_FORWARD; return true;
150
- case VK_BROWSER_REFRESH: c = KEY_BROWSER_REFRESH; return true;
151
- case VK_BROWSER_STOP: c = KEY_BROWSER_STOP; return true;
152
- case VK_BROWSER_SEARCH: c = KEY_BROWSER_SEARCH; return true;
153
- case VK_BROWSER_FAVORITES: c = KEY_BROWSER_FAVORITES; return true;
154
- case VK_BROWSER_HOME: c = KEY_BROWSER_HOME; return true;
155
- case VK_VOLUME_MUTE: c = KEY_VOLUME_MUTE; return true;
156
- case VK_VOLUME_DOWN: c = KEY_VOLUME_DOWN; return true;
157
- case VK_VOLUME_UP: c = KEY_VOLUME_UP; return true;
158
- case VK_MEDIA_NEXT_TRACK: c = KEY_MEDIA_NEXT_TRACK; return true;
159
- case VK_MEDIA_PREV_TRACK: c = KEY_MEDIA_PREV_TRACK; return true;
160
- case VK_MEDIA_STOP: c = KEY_MEDIA_STOP; return true;
161
- case VK_MEDIA_PLAY_PAUSE: c = KEY_MEDIA_PLAY_PAUSE; return true;
162
- case VK_LAUNCH_MAIL: c = KEY_LAUNCH_MAIL; return true;
163
- case VK_LAUNCH_MEDIA_SELECT: c = KEY_LAUNCH_MEDIA_SELECT; return true;
164
- case VK_LAUNCH_APP1: c = KEY_LAUNCH_APP1; return true;
165
- case VK_LAUNCH_APP2: c = KEY_LAUNCH_APP2; return true;
166
- #if 0
167
- case VK_OEM_1: s = ","; return true;
168
- case VK_OEM_PLUS: s = "},"; return true;
169
- case VK_OEM_COMMA: s = ","; return true;
170
- case VK_OEM_MINUS: s = "-"; return true;
171
- case VK_OEM_PERIOD: s = "."; return true;
172
- case VK_OEM_2: s = "/"; return true;
173
- case VK_OEM_3: s = "@"; return true;
174
- case VK_OEM_4: s = "["; return true;
175
- case VK_OEM_5: s = "\\"; return true;
176
- case VK_OEM_6: s = "]"; return true;
177
- case VK_OEM_7: s = "^"; return true;
178
- case VK_OEM_8: c = KEY_OEM_8; return true;
179
- case VK_OEM_AX: c = KEY_KEY_OEM_AX; return true;
180
- case VK_OEM_102: s = "\\"; return true;
181
- case VK_ICO_HELP: c = KEY_ICO_HELP; return true;
182
- case VK_ICO_OO: c = KEY_ICO_OO; return true;
183
- #endif
184
- case VK_PROCESSKEY: c = KEY_IME_PROCESS; return true;
185
- #if 0
186
- case VK_ICO_CLEAR: c = KEY_ICO_CLEAR; return true;
187
- case VK_PACKET: c = KEY_PACKET; return true;
188
- case VK_OEM_RESET: c = KEY_OEM_RESET; return true;
189
- case VK_OEM_JUMP: c = KEY_OEM_JUMP; return true;
190
- case VK_OEM_PA1: c = KEY_OEM_PA1; return true;
191
- case VK_OEM_PA2: c = KEY_OEM_PA2; return true;
192
- case VK_OEM_PA3: c = KEY_OEM_PA3; return true;
193
- case VK_OEM_WSCTRL: c = KEY_OEM_WSCTRL; return true;
194
- case VK_OEM_CUSEL: c = KEY_OEM_CUSEL; return true;
195
- case VK_OEM_ATTN: c = KEY_OEM_ATTN; return true;
196
- case VK_OEM_FINISH: c = KEY_OEM_FINISH; return true;
197
- case VK_OEM_COPY: c = KEY_OEM_COPY; return true;
198
- case VK_OEM_AUTO: c = KEY_OEM_AUTO; return true;
199
- case VK_OEM_ENLW: c = KEY_OEM_ENLW; return true;
200
- case VK_OEM_BACKTAB: c = KEY_OEM_BACKTAB; return true;
201
- case VK_ATTN: c = KEY_ATTN; return true;
202
- case VK_CRSEL: c = KEY_CRSEL; return true;
203
- case VK_EXSEL: c = KEY_EXSEL; return true;
204
- case VK_EREOF: c = KEY_EREOF; return true;
205
- #endif
206
- case VK_PLAY: c = KEY_PLAY; return true;
207
- case VK_ZOOM: c = KEY_ZOOM; return true;
208
- #if 0
209
- case VK_NONAME: c = KEY_NONAME; return true;
210
- case VK_PA1: c = KEY_PA1; return true;
211
- case VK_OEM_CLEAR: c = KEY_OEM_CLEAR; return true;
212
- #endif
213
- }
214
-
215
- return false;
216
- }
217
-
218
- static bool
219
- get_chars (Key* key, UINT msg, WPARAM wp, LPARAM lp)
220
- {
221
- if (!key) return false;
222
-
223
- key->chars += (char) wp;
224
- return true;
225
- }
226
-
227
- static bool
228
- get_key (Key* key, UINT msg, WPARAM wp, LPARAM lp)
229
- {
230
- if (!key || !get_modifiers(&key->modifiers))
231
- return false;
232
-
233
- bool ret = true;
234
-
235
- if (
236
- msg == WM_KEYDOWN || msg == WM_KEYUP ||
237
- msg == WM_SYSKEYDOWN || msg == WM_SYSKEYUP)
238
- {
239
- ret &= get_keypress(key, msg, wp, lp);
240
- }
241
- else if (
242
- msg == WM_CHAR || msg == WM_SYSCHAR ||
243
- msg == WM_DEADCHAR || msg == WM_SYSDEADCHAR)
244
- {
245
- ret &= get_chars(key, msg, wp, lp);
246
- }
247
-
248
- key->repeat = lp & 0xff;
249
- ret &= get_modifiers(&key->modifiers);
250
-
251
- return ret;
252
- }
253
-
254
- static int
255
- get_points (Points* points, UINT msg, WPARAM wp, LPARAM lp)
256
- {
257
- if (!points) return false;
258
-
259
- switch (msg)
260
- {
261
- case WM_LBUTTONDBLCLK:
262
- points->count += 1;
263
- case WM_LBUTTONDOWN:
264
- case WM_LBUTTONUP:
265
- points->type = POINT_MOUSE_LEFT;
266
- points->count += 1;
267
- break;
268
-
269
- case WM_RBUTTONDBLCLK:
270
- points->count += 1;
271
- case WM_RBUTTONDOWN:
272
- case WM_RBUTTONUP:
273
- points->type = POINT_MOUSE_RIGHT;
274
- points->count += 1;
275
- break;
276
-
277
- case WM_MBUTTONDBLCLK:
278
- points->count += 1;
279
- case WM_MBUTTONDOWN:
280
- case WM_MBUTTONUP:
281
- points->type = POINT_MOUSE_MIDDLE;
282
- points->count += 1;
283
- break;
284
- }
285
-
286
- return get_modifiers(&points->modifiers);
287
- }
288
-
289
-
290
- Win32Key::Win32Key (UINT msg, WPARAM wp, LPARAM lp)
291
- {
292
- get_key(this, msg, wp, lp);
293
- }
294
-
295
-
296
- Win32Points::Win32Points (UINT msg, WPARAM wp, LPARAM lp)
297
- : Points(POINT_NONE, GET_X_LPARAM(lp), GET_Y_LPARAM(lp))
298
- {
299
- get_points(this, msg, wp, lp);
300
- }
301
-
302
-
303
- }// Reflex
data/src/win32/defs.h DELETED
@@ -1,34 +0,0 @@
1
- // -*- c++ -*-
2
- #pragma once
3
- #ifndef __REFLEX_SRC_WIN32_DEFS_H__
4
- #define __REFLEX_SRC_WIN32_DEFS_H__
5
-
6
-
7
- #include <windows.h>
8
- #include "reflex/defs.h"
9
-
10
-
11
- namespace Reflex
12
- {
13
-
14
-
15
- struct Win32Key : public Key
16
- {
17
-
18
- Win32Key (UINT msg, WPARAM wp, LPARAM lp);
19
-
20
- };// Win32Key
21
-
22
-
23
- struct Win32Points : public Points
24
- {
25
-
26
- Win32Points (UINT msg, WPARAM wp, LPARAM lp);
27
-
28
- };// Win32Points
29
-
30
-
31
- }// Reflex
32
-
33
-
34
- #endif//EOH