rust runs in obsidian plugin, yay

This commit is contained in:
Sebastian Moser
2026-02-18 19:34:10 +01:00
parent 56f658da1e
commit 48e691f163
27 changed files with 3047 additions and 697 deletions

View File

@@ -10,12 +10,12 @@ wasm-opt = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
default = [ "os-target" ]
default = [ "target-os" ]
qt = [ "slint", "cpp", "qt_core", "qt_gui", "qt_widgets", "comandr/qt" ]
slint = [ "i-slint-backend-qt", "dep:slint", "slint-interpreter", "spin_on", "qt" ]
os-target = [ "tao", "wry", "tracing-subscriber", "clap", "webkit2gtk", "mize/os-target", "glib" ]
#os-target = [ "tao", "wry", "tracing-subscriber", "clap" ]
wasm-target = [ "wasm-bindgen", "console_error_panic_hook", "wasm-bindgen-cli", "web-sys", "comandr/wasm-target", "mize/wasm-target" ]
target-os= [ "tao", "wry", "tracing-subscriber", "clap", "webkit2gtk", "mize/target-os", "glib" ]
#target-os= [ "tao", "wry", "tracing-subscriber", "clap" ]
target-wasm = [ "wasm-bindgen", "console_error_panic_hook", "wasm-bindgen-cli", "web-sys", "comandr/target-wasm ", "mize/wasm-target" ]
console_error_panic_hook = ["dep:console_error_panic_hook"]
[target.'cfg(unix)'.dependencies]

View File

@@ -18,7 +18,7 @@ use wasm_bindgen::JsValue;
#[cfg(feature = "wasm-target")]
use web_sys::js_sys::Function;
//#[cfg(feature = "os-target")]
//#[cfg(feature = "target-os")]
//use crate::implementors::qt_widget::QtWidgetSlot;
#[cfg(feature = "qt")]
use qt_core::{qs, QString, QTimer, SlotNoArgs};
@@ -142,7 +142,7 @@ impl Module for Mme {
println!("MmeModule init");
#[cfg(feature = "os-target")]
#[cfg(feature = "target-os")]
{
//self.mize.spawn("mme-main", || self.create_x_window());
let mut cloned_self = self.clone();
@@ -212,7 +212,7 @@ impl Mme {
Ok(())
}
#[cfg(feature = "os-target")]
#[cfg(feature = "target-os")]
pub fn create_x_window(&mut self) -> MizeResult<()> {
use std::fs;
@@ -451,19 +451,19 @@ impl Mme {
}
#[cfg(feature = "os-target")]
#[cfg(feature = "target-os")]
use tao::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
#[cfg(feature = "os-target")]
#[cfg(feature = "target-os")]
use wry::{
http::{self, header::CONTENT_TYPE, Request, Response},
WebViewBuilder,
};
#[cfg(feature = "os-target")]
#[cfg(feature = "target-os")]
fn get_wry_response(request: Request<Vec<u8>>, mut mme: Mme) -> Result<http::Response<Vec<u8>>, Box<dyn std::error::Error>> {
use comandr::core::module;
use mize::item::ItemData;

View File

@@ -7,13 +7,13 @@ use ciborium::Value as CborValue;
use flume::{ Receiver, Sender };
use ciborium_io::Read;
#[cfg(feature = "os-target")]
#[cfg(feature = "target-os")]
use wry::http::Request;
#[cfg(feature = "os-target")]
#[cfg(feature = "target-os")]
use wry::WebView;
#[cfg(feature = "os-target")]
#[cfg(feature = "target-os")]
use tao::event_loop::EventLoopProxy;
#[cfg(feature = "wasm-target")]
@@ -54,7 +54,7 @@ use mize::MizeError;
#[cfg(feature = "os-target")]
#[cfg(feature = "target-os")]
pub fn mme_setup_weview_con_host(mme: &mut Mme, rx: Receiver<MizeMessage>, event_loop_proxy: EventLoopProxy<MizeMessage>) -> MizeResult<()> {
let mize_clone = mme.mize.clone();