pub struct SkinRuntime { /* private fields */ }Expand description
A loaded modern skin.
Implementations§
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn classic_cursor_at(&mut self, sx: i32, sy: i32) -> Option<usize>
pub fn classic_cursor_at(&mut self, sx: i32, sy: i32) -> Option<usize>
The cursor slot (an index into CURSOR_FILES) Winamp shows at sx, sy of the
stack, over a classic skin’s window; None elsewhere.
Sourcepub fn classic_cursor(&mut self, slot: usize) -> Option<Rc<SkinCursor>>
pub fn classic_cursor(&mut self, slot: usize) -> Option<Rc<SkinCursor>>
The skin’s picture for cursor slot, decoded once. Without that file, Winamp’s
cursor of the slot’s kind, from the base skin behind the skin; None without either,
and the host shows a cursor for the CursorKind.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn classic_client_rect(&mut self, container: &str) -> Option<Rect>
pub fn classic_client_rect(&mut self, container: &str) -> Option<Rect>
The area of gen window container the host fills (the media library’s list, a
plug-in’s picture), in the window: inside the frame, x 11..w-8 and y 20..h-14. None
when the container holds no gen window.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn classic_genex_colors(&mut self) -> [Rgb; 24]
pub fn classic_genex_colors(&mut self) -> [Rgb; 24]
The colors a classic skin’s genex.bmp gives what the host draws in a gen window (the
media library’s lists, a plug-in’s controls), indexed by GenexColor. A skin without
the sheet takes the base skin’s; without either it gets the media library’s colors.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn set_classic_list_font_size(&mut self, px: i32)
pub fn set_classic_list_font_size(&mut self, px: i32)
Sets the playlist font’s size, pixels to the em, as Winamp’s “playlist font size”
preference does (pe_fontsize, the em in pixels); its rows grow and shrink with it.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn set_classic_style(&mut self, style: ClassicStyle)
pub fn set_classic_style(&mut self, style: ClassicStyle)
Shows the classic windows as style’s Winamp does, its playlist font size included.
Sourcepub fn classic_style(&self) -> ClassicStyle
pub fn classic_style(&self) -> ClassicStyle
The Winamp the classic windows are shown as.
Sourcepub fn wheel_classic_playlist(&mut self, notches: i32)
pub fn wheel_classic_playlist(&mut self, notches: i32)
Scrolls a classic playlist for notches of the mouse wheel, down for more than 0, as
many rows a notch as the style’s Winamp does.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn classic_time_remaining(&self) -> bool
pub fn classic_time_remaining(&self) -> bool
Whether the time displays count down, as a click on them switches it.
Sourcepub fn set_classic_time_remaining(&mut self, on: bool)
pub fn set_classic_time_remaining(&mut self, on: bool)
Makes the time displays count down, or up.
Sourcepub fn classic_eq_auto(&self) -> bool
pub fn classic_eq_auto(&self) -> bool
Whether the equalizer’s auto button is on.
Sourcepub fn set_classic_eq_auto(&mut self, on: bool)
pub fn set_classic_eq_auto(&mut self, on: bool)
Turns the equalizer’s auto button on or off.
Sourcepub fn classic_vis_mode(&self) -> VisMode
pub fn classic_vis_mode(&self) -> VisMode
What the main window’s vis shows, as a press on it steps it.
Sourcepub fn set_classic_vis_mode(&mut self, mode: VisMode)
pub fn set_classic_vis_mode(&mut self, mode: VisMode)
Makes the main window’s vis show mode.
Sourcepub fn set_classic_playlist_selection(&mut self, rows: &[i32])
pub fn set_classic_playlist_selection(&mut self, rows: &[i32])
Shows rows as the classic playlist’s selection, as the host’s playlist has it after its
select all or invert; rows past the list are left out, and the host is not told back.
Sourcepub fn classic_shades(&self) -> bool
pub fn classic_shades(&self) -> bool
Whether the classic windows switch to their shade bars, from their shade buttons and a double tap on their title bars.
Sourcepub fn set_classic_shades(&mut self, on: bool)
pub fn set_classic_shades(&mut self, on: bool)
Lets the classic windows switch to their shade bars, or not; turning it off puts every shaded one back in its normal layout.
Sourcepub fn set_classic_row_marks(&mut self, marks: RowMarks)
pub fn set_classic_row_marks(&mut self, marks: RowMarks)
Puts marks on the classic playlist’s rows, as the host’s playlist marks them; the host
sets them again when its playlist changes. Empty marks take them off.
Sourcepub fn scroll_classic_playlist(&mut self, rows: i32)
pub fn scroll_classic_playlist(&mut self, rows: i32)
Scrolls the playlist by rows, down for more than 0, within its songs.
Sourcepub fn classic_playlist_scroll(&mut self) -> i32
pub fn classic_playlist_scroll(&mut self) -> i32
The first song the classic playlist shows: how far it is scrolled. 0 when the skin has no classic playlist on screen.
Sourcepub fn show_classic_playlist_row(&mut self, row: i32)
pub fn show_classic_playlist_row(&mut self, row: i32)
Scrolls the classic playlist as little as brings song row into view: to the top row
when it lies above what shows, to the bottom row when it lies below, and not at all
when it shows already. A row past the list counts as the last song.
Source§impl SkinRuntime
impl SkinRuntime
Source§impl SkinRuntime
impl SkinRuntime
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Asks for a frame and a new window shape.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn scroll_playlist(&mut self, rows: i32)
pub fn scroll_playlist(&mut self, rows: i32)
Scrolls a modern skin’s playlists by rows, down for more than 0, within their songs:
what a host does for its mouse wheel over one. A classic playlist has
SkinRuntime::scroll_classic_playlist, and SkinRuntime::scroll_at finds the
list under a point.
Sourcepub fn scroll_at(&mut self, x: i32, y: i32, rows: i32) -> bool
pub fn scroll_at(&mut self, x: i32, y: i32, rows: i32) -> bool
Scrolls the list under the point (x, y) of the stack by rows, down for more than
0: what a host does for its mouse wheel, wherever a skin shows its lists. The list is a
modern skin’s playlist, its list of color themes, or a classic playlist window, and
each scrolls within what it holds. False when no list is under the point: the wheel
is then the host’s to use for something else.
Sourcepub fn set_playlist_selection(&mut self, index: Option<i32>)
pub fn set_playlist_selection(&mut self, index: Option<i32>)
Shows entry index (or none) as the playlists’ selection, as the host’s playlist
has it after it changed the selection or the list itself; the host is not told back.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn vis_rect(&mut self) -> Option<Rect>
pub fn vis_rect(&mut self) -> Option<Rect>
Where the visualizer shows in the stack, in layout pixels: a shown window holder for
Winamp’s visualizer (hold="guid:avs", Winamp Modern’s drawer in its visualizer mode) or
for its video, which the host does not play, cut to the groups around it, as they cut
what is drawn inside them. None when none shows, or none of it is left uncut (a drawer
shut). The host draws its visualizer there.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn config_version(&self) -> i32
pub fn config_version(&self) -> i32
Counts changes to the skin’s Config items: an item or attribute made, an attribute made
by newAttribute, or a value changed. A host compares it to SkinOptions::version to
know whether SkinRuntime::skin_options would read differently.
Sourcepub fn skin_options(&self) -> SkinOptions
pub fn skin_options(&self) -> SkinOptions
The options the skin’s scripts list for Winamp’s Options menu, read from the Config item Winamp lists there only (the Windows menu item is not read). An attribute whose value is another item’s GUID is a submenu named by the attribute, “-” is a separator, and any other is a toggle. Attributes only read with getAttribute are left out. Reading makes no item. A toggle is a radio button when a toggle button of the skin set to that attribute draws a picture whose id says “radio”, as Winamp Modern’s config drawer draws its choices.
Sourcepub fn toggle_skin_option(&mut self, key: &OptionKey) -> bool
pub fn toggle_skin_option(&mut self, key: &OptionKey) -> bool
Flips the option key names as a pick from Winamp’s menu does: “1” over a value that
reads as 0, “0” over any other. It is set with setData, so every script hears
onDataChanged and the value is kept with the skin’s settings. False for an unknown key,
a separator, or a value that is a GUID, a submenu’s or not.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn pointer_down_in(&mut self, window: WindowId, x: i32, y: i32, seq: i32)
pub fn pointer_down_in(&mut self, window: WindowId, x: i32, y: i32, seq: i32)
pointer_down at a point of window, in that window’s pixels.
Sourcepub fn pointer_move_in(&mut self, window: WindowId, x: i32, y: i32)
pub fn pointer_move_in(&mut self, window: WindowId, x: i32, y: i32)
pointer_move at a point of window, in that window’s pixels.
Sourcepub fn pointer_up_in(&mut self, window: WindowId, x: i32, y: i32)
pub fn pointer_up_in(&mut self, window: WindowId, x: i32, y: i32)
pointer_up at a point of window, in that window’s pixels.
Sourcepub fn double_tap_in(&mut self, window: WindowId, x: i32, y: i32, seq: i32)
pub fn double_tap_in(&mut self, window: WindowId, x: i32, y: i32, seq: i32)
double_tap at a point of window, in that window’s pixels.
Sourcepub fn pointer_shape_at(&mut self, x: i32, y: i32) -> PointerShape
pub fn pointer_shape_at(&mut self, x: i32, y: i32) -> PointerShape
What a press at a point of the stack would take hold of in a modern skin: a frame’s divider or a window’s resize grip, by the way it is dragged, else the arrow. While a divider or a grip is dragged the answer is its shape wherever the pointer is. For the cursor of a host with a mouse.
Sourcepub fn pointer_down(&mut self, sx: i32, sy: i32, seq: i32)
pub fn pointer_down(&mut self, sx: i32, sy: i32, seq: i32)
Pointer events take points of the stack; objects hear points of their window. seq
names this touch for the menu and move targets and right_click.
Sourcepub fn pointer_move(&mut self, sx: i32, sy: i32)
pub fn pointer_move(&mut self, sx: i32, sy: i32)
The finger moves to a point of the stack.
Sourcepub fn pointer_up(&mut self, sx: i32, sy: i32)
pub fn pointer_up(&mut self, sx: i32, sy: i32)
The finger lifts at a point of the stack.
Sourcepub fn double_tap(&mut self, sx: i32, sy: i32, seq: i32)
pub fn double_tap(&mut self, sx: i32, sy: i32, seq: i32)
A second tap of a double tap, at a point of the stack.
The seq of the last press when it landed on an object with a skin menu, else None.
Sourcepub fn move_target(&self) -> Option<i32>
pub fn move_target(&self) -> Option<i32>
The seq of the last press when it landed on no object, or the object it pressed moves the window; none while the windows are apart, where the engine moves them itself.
Sourcepub fn right_click(&mut self, seq: i32)
pub fn right_click(&mut self, seq: i32)
A right click on the object the touch seq landed on, at the point it landed, as a separate touch.
Sourcepub fn gesture<T>(
&mut self,
fresh: bool,
block: impl FnOnce(&mut Self) -> T,
) -> T
pub fn gesture<T>( &mut self, fresh: bool, block: impl FnOnce(&mut Self) -> T, ) -> T
Runs block as a touch the listener made, from which a script may pop a menu. fresh
starts a new touch, whose menu count starts over.
Sourcepub fn gesture_begin(&mut self, fresh: bool)
pub fn gesture_begin(&mut self, fresh: bool)
Starts a touch the listener made, as SkinRuntime::gesture does around its block, for
a host across a boundary that cannot pass the block; SkinRuntime::gesture_end ends it.
Sourcepub fn gesture_end(&mut self)
pub fn gesture_end(&mut self)
Ends the touch SkinRuntime::gesture_begin started; one that was not started ends nothing.
The listener’s pick from a menu a script popped, by command id, or 0.
Sourcepub fn set_pointer_precise(&mut self, precise: bool)
pub fn set_pointer_precise(&mut self, precise: bool)
Makes the moves and the release of the press now held land exactly where they say, as a
mouse’s do: no touch slop keeps the press on its control or a finger on a button. For a
host’s magnifier, which steers the press with a finger geared down; the next
pointer_down turns it off.
Sourcepub fn set_pointer_modifiers(&mut self, ctrl: bool, shift: bool)
pub fn set_pointer_modifiers(&mut self, ctrl: bool, shift: bool)
The keys held with the next press, from a keyboard beside a mouse or a finger: Ctrl and Shift. A classic playlist’s row takes them as Winamp’s does, Ctrl adding a row to the selection or taking it out, Shift selecting the rows from the last one picked. They hold until the host says again.
Sourcepub fn press_controls(&mut self) -> Vec<TouchControl>
pub fn press_controls(&mut self) -> Vec<TouchControl>
The controls of the window the press now held is on, in stack pixels, for a host’s magnifier to show and to steer the press between; empty without a press. A classic window lists each control by the box it answers in, and, while one of its playlist buttons is held, the pictures of its menu, which ask for the magnifier.
Sourcepub fn pointer_cancel(&mut self)
pub fn pointer_cancel(&mut self)
Ends the press under the finger without a release.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn script_object(&self, id: &str) -> Option<Handle>
pub fn script_object(&self, id: &str) -> Option<Handle>
The object with id id in the main window, as a script’s getObject finds it.
Sourcepub fn script_layout(&self, window: WindowId) -> Option<Handle>
pub fn script_layout(&self, window: WindowId) -> Option<Handle>
The layout window shows, as a script holds a Layout.
Sourcepub fn script_container(&self, id: &str) -> Option<Handle>
pub fn script_container(&self, id: &str) -> Option<Handle>
The container with id id, as a script’s getContainer finds it.
Sourcepub fn script_make(&mut self, class: &str) -> Option<Handle>
pub fn script_make(&mut self, class: &str) -> Option<Handle>
An object of class class (Timer, PopupMenu, …), as a script’s new makes it.
Sourcepub fn script_config_item(&mut self, name: &str, guid: &str) -> Option<Handle>
pub fn script_config_item(&mut self, name: &str, guid: &str) -> Option<Handle>
The Config item named name with guid, as getItem and newItem reach it.
Sourcepub fn script_call(
&mut self,
receiver: Handle,
method: &str,
args: &[Value],
) -> Option<Value>
pub fn script_call( &mut self, receiver: Handle, method: &str, args: &[Value], ) -> Option<Value>
Runs method (any case) on receiver with args, as a script’s call does; None when
the receiver has no such method.
Sourcepub fn begin_slide_as_script(&mut self, o: Handle)
pub fn begin_slide_as_script(&mut self, o: Handle)
Puts object o on its way to a target, as gotoTarget does: the windows count as
sliding until SkinRuntime::end_slides_as_script.
Sourcepub fn end_slides_as_script(&mut self)
pub fn end_slides_as_script(&mut self)
Ends every slide, as the slides reaching their targets do.
Sourcepub fn next_timer_at(&self) -> Option<i64>
pub fn next_timer_at(&self) -> Option<i64>
When the next of the skin’s timers fires, in the clock’s ms; None when none runs.
Sourcepub fn record_events(&mut self, on: bool)
pub fn record_events(&mut self, on: bool)
Starts or stops writing down every event the engine fires, for SkinRuntime::take_recorded_events.
Sourcepub fn take_recorded_events(&mut self) -> Vec<RecordedEvent>
pub fn take_recorded_events(&mut self) -> Vec<RecordedEvent>
The events fired since the last take, in order; empty while nothing is recorded.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn visualizer_window_closed(&mut self)
pub fn visualizer_window_closed(&mut self)
The host closed its visualizer window, which stands in for the skin’s visualizer and
video windows: each of those a script had it open goes back into the skin, as the skin’s
window’s Reattach button puts it (Winamp Modern’s button.vis.reattach), the button
in the skin’s window for it whose id says “attach”. The skin’s window stays shut.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn animating(&self) -> bool
pub fn animating(&self) -> bool
Whether something moves by itself right now: a target slide, or an animation playing and not paused.
Sourcepub fn frames_wanted(&mut self) -> bool
pub fn frames_wanted(&mut self) -> bool
Whether something on the skin moves smoothly by itself now and wants a frame on every display frame.
Sourcepub fn next_due_at(&mut self) -> Option<i64>
pub fn next_due_at(&mut self) -> Option<i64>
When, in clock milliseconds, something on the skin next changes by itself; None when nothing will.
Sourcepub fn tick_with_lead(&mut self, slide_lead: i64) -> bool
pub fn tick_with_lead(&mut self, slide_lead: i64) -> bool
tick with the next target slide placed slide_lead ms ahead of now.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn ensure_layout(&mut self)
pub fn ensure_layout(&mut self)
Lays the main window out now, for a script that asks where something is.
Sourcepub fn stack_size(&mut self) -> (i32, i32)
pub fn stack_size(&mut self) -> (i32, i32)
The stack’s size, in layout pixels; among windows set out apart, the view’s (the viewport’s until the host gives a view size).
Sourcepub fn drawn_size(&mut self) -> (i32, i32)
pub fn drawn_size(&mut self) -> (i32, i32)
The part of the stack its windows show, in layout pixels: the stack with each window cut on its right to where it shows and on its bottom to the part Winamp docks and snaps to.
Sourcepub fn draw_windows(&mut self) -> Vec<(Rect, Vec<DrawCmd>)>
pub fn draw_windows(&mut self) -> Vec<(Rect, Vec<DrawCmd>)>
Every window’s drawing with its place in the stack; draw each translated to its rectangle.
Sourcepub fn drawn_window_ids(&mut self) -> Vec<WindowId>
pub fn drawn_window_ids(&mut self) -> Vec<WindowId>
The windows in the order SkinRuntime::draw_windows draws them, bottom to top: the
stack’s order, or the raised order while the windows are apart, which differs from
SkinRuntime::window_ids once a window was raised. A host pairs the drawn windows
with these.
Sourcepub fn draw_windows_owned(&mut self) -> Vec<DrawnWindow>
pub fn draw_windows_owned(&mut self) -> Vec<DrawnWindow>
Every window’s drawing as SkinRuntime::draw_windows gives it, with the object that
drew each command, for a host that plans what it keeps between frames.
Sourcepub fn take_placed_only(&mut self) -> Option<Vec<(WindowId, Rect)>>
pub fn take_placed_only(&mut self) -> Option<Vec<(WindowId, Rect)>>
When the windows only moved since they were last drawn, where each one shows now, bottom
to top as SkinRuntime::draw_windows_owned gives them, and the move taken as drawn: a
host places its windows again and keeps their drawings. None when something needs
drawing, which SkinRuntime::draw_windows_owned then does.
Sourcepub fn take_tick_changed(&mut self) -> Vec<ObjId>
pub fn take_tick_changed(&mut self) -> Vec<ObjId>
The objects the last tick found moving by themselves (a ticker stepping, a visualizer, a seek thumb), taken once: a host’s planner counts them live from their first change.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn window_ids(&mut self) -> Vec<WindowId>
pub fn window_ids(&mut self) -> Vec<WindowId>
The windows on screen, top to bottom, as windows has them: the main one first.
Sourcepub fn main_window(&self) -> Option<WindowId>
pub fn main_window(&self) -> Option<WindowId>
The main window as it shows now (its normal layout or its shade), or None when the skin has none.
Sourcepub fn window_info(&mut self, id: WindowId) -> WindowInfo
pub fn window_info(&mut self, id: WindowId) -> WindowInfo
What id is like now; see WindowInfo.
Sourcepub fn object_info(&mut self, id: &str) -> Option<ObjectInfo>
pub fn object_info(&mut self, id: &str) -> Option<ObjectInfo>
The object with id id in the windows on screen, the top one first; None when none has it.
Sourcepub fn unknown_objects(&mut self) -> Vec<UnknownObject>
pub fn unknown_objects(&mut self) -> Vec<UnknownObject>
The objects in the windows on screen that stand in for tags nothing defines, the main
window first and each window’s in the order its objects draw; see UnknownObject.
Only what SkinRuntime::draw_windows would draw counts: the current layout of each
open container, and in it the objects that show with every group around them. Unknown
tags in closed containers, other layouts or hidden groups (a preferences dialog, a shade
that is not shown) leave the picture as it is and are not listed. An empty list means
no part of the drawn windows is missing for want of a definition.
Sourcepub fn window_of(&self, container: &str) -> Option<WindowId>
pub fn window_of(&self, container: &str) -> Option<WindowId>
The window container container shows now, or None when the skin has no such container.
Sourcepub fn window_rect(&mut self, id: WindowId) -> Rect
pub fn window_rect(&mut self, id: WindowId) -> Rect
Where id sits in the stack, in layout pixels.
Sourcepub fn window_docking_rect(&mut self, id: WindowId) -> Rect
pub fn window_docking_rect(&mut self, id: WindowId) -> Rect
The part of window id that docks to others: its rect inside the snap margins its skin
gives it (Winamp Modern’s main window leaves out its closed drawer).
Sourcepub fn set_window_title(&mut self, container: &str, title: &str) -> bool
pub fn set_window_title(&mut self, container: &str, title: &str) -> bool
Names the windows of container: the title a classic gen.bmp frame shows (the
visualizer’s plug-in, say). False when the skin has no such container.
Sourcepub fn window_scale(&self, container: &str) -> f32
pub fn window_scale(&self, container: &str) -> f32
Screen pixels per layout pixel of the windows of container; 1 when it has none.
Sourcepub fn set_window_scale(&mut self, container: &str, scale: f32) -> bool
pub fn set_window_scale(&mut self, container: &str, scale: f32) -> bool
Shows the windows of container scale times as large (2 for Winamp’s double size),
from 0.25 to 8. Apart, the windows hanging off its edges, and off theirs, stay docked.
False when the skin has no such container.
Sourcepub fn open_window(&mut self, container: &str) -> bool
pub fn open_window(&mut self, container: &str) -> bool
Opens the window of container in the stack; false when the skin has no such container.
Sourcepub fn close_window(&mut self, container: &str) -> bool
pub fn close_window(&mut self, container: &str) -> bool
Closes the window of container; false when the skin has no such container.
Sourcepub fn window_size(&mut self, id: WindowId) -> (i32, i32)
pub fn window_size(&mut self, id: WindowId) -> (i32, i32)
id’s size as it shows now, in layout pixels.
Sourcepub fn resize_window(&mut self, id: WindowId, width: i32, height: i32)
pub fn resize_window(&mut self, id: WindowId, width: i32, height: i32)
Sizes id to width by height where it is, as the host sizes a window to its box.
Sourcepub fn window_open(&self) -> bool
pub fn window_open(&self) -> bool
Whether a window besides the main one is open, which Back would put away.
Sourcepub fn set_view_size(&mut self, value: Option<(i32, i32)>)
pub fn set_view_size(&mut self, value: Option<(i32, i32)>)
The space the app has for the stack, in layout pixels; None leaves each window at the size it has.
Sourcepub fn skin_name(&self) -> &str
pub fn skin_name(&self) -> &str
What getSkinName() answers: the skin’s folder name, which scripts key what they remember
by; the name in the skin’s <skininfo> when the host gave none before load.
Sourcepub fn set_skin_name(&mut self, name: &str)
pub fn set_skin_name(&mut self, name: &str)
Names the skin for its scripts, before or after load; a name given stays through load.
Sourcepub fn presentation(&self) -> Presentation
pub fn presentation(&self) -> Presentation
How the host shows the windows, as one value.
Sourcepub fn set_presentation(&mut self, p: &Presentation)
pub fn set_presentation(&mut self, p: &Presentation)
Sets how the host shows the windows; what differs changes, as setting the viewport, the columns, the column width, the stretch, the touch slop and the view size one by one does.
Sourcepub fn place_window(&mut self, id: WindowId, x: i32, y: i32)
pub fn place_window(&mut self, id: WindowId, x: i32, y: i32)
Puts window id at x, y in the viewport, among windows set out apart: where the
host keeps it between runs. Nothing changes while the windows are one stack.
Sourcepub fn set_columns(&mut self, columns: i32)
pub fn set_columns(&mut self, columns: i32)
How many columns the stack is set out in once the host gives it a view size: at 2 the windows that show a list go in a column right of the main window, else every window docks under the main one. A change lays the windows out again.
Sourcepub fn set_column_width(&mut self, width: i32)
pub fn set_column_width(&mut self, width: i32)
How wide the windows in the right column of two columns are, in layout pixels; 0 for as wide as what shows of the main window. A change lays the windows out again.
Sourcepub fn set_stretch_last(&mut self, stretch: bool)
pub fn set_stretch_last(&mut self, stretch: bool)
Whether the last docked window takes the height the view leaves under the others, when it can be made taller and shows a list. Off, every window keeps the height the skin gives it.
Sourcepub fn set_touch_slop(&mut self, slop: i32)
pub fn set_touch_slop(&mut self, slop: i32)
How far beside an object a finger may land and still mean it, in layout pixels.
Sourcepub fn content_right_of(&mut self, id: WindowId, lay_out_first: bool) -> i32
pub fn content_right_of(&mut self, id: WindowId, lay_out_first: bool) -> i32
Where id visibly ends on the right; with lay_out_first after laying it out at its
size, as the stack is measured.
Sourcepub fn list_window_open(&mut self) -> bool
pub fn list_window_open(&mut self) -> bool
Whether a window docked under the main one shows a list.
Sourcepub fn shown_width(&mut self, width: i32) -> i32
pub fn shown_width(&mut self, width: i32) -> i32
How far right the stack shows in one column while the main window shows width across
(0 for what it shows now): that width, or a docked window its minimum width makes wider.
It changes no window’s size and runs no layout pass. 0 without a main window.
Sourcepub fn natural_stack_size(
&mut self,
columns: i32,
column_width: i32,
) -> Option<(i32, i32)>
pub fn natural_stack_size( &mut self, columns: i32, column_width: i32, ) -> Option<(i32, i32)>
How large the stack is in columns with a view and every window at its natural height,
with a right column column_width wide, in layout pixels. It changes no window’s size
and runs no layout pass, so the skin hears nothing: the host weighs one column against
two with it. None without a main window.
Sourcepub fn left_column(&mut self) -> Option<Rect>
pub fn left_column(&mut self) -> Option<Rect>
The left column of the stack in two columns, in layout pixels from the stack’s corner:
from the left edge to where the right column starts, and from the top to where the lowest
window in it ends as Winamp docks to it. None for a stack in one column: the columns are
not 2, or no list window is open.
Sourcepub fn edge_placements(&self) -> i32
pub fn edge_placements(&self) -> i32
How many times a script moved the main window against an edge of the viewport after the listener picked from one of its menus in the same touch.
Sourcepub fn focused_window(&mut self) -> Option<WindowId>
pub fn focused_window(&mut self) -> Option<WindowId>
The window that has the focus: the one pressed last, else the main window.
Sourcepub fn focus_window(&mut self, id: WindowId)
pub fn focus_window(&mut self, id: WindowId)
Gives window id the focus, as a press on it does: for a host whose windows take
the keyboard by other ways than a click. The window losing the focus and id show it on
the next frame. Nothing for an id that is no window on screen.
Sourcepub fn set_window_layout(&mut self, id: WindowId, layout: &str)
pub fn set_window_layout(&mut self, id: WindowId, layout: &str)
Shows window id’s container in the layout named (normal, shade), as Winamp’s
windowshade toggle does; nothing when the container has no such layout.
Sourcepub fn close_top_window(&mut self)
pub fn close_top_window(&mut self)
Closes the window on top, the one opened last.
Source§impl SkinRuntime
impl SkinRuntime
Sourcepub fn new(
files: Box<dyn SkinFiles>,
host: Box<dyn SkinHost>,
player: Box<dyn Player>,
setup: SkinSetup,
clock: Clock,
) -> Self
pub fn new( files: Box<dyn SkinFiles>, host: Box<dyn SkinHost>, player: Box<dyn Player>, setup: SkinSetup, clock: Clock, ) -> Self
A runtime for the skin in files, with host and player, set up as setup says, on clock.
Sourcepub fn set_classic_vis_style(&mut self, style: VisStyle)
pub fn set_classic_vis_style(&mut self, style: VisStyle)
Sets how a classic skin’s vis area draws (Winamp’s visualization options).
Sourcepub fn now(&self) -> i64
pub fn now(&self) -> i64
The clock’s reading now, in ms. While the windows are drawn it is the moment that drawing began: a real clock moves on meanwhile, and one pass shows one moment.
Sourcepub fn set_viewport(&mut self, w: i32, h: i32)
pub fn set_viewport(&mut self, w: i32, h: i32)
The screen a skin may place windows on before the host sets a view size, in layout pixels.
Sourcepub fn set_zone_offset(&mut self, f: Box<dyn Fn(i64) -> i32>)
pub fn set_zone_offset(&mut self, f: Box<dyn Fn(i64) -> i32>)
How far the local time is from UTC at a moment of the clock, in ms: the time of day scripts read is local. 0 unless the host says.
Sourcepub fn viewport(&self) -> (i32, i32)
pub fn viewport(&self) -> (i32, i32)
The screen as scripts ask for it (getViewportWidth): the phone’s view in layout pixels once known.
Sourcepub fn stats(&self) -> EngineStats
pub fn stats(&self) -> EngineStats
What the engine has done so far; see EngineStats.
Sourcepub fn color_themes(&self) -> Vec<String>
pub fn color_themes(&self) -> Vec<String>
The skin’s color themes (gammasets), in the order the skin defines them.
Sourcepub fn color_theme(&self) -> Option<&str>
pub fn color_theme(&self) -> Option<&str>
The color theme in use.
Sourcepub fn select_color_theme(&mut self, name: &str)
pub fn select_color_theme(&mut self, name: &str)
Wears the color theme named name, matched ignoring case; an unknown name changes nothing.
Sourcepub fn settings_version(&self) -> i32
pub fn settings_version(&self) -> i32
Counts changes to what a host keeps of the skin between runs.
Sourcepub fn saved_settings(&self) -> SavedSettings
pub fn saved_settings(&self) -> SavedSettings
What the host keeps of the skin between runs, as it is now; the color theme is
SkinRuntime::color_theme.
Sourcepub fn restore_settings(&mut self, saved: &SavedSettings)
pub fn restore_settings(&mut self, saved: &SavedSettings)
Puts back what SkinRuntime::saved_settings gave in an earlier run, before load, so
the scripts read it as they start. It counts as no change (SkinRuntime::settings_version).