From 960336af94a4e438de99f2893160735fed55f532 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 16 Apr 2021 08:45:34 -0400 Subject: Add beginnings of a graphical user interface widget module. --- Makefile.am | 1 + starling/gui.scm | 485 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 486 insertions(+) create mode 100644 starling/gui.scm diff --git a/Makefile.am b/Makefile.am index aa89d2c..22c997f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -50,6 +50,7 @@ SOURCES = \ starling/minibuffer.scm \ starling/kernel.scm \ starling/node-2d.scm \ + starling/gui.scm \ starling/transition.scm EXTRA_DIST += \ diff --git a/starling/gui.scm b/starling/gui.scm new file mode 100644 index 0000000..614dfc0 --- /dev/null +++ b/starling/gui.scm @@ -0,0 +1,485 @@ +;;; Starling Game Engine +;;; Copyright © 2019 David Thompson +;;; +;;; This program is free software: you can redistribute it and/or +;;; modify it under the terms of the GNU General Public License as +;;; published by the Free Software Foundation, either version 3 of the +;;; License, or (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;;; General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with Starling. If not, see . + +;;; Commentary: +;; +;; 2D Graphical User Interface +;; +;;; Code: + +(define-module (starling gui) + #:use-module (chickadee config) + #:use-module (chickadee graphics color) + #:use-module (chickadee graphics font) + #:use-module (chickadee graphics texture) + #:use-module (chickadee math vector) + #:use-module (ice-9 match) + #:use-module (oop goops) + #:use-module (srfi srfi-1) + #:use-module (starling asset) + #:use-module (starling config) + #:use-module (starling node) + #:use-module (starling node-2d) + #:use-module (starling scene) + #:export ( + settings + theme-ref + define-theme + current-theme + + focused? + hover? + left-pressed? + right-pressed? + middle-pressed? + add-listener + remove-listener + notify + mouse-enter + mouse-exit + mouse-press + mouse-click + + + + + + left-margin + right-margin + bottom-margin + top-margin +