feat(wallpaper): extend commands with gallery, delete image, and crop
The plugin now exposes gallery retrieval, image deletion and image crop across Android, desktop and mobile. The Rust core and Android bridge are wired to handle these commands, updating state as needed. - Add gallery, delete_image, and set_image_crop commands - across Android, desktop and mobile. - Update permissions, defaults, and schema to enable new commands.
This commit is contained in:
+52
-7
@@ -3,14 +3,59 @@ use serde::{Deserialize, Serialize};
|
||||
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct WallpaperState {
|
||||
pub image_count: usize,
|
||||
pub enabled: bool,
|
||||
pub shuffle: bool,
|
||||
pub lock_screen_only: bool,
|
||||
pub current_index: usize,
|
||||
pub image_urls: Vec<String>,
|
||||
pub image_count: usize,
|
||||
pub enabled: bool,
|
||||
pub shuffle: bool,
|
||||
pub lock_screen_only: bool,
|
||||
pub current_index: usize,
|
||||
pub image_urls: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SettingRequest { pub name: String, pub value: bool }
|
||||
pub struct SettingRequest {
|
||||
pub name: String,
|
||||
pub value: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GalleryRequest {
|
||||
pub offset: usize,
|
||||
pub limit: usize,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct DeleteImageRequest {
|
||||
pub id: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct ImageCropRequest {
|
||||
pub id: String,
|
||||
pub mode: String,
|
||||
pub zoom: f64,
|
||||
pub position_x: f64,
|
||||
pub position_y: f64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GalleryImage {
|
||||
pub id: String,
|
||||
pub url: String,
|
||||
pub selected: bool,
|
||||
pub crop_mode: String,
|
||||
pub crop_zoom: f64,
|
||||
pub crop_position_x: f64,
|
||||
pub crop_position_y: f64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct GalleryPage {
|
||||
pub total: usize,
|
||||
pub items: Vec<GalleryImage>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user