feat: more api changes in ewwii_plugin_api
This commit is contained in:
10
crates/ewwii_plugin_api/src/example.rs
Normal file
10
crates/ewwii_plugin_api/src/example.rs
Normal 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!");
|
||||
}
|
||||
}
|
||||
@@ -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]
|
||||
@@ -23,7 +23,9 @@
|
||||
//! export_plugin!(DummyStructure);
|
||||
//! ```
|
||||
|
||||
pub mod export;
|
||||
mod export_macros;
|
||||
|
||||
pub mod example;
|
||||
pub mod widget_backend;
|
||||
|
||||
use rhai::Engine;
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user