PluginHost

Struct PluginHost 

Source
pub struct PluginHost { /* private fields */ }
Expand description
  • instance_name (non-official)
  • config_*
  • db_*
  • debug_* (tracing)
  • localization_get_*
  • os_enable_or_disable_dlg_item
  • os_get_(local_)?app_data_path_cat_filename
  • plugin_?et_setting_string
  • property_*
  • ui_options_add_plugin_page
  • utf8_buf_(init|kill)
  • version_get_*, plugin_get_version

Implementations§

Source§

impl PluginHost

Source

pub fn config_get_int_value(&self, name: &str) -> i32

Get an Everything setting value by setting name.

Returns the integer value of the setting.

§Example
let app_data = host.config_get_int_value("app_data");
Source

pub fn config_set_int_value(&self, name: &str, value: i32) -> i32

Set an Everything setting value by setting name.

Returns 1 if the setting was changed.
Returns 0 if the setting remains the same.

§Example
host.config_set_int_value("always_keep_sort", 1);
Source

pub fn config_get_language(&self) -> Option<u16>

§Returns
  • None: User Default
  • Some(u16): Language identifier
Source

pub fn get_language_name(language: u16) -> String

Source

pub fn get_thread_language_name() -> String

Source

pub fn config_get_language_name(&self) -> String

Source§

impl PluginHost

Source

pub fn os_get_app_data_path(&self) -> PathBuf

Source

pub fn os_get_app_data_path_cat_filename(&self, filename: &str) -> PathBuf

Build the setting or data full path using the specified filename.

The full path is stored in cbuf.
This will either be %APPDATA%\Everything\filename or filename in the same location as your Everything.exe
Depending on your app_data setting.
cbuf must be initialized with Self::utf8_buf_init

See also Self::utf8_buf_init

Source

pub fn os_get_local_app_data_path(&self) -> PathBuf

Source

pub fn os_get_local_app_data_path_cat_filename(&self, filename: &str) -> PathBuf

Build the data full path using the specified filename.

The full path is stored in cbuf.
This will either be %LOCALAPPDATA%\Everything\filename or filename in the same location as your Everything.exe
Depending on your app_data setting.

Source

pub fn plugin_get_setting_string( &self, data: *mut c_void, name: &str, current_string: *mut everything_plugin_utf8_t, ) -> *mut everything_plugin_utf8_t

Get an string setting value by name from the specified setting sorted list.

Returns a pointer to the string value.

current_value is returned if the setting value was not found.

§Note
Source

pub fn plugin_set_setting_string( &self, data: *mut c_void, name: &str, value: &str, )

Writes a string setting value with the specified name to the specified output stream.

§Note

Plugins{-instance_name}.ini:

[{plugin_dll}]
{name}={value}
...
Source

pub fn plugin_setting_json_path(&self) -> PathBuf

Non-official plugins.json path.

TODO: Named instances

Source§

impl PluginHost

Source

pub fn ui_options_add_plugin_page( &self, data: *mut c_void, user_data: *mut c_void, name: &str, )

Source

pub fn ui_options_from_page_hwnd(page_hwnd: HWND) -> HWND

Source

pub fn ui_options_enable_or_disable_apply_button( &self, options_hwnd: HWND, enable: bool, )

Source

pub fn os_enable_or_disable_dlg_item( &self, parent_hwnd: HWND, id: i32, enable: bool, )

Enable or disable a dialog control.

§Note

For options_hwnd, see OptionsDlgItem.

Source§

impl PluginHost

Source

pub fn new(get_proc_address: everything_plugin_get_proc_address_t) -> Self

Source

pub unsafe fn from_data(data: *mut c_void) -> Self

Source

pub unsafe fn get<T: Copy>(&self, name: &str) -> Option<T>

You can unwrap_unchecked() if the API exists in all versions of Everything.

Source

pub fn utf8_buf_init(&self, cbuf: *mut everything_plugin_utf8_buf_t)

Initialize a cbuf with an empty string.

The cbuf must be killed with Self::utf8_buf_kill

See also Self::utf8_buf_kill

§Note

Usage:

let mut cbuf = MaybeUninit::uninit();
host.utf8_buf_init(cbuf.as_mut_ptr());

unsafe { os_get_app_data_path_cat_filename(filename.as_ptr() as _, cbuf.as_mut_ptr()) };

// Or `utf8_buf_kill()`
self.utf8_buf_into_string(cbuf.as_mut_ptr())

Do not move sys::everything_plugin_utf8_buf_t.

Source

pub fn utf8_buf_kill(&self, cbuf: *mut everything_plugin_utf8_buf_t)

Kill a cbuf initialized with Self::utf8_buf_init.

Any allocated memory is returned to the system.

See also Self::utf8_buf_init

Source

pub fn utf8_buf_into_string( &self, cbuf: *mut everything_plugin_utf8_buf_t, ) -> String

Source

pub fn ipc_window_from_main_thread() -> Option<IpcWindow>

Source

pub fn instance_name_from_main_thread() -> Option<String>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more