rubysdl 1.3.1 → 2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MANIFEST +22 -2
- data/NEWS.en +80 -0
- data/NEWS.ja +83 -0
- data/README.en +2 -1
- data/README.ja +2 -2
- data/doc-en/Makefile +18 -0
- data/doc-en/cdrom.rsd +417 -0
- data/doc-en/collision.rsd +174 -0
- data/doc-en/event.rsd +1476 -0
- data/doc-en/font.rsd +811 -0
- data/doc-en/general.rsd +43 -0
- data/doc-en/init.rsd +168 -0
- data/doc-en/joystick.rsd +401 -0
- data/doc-en/mixer.rsd +869 -0
- data/doc-en/mpeg.rsd +585 -0
- data/doc-en/opengl.rsd +155 -0
- data/doc-en/sdlskk.rsd +472 -0
- data/doc-en/time.rsd +46 -0
- data/doc-en/video.rsd +2806 -0
- data/doc-en/wm.rsd +112 -0
- data/doc/Makefile +1 -1
- data/doc/cdrom.rsd +3 -3
- data/doc/event.rsd +178 -179
- data/doc/general.rsd +10 -0
- data/doc/init.rsd +2 -2
- data/doc/joystick.rsd +29 -5
- data/doc/mixer.rsd +20 -0
- data/doc/rsd.rb +42 -9
- data/doc/sdlskk.rsd +7 -7
- data/doc/video.rsd +461 -168
- data/doc/wm.rsd +2 -2
- data/extconf.rb +1 -8
- data/lib/rubysdl_aliases.rb +52 -190
- data/lib/rubysdl_compatible_ver1.rb +243 -0
- data/lib/sdl.rb +58 -92
- data/rubysdl.h +59 -68
- data/rubysdl_cdrom.c +125 -102
- data/{rubysdl_doc.en.rd → rubysdl_doc_old.en.rd} +3 -2
- data/rubysdl_event.c +318 -255
- data/rubysdl_event_key.c +299 -287
- data/rubysdl_image.c +37 -13
- data/rubysdl_joystick.c +180 -67
- data/rubysdl_kanji.c +61 -75
- data/rubysdl_main.c +65 -138
- data/rubysdl_mixer.c +339 -214
- data/rubysdl_mouse.c +50 -43
- data/rubysdl_opengl.c +31 -28
- data/rubysdl_pixel.c +17 -28
- data/rubysdl_ref.en.html +5658 -0
- data/rubysdl_ref.en.rd +6337 -0
- data/rubysdl_ref.html +2253 -1964
- data/rubysdl_ref.rd +823 -469
- data/rubysdl_rwops.c +9 -6
- data/rubysdl_sdlskk.c +137 -165
- data/rubysdl_sge_video.c +355 -469
- data/rubysdl_smpeg.c +189 -190
- data/rubysdl_time.c +1 -1
- data/rubysdl_ttf.c +147 -215
- data/rubysdl_video.c +486 -405
- data/rubysdl_wm.c +30 -30
- data/sample/aadraw.rb +9 -9
- data/sample/alpha.rb +12 -13
- data/sample/alphadraw.rb +10 -10
- data/sample/bfont.rb +4 -4
- data/sample/cdrom.rb +11 -4
- data/sample/collision.rb +20 -20
- data/sample/cursor.rb +5 -5
- data/sample/ellipses.rb +20 -16
- data/sample/event2.rb +11 -9
- data/sample/font.rb +4 -4
- data/sample/fpstimer.rb +3 -3
- data/sample/icon.bmp.gz +0 -0
- data/sample/icon.png +0 -0
- data/sample/joy2.rb +14 -14
- data/sample/kanji.rb +7 -7
- data/sample/load_from_io.rb +44 -0
- data/sample/movesp.rb +13 -12
- data/sample/playmod.rb +2 -3
- data/sample/plaympeg.rb +8 -8
- data/sample/playwave.rb +5 -6
- data/sample/sdlskk.rb +11 -11
- data/sample/sgetest.rb +14 -12
- data/sample/stetris.rb +12 -13
- data/sample/testgl.rb +13 -14
- data/sample/testsprite.rb +12 -11
- data/sample/transformblit.rb +23 -22
- metadata +62 -35
- data/rubysdl_event2.c +0 -417
data/doc-en/opengl.rsd
ADDED
@@ -0,0 +1,155 @@
|
|
1
|
+
= OpenGL
|
2
|
+
* ((<OpenGL outline>))
|
3
|
+
|
4
|
+
* OpenGL related methods
|
5
|
+
TOC
|
6
|
+
|
7
|
+
== OpenGL outline
|
8
|
+
Ruby/SDL has the ability to create and use OpenGL
|
9
|
+
contexts on several platforms(Linux/
|
10
|
+
X11, Win32, Mac OS X, etc).
|
11
|
+
This allows you to use SDL's audio, event handling and times in your
|
12
|
+
OpenGL applications (a function often performed by GLUT).
|
13
|
+
|
14
|
+
Ruby/SDL has no OpenGL methods, please use
|
15
|
+
((<OpenGL Interface|URL:http://www2.giganet.net/~yoshi/>)) or
|
16
|
+
((<riko|URL:http://www.kumaryu.net/?(Ruby)+Riko>))
|
17
|
+
with Ruby/SDL.
|
18
|
+
|
19
|
+
=== Initialisation
|
20
|
+
Initialising Ruby/SDL to use OpenGL is not very
|
21
|
+
different to initialising Ruby/SDL normally.
|
22
|
+
There are three differences; you must pass
|
23
|
+
SDL::OPENGL to @[Screen.open], you
|
24
|
+
must specify several GL attributes (depth buffer size, framebuffer sizes) using
|
25
|
+
@[GL.set_attr] and finally, if you wish to use double buffering you must
|
26
|
+
specify it as a GL attribute, ((*not*)) by passing the SDL::DOUBLEBUF flag to
|
27
|
+
SDL::DOUBLEBUF.
|
28
|
+
|
29
|
+
|
30
|
+
EXAMPLE
|
31
|
+
# First, initialize SDL's video subsystem.
|
32
|
+
SDL.init(SDL::INIT_VIDEO)
|
33
|
+
# Let's get some video information.
|
34
|
+
info = SDL::Screen.info
|
35
|
+
# Set our width/height to 640/480 (you would
|
36
|
+
# of course let the user decide this in a normal
|
37
|
+
# app).
|
38
|
+
width = 640
|
39
|
+
height = 480
|
40
|
+
# We get the bpp we will request from the display.
|
41
|
+
bpp = info.bpp
|
42
|
+
# Now, we want to setup our requested
|
43
|
+
# window attributes for our OpenGL window.
|
44
|
+
# We want *at least* 5 bits of red, green
|
45
|
+
# and blue. We also want at least a 16-bit
|
46
|
+
# depth buffer.
|
47
|
+
#
|
48
|
+
# The last thing we do is request a double
|
49
|
+
# buffered window. '1' turns on double
|
50
|
+
# buffering, '0' turns it off.
|
51
|
+
#
|
52
|
+
# Note that we do not use SDL::DOUBLEBUF in
|
53
|
+
# the flags to SDL::Screen.open. That does
|
54
|
+
# not affect the GL attribute state, only
|
55
|
+
# the standard 2D blitting setup.
|
56
|
+
SDL::GL.set_attr(SDL::GL::RED_SIZE, 5)
|
57
|
+
SDL::GL.set_attr(SDL::GL::GREEN_SIZE, 5)
|
58
|
+
SDL::GL.set_attr(SDL::GL::BLUE_SIZE, 5)
|
59
|
+
SDL::GL.set_attr(SDL::GL::DEPTH_SIZE, 16)
|
60
|
+
SDL::GL.set_attr(SDL::GL::DOUBLEBUFFER, 1)
|
61
|
+
|
62
|
+
# We want to request that SDL provide us
|
63
|
+
# with an OpenGL window, in a fullscreen
|
64
|
+
# video mode.
|
65
|
+
flags = SDL:;OPENGL | SDL::FULLSCREEN
|
66
|
+
|
67
|
+
# Set the video mode
|
68
|
+
SDL::Screen.open(width, height, bpp, flags)
|
69
|
+
|
70
|
+
=== GL attribute
|
71
|
+
You can use @[GL.get_attr] and @[GL.set_attr] with following attributes:
|
72
|
+
* SDL::GL::RED_SIZE Size of the framebuffer red component, in bits
|
73
|
+
* SDL::GL::GREEN_SIZE Size of the framebuffer green component, in bits
|
74
|
+
* SDL::GL::BLUE_SIZE Size of the framebuffer blue component, in bits
|
75
|
+
* SDL::GL::ALPHA_SIZE Size of the framebuffer alpha component, in bits
|
76
|
+
* SDL::GL::DOUBLEBUFFER 0 or 1, enable or disable double buffering
|
77
|
+
* SDL::GL::BUFFER_SIZE Size of the framebuffer, in bits
|
78
|
+
* SDL::GL::DEPTH_SIZE Size of the depth buffer, in bits
|
79
|
+
* SDL::GL::STENCIL_SIZE Size of the stencil buffer, in bits
|
80
|
+
* SDL::GL::ACCUM_RED_SIZE Size of the accumulation buffer red component, in bits
|
81
|
+
* SDL::GL::ACCUM_GREEN_SIZE Size of the accumulation buffer green component, in bits
|
82
|
+
* SDL::GL::ACCUM_BLUE_SIZE Size of the accumulation buffer blue component, in bits
|
83
|
+
* SDL::GL::ACCUM_ALPHA_SIZE Size of the accumulation buffer alpha component, in bits
|
84
|
+
|
85
|
+
=== Drawing
|
86
|
+
Apart from initialisation, using OpenGL within Ruby/SDL
|
87
|
+
is the same as using OpenGL
|
88
|
+
with any other API, e.g. GLUT. You still use all the same function calls and data
|
89
|
+
types. However if you are using a double-buffered display, then you must use
|
90
|
+
@[GL.swap_buffers] to swap the buffers and update the display. To request
|
91
|
+
double-buffering with OpenGL, use @[GL.set_attr] with SDL::GL::DOUBLEBUFFER,
|
92
|
+
and use @[GL.get_attr] to see if you actually got it.
|
93
|
+
|
94
|
+
== Methods
|
95
|
+
%%%
|
96
|
+
NAME get_attr
|
97
|
+
MOD GL
|
98
|
+
TYPE .
|
99
|
+
PURPOSE Get the value of a special SDL/OpenGL attribute
|
100
|
+
RVAL Integer
|
101
|
+
|
102
|
+
PROTO
|
103
|
+
get_attr(attr)
|
104
|
+
getAttr(attr)
|
105
|
+
|
106
|
+
DESC
|
107
|
+
Returns the value of the SDL/OpenGL ((<attribute|GL attribute>)) $[attr].
|
108
|
+
This is useful after
|
109
|
+
a call to @[Screen.open] to check whether your attributes have been set as you
|
110
|
+
expected.
|
111
|
+
|
112
|
+
EXCEPTION *
|
113
|
+
SEEALSO
|
114
|
+
GL.set_attr
|
115
|
+
|
116
|
+
%%
|
117
|
+
NAME set_attr
|
118
|
+
MOD GL
|
119
|
+
TYPE .
|
120
|
+
PURPOSE Set a special SDL/OpenGL attribute
|
121
|
+
|
122
|
+
PROTO
|
123
|
+
set_attr(attr, val)
|
124
|
+
setAttr(attr, val)
|
125
|
+
|
126
|
+
DESC
|
127
|
+
Sets the OpenGL ((<attribute|GL attribute>)) $[attr] to $[value].
|
128
|
+
The attributes you set don't take effect
|
129
|
+
until after a call to @[Screen.open]. You should use @[GL.get_attr] to
|
130
|
+
check the values after a @[Screen.open] call.
|
131
|
+
|
132
|
+
EXCEPTION *
|
133
|
+
NOTES
|
134
|
+
The SDL::DOUBLEBUF flag is not required to enable double buffering when
|
135
|
+
setting an OpenGL video mode. Double buffering is enabled or disabled using
|
136
|
+
the SDL::GL::DOUBLEBUFFER attribute.
|
137
|
+
|
138
|
+
SEEALSO
|
139
|
+
GL.get_attr
|
140
|
+
|
141
|
+
%%
|
142
|
+
NAME swap_buffers
|
143
|
+
MOD GL
|
144
|
+
TYPE .
|
145
|
+
PURPOSE Swap OpenGL framebuffers/Update Display
|
146
|
+
PROTO
|
147
|
+
swap_buffers()
|
148
|
+
swapBuffers()
|
149
|
+
|
150
|
+
DESC
|
151
|
+
Swap the OpenGL buffers, if double-buffering is supported.
|
152
|
+
|
153
|
+
SEEALSO
|
154
|
+
GL.set_attr
|
155
|
+
Screen.open
|
data/doc-en/sdlskk.rsd
ADDED
@@ -0,0 +1,472 @@
|
|
1
|
+
= SDLSKK
|
2
|
+
* ((<Japanese input system by SDLSKK>))
|
3
|
+
* ((<SDL::SKK::Context>))
|
4
|
+
* ((<SDL::SKK::Dictionary>))
|
5
|
+
* ((<SDL::SKK::Keybind>))
|
6
|
+
* ((<SDL::SKK::RomKanaRuleTable>))
|
7
|
+
* SDLSKK methods
|
8
|
+
TOC
|
9
|
+
|
10
|
+
== Japanese input system by SDLSKK
|
11
|
+
Ruby/SDL has
|
12
|
+
((<SKK|URL:http://openlab.jp/skk/index-j.html>))-like
|
13
|
+
Japanese input system by
|
14
|
+
((<SDLSKK|URL:http://www.kmc.gr.jp/~ohai/sdlskk.html>)).
|
15
|
+
|
16
|
+
This system enables you not only to input Japanse
|
17
|
+
but also to handle line input including
|
18
|
+
cut and paste.
|
19
|
+
|
20
|
+
Please see sample/sdlskk.rb.
|
21
|
+
|
22
|
+
== SDL::SKK
|
23
|
+
This module has some SDLSKK-related module functions
|
24
|
+
and classes.
|
25
|
+
|
26
|
+
METHODS(SKK)
|
27
|
+
|
28
|
+
== SDL::SKK::Context
|
29
|
+
This class represents input state.
|
30
|
+
|
31
|
+
METHODS(SKK::Context)
|
32
|
+
|
33
|
+
== SDL::SKK::Dictionary
|
34
|
+
This class represents a Kana-Kanji dictionary.
|
35
|
+
Load SKK dictionary from files.
|
36
|
+
|
37
|
+
METHODS(SKK::Dictionary)
|
38
|
+
|
39
|
+
== SDL::SKK::Keybind
|
40
|
+
This class represents keybind.
|
41
|
+
|
42
|
+
METHODS(SKK::Keybind)
|
43
|
+
|
44
|
+
== SDL::SKK::RomKanaRuleTable
|
45
|
+
This class represents the translation table
|
46
|
+
from Romaji(Alphabet) to Kana.
|
47
|
+
Load text data from a file and create new table object.
|
48
|
+
|
49
|
+
METHODS(SKK::RomKanaRuleTable)
|
50
|
+
|
51
|
+
== SDLSKK methods
|
52
|
+
%%%
|
53
|
+
NAME encoding=
|
54
|
+
MOD SKK
|
55
|
+
TYPE .
|
56
|
+
DEP SDLSKK
|
57
|
+
PURPOSE Set SDLSKK internal encoding
|
58
|
+
|
59
|
+
PROTO
|
60
|
+
encoding=(encoding)
|
61
|
+
|
62
|
+
DESC
|
63
|
+
Sets SDLSKKK internal encoding to $[encoding].
|
64
|
+
Following constants are allowed:
|
65
|
+
* SDL::SKK::EUCJP
|
66
|
+
* SDL::SKK::UTF8
|
67
|
+
* SDL::SKK::SJIS
|
68
|
+
Default is SDL::SKK::EUCJP.
|
69
|
+
|
70
|
+
This encoding determines
|
71
|
+
the encoding of @[dictionary files|SKK::Dictionary#load],
|
72
|
+
@[a romaji-kana translation table file|SKK::RomKanaRuleTable.new]
|
73
|
+
and @[private dictionary|SKK::Dictionary#save].
|
74
|
+
|
75
|
+
NOTES
|
76
|
+
This function should call once before calling other
|
77
|
+
SDLSKK methods.
|
78
|
+
|
79
|
+
SEEALSO
|
80
|
+
SKK.encoding
|
81
|
+
SKK::Dictionary#load
|
82
|
+
SKK::Dictionary#save
|
83
|
+
SKK::RomKanaRuleTable.new
|
84
|
+
|
85
|
+
%%
|
86
|
+
NAME encoding
|
87
|
+
MOD SKK
|
88
|
+
TYPE .
|
89
|
+
DEP SDLSKK
|
90
|
+
PURPOSE Get SDLSKK internal encoding
|
91
|
+
RVAL UINT
|
92
|
+
|
93
|
+
PROTO
|
94
|
+
encoding
|
95
|
+
|
96
|
+
DESC
|
97
|
+
Returns the SDLSKK internal encoding. Please see
|
98
|
+
@[SKK.encoding=] for more detail.
|
99
|
+
|
100
|
+
SEEALSO
|
101
|
+
SKK.encoding=
|
102
|
+
|
103
|
+
%%
|
104
|
+
NAME new
|
105
|
+
MOD SKK::RomKanaRuleTable
|
106
|
+
TYPE .
|
107
|
+
DEP SDLSKK
|
108
|
+
PURPOSE Load a Romaji-Kana trasnlation table
|
109
|
+
RVAL SDL::SKK::RomKanaRuleTable
|
110
|
+
|
111
|
+
PROTO
|
112
|
+
new(filename)
|
113
|
+
|
114
|
+
DESC
|
115
|
+
Load a Romaji-Kana trasnlation table from $[filename].
|
116
|
+
File format is:
|
117
|
+
* a line beginnig with ;; is comment
|
118
|
+
* empty line is ignored
|
119
|
+
* one entry per one line: <input alphabets><TAB><Katakana><TAB><Hiragana>
|
120
|
+
|
121
|
+
NOTES
|
122
|
+
Encoding of this file is set by @[SKK.encoding=]
|
123
|
+
before loading it.
|
124
|
+
|
125
|
+
SEEALSO
|
126
|
+
SKK::Context.new
|
127
|
+
|
128
|
+
%%
|
129
|
+
NAME new
|
130
|
+
MOD SKK::Dictionary
|
131
|
+
TYPE .
|
132
|
+
DEP SDLSKK
|
133
|
+
PURPOSE Create empty dictionary
|
134
|
+
RVAL SDL::SKK::Dictionary
|
135
|
+
|
136
|
+
PROTO
|
137
|
+
new
|
138
|
+
|
139
|
+
DESC
|
140
|
+
Creates empty dictionary object and returns it.
|
141
|
+
|
142
|
+
SEEALSO
|
143
|
+
SKK::Dictionary#load
|
144
|
+
|
145
|
+
%%
|
146
|
+
NAME load
|
147
|
+
MOD SKK::Dictionary
|
148
|
+
TYPE #
|
149
|
+
DEP SDLSKK
|
150
|
+
PURPOSE Read a dictionary file
|
151
|
+
|
152
|
+
PROTO
|
153
|
+
load(filename, user)
|
154
|
+
|
155
|
+
DESC
|
156
|
+
Read a dictionary data from $[filename].
|
157
|
+
Format of dictionary is same as of SKK
|
158
|
+
(Ruby/SDL cannot read data with annotations).
|
159
|
+
If $[user] is true, loaded data is treated as
|
160
|
+
user dictionary data. If $[user] is false,
|
161
|
+
loaded data is treated as system dictionary data.
|
162
|
+
|
163
|
+
NOTES
|
164
|
+
Encoding of this file is set by @[SKK.encoding=]
|
165
|
+
before loading it.
|
166
|
+
|
167
|
+
EXCEPTION *
|
168
|
+
|
169
|
+
SEEALSO
|
170
|
+
SKK::Dictionary.new
|
171
|
+
SKK::Dictionary#save
|
172
|
+
SKK::Context.new
|
173
|
+
|
174
|
+
%%
|
175
|
+
NAME save
|
176
|
+
MOD SKK::Dictionary
|
177
|
+
TYPE #
|
178
|
+
DEP SDLSKK
|
179
|
+
PURPOSE Save user dictionary data
|
180
|
+
|
181
|
+
PROTO
|
182
|
+
save(filename)
|
183
|
+
|
184
|
+
DESC
|
185
|
+
Save user dictionary data into $[filename].
|
186
|
+
|
187
|
+
SEEALSO
|
188
|
+
SKK::Dictionary.new
|
189
|
+
SKK::Dictionary#load
|
190
|
+
|
191
|
+
%%
|
192
|
+
NAME new
|
193
|
+
MOD SKK::Keybind
|
194
|
+
TYPE .
|
195
|
+
DEP SDLSKK
|
196
|
+
PURPOSE Create empty keybind
|
197
|
+
RVAL SDL::SKK::Keybind
|
198
|
+
|
199
|
+
PROTO
|
200
|
+
new
|
201
|
+
|
202
|
+
DESC
|
203
|
+
Creates empty keybind object and returns it.
|
204
|
+
Add keybind to this object using
|
205
|
+
@[SKK::Keybind#set_key] and @[SKK::Keybind#set_default_key].
|
206
|
+
|
207
|
+
SEEALSO
|
208
|
+
SKK::Keybind#set_key
|
209
|
+
SKK::Keybind#set_default_key
|
210
|
+
SKK::Context.new
|
211
|
+
|
212
|
+
%%
|
213
|
+
NAME set_key
|
214
|
+
MOD SKK::Keybind
|
215
|
+
TYPE #
|
216
|
+
DEP SDLSKK
|
217
|
+
PURPOSE Set keybind
|
218
|
+
|
219
|
+
PROTO
|
220
|
+
set_key(key_str, cmd_str)
|
221
|
+
|
222
|
+
DESC
|
223
|
+
Sets keybind. $[key_str] is a key-symbol string.
|
224
|
+
$[cmd_str] is command string.
|
225
|
+
|
226
|
+
Following strings are allowed as $[key_str]:
|
227
|
+
* Alphabet and ascii characters like "%"
|
228
|
+
* "SPC" "TAB" "DEL" "RET" "UP" "DOWN" "RIGHT" "LEFT" "INSERT" "HOME" "END"
|
229
|
+
"PAGEUP" "PAGEDOWN" "F1" "F2" "F3" "F4" "F5" "F6" "F7" "F8" "F9" "F10"
|
230
|
+
"F11" "F12" "F13" "F14" "F15" "HELP"
|
231
|
+
* key with modifiers like "C-a" and "M-C-a"
|
232
|
+
|
233
|
+
Following strings is allowed as $[cmd_str]:
|
234
|
+
* "backward-char",
|
235
|
+
* "forward-char",
|
236
|
+
* "backward-delete-char",
|
237
|
+
* "delete-char",
|
238
|
+
* "kakutei",
|
239
|
+
* "kettei",
|
240
|
+
* "space",
|
241
|
+
* "keyboard-quit",
|
242
|
+
* "set-mark-command",
|
243
|
+
* "kill-region",
|
244
|
+
* "yank",
|
245
|
+
* "copy",
|
246
|
+
* "graph-char",
|
247
|
+
* "upper-char",
|
248
|
+
* "lower-char",
|
249
|
+
* "abbrev-input",
|
250
|
+
* "latin-mode",
|
251
|
+
* "previous-candidate",
|
252
|
+
* "jisx0208-mode",
|
253
|
+
* "toggle-kana",
|
254
|
+
* "beginning-of-line"
|
255
|
+
* "end-of-line"
|
256
|
+
* "do-nothing"
|
257
|
+
|
258
|
+
You shouldn't change the keybind of only one ascii character key
|
259
|
+
like "a" and "/".
|
260
|
+
|
261
|
+
@[SKK::Keybind#set_default_key] is useful.
|
262
|
+
|
263
|
+
SEEALSO
|
264
|
+
SKK::Keybind#set_default_key
|
265
|
+
SKK::Keybind#unset_key
|
266
|
+
|
267
|
+
%%
|
268
|
+
NAME set_default_key
|
269
|
+
MOD SKK::Keybind
|
270
|
+
TYPE #
|
271
|
+
DEP SDLSKK
|
272
|
+
PURPOSE Load default Emacs-like keybinds
|
273
|
+
|
274
|
+
PROTO
|
275
|
+
set_default_key
|
276
|
+
|
277
|
+
DESC
|
278
|
+
Load default Emacs-like keybinds.
|
279
|
+
|
280
|
+
SEEALSO
|
281
|
+
SKK::Keybind#set_key
|
282
|
+
|
283
|
+
%%
|
284
|
+
NAME unset_key
|
285
|
+
MOD SKK::Keybind
|
286
|
+
TYPE #
|
287
|
+
DEP SDLSKK
|
288
|
+
PURPOSE Unset keybind
|
289
|
+
|
290
|
+
PROTO
|
291
|
+
unset_key(key_str)
|
292
|
+
|
293
|
+
DESC
|
294
|
+
Unset keybind of $[key_str].
|
295
|
+
|
296
|
+
SEEALSO
|
297
|
+
SKK::Keybind#set_key
|
298
|
+
|
299
|
+
%%
|
300
|
+
NAME new
|
301
|
+
MOD SKK::Context
|
302
|
+
TYPE .
|
303
|
+
DEP SDLSKK
|
304
|
+
PURPOSE Create new input context
|
305
|
+
RVAL SKK::Context
|
306
|
+
|
307
|
+
PROTO
|
308
|
+
new(dict, romkama_table, bind, use_minibuffer)
|
309
|
+
|
310
|
+
DESC
|
311
|
+
Creates input context and returns new @[SKK::Context] object.
|
312
|
+
$[dict] is a @[dictionary|SKK::Dictionary],
|
313
|
+
$[romkama_table] is a
|
314
|
+
@[Ronaji-Kana translation table|SKK::RomKanaRuleTable]
|
315
|
+
and $[bind] is @[keybind|SKK::Keybind].
|
316
|
+
If $[use_minibuffer] is true,
|
317
|
+
SKK-like minibuffer is enabled.
|
318
|
+
|
319
|
+
EXAMPLE
|
320
|
+
# Create dictionary object and read data from 'jisyo'
|
321
|
+
dict = SDL::SKK::Dictionary.new
|
322
|
+
dict.load( 'jisyo', false )
|
323
|
+
# Read Romaji-Kana translation table from 'rule_table'
|
324
|
+
table = SDL::SKK::RomKanaRuleTable.new( 'rule_table' )
|
325
|
+
# Set keybind
|
326
|
+
bind = SDL::SKK::Keybind.new
|
327
|
+
bind.set_default_key
|
328
|
+
|
329
|
+
# Create context
|
330
|
+
context = SDL::SKK::Context.new( dict, table, bind, use_minibuffer )
|
331
|
+
|
332
|
+
SEEALSO
|
333
|
+
SKK::Context#input
|
334
|
+
SKK::Context#str
|
335
|
+
|
336
|
+
%%
|
337
|
+
NAME input
|
338
|
+
MOD SKK::Context
|
339
|
+
TYPE #
|
340
|
+
DEP SDLSKK
|
341
|
+
PURPOSE Handle keyboard event
|
342
|
+
|
343
|
+
PROTO
|
344
|
+
input(event)
|
345
|
+
|
346
|
+
DESC
|
347
|
+
Handles keyboard event. $[event] should be
|
348
|
+
@[Event] object.
|
349
|
+
This method handles only @[keydown events|Event::KeyDown]
|
350
|
+
and ignore other events.
|
351
|
+
|
352
|
+
EXAMPLE
|
353
|
+
while event = SDL::Event.poll do
|
354
|
+
case event
|
355
|
+
when SDL::Event::Quit
|
356
|
+
exit
|
357
|
+
when SDL::Event::KeyDown
|
358
|
+
if event.sym == SDL::Key::ESCAPE then
|
359
|
+
exit
|
360
|
+
end
|
361
|
+
if event.sym == SDL::Key::F1
|
362
|
+
dict.save("test_user_dict")
|
363
|
+
end
|
364
|
+
context.input( event )
|
365
|
+
end
|
366
|
+
end
|
367
|
+
|
368
|
+
%%
|
369
|
+
NAME str
|
370
|
+
MOD SKK::Context
|
371
|
+
TYPE #
|
372
|
+
DEP SDLSKK
|
373
|
+
PURPOSE Get input string
|
374
|
+
RVAL String
|
375
|
+
|
376
|
+
PROTO
|
377
|
+
str
|
378
|
+
|
379
|
+
DESC
|
380
|
+
Returns input string.
|
381
|
+
|
382
|
+
SEEALSO
|
383
|
+
SKK::Context#render_str
|
384
|
+
SKK::Context#clear
|
385
|
+
SKK::Context#clear_text
|
386
|
+
|
387
|
+
%%
|
388
|
+
NAME render_str
|
389
|
+
MOD SKK::Context
|
390
|
+
TYPE #
|
391
|
+
DEP SDLSKK
|
392
|
+
PURPOSE Render input string
|
393
|
+
RVAL SDL::Surface
|
394
|
+
|
395
|
+
PROTO
|
396
|
+
render_str(font, r, g, b)
|
397
|
+
|
398
|
+
DESC
|
399
|
+
Renders input string and returns @[Surface] object.
|
400
|
+
|
401
|
+
SEEALSO
|
402
|
+
SKK::Context#render_minibuffer_str
|
403
|
+
|
404
|
+
%%
|
405
|
+
NAME render_minibuffer_str
|
406
|
+
MOD SKK::Context
|
407
|
+
TYPE #
|
408
|
+
DEP SDLSKK
|
409
|
+
PURPOSE Render minibuffer string
|
410
|
+
|
411
|
+
PROTO
|
412
|
+
render_minibuffer_str(font, r, g, b)
|
413
|
+
|
414
|
+
DESC
|
415
|
+
Renders minibuffer string and returns @[Surface] object.
|
416
|
+
|
417
|
+
%%
|
418
|
+
NAME clear
|
419
|
+
MOD SKK::Context
|
420
|
+
TYPE #
|
421
|
+
DEP SDLSKK
|
422
|
+
PURPOSE Clear context
|
423
|
+
|
424
|
+
PROTO
|
425
|
+
clear
|
426
|
+
|
427
|
+
DESC
|
428
|
+
Clears input context.
|
429
|
+
|
430
|
+
SEEALSO
|
431
|
+
SKK::Context#clear_text
|
432
|
+
|
433
|
+
%%
|
434
|
+
NAME clear_text
|
435
|
+
MOD SKK::Context
|
436
|
+
TYPE #
|
437
|
+
DEP SDLSKK
|
438
|
+
PURPOSE Creat input text
|
439
|
+
|
440
|
+
PROTO
|
441
|
+
clear_text
|
442
|
+
|
443
|
+
DESC
|
444
|
+
Clears input text, but input mode is held.
|
445
|
+
|
446
|
+
If you want multi-line input, this method is better
|
447
|
+
than @[SKK::Context#clear]
|
448
|
+
|
449
|
+
SEEALSO
|
450
|
+
SKK::Context#get_basic_mode
|
451
|
+
|
452
|
+
%%
|
453
|
+
NAME get_basic_mode
|
454
|
+
MOD SKK::Context
|
455
|
+
TYPE #
|
456
|
+
DEP SDLSKK
|
457
|
+
PURPOSE Get whether input mode is basic mode
|
458
|
+
RVAL true/false
|
459
|
+
|
460
|
+
PROTO
|
461
|
+
get_basic_mode
|
462
|
+
|
463
|
+
DESC
|
464
|
+
Returns true if $[self]'s input mode is kakutei-mode,
|
465
|
+
latin-mode or jisx0208-latim-mode, otherwise returns
|
466
|
+
false.
|
467
|
+
|
468
|
+
NOTES
|
469
|
+
Please see ((<SKK|URL:http://openlab.jp/skk/index.html>)).
|
470
|
+
|
471
|
+
SEEALSO
|
472
|
+
SKK::Context#clear_text
|