Package guidoc
guidoc #sleela 3.0 (lib/guidoc/guidoc.sleela)
GuiDoc class
The launcher of the document GUI. It builds the GUI from its spec, runs the readiness gate, optionally opens the file named by the environment variable SLEELA_GUIDOC_OPEN, prints the screen as a text outline and says whether the GUI is ready. SLEELA_GUIDOC_ADMIN=1 makes the session an admin and SLEELA_GUIDOC_LOCK=1 (admin only) locks the system before the screen is printed. With SLEELA_GUIDOC_PLAN=1 it also prints the mount plan a windowing host consumes. On a host with no display it stops there; a windowing host drives the same SLGuiDocApp through click(), type() and accelerate(). Output ends with GUIDOC READY or GUIDOC NOT READY (SLeeLa 3.0 main cannot set an exit status, so scripts match that line).
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
main | void main() | No description in source. |
guidoc-demo #sleela 3.0 (lib/guidoc/guidoc-demo.sleela)
GuiDocDemo class
Runnable, self-checking demonstrator for the document GUI in white: menus and accelerators, tabs, the line editor, the open and save-as dialogs, load and save to real files, the discard confirmations, the 14-tab limit, read-only unsplit files, external changes seen by the GUI document listener, and the white theme. It drives the widget tree with scripted presses (the same calls a host makes from real widgets) and verifies the screen after each step. Prints PASS or FAIL per check and a tally.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
passed | int passed | No description in source. |
failed | int failed | No description in source. |
app | SLGuiDocApp app | No description in source. |
v | SLGuiDocView v | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
check | void check(String label, boolean ok) | No description in source. |
banner | void banner(String t) | No description in source. |
t | String t(String id) | No description in source. |
vis | boolean vis(String id) | No description in source. |
en | boolean en(String id) | No description in source. |
cur | SLGuiDocTab cur() | No description in source. |
menuClick | int menuClick(String menu, String item) | Click a menu then one of its items, the way a user would. |
menuClickOn | int menuClickOn(SLGuiDocApp a, String menu, String item) | No description in source. |
auditHas | boolean auditHas(SLGuiDocApp a, String entry) | No description in source. |
outlineHas | boolean outlineHas(String line) | No description in source. |
slurp | String slurp(String path) | No description in source. |
dump | void dump(String path, String data) | No description in source. |
main | void main() | No description in source. |
notesCleanup | void notesCleanup(String base, String a, String b, String c) | No description in source. |
SLGuiDocApp #sleela 3.0 (lib/guidoc/SLGuiDocApp.sleela)
SLGuiDocApp class
Defines SLGuiDocApp — the controller of the document GUI, in white. It builds the widget tree from the spec (SLGuiDocSpec, mirrored by gui-document.xml), keeps up to 14 tabs (each a standing document with its own observer and white GUI listener), runs the menu commands, handles keyboard accelerators, the open and save-as dialogs and the discard-changes confirmations, and repaints the view whenever a command or an external change to a document calls for it. Load and save go through SLGuiDocFile.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
spec | SLGuiDocSpec spec | No description in source. |
white | SLGuiDocWhite white | No description in source. |
file | SLGuiDocFile file | No description in source. |
view | SLGuiDocView view | No description in source. |
tabs | SLGuiDocTab[] tabs | No description in source. |
tabCount | int tabCount | No description in source. |
active | int active | No description in source. |
untitled | int untitled | No description in source. |
dialog | int dialog | No description in source. |
pendingTab | int pendingTab | No description in source. |
quitFlag | int quitFlag | No description in source. |
status | String status | No description in source. |
statusError | int statusError | No description in source. |
openMenu | String openMenu | No description in source. |
executed | int executed | No description in source. |
refusedCommands | int refusedCommands | No description in source. |
ready | SLGuiDocReady ready | No description in source. |
cmdRuns | int[] cmdRuns | No description in source. |
itemClicks | int[] itemClicks | No description in source. |
admin | int admin | No description in source. |
locked | int locked | No description in source. |
choiceTab | int choiceTab | No description in source. |
trail | String[] trail | No description in source. |
trailCount | int trailCount | No description in source. |
trailLost | int trailLost | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | boolean configure() | Build everything from the spec. False if the spec or the white theme is inconsistent (nothing is half-built). |
lifecycle | SLGuiDocReady lifecycle() | No description in source. |
isReady | boolean isReady() | No description in source. |
isCertified | boolean isCertified() | No description in source. |
whenReady | boolean whenReady(String subscriber) | No description in source. |
takeReady | boolean takeReady(String subscriber) | No description in source. |
audit | void audit(String entry) | No description in source. |
auditSize | int auditSize() | No description in source. |
auditAt | String auditAt(int i) | No description in source. |
isAdmin | boolean isAdmin() | No description in source. |
isLocked | boolean isLocked() | No description in source. |
choiceIndex | int choiceIndex() | No description in source. |
inChoice | boolean inChoice() | No description in source. |
setAdmin | void setAdmin(boolean on) | No description in source. |
lockAllows | boolean lockAllows(String command) | Does the lock let this command run right now? |
lockAllTabs | void lockAllTabs(boolean on) | No description in source. |
endChoice | boolean endChoice(String reason) | End the editor choice session, if any. Returns true when edits were reverted. Callers set their own status text. |
applySettings | void applySettings() | Re-read the settings that are copied at build time (the file limits and the sidecar suffix). New tabs also read the listener flag from the spec when they are made. Call after changing the spec at run time. |
requestClose | boolean requestClose() | The window was asked to close (the host reports its close button). With a dialog open that cancels the dialog; otherwise it is Quit, which asks first if the spec says so. Returns true only if quitting went ahead or a confirmation was opened. |
expectedNodes | int expectedNodes() | The node count the spec implies: window, menubar, menus, items, tab bar, tabs, new-tab button, editor, two nodes per row, entry, three status labels and the five dialog nodes. |
start | boolean start() | Run the self-checks. Returns true when the GUI is READY. Can be retried after a failure. |
specification | SLGuiDocSpec specification() | No description in source. |
look | SLGuiDocWhite look() | No description in source. |
widgets | SLGuiDocView widgets() | No description in source. |
files | SLGuiDocFile files() | No description in source. |
tabTotal | int tabTotal() | No description in source. |
activeIndex | int activeIndex() | No description in source. |
tabAt | SLGuiDocTab tabAt(int i) | No description in source. |
activeTab | SLGuiDocTab activeTab() | No description in source. |
quitRequested | boolean quitRequested() | No description in source. |
statusText | String statusText() | No description in source. |
statusIsError | boolean statusIsError() | No description in source. |
dialogMode | int dialogMode() | No description in source. |
menuOpen | String menuOpen() | No description in source. |
executedCount | int executedCount() | No description in source. |
refusedCount | int refusedCount() | No description in source. |
itemText | String itemText(int i, boolean paintedState) | The text of a menu item: its label (or, for a toggle that is on, its active label) and its accelerator. |
buildView | void buildView() | No description in source. |
whenHolds | boolean whenHolds(String when) | No description in source. |
say | void say(String text) | No description in source. |
complain | void complain(String text) | No description in source. |
tabLabel | String tabLabel(SLGuiDocTab t) | No description in source. |
paint | void paint() | No description in source. |
paintEditor | void paintEditor(SLGuiDocTab cur) | No description in source. |
paintStatus | void paintStatus(SLGuiDocTab cur) | No description in source. |
paintDialog | void paintDialog(SLGuiDocTab cur) | No description in source. |
refresh | boolean refresh() | Called by the host loop after anything outside the GUI may have changed a document: repaint if any tab listener latched a repaint. |
type | void type(String id, String text) | No description in source. |
click | int click(String id) | Report a node activation and service it. Returns commands executed. |
pump | int pump() | No description in source. |
handle | void handle(String command, int arg) | No description in source. |
accelerate | boolean accelerate(String accel) | A keyboard accelerator such as Ctrl+S. |
runKeyAction | boolean runKeyAction(String action) | Enter and Esc while a dialog or a menu is open. |
execute | boolean execute(String command) | No description in source. |
dispatch | int dispatch(String command, boolean run) | The one command table. run=false only asks whether the command has a handler. Returns 1 ran and succeeded, 0 ran and was refused, -1 unknown. |
flag | int flag(boolean b) | No description in source. |
commandRunCount | int commandRunCount(String command) | No description in source. |
itemClickCount | int itemClickCount(String itemId) | No description in source. |
commandsCovered | int commandsCovered() | No description in source. |
itemsCovered | int itemsCovered() | No description in source. |
coverageComplete | boolean coverageComplete() | No description in source. |
printCoverage | void printCoverage() | Machine-readable coverage lines, one per command and per item. |
addTab | boolean addTab(SLGuiDocTab t) | No description in source. |
cmdNew | boolean cmdNew() | No description in source. |
cmdOpen | boolean cmdOpen() | No description in source. |
cmdSaveAs | boolean cmdSaveAs() | No description in source. |
cmdSave | boolean cmdSave() | No description in source. |
cmdCloseTab | boolean cmdCloseTab() | No description in source. |
cmdQuit | boolean cmdQuit() | No description in source. |
cmdInsertLine | boolean cmdInsertLine() | No description in source. |
cmdReplaceLine | boolean cmdReplaceLine() | No description in source. |
cmdDeleteLine | boolean cmdDeleteLine() | No description in source. |
moveTo | boolean moveTo(int to) | No description in source. |
cmdSelectPrev | boolean cmdSelectPrev() | No description in source. |
cmdSelectNext | boolean cmdSelectNext() | No description in source. |
cmdPageUp | boolean cmdPageUp() | No description in source. |
cmdPageDown | boolean cmdPageDown() | No description in source. |
cmdLoadLine | boolean cmdLoadLine() | Copy the selected line into the entry box so it can be changed and put back with Replace Line. Needs the same rights as editing. |
cmdLock | boolean cmdLock() | Admin only (the menu item is enabled only for an admin). Locking refuses every command that adds content; unlocking ends any editor choice session. |
cmdChoice | boolean cmdChoice() | Admin only, and only while the system is locked: start an editor choice session on the active tab, or end the one that is running. |
cmdNextTab | boolean cmdNextTab() | No description in source. |
cmdPrevTab | boolean cmdPrevTab() | No description in source. |
cmdAbout | boolean cmdAbout() | No description in source. |
gotoTab | void gotoTab(int i) | No description in source. |
selectRow | void selectRow(int row) | No description in source. |
saveActiveTo | boolean saveActiveTo(String path) | No description in source. |
openPath | boolean openPath(String path) | Open a path in a new tab (or switch to the tab that already has it). |
closeTab | boolean closeTab(int idx) | No description in source. |
dialogOk | void dialogOk() | No description in source. |
dialogCancel | void dialogCancel() | No description in source. |
SLGuiDocFile #sleela 3.0 (lib/guidoc/SLGuiDocFile.sleela)
SLGuiDocFile class
Defines SLGuiDocFile — load and save for the document GUI over the openFile / read / write / close, osRename, osMakeDir and osRemove bridge. Save writes the document as plain text (lines joined by newline, with a trailing newline) through a temporary file and a rename, then writes a sidecar directory holding one file per line. Load never trusts a split: SLeeLa cannot cut a String into lines, so it reads the whole file and accepts the sidecar lines only if joining them reproduces the file EXACTLY. Otherwise the file is opened unsplit (one block) and the GUI keeps it read-only. Nothing is ever loaded that the file does not literally contain.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
maxBytes | int maxBytes | No description in source. |
maxLines | int maxLines | No description in source. |
suffix | String suffix | No description in source. |
lastCode | int lastCode | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String sidecarSuffix, int byteLimit, int lineLimit) | The line limit can be lowered below the document capacity (64) but never raised above it. |
getMaxLines | int getMaxLines() | No description in source. |
getLastCode | int getLastCode() | No description in source. |
getSidecarSuffixValue | String getSidecarSuffixValue() | No description in source. |
sidecarDir | String sidecarDir(String path) | No description in source. |
pad4 | String pad4(int i) | No description in source. |
lineFile | String lineFile(String path, int i) | No description in source. |
joinDocument | String joinDocument(SLObserverDocument doc, boolean trailing) | The document as text: lines joined by newline, optionally ending in one. |
exists | boolean exists(String p) | No description in source. |
writeWhole | boolean writeWhole(String path, String data) | No description in source. |
readWhole | String readWhole(String path) | No description in source. |
save | int save(String path, SLObserverDocument doc) | Save the document. The plain-text file is replaced atomically (temporary file then rename). A stale or missing sidecar is harmless: load will simply open the file unsplit. |
load | int load(String path, SLObserverDocument into) | Load into an EMPTY document. 0 = exact lines, 10 = opened unsplit. |
forget | void forget(String path) | Remove a saved file and its sidecar (used by tests and by a host cleanup). |
SLGuiDocHost #sleela 3.0 (lib/guidoc/SLGuiDocHost.sleela)
SLGuiDocHost class
Defines SLGuiDocHost — the host side of the document GUI: how a host sees the screen. outline() renders the visible GUI as plain text lines (the terminal and headless view: window, menus, tabs, editor rows, entry, status, dialog), and mountPlan() lists every visible node in tree order with its tag, parent, background and foreground colour tokens, enabled flag and text, which is exactly what a windowing host needs to mount real widgets. Every node carries its white role, and colours are resolved by role through SLGuiDocWhite, so no style string is ever parsed.
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
emit | int emit(String[] out, int cap, int n, String line) | No description in source. |
outline | int outline(SLGuiDocApp app, String[] out, int cap) | The visible GUI as text. Returns the number of lines written. |
mountPlan | int mountPlan(SLGuiDocApp app, String[] out, int cap) | Every visible node in tree order, as a mount instruction for a host. |
event | int event(SLGuiDocApp app, String kind, String id, String value) | The single entry point for a windowing host. Everything a real window can report is one of these events, and nothing else reaches the GUI: press id a widget was activated (menu, menu item, tab, row, button) type id value the user typed into an entry widget key value a key chord, e.g. Ctrl+S, Up, Enter, Esc close the window close button tick a turn of the host loop: repaint if a document changed Returns the number of commands run (press), 1 or 0 (key, close, tick), 0 (type), or -1 for an unknown event kind. |
visibleNodes | int visibleNodes(SLGuiDocApp app) | How many nodes mountPlan() would list (visible nodes). |
SLGuiDocListener #sleela 3.0 (lib/guidoc/SLGuiDocListener.sleela)
SLGuiDocListener class
Defines SLGuiDocListener — the GUI document listener, in white. Its nested Responder is an observer module (a drop-in, admitted through a bounded port) that listens to the standing document of one tab. Every change latches a repaint, and the listener tells changes made through the GUI apart from changes made by someone else (an external change is flagged, shown in the status line, and never silently absorbed). It speaks the white theme through SLGuiDocWhite.
Responder class
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
port | SLObserverPort port | No description in source. |
white | SLGuiDocWhite white | No description in source. |
lastRevision | int lastRevision | No description in source. |
changes | int changes | No description in source. |
externalChanges | int externalChanges | No description in source. |
lastSource | String lastSource | No description in source. |
lastExternal | String lastExternal | No description in source. |
repaint | int repaint | No description in source. |
seenNotes | int seenNotes | No description in source. |
flagging | int flagging | No description in source. |
quietChanges | int quietChanges | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
attach | void attach(String portName, SLGuiDocWhite look, boolean flagExternal) | flagExternal=false still counts every change but never flags one as external: it stays quiet in the status line. |
portOf | SLObserverPort portOf() | No description in source. |
revisionSeen | int revisionSeen() | No description in source. |
changeCount | int changeCount() | No description in source. |
externalCount | int externalCount() | No description in source. |
latestSource | String latestSource() | No description in source. |
latestExternal | String latestExternal() | No description in source. |
noteCount | int noteCount() | No description in source. |
quietCount | int quietCount() | No description in source. |
flagsExternal | boolean flagsExternal() | No description in source. |
pump | int pump() | Read the mailbox. Returns the number of messages handled. |
takeRepaint | boolean takeRepaint() | Take-the-latch: true once per batch of changes. |
syncTo | void syncTo(int revision) | After a load fills the document directly, bring the listener level with its revision (no change message was sent for the load). |
hasExternal | boolean hasExternal() | No description in source. |
acknowledgeExternal | void acknowledgeExternal() | Forget the external flag (the user has seen it). |
statusRole | String statusRole() | No description in source. |
statusStyle | String statusStyle() | No description in source. |
statusText | String statusText() | No description in source. |
SLGuiDocReady #sleela 3.0 (lib/guidoc/SLGuiDocReady.sleela)
SLGuiDocReady class
Defines SLGuiDocReady — the readiness gate and ready lifecycle of the document GUI. Like a document-ready event, the GUI is CREATED, then CHECKING while named self-checks run, then READY (every check passed) or FAILED (the first failure is kept). Nothing may act on the GUI before it is ready. Subscribers register by name with whenReady() and take a one-shot latch once the GUI is ready; a subscriber that registers late still gets its latch. A failed gate never fires a subscriber, and begin() can retry.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
state | int state | No description in source. |
names | String[] names | No description in source. |
passedFlag | int[] passedFlag | No description in source. |
details | String[] details | No description in source. |
count | int count | No description in source. |
failures | int failures | No description in source. |
firstFailure | String firstFailure | No description in source. |
subscribers | String[] subscribers | No description in source. |
latched | int[] latched | No description in source. |
subscriberCount | int subscriberCount | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure() | No description in source. |
getState | int getState() | No description in source. |
isReady | boolean isReady() | No description in source. |
hasFailed | boolean hasFailed() | No description in source. |
checkTotal | int checkTotal() | No description in source. |
failureTotal | int failureTotal() | No description in source. |
firstFailureText | String firstFailureText() | No description in source. |
checkName | String checkName(int i) | No description in source. |
checkPassed | boolean checkPassed(int i) | No description in source. |
checkDetail | String checkDetail(int i) | No description in source. |
stateName | String stateName() | No description in source. |
begin | boolean begin() | Start (or restart) the checks. Subscribers that already fired stay fired. |
noteCheck | boolean noteCheck(String name, boolean ok, String detail) | Note one named check. Only valid while checking. A 25th check is a failure: an overflowing gate is not trusted. |
finish | boolean finish() | Close the gate: READY only if at least one check ran and none failed. |
subscriberIndex | int subscriberIndex(String name) | No description in source. |
whenReady | boolean whenReady(String name) | Register for the ready event. Late subscribers are latched at once. |
takeReady | boolean takeReady(String name) | Take-the-latch: true once per subscriber, and only once the GUI is ready. |
subscriberTotal | int subscriberTotal() | No description in source. |
SLGuiDocSpec #sleela 3.0 (lib/guidoc/SLGuiDocSpec.sleela)
SLGuiDocSpec class
Defines SLGuiDocSpec — the executable copy of gui-document.xml: the window and theme, the commands, the menus and their items (with accelerators and enabled-when conditions), the tab strip, the editor, the file dialog and the listener. The GUI is built from this spec, and tools/validate_gui_document.py fails if the XML and standard() drift. Every addition is validated and refused (fail closed) when out of vocabulary, duplicated or over a cap.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
winTitle | String winTitle | No description in source. |
winTheme | String winTheme | No description in source. |
maxTabs | int maxTabs | No description in source. |
dirtyMarker | String dirtyMarker | No description in source. |
newTabTitle | String newTabTitle | No description in source. |
editorRows | int editorRows | No description in source. |
lineNumbers | int lineNumbers | No description in source. |
readOnlyWhenUnsplit | int readOnlyWhenUnsplit | No description in source. |
sidecarSuffix | String sidecarSuffix | No description in source. |
maxLines | int maxLines | No description in source. |
maxBytes | int maxBytes | No description in source. |
listenerPort | String listenerPort | No description in source. |
flagExternal | int flagExternal | No description in source. |
readiness | String readiness | No description in source. |
release | String release | No description in source. |
mId | String[] mId | No description in source. |
mLabel | String[] mLabel | No description in source. |
mCount | int mCount | No description in source. |
iMenu | String[] iMenu | No description in source. |
iId | String[] iId | No description in source. |
iLabel | String[] iLabel | No description in source. |
iCommand | String[] iCommand | No description in source. |
iAccel | String[] iAccel | No description in source. |
iWhen | String[] iWhen | No description in source. |
iCount | int iCount | No description in source. |
cId | String[] cId | No description in source. |
cHandler | String[] cHandler | No description in source. |
cConfirm | int[] cConfirm | No description in source. |
cLock | String[] cLock | No description in source. |
cCount | int cCount | No description in source. |
tItem | String[] tItem | No description in source. |
tKind | String[] tKind | No description in source. |
tActive | String[] tActive | No description in source. |
tCount | int tCount | No description in source. |
choiceEdits | String choiceEdits | No description in source. |
kAccel | String[] kAccel | No description in source. |
kScope | String[] kScope | No description in source. |
kAction | String[] kAction | No description in source. |
kCount | int kCount | No description in source. |
refused | int refused | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure() | No description in source. |
refusedCount | int refusedCount() | No description in source. |
no | boolean no() | No description in source. |
knownTheme | boolean knownTheme(String t) | No description in source. |
knownWhen | boolean knownWhen(String w) | No description in source. |
setWindow | boolean setWindow(String title, String theme) | No description in source. |
setTabs | boolean setTabs(int max, String marker, String newTitle) | No description in source. |
setEditor | boolean setEditor(int rows, int numbers, int readOnlyUnsplit) | No description in source. |
setFileDialog | boolean setFileDialog(String suffix, int lines, int bytes) | No description in source. |
setListener | boolean setListener(String port, int external) | No description in source. |
setReadiness | boolean setReadiness(String status, String version) | The document is draft or ready. Ready is a claim that tools/ validate_gui_document.py --gate checks against the demo. |
getReadiness | String getReadiness() | No description in source. |
getRelease | String getRelease() | No description in source. |
isCertified | boolean isCertified() | No description in source. |
commandIndex | int commandIndex(String id) | No description in source. |
menuIndex | int menuIndex(String id) | No description in source. |
itemIndex | int itemIndex(String id) | No description in source. |
addCommand | boolean addCommand(String id, String handler, int confirms, String lockPolicy) | lockPolicy: allowed (runs while the system is locked), blocked (refused while locked), choice (refused while locked unless the active tab is in an editor choice session). |
addToggle | boolean addToggle(String itemId, String kind, String activeLabel) | A toggle item shows its label when the state is off and activeLabel when on. kind is lock (the system lock) or choice (an editor choice session). |
setConfirms | boolean setConfirms(String command, boolean on) | Change whether a command asks before it discards unsaved work. |
addKey | boolean addKey(String accel, String scope, String action) | A modal key: Enter or Esc, meaningful only while a dialog (ok, cancel) or a menu (close) is open. |
keyTotal | int keyTotal() | No description in source. |
keyAccelAt | String keyAccelAt(int i) | No description in source. |
keyScopeAt | String keyScopeAt(int i) | No description in source. |
keyActionAt | String keyActionAt(int i) | No description in source. |
actionForKey | String actionForKey(String accel, String scope) | No description in source. |
setLock | boolean setLock(String choiceEditsPolicy) | No description in source. |
lockPolicyOf | String lockPolicyOf(String command) | No description in source. |
toggleTotal | int toggleTotal() | No description in source. |
toggleItemAt | String toggleItemAt(int i) | No description in source. |
toggleKindAt | String toggleKindAt(int i) | No description in source. |
toggleActiveLabelAt | String toggleActiveLabelAt(int i) | No description in source. |
toggleKindOf | String toggleKindOf(String itemId) | The toggle kind of an item ("" if it is not a toggle). |
toggleLabelOf | String toggleLabelOf(String itemId) | No description in source. |
getChoiceEdits | String getChoiceEdits() | No description in source. |
choiceReverts | boolean choiceReverts() | No description in source. |
commandsWithPolicy | int commandsWithPolicy(String policy) | No description in source. |
addMenu | boolean addMenu(String id, String label) | No description in source. |
addItem | boolean addItem(String menu, String id, String label, String command, String accel, String when) | An item needs an existing menu and command, a unique id, a known enabled-when condition, and an accelerator no other item uses. |
menuTotal | int menuTotal() | No description in source. |
menuIdAt | String menuIdAt(int i) | No description in source. |
menuLabelAt | String menuLabelAt(int i) | No description in source. |
itemTotal | int itemTotal() | No description in source. |
itemMenuAt | String itemMenuAt(int i) | No description in source. |
itemIdAt | String itemIdAt(int i) | No description in source. |
itemLabelAt | String itemLabelAt(int i) | No description in source. |
itemCommandAt | String itemCommandAt(int i) | No description in source. |
itemAccelAt | String itemAccelAt(int i) | No description in source. |
itemWhenAt | String itemWhenAt(int i) | No description in source. |
commandTotal | int commandTotal() | No description in source. |
commandIdAt | String commandIdAt(int i) | No description in source. |
handlerOf | String handlerOf(String command) | No description in source. |
confirmsDiscard | boolean confirmsDiscard(String command) | No description in source. |
commandForAccel | String commandForAccel(String accel) | The command an accelerator runs, or "" if none. |
whenForCommand | String whenForCommand(String command) | The enabled-when condition of the first item that runs a command. |
getTitle | String getTitle() | No description in source. |
getTheme | String getTheme() | No description in source. |
getMaxTabs | int getMaxTabs() | No description in source. |
getDirtyMarker | String getDirtyMarker() | No description in source. |
getNewTabTitle | String getNewTabTitle() | No description in source. |
getEditorRows | int getEditorRows() | No description in source. |
showsLineNumbers | boolean showsLineNumbers() | No description in source. |
lockUnsplit | boolean lockUnsplit() | No description in source. |
getSidecarSuffix | String getSidecarSuffix() | No description in source. |
getMaxLines | int getMaxLines() | No description in source. |
getMaxBytes | int getMaxBytes() | No description in source. |
getListenerPort | String getListenerPort() | No description in source. |
flagsExternal | boolean flagsExternal() | No description in source. |
standard | int standard() | Seed the spec declared in gui-document.xml. Returns the number of seeds refused (0 when everything is consistent). |
SLGuiDocTab #sleela 3.0 (lib/guidoc/SLGuiDocTab.sleela)
SLGuiDocTab class
Defines SLGuiDocTab — one open document in the GUI: its standing document, its own dynamic observer, the white GUI listener admitted to that observer, the path it was loaded from or saved to, the saved revision (dirty means the revision moved since), the selected line and the editor scroll position. A tab opened unsplit is read-only.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
title | String title | No description in source. |
path | String path | No description in source. |
doc | SLObserverDocument doc | No description in source. |
obs | SLDocumentObserver obs | No description in source. |
savedRevision | int savedRevision | No description in source. |
readOnly | int readOnly | No description in source. |
selected | int selected | No description in source. |
viewTop | int viewTop | No description in source. |
locked | int locked | system lock: 1 while the system is locked |
choice | int choice | editor choice: 1 while an admin session may edit this tab despite the lock |
snapLines | String[] snapLines | No description in source. |
snapCount | int snapCount | No description in source. |
snapRevision | int snapRevision | No description in source. |
snapSaved | int snapSaved | No description in source. |
snapSelected | int snapSelected | No description in source. |
snapTop | int snapTop | No description in source. |
snapTaken | int snapTaken | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(String name, SLGuiDocWhite white, String listenerPort, boolean flagExternal) | No description in source. |
getTitle | String getTitle() | No description in source. |
setTitle | void setTitle(String t) | No description in source. |
getPath | String getPath() | No description in source. |
setPath | void setPath(String p) | No description in source. |
body | SLObserverDocument body() | No description in source. |
observer | SLDocumentObserver observer() | No description in source. |
isReadOnly | boolean isReadOnly() | No description in source. |
lock | void lock() | No description in source. |
selectedLine | int selectedLine() | No description in source. |
topLine | int topLine() | No description in source. |
hasSelection | boolean hasSelection() | No description in source. |
settle | void settle() | The host cycle for this tab: deliver, let the listener read, route. |
isLocked | boolean isLocked() | No description in source. |
inChoice | boolean inChoice() | No description in source. |
setLocked | void setLocked(boolean on) | Locking the tab freezes its observer, so the lock holds against any other writer too, not just the menu. |
edit | int edit(int op, int line, String text, String source) | Edit through the observer. Refused when the tab is read-only, and refused while the system is locked unless an editor choice session is running on this tab (checked here as well as in the menu, so no path around the lock). |
editAs | int editAs(int op, int line, String text, String source) | Someone else changes the document (used for external changes). While the system is locked this is refused even during an editor choice session: the exemption is for the admin editing through the GUI only. |
beginChoice | boolean beginChoice() | No description in source. |
endChoice | boolean endChoice(boolean revert) | End the session. With revert=true the document is put back exactly as it was when the session began. Returns true when something was reverted. |
isDirty | boolean isDirty() | No description in source. |
markSaved | void markSaved() | No description in source. |
select | void select(int line) | No description in source. |
clampSelection | void clampSelection() | Keep the selection on a real line after the document changed. |
ensureVisible | void ensureVisible(int rows) | Scroll so the selected line is inside a window of `rows` rows. |
loadFrom | int loadFrom(SLGuiDocFile file, String filePath, boolean lockUnsplit) | Load a file into this (still empty) tab. Returns the load code. |
saveTo | int saveTo(SLGuiDocFile file, String filePath) | Save to a path. Refused for a read-only tab. Returns the save code. |
SLGuiDocView #sleela 3.0 (lib/guidoc/SLGuiDocView.sleela)
SLGuiDocView class
Defines SLGuiDocView — the widget tree of the document GUI: the window, menu bar and menus, tab strip, editor (line gutter and rows), entry, status line and file dialog. Each node has a tag, text, white role (and so a style), visibility, enabled flag and a command; pressing a node latches it and the controller takes the latch. It is self-contained on purpose: a host walks nodeCount() / idAt() / tagAt() / textAt() / styleAt() to mount it on real widgets, and calls press(id) when one is activated.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
MAX_NODES | int MAX_NODES = 128 | No description in source. |
ids | String[] ids | No description in source. |
tags | String[] tags | No description in source. |
texts | String[] texts | No description in source. |
roles | String[] roles | No description in source. |
parents | String[] parents | No description in source. |
cmds | String[] cmds | No description in source. |
args | int[] args | No description in source. |
enabled | int[] enabled | No description in source. |
visible | int[] visible | No description in source. |
latch | int[] latch | No description in source. |
count | int count | No description in source. |
white | SLGuiDocWhite white | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure(SLGuiDocWhite look) | No description in source. |
nodeCount | int nodeCount() | No description in source. |
idAt | String idAt(int i) | No description in source. |
tagAt | String tagAt(int i) | No description in source. |
textAt | String textAt(int i) | No description in source. |
roleAt | String roleAt(int i) | The white role of a node and the style string made from it. |
styleAt | String styleAt(int i) | No description in source. |
parentAt | String parentAt(int i) | No description in source. |
commandAt | String commandAt(int i) | No description in source. |
argAt | int argAt(int i) | No description in source. |
visibleAt | boolean visibleAt(int i) | No description in source. |
enabledAt | boolean enabledAt(int i) | No description in source. |
indexOf | int indexOf(String id) | No description in source. |
add | boolean add(String parent, String tag, String id, String text, String role) | No description in source. |
bind | void bind(String id, String command, int arg) | No description in source. |
setText | void setText(String id, String t) | No description in source. |
textOf | String textOf(String id) | No description in source. |
setStyle | void setStyle(String id, String role) | Give a node a white role (its style follows). |
roleOf | String roleOf(String id) | No description in source. |
styleOf | String styleOf(String id) | No description in source. |
setVisible | void setVisible(String id, boolean on) | No description in source. |
isVisible | boolean isVisible(String id) | No description in source. |
setEnabled | void setEnabled(String id, boolean on) | No description in source. |
isEnabled | boolean isEnabled(String id) | No description in source. |
type | void type(String id, String t) | A host reports the user typed into an entry. |
press | boolean press(String id) | A host reports a node was activated. Only an enabled, visible node with a command latches; anything else is ignored. |
takePress | int takePress() | Take one latched press (the lowest node index), or -1 when idle. |
clearPresses | void clearPresses() | No description in source. |
SLGuiDocWhite #sleela 3.0 (lib/guidoc/SLGuiDocWhite.sleela)
SLGuiDocWhite class
Defines SLGuiDocWhite — the white look of the document GUI. It takes the White flavor of the standard UI themes (lib/ui SLThemeFlavor: off-white background, white surfaces, dark ink, a single blue accent) and answers a style string for each role the GUI draws (window, menubar, tab, editor row, status, dialog ...). Every widget style in the document GUI comes from here, so the whole GUI stays white and consistent.
Fields — the named values this unit stores.
| Field | Declaration | What it holds |
|---|---|---|
theme | SLStandardTheme theme | No description in source. |
Methods — the actions this unit can perform.
| Method | Signature | What it does |
|---|---|---|
configure | void configure() | No description in source. |
standardTheme | SLStandardTheme standardTheme() | No description in source. |
isWhite | boolean isWhite() | No description in source. |
name | String name() | No description in source. |
accentColor | String accentColor() | No description in source. |
roleAt | String roleAt(int i) | Every role the GUI draws, in a fixed order. |
roleTotal | int roleTotal() | No description in source. |
bgOf | String bgOf(String role) | The background colour token of a role. Unknown roles use the surface. |
fgOf | String fgOf(String role) | The foreground (ink) colour token of a role. |
style | String style(String role) | The style for a role: bg:#RRGGBB;fg:#RRGGBB; |
roleOfStyle | String roleOfStyle(String s) | The role a style string was made from, or "" if it is none of ours. A host uses this with bgOf and fgOf to get colour tokens without parsing text. |