feat: more api changes in ewwii_plugin_api

This commit is contained in:
Byson94
2025-10-10 22:30:07 +05:30
parent 975ebc7ee5
commit 732acbdf5c
4 changed files with 15 additions and 17 deletions

View File

@@ -0,0 +1,10 @@
//! A module providing example implementations of plugins
/// An example plugin that can be exported directly
pub struct ExamplePlugin;
impl crate::Plugin for ExamplePlugin {
fn init(&self, host: &dyn crate::EwwiiAPI) {
host.log("Example plugin says Hello!");
}
}

View File

@@ -1,18 +1,4 @@
//! A module implementing macros and similar functions
//! for exporting a module. All the macros defined here
//! are acessable at the root of this crate.
//!
//! This module also provides an example structure called
//! [`ExamplePlugin`], which can be exported directly.
/// An example plugin that can be exported directly
pub struct ExamplePlugin;
impl crate::Plugin for ExamplePlugin {
fn init(&self, host: &dyn crate::EwwiiAPI) {
host.log("Example plugin says Hello!");
}
}
//! Module implementing macros
/// Automatically implements `create_plugin` for a given fieldless structure
#[macro_export]

View File

@@ -23,7 +23,9 @@
//! export_plugin!(DummyStructure);
//! ```
pub mod export;
mod export_macros;
pub mod example;
pub mod widget_backend;
use rhai::Engine;

View File

@@ -7,7 +7,7 @@ use std::collections::HashMap;
/// A representation of widget registry which holds all the
/// information needed for the dynamic runtime engine in ewwii.
///
/// Not every change in this structure will be represented in the
/// Not every change in this structure will be represented in the
/// original WidgetRegistry in ewwii. Only the change on gtk4::Widget
/// is reflected back.
pub struct WidgetRegistryRepr<'a> {