Skip to content

Commit

Permalink
wip: move shell spec into shell layer
Browse files Browse the repository at this point in the history
  • Loading branch information
cilki committed Dec 25, 2024
1 parent 723326d commit 410acc7
Show file tree
Hide file tree
Showing 9 changed files with 3,530 additions and 1,533 deletions.
4,456 changes: 3,315 additions & 1,141 deletions Cargo.lock

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions sandpolis/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ built = { version = "0.7", features = ["cargo-lock", "dependency-tree", "git2",
anyhow = "1.0.76"
clap = { version = "4.4.7", features = ["derive", "string"] }
couch_rs = { version = "0.10.1", default-features = false, features = ["couch_rs_derive", "derive", "rustls-tls"] }
dialoguer = { version = "0.11.0" }
fuser = { version = "0.15.1", optional = true }
futures = "0.3.30"
os_info = "3.8.2"
rand = "0.8.5"
Expand All @@ -26,22 +28,21 @@ tokio = { version = "1.34.0", default-features = false, features = ["rt", "macro
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
uuid = { version = "1.10.0", features = ["v7", "serde"] }
dialoguer = { version = "0.11.0" }

# Server dependencies
axum-macros = { version = "0.4.1", optional = true }
axum-server = { version = "0.6.0", features = ["tls-rustls"], optional = true }
axum-server = { version = "0.7.1", features = ["tls-rustls"], optional = true }
axum = { version = "0.7.4", optional = true }
rcgen = { version = "0.13.1", optional = true }

# Client dependencies
bevy = { version = "0.14.0", optional = true }
bevy_egui = { version = "0.28.0", optional = true }
bevy_rapier2d = { version = "0.27.0", optional = true }
egui = { version = "0.28", optional = true }
bevy = { version = "0.15.0", optional = true }
bevy_egui = { version = "0.31.1", optional = true }
bevy_rapier2d = { version = "0.28.0", optional = true }
egui = { version = "0.30.0", optional = true }

# Agent dependencies
sysinfo = { version = "0.30.13", optional = true }
sysinfo = { version = "0.33.0", optional = true }

[features]
server = [ "dep:axum", "dep:axum-server", "dep:axum-macros", "dep:rcgen", "local-database" ]
Expand All @@ -53,7 +54,7 @@ client = [ "dep:bevy", "dep:bevy_rapier2d", "dep:bevy_egui", "dep:egui" ]
layer-account = []
layer-alerts = []
layer-desktop = []
layer-filesystem = []
layer-filesystem = ["dep:fuser"]
layer-health = []
layer-inventory = []
layer-logging = []
Expand Down
139 changes: 0 additions & 139 deletions sandpolis/src/api/shell.rs

This file was deleted.

168 changes: 78 additions & 90 deletions sandpolis/src/core/layer/desktop.rs
Original file line number Diff line number Diff line change
@@ -1,57 +1,51 @@
//============================================================================//
// //
// Copyright © 2015 - 2022 Sandpolis Software Foundation //
// //
// This source file is subject to the terms of the Mozilla Public License //
// version 2. You may not use this file except in compliance with the MPLv2. //
// //
//============================================================================//
syntax = "proto3";

package plugin.desktop;

option java_package = "org.s7s.plugin.desktop";

// Request for a listing of available desktops
message RQ_DesktopList {

pub enum DesktopStreamColorMode {
/// Each pixel encoded in three bytes
Rgb888,
/// Each pixel encoded in two bytes
Rgb565,
/// Each pixel encoded in one byte
Rgb332,
}

// Response containing all available desktops
message RS_DesktopList {
pub enum DesktopStreamCompressionMode {
None,
Zlib,
Zstd,
}

message Desktop {
pub enum DesktopStreamPointerButton {
Primary,
Middle,
Secondary,
Back,
Forward,
}

// The desktop name
string name = 1;
/// List available desktops.
pub struct DesktopListRequest;

// The desktop width in pixels
int32 width = 2;
message Desktop {

// The desktop height in pixels
int32 height = 3;
}
// The desktop name
string name = 1;

repeated Desktop desktop = 1;
}
// The desktop width in pixels
int32 width = 2;

message RQ_DesktopStream {
// The desktop height in pixels
int32 height = 3;
}

enum ColorMode {
// Each pixel encoded in three bytes
RGB888 = 0;
// Response containing all available desktops
message RS_DesktopList {

// Each pixel encoded in two bytes
RGB565 = 1;

// Each pixel encoded in one byte
RGB332 = 2;
}
repeated Desktop desktop = 1;
}

enum CompressionMode {
NONE = 0;
message RQ_DesktopStream {

ZLIB = 1;
}

// The requested stream ID
int32 stream_id = 1;
Expand All @@ -67,76 +61,70 @@ enum RS_DesktopStream {
DESKTOP_STREAM_OK = 0;
}

message EV_DesktopStreamInput {

enum PointerButton {
PRIMARY = 0;
MIDDLE = 1;
SECONDARY = 2;
BACK = 3;
FORWARD = 4;
}
pub struct DesktopStreamInputEvent {

//
string key_pressed = 1;
/// Indicates a key was pressed
pub key_pressed: Option<char>,

//
string key_released = 2;
/// Indicates a key was released
pub key_released: Option<char>,

//
string key_typed = 3;
/// Indicates a key was typed
pub key_typed: Option<char>,

//
PointerButton pointer_pressed = 4;
/// Indicates a pointing device was pressed
pub pointer_pressed: Option<DesktopStreamPointerButton>,

//
PointerButton pointer_released = 5;
/// Indicates a pointing device was released
pub pointer_released: Option<DesktopStreamPointerButton>,

// The X coordinate of the pointer
int32 pointer_x = 6;
/// The X coordinate of the pointer
pub pointer_x: Option<i32>,

// The Y coordinate of the pointer
int32 pointer_y = 7;
/// The Y coordinate of the pointer
pub pointer_y: Option<i32>,

// Scale factor
double scale_factor = 8;
/// Screen scale factor
pub scale_factor: Option<f64>,

// Clipboard data
string clipboard = 9;
/// Clipboard data
pub clipboard: Option<Vec<u8>>,
}

message EV_DesktopStreamOutput {
pub struct DesktopStreamOutputEvent {

// The width of the destination block in pixels
int32 width = 1;
/// The width of the destination block in pixels
pub width: Option<i32>,

// The height of the destination block in pixels
int32 height = 2;
/// The height of the destination block in pixels
pub height: Option<i32>,

// The X coordinate of the destination block's top left corner
int32 dest_x = 3;
/// The X coordinate of the destination block's top left corner
pub dest_x: Option<i32>,

// The Y coordinate of the destination block's top left corner
int32 dest_y = 4;
/// The Y coordinate of the destination block's top left corner
pub dest_y: Option<i32>,

// The X coordinate of the source block's top left corner
int32 source_x = 5;
/// The X coordinate of the source block's top left corner
pub source_x: Option<i32>,

// The Y coordinate of the source block's top left corner
int32 source_y = 6;
/// The Y coordinate of the source block's top left corner
pub source_y: Option<i32>,

// The pixel data encoded according to the session's parameters
bytes pixel_data = 7;
/// The pixel data encoded according to the session's parameters
pub pixel_data: Option<Vec<u8>>,

// Clipboard data
string clipboard = 8;
/// Clipboard data
pub clipboard: Option<Vec<u8>>,
}

message RQ_CaptureScreenshot {
// The desktop to capture
string desktop_uuid = 1;
pub struct DesktopScreenshotRequest {
/// The desktop to capture
pub desktop_uuid: String,

// TODO geometry
}

message RS_CaptureScreenshot {
bytes data = 1;
pub struct DesktopScreenshotResponse {
pub data: Vec<u8>,
}
Loading

0 comments on commit 410acc7

Please sign in to comment.