pub trait Editor {
    // Required methods
    fn size(&self) -> (i32, i32);
    fn position(&self) -> (i32, i32);
    fn open(&mut self, parent: *mut c_void) -> bool;
    fn is_open(&mut self) -> bool;

    // Provided methods
    fn idle(&mut self) { ... }
    fn close(&mut self) { ... }
    fn set_knob_mode(&mut self, mode: KnobMode) -> bool { ... }
    fn key_up(&mut self, keycode: KeyCode) -> bool { ... }
    fn key_down(&mut self, keycode: KeyCode) -> bool { ... }
}
Expand description

Implemented by plugin editors.

Required Methods§

source

fn size(&self) -> (i32, i32)

Get the size of the editor window.

source

fn position(&self) -> (i32, i32)

Get the coordinates of the editor window.

source

fn open(&mut self, parent: *mut c_void) -> bool

Called when the editor window is opened.

parent is a window pointer that the new window should attach itself to. It is dependent upon the platform you are targeting.

A few examples:

  • On Windows, it should be interpreted as a HWND
  • On Mac OS X (64 bit), it should be interpreted as a NSView*
  • On X11 platforms, it should be interpreted as a u32 (the ID number of the parent window)

Return true if the window opened successfully, false otherwise.

source

fn is_open(&mut self) -> bool

Return whether the window is currently open.

Provided Methods§

source

fn idle(&mut self)

Editor idle call. Called by host.

source

fn close(&mut self)

Called when the editor window is closed.

source

fn set_knob_mode(&mut self, mode: KnobMode) -> bool

Set the knob mode for this editor (if supported by host).

Return true if the knob mode was set.

source

fn key_up(&mut self, keycode: KeyCode) -> bool

Receive key up event. Return true if the key was used.

source

fn key_down(&mut self, keycode: KeyCode) -> bool

Receive key down event. Return true if the key was used.

Implementors§