src/interface.rs
use Rc;
/// Reference to a horizontal bar created by a `TTouchbar`
///
/// A `BarId` is returned any time a bar is created, where a bar is a horizontal
/// view that can have smaller UI elements added to it, and can eventually be
/// displayed on the Touch Bar hardware.
///
/// The two types of bars are the _root bar_, which appears when you first open
/// the Touch Bar by clicking on its icon in the Control Strip, and _popover
/// bars_, which behave identically but are presented by clicking on buttons
/// on a bar or popover. Popovers provide the mechanism for recursive menus.
///
/// # Memory Allocation
///
/// Memory is allocated for a bar when it is created, and is not released until
/// the bar is made the root bar, or a popover of the root bar, _enabled_, _and
/// subsequently replaced by another bar_. That is, memory is deallocated
/// recursively when an available Touch Bar menu is replaced. If a menu is
/// never registered as the active menu, then it will _never be deallocated_.
/// `BarId` does _not_ implement the Drop trait, and does _not_ deallocate any
/// memory when it falls out of scope.
pub type BarId = u64;
/// Reference to an item that can be added to a bar created by a `TTouchbar`
///
/// An `ItemId` is returned when UI elements are created, and can then be
/// assigned to bars by associating a list of `ItemId`s with a `BarId`.
///
/// # Memory Allocation
///
/// Memory is allocated when an item is created, and is not released until the
/// parent bar that owns it is released. This means it follows the same memory
/// management cycle as `BarId` -- items are not released unless they are
/// assigned to a bar, that bar is registered as the root bar, and then that bar
/// is replaced. `ItemId` does not implement the Drop trait, and does _not_
/// deallocate memory when it falls out of scope.
pub type ItemId = u64;
/// A callback that is called when a button on a Touch Bar is pressed
///
/// `ButtonCb` is expected to be a Boxed closure, and it receives the
/// `ItemId` of the button that is pressed.
///
/// # Arguments
///
/// * first - `ItemId` of the button that was pressed
pub type ButtonCb = ;
/// A callback that is called when the value of a slide on a Touch Bar changes
///
/// 'SliderCb' is expected to be a Boxed closure, and it receives the `ItemId`
/// of the slider that changed, and the new value of the slider as a float.
///
/// # Arguments
///
/// * first - `ItemId` of the slider that was changed
/// * second - Current value of the slider
pub type SliderCb = ;
/// A callback that is called when an item is swiped
///
/// `SwipeCb` is expected to be a Boxed closure, and it receives the
/// `ItemId` of an item as it is being swiped if a swipe gesture recognizer
/// has been added to the item.
///
/// # Arguments
///
/// * first - `ItemId` of the item that was swiped
/// * second - `SwipeState` representing the current gesture's lifecycle
/// * third - Horizontal translation of the swipe, in pixels (positive is right,
/// negative is left).
pub type SwipeCb = ;
/// An allocated image that can be added to items
///
/// A `TouchbarImage` can be created from a path to a file or from a standard
/// Apple template image, and then registered with Touch Bar items that support
/// images, such as buttons and popovers.
pub type TouchbarImage = u64;
/// State of the current swipe gesture on an item
/// Identifiers for Apple's standard button image templates
/// Identifiers for the type of spacing available between items
/// The callback API for managing data in a Scrubber
///
/// The Touch Bar supports a UI element called a 'scrubber', which is a
/// horizontally scrolling widget filled with items which can be dynamically
/// changed, and selected. This is the primary interface for choosing from
/// a list of (possibly dynamic) options.
///
/// Since the contents of a scrubber are dynamic, the scrubber fills in its
/// data on request through a series of callbacks. A type that implements
/// `TScrubberData` provides all of the callbacks that a scrubber needs to
/// present its options.
///
/// See the examples for usage.
/// API for creating, managing, and getting feedback from Touch Bar UIs
///
/// `TTouchbar` is the trait that defines the API for all interactions with the
/// Touch Bar.
///
/// See the documentation of the [`Touchbar`](type.Touchbar.html) type for
/// information on the default implementation.
///
/// An additional 'dummy' implementation is available by building Rubrail with
/// the `--no-default-features` flags. This allows you to build an application
/// that assumes a Touch Bar exists, but to remove it without code changes on
/// platforms that don't have a Touch Bar, or for distributing through official
/// Apple channels which don't permit private API usage.
///