[−][src]Type Definition rubrail::Touchbar
type Touchbar = Box<RustTouchbarDelegateWrapper>;
Controller for creating and using Touch Bar UIs
The Touchbar
type provides the interface between Rust and the Apple Touch
Bar system. It handles communication with the Touch Bar service, delegation
of UI and touch events, and memory management of Objective-C objects. All
creation and modification of Touch Bar UIs is done through it.
This implementation uses private Apple APIs to create an always-available menu to the Control Strip region, which can be accessed regardless of which application is in focus. Apps using it are not permitted in the App Store.
There should typically be one Touchbar
type alocated per application.
Rubrail does not enforce the singleton pattern automatically, so it is up to
the application to guarantee that there is only one. Theoretically, one
application can have multiple disjoint entries in the Touch Bar by creating
more than one Touchbar
, and Rubrail allows this though it is not tested.
See the documentation of the TTouchbar
trait for usage.
Example
extern crate rubrail; use rubrail::TTouchbar; fn main() { let controller = rubrail::Touchbar::alloc("test"); }
Trait Implementations
impl TTouchbar for Touchbar
[src]
type T = Touchbar
A concrete implementation of TTouchbar
fn alloc(title: &str) -> Touchbar
[src]
fn set_icon(&self, image: &str)
[src]
fn create_bar(&mut self) -> BarId
[src]
fn create_popover_item(
&mut self,
image: Option<&TouchbarImage>,
text: Option<&str>,
bar_id: &BarId
) -> ItemId
[src]
&mut self,
image: Option<&TouchbarImage>,
text: Option<&str>,
bar_id: &BarId
) -> ItemId
fn add_items_to_bar(&mut self, bar_id: &BarId, items: Vec<ItemId>)
[src]
fn set_bar_as_root(&mut self, bar_id: BarId)
[src]
fn create_label(&mut self, text: &str) -> ItemId
[src]
fn update_label(&mut self, label_id: &ItemId, text: &str)
[src]
fn update_label_width(&mut self, label_id: &ItemId, width: u32)
[src]
fn create_text_scrubber(&mut self, data: Rc<dyn TScrubberData>) -> ItemId
[src]
fn select_scrubber_item(&mut self, scrub_id: &ItemId, index: u32)
[src]
fn refresh_scrubber(&mut self, scrub_id: &ItemId)
[src]
fn add_item_swipe_gesture(&mut self, item_id: &ItemId, cb: SwipeCb)
[src]
fn add_item_tap_gesture(
&mut self,
item_id: &ItemId,
taps: u32,
fingers: u32,
cb: ButtonCb
)
[src]
&mut self,
item_id: &ItemId,
taps: u32,
fingers: u32,
cb: ButtonCb
)
fn create_spacer(&mut self, space: SpacerType) -> ItemId
[src]
fn create_image_from_path(&mut self, path: &str) -> TouchbarImage
[src]
fn create_image_from_template(
&mut self,
template: ImageTemplate
) -> TouchbarImage
[src]
&mut self,
template: ImageTemplate
) -> TouchbarImage
fn create_button(
&mut self,
image: Option<&TouchbarImage>,
text: Option<&str>,
cb: ButtonCb
) -> ItemId
[src]
&mut self,
image: Option<&TouchbarImage>,
text: Option<&str>,
cb: ButtonCb
) -> ItemId
fn update_button(
&mut self,
item: &ItemId,
image: Option<&TouchbarImage>,
text: Option<&str>
)
[src]
&mut self,
item: &ItemId,
image: Option<&TouchbarImage>,
text: Option<&str>
)
fn update_button_width(&mut self, button_id: &ItemId, width: u32)
[src]
fn create_slider(
&mut self,
min: f64,
max: f64,
label: Option<&str>,
continuous: bool,
cb: SliderCb
) -> ItemId
[src]
&mut self,
min: f64,
max: f64,
label: Option<&str>,
continuous: bool,
cb: SliderCb
) -> ItemId