#[repr(C)]pub struct Mode {Show 23 fields
pub abi_version: c_uint,
pub name: *mut c_char,
pub cfg_name_key: [c_char; 128],
pub display_name: *mut c_char,
pub _init: ModeInit,
pub _destroy: ModeDestroy,
pub _get_num_entries: ModeGetNumEntries,
pub _result: ModeResult,
pub _token_match: ModeTokenMatch,
pub _get_display_value: ModeGetDisplayValue,
pub _get_icon: ModeGetIcon,
pub _get_completion: ModeGetCompletion,
pub _preprocess_input: ModePreprocessInput,
pub _get_message: ModeGetMessage,
pub private_data: *mut c_void,
pub free: ModeFree,
pub _create: ModeCreate,
pub _completer_result: ModeCompleterResult,
pub ed: *mut c_void,
pub module: *mut GModule,
pub fallback_icon_fetch_uid: u32,
pub fallback_icon_not_found: u32,
pub type: ModeType,
}Expand description
Structure defining a switcher.
Access should be done through mode_* functions,
not the function pointer fields on this type.
It consists of a name, callback and if enabled a textbox for the sidebar-mode.
Fields§
§abi_version: c_uintUsed for external plugins.
You should set this to ABI_VERSION.
name: *mut c_charName (max 31 char long)
cfg_name_key: [c_char; 128]§display_name: *mut c_char§_init: ModeInitInitialize the Mode.
Returns true if successful.
_destroy: ModeDestroyDestroy the switcher, e.g. free all its memory. Still ready to restart.
_get_num_entries: ModeGetNumEntriesGet the number of entries to display (unfiltered).
_result: ModeResultProcess the result of the user selection.
_token_match: ModeTokenMatchToken match for the matching algorithm.
_get_display_value: ModeGetDisplayValueGet the string to display for the entry.
_get_icon: ModeGetIconObtains the icon of the entry if available.
_get_completion: ModeGetCompletionObtains the string to complete.
_preprocess_input: ModePreprocessInputPreprocess the input for sorting.
_get_message: ModeGetMessageMessage to show in the message bar.
private_data: *mut c_voidPointer to private data.
free: ModeFreeFree the switcher.
_create: ModeCreateCreate mode.
_completer_result: ModeCompleterResultIf this mode is used as a completer.
ed: *mut c_voidExtra fields for the script.
module: *mut GModuleModule
fallback_icon_fetch_uid: u32Fallback icon
fallback_icon_not_found: u32Fallback icon
type: ModeTypeType.