-
Notifications
You must be signed in to change notification settings - Fork 0
/
libscroll.rei
42 lines (36 loc) · 2.08 KB
/
libscroll.rei
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module LibScroll = {
// models libscroll as a flat api,
// may change to be more structured later
module ScrollView = {
type t; // opaque per API
external create: unit => t = "rlscroll_create_scrollview";
external destroy: t => unit = "rlscroll_destroy_scrollview";
// takes uints, TODO: pull in library to enforce unsigned args here to avoid spooky behavior
external set_geometry: (t, int, int, int, int) => unit = "rlscroll_set_geometry";
}
module Source = {
external set_source_undefined: ScrollView.t => unit = "rlscroll_set_source_undefined";
external set_source_touchscreen: ScrollView.t => unit = "rlscroll_set_source_touchscreen";
external set_source_touchpad: ScrollView.t => unit = "rlscroll_set_source_touchpad";
external set_source_mousewheel: ScrollView.t => unit = "rlscroll_set_source_mousewheel";
external set_source_mousewheel_precise: ScrollView.t => unit = "rlscroll_set_source_mousewheel_precise";
external set_source_passthrough: ScrollView.t => unit = "rlscroll_set_source_passthrough";
external set_source_passthrough_kinetic: ScrollView.t => unit = "rlscroll_set_source_passthrough_kinetic";
}
module Events = {
external signal_pan_x: (ScrollView.t, int) => unit = "rlscroll_signal_pan_x";
external signal_pan_y: (ScrollView.t, int) => unit = "rlscroll_signal_pan_y";
external signal_release: (ScrollView.t) => unit = "rlscroll_signal_release";
external signal_interrupt: (ScrollView.t) => unit = "rlscroll_signal_interrupt";
}
module Output = {
external pan_x: (ScrollView.t) => int = "rlscroll_get_pan_x";
external pan_y: (ScrollView.t) => int = "rlscroll_get_pan_y";
external position_x: (ScrollView.t) => int = "rlscroll_get_pos_x";
external position_y: (ScrollView.t) => int = "rlscroll_get_pos_y";
}
module Manual = {
external pan: (ScrollView.t, int, int) => unit = "rlscroll_force_pan";
external jump: (ScrollView.t, int, int) => unit = "rlscroll_force_jump";
}
}