add remaining glut enumerations
[clinton/guile-figl.git] / figl / glut / enums.scm
1 ;;; fgil
2 ;;; Copyright (C) 2013 Daniel Hartwig <mandyke@gmail.com>
3 ;;;
4 ;;; Figl is free software: you can redistribute it and/or modify it
5 ;;; under the terms of the GNU Lesser General Public License as
6 ;;; published by the Free Software Foundation, either version 3 of the
7 ;;; License, or (at your option) any later version.
8 ;;;
9 ;;; Figl is distributed in the hope that it will be useful, but WITHOUT
10 ;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 ;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
12 ;;; Public License for more details.
13 ;;;
14 ;;; You should have received a copy of the GNU Lesser General Public
15 ;;; License along with this program. If not, see
16 ;;; <http://www.gnu.org/licenses/>.
17
18 ;;; Commentary:
19 ;;
20 ;; Derived from the values listed in the OpenGL Utility Toolkit (GLUT)
21 ;; Programming Inferface, API Version 3.
22 ;;
23 ;;; Code:
24
25 (define-module (figl glut enums)
26 #:use-module (figl runtime)
27 #:export (display-mode
28 button
29 button-state
30 special-key
31 entry-state
32 menu-status
33 visibility-state
34 color-component
35 layer
36 glut-state
37 device-info
38 layer-info
39 modifier-key-state
40 cursor))
41
42 (define-bitfield
43 display-mode
44 (rgb 0)
45 (rgba 0)
46 (index 1)
47 (single 0)
48 (double 2)
49 (accum 4)
50 (alpha 8)
51 (depth 16)
52 (stencil 32)
53 (multisample 128)
54 (stereo 256)
55 (luminance 512))
56
57 (define-enumeration
58 button
59 (left-button 0)
60 (middle-button 1)
61 (right-button 2))
62
63 (define-enumeration
64 button-state
65 (down 0)
66 (up 1))
67
68 (define-enumeration
69 special-key
70 ;; function keys
71 (key-f1 1)
72 (key-f2 2)
73 (key-f3 3)
74 (key-f4 4)
75 (key-f5 5)
76 (key-f6 6)
77 (key-f7 7)
78 (key-f8 8)
79 (key-f9 9)
80 (key-f10 10)
81 (key-f11 11)
82 (key-f12 12)
83 ;; directional keys
84 (key-left 100)
85 (key-up 101)
86 (key-right 102)
87 (key-down 103)
88 (key-page-up 104)
89 (key-page-down 105)
90 (key-home 106)
91 (key-end 107)
92 (key-insert 108))
93
94 (define-enumeration
95 entry-state
96 (left 0)
97 (entered 1))
98
99 (define-enumeration
100 menu-status
101 (menu-not-in-use 0)
102 (menu-in-use 1))
103
104 (define-enumeration
105 visibility-state
106 (not-visible 0)
107 (visible 1))
108
109 (define-enumeration
110 color-component
111 (red 0)
112 (green 1)
113 (blue 2))
114
115 (define-enumeration
116 layer
117 (normal 0)
118 (overlay 1))
119
120 ;; TODO: Fonts.
121
122 ;; extern void *glutStrokeRoman;
123 ;; extern void *glutStrokeMonoRoman;
124
125 ;; ;; stroke font constants (use these in GLUT program)
126 ;; #define GLUT_STROKE_ROMAN (&glutStrokeRoman)
127 ;; #define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
128
129 ;; ;; bitmap font opaque addresses (use constants instead in source code)
130 ;; extern void *glutBitmap9By15;
131 ;; extern void *glutBitmap8By13;
132 ;; extern void *glutBitmapTimesRoman10;
133 ;; extern void *glutBitmapTimesRoman24;
134 ;; extern void *glutBitmapHelvetica10;
135 ;; extern void *glutBitmapHelvetica12;
136 ;; extern void *glutBitmapHelvetica18;
137
138 ;; ;; bitmap font constants (use these in GLUT program)
139 ;; #define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
140 ;; #define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
141 ;; #define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
142 ;; #define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
143 ;; #define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
144 ;; #define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
145 ;; #define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
146
147 (define-enumeration
148 glut-state
149 (window-x 100)
150 (window-y 101)
151 (window-width 102)
152 (window-height 103)
153 (window-buffer-size 104)
154 (window-stencil-size 105)
155 (window-depth-size 106)
156 (window-red-size 107)
157 (window-green-size 108)
158 (window-blue-size 109)
159 (window-alpha-size 110)
160 (window-accum-red-size 111)
161 (window-accum-green-size 112)
162 (window-accum-blue-size 113)
163 (window-accum-alpha-size 114)
164 (window-doublebuffer 115)
165 (window-rgba 116)
166 (window-parent 117)
167 (window-num-children 118)
168 (window-colormap-size 119)
169 (window-num-samples 120)
170 (window-stereo 121)
171 (window-cursor 122)
172 (screen-width 200)
173 (screen-height 201)
174 (screen-width-mm 202)
175 (screen-height-mm 203)
176 (menu-num-items 300)
177 (display-mode-possible 400)
178 (init-window-x 500)
179 (init-window-y 501)
180 (init-window-width 502)
181 (init-window-height 503)
182 (init-display-mode 504)
183 (elapsed-time 700))
184
185 (define-enumeration
186 device-info
187 (has-keyboard 600)
188 (has-mouse 601)
189 (has-spaceball 602)
190 (has-dial-and-button-box 603)
191 (has-tablet 604)
192 (num-mouse-buttons 605)
193 (num-spaceball-buttons 606)
194 (num-button-box-buttons 607)
195 (num-dials 608)
196 (num-tablet-buttons 609))
197
198 (define-enumeration
199 layer-info
200 (overlay-possible 800)
201 (layer-in-use 801)
202 (has-overlay 802)
203 (transparent-index 803)
204 (normal-damaged 804)
205 (overlay-damaged 805))
206
207 (define-bitfield
208 modifier-key-state
209 (active-shift 1)
210 (active-ctrl 2)
211 (active-alt 4))
212
213 (define-enumeration
214 cursor
215 ;; Basic arrows
216 (cursor-right-arrow 0)
217 (cursor-left-arrow 1)
218 ;; Symbolic cursor shapees
219 (cursor-info 2)
220 (cursor-destroy 3)
221 (cursor-help 4)
222 (cursor-cycle 5)
223 (cursor-spray 6)
224 (cursor-wait 7)
225 (cursor-text 8)
226 (cursor-crosshair 9)
227 ;; Directional cursors
228 (cursor-up-down 10)
229 (cursor-left-right 11)
230 ;; Sizing cursors
231 (cursor-top-side 12)
232 (cursor-bottom-side 13)
233 (cursor-left-side 14)
234 (cursor-right-side 15)
235 (cursor-top-left-corner 16)
236 (cursor-top-right-corner 17)
237 (cursor-bottom-right-corner 18)
238 (cursor-bottom-left-corner 19)
239 ;; Inherit from parent window
240 (cursor-inherit 100)
241 ;; Blank cursor
242 (cursor-none 101)
243 ;; Fullscreen crosshair (if available)
244 (cursor-full-crosshair 102))