#![cfg_attr(target_family = "wasm", no_main)]
/// A file under the gallery's assets, by name.
#[cfg(not(target_family = "wasm"))]
macro_rules! asset {
($name:literal) => {
concat!(
env!("CARGO_MANIFEST_DIR"),
"/examples/gallery/assets/",
$name
)
};
}
/// On the web, the build names the pictures' address.
#[cfg(target_family = "wasm")]
macro_rules! asset {
($name:literal) => {
concat!(env!("ELY_GALLERY_ASSETS"), $name)
};
}
mod assets;
#[cfg(not(target_family = "wasm"))]
mod capture;
mod pages;
mod probe;
#[cfg(not(target_family = "wasm"))]
mod script;
mod shell;
// Native capture alone plays the scripts.
#[cfg_attr(target_family = "wasm", allow(dead_code))]
mod step;
#[cfg(not(target_family = "wasm"))]
mod swipe;
mod ui;
#[cfg(target_family = "wasm")]
mod web;
#[cfg(not(target_family = "wasm"))]
use std::path::PathBuf;
#[cfg(not(target_family = "wasm"))]
use anyhow::bail;
use anyhow::{Context as _, Result};
#[cfg(not(target_family = "wasm"))]
use assets::GalleryAssets;
use ely_gpui_component::theme::{Mode, Theme};
use gpui::{
App, AppContext, Bounds, KeyBinding, Menu, MenuItem, SharedString, TitlebarOptions,
WindowBounds, WindowHandle, WindowOptions, actions, point, px, size,
};
actions!(gallery, [Quit, About, LightMode, DarkMode, NewWindow]);
/// The gallery's menu bar, drawn natively and by MenuBar.
pub fn app_menus() -> Vec