Skip to content

Commit efbfa4e

Browse files
committed
CHANGE: moved event-keys and event-types from system/view to system/catalog, because these are used not only in GUI
1 parent ef38d10 commit efbfa4e

File tree

3 files changed

+98
-98
lines changed

3 files changed

+98
-98
lines changed

make/tools/make-boot.reb

+2-2
Original file line numberDiff line numberDiff line change
@@ -793,15 +793,15 @@ emit-head "Event Types" %reb-evtypes.h
793793
emit newline
794794

795795
emit ["enum event_types {" newline]
796-
foreach field ob/view/event-types [
796+
foreach field ob/catalog/event-types [
797797
emit-line "EVT_" field none
798798
]
799799
emit [tab "EVT_MAX^/"]
800800
emit "};^/^/"
801801

802802
emit ["enum event_keys {" newline]
803803
emit-line "EVK_" "NONE" none
804-
foreach field ob/view/event-keys [
804+
foreach field ob/catalog/event-keys [
805805
emit-line "EVK_" field none
806806
]
807807
emit [tab "EVK_MAX^/"]

src/boot/sysobj.reb

+92-92
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,98 @@ catalog: object [
114114
ciphers: [
115115
; will be filled on boot from `Init_Crypt` in `n-crypt.c`
116116
]
117+
event-types: [
118+
; Event types. Order dependent for C and REBOL.
119+
; Due to fixed C constants, this list cannot be reordered after release!
120+
ignore ; ignore event (0)
121+
interrupt ; user interrupt
122+
device ; misc device request
123+
callback ; callback event
124+
custom ; custom events
125+
error
126+
init
127+
128+
open
129+
close
130+
connect
131+
accept
132+
read
133+
write
134+
wrote
135+
lookup
136+
137+
ready
138+
done
139+
time
140+
141+
show
142+
hide
143+
offset
144+
resize
145+
active
146+
inactive
147+
minimize
148+
maximize
149+
restore
150+
151+
move
152+
down
153+
up
154+
alt-down
155+
alt-up
156+
aux-down
157+
aux-up
158+
key
159+
key-up ; Move above when version changes!!!
160+
161+
scroll-line
162+
scroll-page
163+
164+
drop-file
165+
166+
click
167+
change
168+
focus
169+
unfocus
170+
scroll
171+
172+
control ;; used to pass control key events to a console port
173+
control-up ;; only on Windows?
174+
]
175+
event-keys: [
176+
; Event types. Order dependent for C and REBOL.
177+
; Due to fixed C constants, this list cannot be reordered after release!
178+
page-up
179+
page-down
180+
end
181+
home
182+
left
183+
up
184+
right
185+
down
186+
insert
187+
delete
188+
f1
189+
f2
190+
f3
191+
f4
192+
f5
193+
f6
194+
f7
195+
f8
196+
f9
197+
f10
198+
f11
199+
f12
200+
paste-start ;; Bracketed paste turned on - https://cirw.in/blog/bracketed-paste
201+
paste-end ;; Bracketed paste turned off
202+
escape ;; Escape key
203+
shift
204+
control
205+
alt
206+
pause
207+
capital
208+
]
117209
]
118210

119211
contexts: construct [
@@ -453,98 +545,6 @@ view: object [
453545
work-origin:
454546
work-size: 0x0
455547
]
456-
event-types: [
457-
; Event types. Order dependent for C and REBOL.
458-
; Due to fixed C constants, this list cannot be reordered after release!
459-
ignore ; ignore event (0)
460-
interrupt ; user interrupt
461-
device ; misc device request
462-
callback ; callback event
463-
custom ; custom events
464-
error
465-
init
466-
467-
open
468-
close
469-
connect
470-
accept
471-
read
472-
write
473-
wrote
474-
lookup
475-
476-
ready
477-
done
478-
time
479-
480-
show
481-
hide
482-
offset
483-
resize
484-
active
485-
inactive
486-
minimize
487-
maximize
488-
restore
489-
490-
move
491-
down
492-
up
493-
alt-down
494-
alt-up
495-
aux-down
496-
aux-up
497-
key
498-
key-up ; Move above when version changes!!!
499-
500-
scroll-line
501-
scroll-page
502-
503-
drop-file
504-
505-
click
506-
change
507-
focus
508-
unfocus
509-
scroll
510-
511-
control ;; used to pass control key events to a console port
512-
control-up ;; only on Windows?
513-
]
514-
event-keys: [
515-
; Event types. Order dependent for C and REBOL.
516-
; Due to fixed C constants, this list cannot be reordered after release!
517-
page-up
518-
page-down
519-
end
520-
home
521-
left
522-
up
523-
right
524-
down
525-
insert
526-
delete
527-
f1
528-
f2
529-
f3
530-
f4
531-
f5
532-
f6
533-
f7
534-
f8
535-
f9
536-
f10
537-
f11
538-
f12
539-
paste-start ;; Bracketed paste turned on - https://cirw.in/blog/bracketed-paste
540-
paste-end ;; Bracketed paste turned off
541-
escape ;; Escape key
542-
shift
543-
control
544-
alt
545-
pause
546-
capital
547-
]
548548
]
549549

550550
license: none

src/core/t-event.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181

8282
case SYM_TYPE:
8383
if (!IS_WORD(val) && !IS_LIT_WORD(val)) return FALSE;
84-
arg = Get_System(SYS_VIEW, VIEW_EVENT_TYPES);
84+
arg = Get_System(SYS_CATALOG, CAT_EVENT_TYPES);
8585
if (IS_BLOCK(arg)) {
8686
w = VAL_WORD_CANON(val);
8787
for (n = 0, arg = VAL_BLK(arg); NOT_END(arg); arg++, n++) {
@@ -141,7 +141,7 @@
141141
break;
142142
}
143143
else if (IS_LIT_WORD(val) || IS_WORD(val)) {
144-
arg = Get_System(SYS_VIEW, VIEW_EVENT_KEYS);
144+
arg = Get_System(SYS_CATALOG, CAT_EVENT_KEYS);
145145
if (IS_BLOCK(arg)) {
146146
arg = VAL_BLK_DATA(arg);
147147
for (n = VAL_INDEX(arg); NOT_END(arg); n++, arg++) {
@@ -208,7 +208,7 @@
208208

209209
case SYM_TYPE:
210210
if (VAL_EVENT_TYPE(value) == 0) goto is_none;
211-
arg = Get_System(SYS_VIEW, VIEW_EVENT_TYPES);
211+
arg = Get_System(SYS_CATALOG, CAT_EVENT_TYPES);
212212
if (IS_BLOCK(arg) && VAL_TAIL(arg) >= EVT_MAX) {
213213
*val = *VAL_BLK_SKIP(arg, VAL_EVENT_TYPE(value));
214214
break;
@@ -271,7 +271,7 @@
271271
break;
272272
}
273273
else if (VAL_EVENT_TYPE(value) == EVT_CONTROL || VAL_EVENT_TYPE(value) == EVT_CONTROL_UP) {
274-
arg = Get_System(SYS_VIEW, VIEW_EVENT_KEYS);
274+
arg = Get_System(SYS_CATALOG, CAT_EVENT_KEYS);
275275
if (IS_BLOCK(arg) && n <= (REBINT)VAL_TAIL(arg)) {
276276
*val = *VAL_BLK_SKIP(arg, n-1);
277277
break;

0 commit comments

Comments
 (0)