Home /Modules/gui/SLGuiBackend.sleela

SLGuiBackend.sleela

lib/gui/version-mual/SLGuiBackend.sleela · 70 line(s) · sleela

<< lib/gui/version-mual/SLGuiBackend.sleela
   SLeeLa Standard Library Definition.
   Definition: Defines SLGuiBackend — the toolkit-neutral GUI backend identity.
     Mirrors SleelaGui.create(backend) in gui/: a backend is "swing", "javafx"
     (alias "fx"), or "native" (the C ABI bridge). SLeeLa names the backend; the
     Java host or the native bridge supplies the actual desktop controls. >>
#sleela 2.5
material;
< SLeeLa gui front-end contract — toolkit-neutral backend selector. >
< Family: gui. The chosen backend is realized by the Java host (Swing/JavaFX) >
< or by the native bridge; SLeeLa only expresses the intent. >
class SLGuiBackend {
  < ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- >
  << Eleven catalogued attributes with getter/setter pairs, so a GUI, loader,
     or catalog can read and (where appropriate) override this record.
     Values are faithful to the subject's real origin where publicly known. >>
  String metaVersion = "1.0.0";
  int metaId = 11336;
  String metaAuthor = "Kiro Agent";
  String metaDate = "2026-10-19";
  String metaCopyright = "SLeeLa project";
  String metaTrademark = "none";
  String metaCorporation = "none";
  < metaOrigin: National | <nation> | International | Galactic >
  String metaOrigin = "International";
  String metaBirthDate = "2026-10-16";
  < metaScienceRating: maturity/robustness on a 1..10 scale >
  int metaScienceRating = 9;
  < metaNationalSchedule: a real, citable instrument or "none" >
  String metaNationalSchedule = "none";

  String getMetaVersion() { return metaVersion; }
  void setMetaVersion(String v) { metaVersion = v; }
  int getMetaId() { return metaId; }
  void setMetaId(int v) { metaId = v; }
  String getAuthor() { return metaAuthor; }
  void setAuthor(String v) { metaAuthor = v; }
  String getDate() { return metaDate; }
  void setDate(String v) { metaDate = v; }
  String getCopyright() { return metaCopyright; }
  void setCopyright(String v) { metaCopyright = v; }
  String getTrademark() { return metaTrademark; }
  void setTrademark(String v) { metaTrademark = v; }
  String getCorporation() { return metaCorporation; }
  void setCorporation(String v) { metaCorporation = v; }
  String getOrigin() { return metaOrigin; }
  void setOrigin(String v) { metaOrigin = v; }
  String getBirthDate() { return metaBirthDate; }
  void setBirthDate(String v) { metaBirthDate = v; }
  int getScienceRating() { return metaScienceRating; }
  void setScienceRating(int v) { metaScienceRating = v; }
  String getNationalSchedule() { return metaNationalSchedule; }
  void setNationalSchedule(String v) { metaNationalSchedule = v; }
  < "swing" | "javafx" | "fx" | "native" >
  String kind;
  void configure(String k) { kind = k; }
  String name() { return kind; }
  < A backend is supported when it is one of the known toolkits/bridges. >
  boolean supported() {
    return kind == "swing" || kind == "javafx" || kind == "fx" || kind == "native";
  }
  boolean isSwing() { return kind == "swing"; }
  boolean isJavaFx() { return kind == "javafx" || kind == "fx"; }
  boolean isNative() { return kind == "native"; }
  < Normalized label: the "fx" alias resolves to "javafx". >
  String resolved() { return kind == "fx" ? "javafx" : kind; }
  < 1.0 compatibility: JavaFX/native can request host-native menus; Swing uses custom widgets. >
  boolean supportsNativeMenus() { return isNative() || isJavaFx(); }
}