use crate::draw::DrawShared;
use crate::event;
use crate::event::UpdateId;
use crate::theme::{ThemeControl, ThemeSize};
use std::num::NonZeroU32;
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct WindowId(NonZeroU32);
impl WindowId {
#[cfg_attr(not(feature = "internal_doc"), doc(hidden))]
#[cfg_attr(doc_cfg, doc(cfg(internal_doc)))]
pub fn new(n: NonZeroU32) -> WindowId {
WindowId(n)
}
}
bitflags! {
#[must_use]
#[derive(Default)]
pub struct TkAction: u32 {
const EMPTY = 0;
const REDRAW = 1 << 0;
const REGION_MOVED = 1 << 4;
const SET_SIZE = 1 << 8;
const RESIZE = 1 << 9;
const THEME_UPDATE = 1 << 10;
const RECONFIGURE = 1 << 16;
const CLOSE = 1 << 30;
const EXIT = 1 << 31;
}
}
#[cfg_attr(not(feature = "internal_doc"), doc(hidden))]
#[cfg_attr(doc_cfg, doc(cfg(internal_doc)))]
pub trait ShellWindow {
fn add_popup(&mut self, popup: crate::Popup) -> Option<WindowId>;
fn add_window(&mut self, widget: Box<dyn crate::Window>) -> WindowId;
fn close_window(&mut self, id: WindowId);
fn update_all(&mut self, id: UpdateId, payload: u64);
fn get_clipboard(&mut self) -> Option<String>;
fn set_clipboard(&mut self, content: String);
fn adjust_theme(&mut self, f: &mut dyn FnMut(&mut dyn ThemeControl) -> TkAction);
fn size_and_draw_shared(&mut self, f: &mut dyn FnMut(&mut dyn ThemeSize, &mut dyn DrawShared));
fn set_cursor_icon(&mut self, icon: event::CursorIcon);
}