pub trait SDModule: Send + Sync {
Show 15 methods fn name(&self) -> String; fn components(&self) -> HashMap<String, ComponentDefinition>; fn add_component(&self, core: CoreHandle, button: &mut Button, name: &str); fn remove_component(&self, core: CoreHandle, button: &mut Button, name: &str); fn paste_component(
        &self,
        core: CoreHandle,
        reference_button: &Button,
        new_button: &mut Button
    ); fn component_values(
        &self,
        core: CoreHandle,
        button: &Button,
        name: &str
    ) -> Vec<UIValue>; fn set_component_value(
        &self,
        core: CoreHandle,
        button: &mut Button,
        name: &str,
        value: Vec<UIValue>
    ); fn listening_for(&self) -> Vec<String>; fn settings(&self, core_manager: Arc<CoreManager>) -> Vec<UIValue> { ... } fn set_setting(&self, core_manager: Arc<CoreManager>, value: Vec<UIValue>) { ... } fn global_event(&self, event: SDGlobalEvent) { ... } fn event(&self, core: CoreHandle, event: SDCoreEvent) { ... } fn render(
        &self,
        core: CoreHandle,
        button: &UniqueButton,
        frame: &mut DynamicImage
    ) { ... } fn render_hash(
        &self,
        core: CoreHandle,
        button: &UniqueButton,
        hash: &mut Box<dyn Hasher>
    ) { ... } fn metadata(&self) -> PluginMetadata { ... }
}
Expand description

Module trait

Required Methods

Module name

Definition for components that module will be providing

Method for adding components onto buttons

Method for removing components from buttons

Method for handling pasting components of plugin, can be used for any additional handling

Method for letting core know what values component currently has

Method for setting values on components

Specifies which components the module will be receiving events for

Provided Methods

Current settings state of the plugin

Method for updating plugin settings from UI

Method for handling global events, add GLOBAL_EVENTS feature to the plugin metadata to receive global events

Method for handling core events, add CORE_EVENTS feature to the plugin metadata to receive core events

Method renderer will run for rendering additional information on a button if RENDERING feature was specified

Method for telling renderer if anything changed

Changing state of the hash in anyway will cause renderer to either rerender, or use previous cache. This method will also called very frequently, so keep code in here fast

Metadata of the module, auto-implemented for plugins from plugin metadata

Implementors