fix some misspellings

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2022-12-31 21:41:16 +08:00
parent 17225a25dd
commit b114ebf350
20 changed files with 63 additions and 61 deletions

View File

@ -315,7 +315,7 @@ class _RemotePageState extends State<RemotePage>
}))
];
if (!_ffi.canvasModel.cursorEmbeded) {
if (!_ffi.canvasModel.cursorEmbedded) {
paints.add(Obx(() => Offstage(
offstage: _showRemoteCursor.isFalse || _remoteCursorMoved.isFalse,
child: CursorPaint(
@ -382,7 +382,7 @@ class _ImagePaintState extends State<ImagePaint> {
mouseRegion({child}) => Obx(() => MouseRegion(
cursor: cursorOverImage.isTrue
? c.cursorEmbeded
? c.cursorEmbedded
? SystemMouseCursors.none
: keyboardEnabled.isTrue
? (() {

View File

@ -257,7 +257,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
),
]);
if (!ffi.canvasModel.cursorEmbeded) {
if (!ffi.canvasModel.cursorEmbedded) {
menu.add(MenuEntryDivider<String>());
menu.add(() {
final state = ShowRemoteCursorState.find(key);

View File

@ -9,7 +9,7 @@ import '../../common.dart';
typedef KBChoosedCallback = Future<bool> Function(String);
const double _kImageMarginVertical = 6.0;
const double _kImageMarginHorizental = 10.0;
const double _kImageMarginHorizontal = 10.0;
const double _kImageBoarderWidth = 4.0;
const double _kImagePaddingWidth = 4.0;
const Color _kImageBorderColor = Color.fromARGB(125, 202, 247, 2);
@ -47,14 +47,14 @@ class _KBImage extends StatelessWidget {
),
),
margin: EdgeInsets.symmetric(
horizontal: _kImageMarginHorizental,
horizontal: _kImageMarginHorizontal,
vertical: _kImageMarginVertical,
),
padding: EdgeInsets.all(_kImagePaddingWidth),
child: SvgPicture.asset(
'assets/${_kKBLayoutImageMap[kbLayoutType] ?? ""}.svg',
width: imageWidth -
_kImageMarginHorizental * 2 -
_kImageMarginHorizontal * 2 -
_kImagePaddingWidth * 2 -
_kImageBoarderWidth * 2,
),

View File

@ -1086,7 +1086,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
}
/// Show remote cursor
if (!widget.ffi.canvasModel.cursorEmbeded) {
if (!widget.ffi.canvasModel.cursorEmbedded) {
displayMenu.add(() {
final state = ShowRemoteCursorState.find(widget.id);
return MenuEntrySwitch2<String>(

View File

@ -518,7 +518,7 @@ class _RemotePageState extends State<RemotePage> {
),
),
];
if (!gFFI.canvasModel.cursorEmbeded) {
if (!gFFI.canvasModel.cursorEmbedded) {
paints.add(CursorPaint());
}
return paints;
@ -527,7 +527,7 @@ class _RemotePageState extends State<RemotePage> {
Widget getBodyForDesktopWithListener(bool keyboard) {
var paints = <Widget>[ImagePaint()];
if (!gFFI.canvasModel.cursorEmbeded) {
if (!gFFI.canvasModel.cursorEmbedded) {
final cursor = bind.sessionGetToggleOptionSync(
id: widget.id, arg: 'show-remote-cursor');
if (keyboard || cursor) {
@ -1058,7 +1058,7 @@ void showOptions(
final toggles = [
getToggle(id, setState, 'show-quality-monitor', 'Show quality monitor'),
];
if (!gFFI.canvasModel.cursorEmbeded) {
if (!gFFI.canvasModel.cursorEmbedded) {
toggles.insert(0,
getToggle(id, setState, 'show-remote-cursor', 'Show remote cursor'));
}

View File

@ -222,7 +222,7 @@ class FfiModel with ChangeNotifier {
_display.y = double.parse(evt['y']);
_display.width = int.parse(evt['width']);
_display.height = int.parse(evt['height']);
_display.cursorEmbeded = int.parse(evt['cursor_embeded']) == 1;
_display.cursorEmbedded = int.parse(evt['cursor_embedded']) == 1;
if (old != _pi.currentDisplay) {
parent.target?.cursorModel.updateDisplayOrigin(_display.x, _display.y);
}
@ -338,7 +338,7 @@ class FfiModel with ChangeNotifier {
d.y = d0['y'].toDouble();
d.width = d0['width'];
d.height = d0['height'];
d.cursorEmbeded = d0['cursor_embeded'] == 1;
d.cursorEmbedded = d0['cursor_embedded'] == 1;
_pi.displays.add(d);
}
if (_pi.currentDisplay < _pi.displays.length) {
@ -608,8 +608,8 @@ class CanvasModel with ChangeNotifier {
notifyListeners();
}
bool get cursorEmbeded =>
parent.target?.ffiModel.display.cursorEmbeded ?? false;
bool get cursorEmbedded =>
parent.target?.ffiModel.display.cursorEmbedded ?? false;
int getDisplayWidth() {
final defaultWidth = (isDesktop || isWebDesktop)
@ -1343,7 +1343,7 @@ class Display {
double y = 0;
int width = 0;
int height = 0;
bool cursorEmbeded = false;
bool cursorEmbedded = false;
Display() {
width = (isDesktop || isWebDesktop)

View File

@ -40,7 +40,7 @@ message DisplayInfo {
int32 height = 4;
string name = 5;
bool online = 6;
bool cursor_embeded = 7;
bool cursor_embedded = 7;
}
message PortForward {
@ -420,7 +420,7 @@ message SwitchDisplay {
sint32 y = 3;
int32 width = 4;
int32 height = 5;
bool cursor_embeded = 6;
bool cursor_embedded = 6;
}
message PermissionInfo {

View File

@ -72,16 +72,16 @@ pub fn is_x11() -> bool {
#[cfg(x11)]
#[inline]
pub fn is_cursor_embeded() -> bool {
pub fn is_cursor_embedded() -> bool {
if is_x11() {
x11::IS_CURSOR_EMBEDED
x11::is_cursor_embedded
} else {
wayland::IS_CURSOR_EMBEDED
wayland::is_cursor_embedded
}
}
#[cfg(not(x11))]
#[inline]
pub fn is_cursor_embeded() -> bool {
pub fn is_cursor_embedded() -> bool {
false
}

View File

@ -4,7 +4,7 @@ use std::{io, sync::RwLock, time::Duration};
pub struct Capturer(Display, Box<dyn Recorder>, bool, Vec<u8>);
pub const IS_CURSOR_EMBEDED: bool = true;
pub const is_cursor_embedded: bool = true;
lazy_static::lazy_static! {
static ref MAP_ERR: RwLock<Option<fn(err: String)-> io::Error>> = Default::default();

View File

@ -3,7 +3,7 @@ use std::{io, ops, time::Duration};
pub struct Capturer(x11::Capturer);
pub const IS_CURSOR_EMBEDED: bool = false;
pub const is_cursor_embedded: bool = false;
impl Capturer {
pub fn new(display: Display, yuv: bool) -> io::Result<Capturer> {

View File

@ -990,7 +990,7 @@ impl<T: InvokeUiSession> Remote<T> {
self.video_sender.send(MediaData::Reset).ok();
if s.width > 0 && s.height > 0 {
self.handler
.set_display(s.x, s.y, s.width, s.height, s.cursor_embeded);
.set_display(s.x, s.y, s.width, s.height, s.cursor_embedded);
}
}
Some(misc::Union::CloseReason(c)) => {

View File

@ -156,7 +156,7 @@ impl InvokeUiSession for FlutterHandler {
}
/// unused in flutter, use switch_display or set_peer_info
fn set_display(&self, _x: i32, _y: i32, _w: i32, _h: i32, _cursor_embeded: bool) {}
fn set_display(&self, _x: i32, _y: i32, _w: i32, _h: i32, _cursor_embedded: bool) {}
fn update_privacy_mode(&self) {
self.push_event("update_privacy_mode", [].into());
@ -296,7 +296,7 @@ impl InvokeUiSession for FlutterHandler {
h.insert("y", d.y);
h.insert("width", d.width);
h.insert("height", d.height);
h.insert("cursor_embeded", if d.cursor_embeded { 1 } else { 0 });
h.insert("cursor_embedded", if d.cursor_embedded { 1 } else { 0 });
displays.push(h);
}
let displays = serde_json::ser::to_string(&displays).unwrap_or("".to_owned());
@ -357,7 +357,7 @@ impl InvokeUiSession for FlutterHandler {
("y", &display.y.to_string()),
("width", &display.width.to_string()),
("height", &display.height.to_string()),
("cursor_embeded", &{if display.cursor_embeded {1} else {0}}.to_string()),
("cursor_embedded", &{if display.cursor_embedded {1} else {0}}.to_string()),
],
);
}

View File

@ -85,7 +85,7 @@ pub fn new() -> ServerPtr {
#[cfg(not(any(target_os = "android", target_os = "ios")))]
{
server.add_service(Box::new(clipboard_service::new()));
if !video_service::capture_cursor_embeded() {
if !video_service::capture_cursor_embedded() {
server.add_service(Box::new(input_service::new_cursor()));
server.add_service(Box::new(input_service::new_pos()));
}

View File

@ -400,7 +400,7 @@ impl Connection {
},
Some((instant, value)) = rx_video.recv() => {
if !conn.video_ack_required {
video_service::notify_video_frame_feched(id, Some(instant.into()));
video_service::notify_video_frame_fetched(id, Some(instant.into()));
}
if let Err(err) = conn.stream.send(&value as &Message).await {
conn.on_close(&err.to_string(), false).await;
@ -499,7 +499,7 @@ impl Connection {
} else if video_privacy_conn_id == 0 {
let _ = privacy_mode::turn_off_privacy(0);
}
video_service::notify_video_frame_feched(id, None);
video_service::notify_video_frame_fetched(id, None);
scrap::codec::Encoder::update_video_encoder(id, scrap::codec::EncoderUpdate::Remove);
video_service::VIDEO_QOS.lock().unwrap().reset();
if conn.authorized {
@ -1464,7 +1464,7 @@ impl Connection {
}
}
Some(misc::Union::VideoReceived(_)) => {
video_service::notify_video_frame_feched(
video_service::notify_video_frame_fetched(
self.inner.id,
Some(Instant::now().into()),
);

View File

@ -78,11 +78,11 @@ fn is_capturer_mag_supported() -> bool {
false
}
pub fn capture_cursor_embeded() -> bool {
scrap::is_cursor_embeded()
pub fn capture_cursor_embedded() -> bool {
scrap::is_cursor_embedded()
}
pub fn notify_video_frame_feched(conn_id: i32, frame_tm: Option<Instant>) {
pub fn notify_video_frame_fetched(conn_id: i32, frame_tm: Option<Instant>) {
FRAME_FETCHED_NOTIFIER.0.send((conn_id, frame_tm)).unwrap()
}
@ -146,7 +146,7 @@ impl VideoFrameController {
fetched_conn_ids.insert(id);
}
Ok(None) => {
// this branch would nerver be reached
// this branch would never be reached
}
}
}
@ -162,7 +162,7 @@ fn check_display_changed(
last_n: usize,
last_current: usize,
last_width: usize,
last_hegiht: usize,
last_height: usize,
) -> bool {
#[cfg(target_os = "linux")]
{
@ -187,7 +187,7 @@ fn check_display_changed(
if i != last_current {
return true;
};
if d.width() != last_width || d.height() != last_hegiht {
if d.width() != last_width || d.height() != last_height {
return true;
};
}
@ -249,7 +249,7 @@ fn create_capturer(
PRIVACY_WINDOW_NAME
);
}
log::debug!("Create maginifier capture for {}", privacy_mode_id);
log::debug!("Create magnifier capture for {}", privacy_mode_id);
c = Some(Box::new(c1));
}
Err(e) => {
@ -385,10 +385,12 @@ fn get_capturer(use_yuv: bool, portable_service_running: bool) -> ResultType<Cap
captuerer_privacy_mode_id,
);
if privacy_mode_id != captuerer_privacy_mode_id {
log::info!("In privacy mode, but show UAC prompt window for now");
} else {
log::info!("In privacy mode, the peer side cannot watch the screen");
if privacy_mode_id != 0 {
if privacy_mode_id != captuerer_privacy_mode_id {
log::info!("In privacy mode, but show UAC prompt window for now");
} else {
log::info!("In privacy mode, the peer side cannot watch the screen");
}
}
let capturer = create_capturer(
captuerer_privacy_mode_id,
@ -413,7 +415,7 @@ fn run(sp: GenericService) -> ResultType<()> {
#[cfg(windows)]
ensure_close_virtual_device()?;
// ensure_inited() is needed because release_resouce() may be called.
// ensure_inited() is needed because release_resource() may be called.
#[cfg(target_os = "linux")]
super::wayland::ensure_inited()?;
#[cfg(windows)]
@ -464,7 +466,7 @@ fn run(sp: GenericService) -> ResultType<()> {
y: c.origin.1 as _,
width: c.width as _,
height: c.height as _,
cursor_embeded: capture_cursor_embeded(),
cursor_embedded: capture_cursor_embedded(),
..Default::default()
});
let mut msg_out = Message::new();
@ -599,7 +601,7 @@ fn run(sp: GenericService) -> ResultType<()> {
would_block_count += 1;
if !scrap::is_x11() {
if would_block_count >= 100 {
super::wayland::release_resouce();
super::wayland::release_resource();
bail!("Wayland capturer none 100 times, try restart captuere");
}
}
@ -653,7 +655,7 @@ fn run(sp: GenericService) -> ResultType<()> {
#[cfg(target_os = "linux")]
if !scrap::is_x11() {
super::wayland::release_resouce();
super::wayland::release_resource();
}
Ok(())
@ -821,7 +823,7 @@ pub(super) fn get_displays_2(all: &Vec<Display>) -> (usize, Vec<DisplayInfo>) {
height: d.height() as _,
name: d.name(),
online: d.is_online(),
cursor_embeded: false,
cursor_embedded: false,
..Default::default()
});
}

View File

@ -129,7 +129,7 @@ pub(super) async fn check_init() -> ResultType<()> {
let num = all.len();
let (primary, mut displays) = super::video_service::get_displays_2(&all);
for display in displays.iter_mut() {
display.cursor_embeded = true;
display.cursor_embedded = true;
}
let mut rects: Vec<((i32, i32), usize, usize)> = Vec::new();

View File

@ -164,10 +164,10 @@ class Header: Reactor.Component {
var codecs = handler.supported_hwcodec();
var show_codec = handler.has_hwcodec() && (codecs[0] || codecs[1]);
var cursor_embeded = false;
var cursor_embedded = false;
if ((pi.displays || []).length > 0) {
if (pi.displays.length > pi.current_display) {
cursor_embeded = pi.displays[pi.current_display].cursor_embeded;
cursor_embedded = pi.displays[pi.current_display].cursor_embedded;
}
}
@ -191,7 +191,7 @@ class Header: Reactor.Component {
{codecs[1] ? <li #h265 type="codec-preference"><span>{svg_checkmark}</span>H265</li> : ""}
</div> : ""}
<div .separator />
{!cursor_embeded && <li #show-remote-cursor .toggle-option><span>{svg_checkmark}</span>{translate('Show remote cursor')}</li>}
{!cursor_embedded && <li #show-remote-cursor .toggle-option><span>{svg_checkmark}</span>{translate('Show remote cursor')}</li>}
<li #show-quality-monitor .toggle-option><span>{svg_checkmark}</span>{translate('Show quality monitor')}</li>
{audio_enabled ? <li #disable-audio .toggle-option><span>{svg_checkmark}</span>{translate('Mute')}</li> : ""}
{is_win && pi.platform == 'Windows' && file_enabled ? <li #enable-file-transfer .toggle-option><span>{svg_checkmark}</span>{translate('Allow file copy and paste')}</li> : ""}

View File

@ -79,8 +79,8 @@ impl InvokeUiSession for SciterHandler {
}
}
fn set_display(&self, x: i32, y: i32, w: i32, h: i32, cursor_embeded: bool) {
self.call("setDisplay", &make_args!(x, y, w, h, cursor_embeded));
fn set_display(&self, x: i32, y: i32, w: i32, h: i32, cursor_embedded: bool) {
self.call("setDisplay", &make_args!(x, y, w, h, cursor_embedded));
// https://sciter.com/forums/topic/color_spaceiyuv-crash
// Nothing spectacular in decoder done on CPU side.
// So if you can do BGRA translation on your side the better.
@ -223,7 +223,7 @@ impl InvokeUiSession for SciterHandler {
display.set_item("y", d.y);
display.set_item("width", d.width);
display.set_item("height", d.height);
display.set_item("cursor_embeded", d.cursor_embeded);
display.set_item("cursor_embedded", d.cursor_embedded);
displays.push(display);
}
pi_sciter.set_item("displays", displays);

View File

@ -6,7 +6,7 @@ var display_width = 0;
var display_height = 0;
var display_origin_x = 0;
var display_origin_y = 0;
var display_cursor_embeded = false;
var display_cursor_embedded = false;
var display_scale = 1;
var keyboard_enabled = true; // server side
var clipboard_enabled = true; // server side
@ -16,12 +16,12 @@ var restart_enabled = true; // server side
var recording_enabled = true; // server side
var scroll_body = $(body);
handler.setDisplay = function(x, y, w, h, cursor_embeded) {
handler.setDisplay = function(x, y, w, h, cursor_embedded) {
display_width = w;
display_height = h;
display_origin_x = x;
display_origin_y = y;
display_cursor_embeded = cursor_embeded;
display_cursor_embedded = cursor_embedded;
adaptDisplay();
if (recording) handler.record_screen(true, w, h);
}
@ -197,7 +197,7 @@ function handler.onMouse(evt)
dragging = false;
break;
case Event.MOUSE_MOVE:
if (display_cursor_embeded) {
if (display_cursor_embedded) {
break;
}
if (cursor_img.style#display != "none" && keyboard_enabled) {
@ -365,7 +365,7 @@ function updateCursor(system=false) {
}
function refreshCursor() {
if (display_cursor_embeded) {
if (display_cursor_embedded) {
cursor_img.style#display = "none";
return;
}

View File

@ -604,7 +604,7 @@ pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {
fn set_cursor_data(&self, cd: CursorData);
fn set_cursor_id(&self, id: String);
fn set_cursor_position(&self, cp: CursorPosition);
fn set_display(&self, x: i32, y: i32, w: i32, h: i32, cursor_embeded: bool);
fn set_display(&self, x: i32, y: i32, w: i32, h: i32, cursor_embedded: bool);
fn switch_display(&self, display: &SwitchDisplay);
fn set_peer_info(&self, peer_info: &PeerInfo); // flutter
fn on_connected(&self, conn_type: ConnType);
@ -710,7 +710,7 @@ impl<T: InvokeUiSession> Interface for Session<T> {
current.y,
current.width,
current.height,
current.cursor_embeded,
current.cursor_embedded,
);
}
self.update_privacy_mode();