feat: improving docs and comments on ewwii_plugin_api

This commit is contained in:
Byson94
2025-10-10 21:43:28 +05:30
parent 03baaf3099
commit 975ebc7ee5
4 changed files with 18 additions and 9 deletions

2
Cargo.lock generated
View File

@@ -527,7 +527,7 @@ dependencies = [
[[package]]
name = "ewwii_plugin_api"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"gtk4",
"rhai",

View File

@@ -7,8 +7,7 @@ A shared interface providing traits for building plugins for ewwii.
A simple example showing how to use this interface is provided below:
```rust
use ewwii_plugin_api::{EwwiiAPI, Plugin};
use ewwii_plugin_api::export::export_plugin;
use ewwii_plugin_api::{EwwiiAPI, Plugin, export_plugin};
pub struct DummyStructure;

View File

@@ -1,6 +1,18 @@
//! A module implementing macros for exporting a plugin.
//! It allows fast and easy export of plugins by abstracting
//! the FFI (Foreign Function Interface) related code needed.
//! 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!");
}
}
/// Automatically implements `create_plugin` for a given fieldless structure
#[macro_export]

View File

@@ -8,9 +8,7 @@
//! The following example shows how this crate shall be used to build ewwii plugins:
//!
//! ```rust
//! use ewwii_plugin_api::{EwwiiAPI, Plugin};
//! use ewwii_plugin_api::export::export_plugin;
//!
//! use ewwii_plugin_api::{EwwiiAPI, Plugin, export_plugin};
//! pub struct DummyStructure;
//!
//! impl Plugin for DummyStructure {