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
//! `CPlugIn`-level FFI declarations.
use std::ffi::{c_char, c_int};
use crate::PluginPtr;
unsafe extern "C" {
/// `CPlugIn::DisplayUserMessage` — print a line into the controller's
/// message/chat area. All strings are borrowed NUL-terminated ANSI.
pub fn es_plugin_display_user_message(
plugin: PluginPtr,
handler: *const c_char,
sender: *const c_char,
message: *const c_char,
show_handler: bool,
show_unread: bool,
show_unread_even_if_busy: bool,
start_flashing: bool,
need_confirmation: bool,
);
/// `CPlugIn::GetConnectionType` — one of the `CONNECTION_TYPE_*` codes.
pub fn es_plugin_connection_type(plugin: PluginPtr) -> c_int;
/// Number of flight plans currently tracked by me.
pub fn es_plugin_count_tracked_by_me(plugin: PluginPtr) -> c_int;
/// Number of radar targets currently in range.
pub fn es_plugin_count_radar_targets(plugin: PluginPtr) -> c_int;
/// `CPlugIn::RegisterTagItemType` — declare a custom tag item.
pub fn es_plugin_register_tag_item_type(plugin: PluginPtr, name: *const c_char, code: c_int);
/// `CPlugIn::RegisterTagItemFunction` — declare a custom tag-item function.
pub fn es_plugin_register_tag_item_function(
plugin: PluginPtr,
name: *const c_char,
code: c_int,
);
/// `CPlugIn::AddAlias` — register a `.chat` alias expansion.
pub fn es_plugin_add_alias(plugin: PluginPtr, name: *const c_char, value: *const c_char);
/// `CPlugIn::GetPlugInName` — the plugin's own name (borrowed).
pub fn es_plugin_name(plugin: PluginPtr) -> *const c_char;
/// `CPlugIn::RegisterToolbarItem`.
pub fn es_plugin_register_toolbar_item(plugin: PluginPtr, item_id: c_int, name: *const c_char);
/// `CPlugIn::RefreshToolbar`.
pub fn es_plugin_refresh_toolbar(plugin: PluginPtr, resize_too: bool);
/// `CPlugIn::SelectActiveSectorfile`.
pub fn es_plugin_select_active_sectorfile(plugin: PluginPtr);
/// `CPlugIn::SelectScreenSectorfile` — `screen` is a `CRadarScreen*`.
pub fn es_plugin_select_screen_sectorfile(plugin: PluginPtr, screen: crate::EsHandle);
/// `CPlugIn::RegisterDisplayType` — register a custom radar display type.
pub fn es_plugin_register_display_type(
plugin: PluginPtr,
name: *const c_char,
need_radar_content: bool,
geo_referenced: bool,
can_be_saved: bool,
can_be_created: bool,
);
/// `CPlugIn::OpenPopupList` — begin a popup list at the given rectangle.
pub fn es_plugin_open_popup_list(
plugin: PluginPtr,
left: c_int,
top: c_int,
right: c_int,
bottom: c_int,
title: *const c_char,
column_number: c_int,
);
/// `CPlugIn::OpenPopupEdit` — open an inline edit box at the given rectangle.
pub fn es_plugin_open_popup_edit(
plugin: PluginPtr,
left: c_int,
top: c_int,
right: c_int,
bottom: c_int,
function_id: c_int,
initial_value: *const c_char,
);
/// `CPlugIn::AddPopupListElement` — add an element to the open popup list.
pub fn es_plugin_add_popup_list_element(
plugin: PluginPtr,
string1: *const c_char,
string2: *const c_char,
function_id: c_int,
selected: bool,
checked: c_int,
disabled: bool,
fixed: bool,
);
}