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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//! `CRadarScreen` method declarations (Rust -> EuroScope). The `screen` handle
//! is the `CRadarScreen*` delivered to a radar-screen callback.
use std::ffi::{c_char, c_int};
use crate::EsHandle;
unsafe extern "C" {
/// The owning `CPlugIn*` (`CRadarScreen::GetPlugIn`).
pub fn es_screen_get_plugin(screen: EsHandle) -> EsHandle;
/// Radar drawing area, as `left/top/right/bottom` out-params.
pub fn es_screen_radar_area(
screen: EsHandle,
l: *mut c_int,
t: *mut c_int,
r: *mut c_int,
b: *mut c_int,
);
/// Toolbar area.
pub fn es_screen_toolbar_area(
screen: EsHandle,
l: *mut c_int,
t: *mut c_int,
r: *mut c_int,
b: *mut c_int,
);
/// Chat area.
pub fn es_screen_chat_area(
screen: EsHandle,
l: *mut c_int,
t: *mut c_int,
r: *mut c_int,
b: *mut c_int,
);
/// Convert a lat/lon to screen pixels.
pub fn es_screen_position_to_pixel(
screen: EsHandle,
lat: f64,
lon: f64,
x: *mut c_int,
y: *mut c_int,
);
/// Convert screen pixels to a lat/lon.
pub fn es_screen_pixel_to_position(
screen: EsHandle,
x: c_int,
y: c_int,
lat: *mut f64,
lon: *mut f64,
);
/// Register a clickable/hover screen object (`CRadarScreen::AddScreenObject`).
pub fn es_screen_add_screen_object(
screen: EsHandle,
object_type: c_int,
object_id: *const c_char,
l: c_int,
t: c_int,
r: c_int,
b: c_int,
moveable: bool,
message: *const c_char,
);
/// Request an asynchronous repaint.
pub fn es_screen_request_refresh(screen: EsHandle);
/// Rebuild cached map content.
pub fn es_screen_refresh_map_content(screen: EsHandle);
/// Read an ASR variable (borrowed NUL-terminated string).
pub fn es_screen_get_data_from_asr(screen: EsHandle, name: *const c_char) -> *const c_char;
/// Persist an ASR variable.
pub fn es_screen_save_data_to_asr(
screen: EsHandle,
name: *const c_char,
description: *const c_char,
value: *const c_char,
);
/// Current display bounds as two corners' lat/lon (out-params).
pub fn es_screen_get_display_area(
screen: EsHandle,
ld_lat: *mut f64,
ld_lon: *mut f64,
ru_lat: *mut f64,
ru_lon: *mut f64,
);
/// Set the display bounds from two corners' lat/lon.
pub fn es_screen_set_display_area(
screen: EsHandle,
ld_lat: f64,
ld_lon: f64,
ru_lat: f64,
ru_lon: f64,
);
/// Show/hide a sector-file element on this screen. `element` is a
/// `CSectorElement*`.
pub fn es_screen_show_sector_element(
screen: EsHandle,
element: EsHandle,
component: *const c_char,
show: bool,
);
/// Trigger another plugin's tag function on a target.
#[allow(clippy::too_many_arguments)]
pub fn es_screen_start_tag_function(
screen: EsHandle,
callsign: *const c_char,
item_plugin: *const c_char,
item_code: c_int,
item_string: *const c_char,
function_plugin: *const c_char,
function_id: c_int,
x: c_int,
y: c_int,
l: c_int,
t: c_int,
r: c_int,
b: c_int,
);
}