diff --git a/clog.asd b/clog.asd index 428d49e..ce7effc 100644 --- a/clog.asd +++ b/clog.asd @@ -1,10 +1,16 @@ -;;;; clog.asd +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; CLOG - The Common Lisp Omnificent GUI ;;;; +;;;; (c) 2020-2024 David Botton ;;;; +;;;; License BSD 3 Clause ;;;; +;;;; ;;;; +;;;; clog.asd ;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (asdf:defsystem #:clog - :description "The Common Lisp Omnificent GUI" + :description "CLOG - The Common Lisp Omnificent GUI" :author "David Botton " :license "BSD" - :version "1.6.0" + :version "1.9.0" :serial t :depends-on (#:clack #:websocket-driver #:alexandria #:hunchentoot #:cl-ppcre #:bordeaux-threads #:trivial-open-browser #:parse-float #:quri @@ -14,41 +20,52 @@ :components ((:module "static-files" :components ((:static-file "js/boot.js"))) (:module "source" - :components ((:file "asdf-ext") + :components (;; ASDF Extension for CLOG Panel files + (:file "asdf-ext") + ;; Connectivity (:file "clog-connection") (:file "clog-connection-websockets") + ;; CLOG Framework (:file "clog") + (:file "clog-system") (:file "clog-utilities") + ;; Base System (:file "clog-base") (:file "clog-element") (:file "clog-jquery") - (:file "clog-element-common") - (:file "clog-style") - (:file "clog-canvas") - (:file "clog-webgl") - (:file "clog-form") - (:file "clog-multimedia") - (:file "clog-window") + ;; DOM Elements + (:file "clog-body") (:file "clog-document") + (:file "clog-window") (:file "clog-location") (:file "clog-navigator") - (:file "clog-body") - (:file "clog-system") + (:file "clog-style") + ;; HTML Elements + (:file "clog-element-common") + (:file "clog-form") + (:file "clog-multimedia") + (:file "clog-canvas") + (:file "clog-webgl") + ;; CLOG Extensions (:file "clog-panel") (:file "clog-presentations") (:file "clog-data") (:file "clog-dbi") (:file "clog-auth") - (:file "clog-gui") + ;; W3CSS Bindings (:file "clog-web") (:file "clog-web-dbi") (:file "clog-web-themes") + ;; Desktop Environment + (:file "clog-gui") + ;; CLOG Programming Tools (:file "clog-helpers"))))) (asdf:defsystem #:clog/docs :depends-on (#:clog #:3BMD #:colorize) :pathname "source/" - :components ((:file "clog-docs"))) + :components (;; CLOG documentation creation utils and additional documentation + (:file "clog-docs"))) (asdf:defsystem #:clog/tools :depends-on (#:clog #:clog-ace #:clog-terminal #:s-base64 #:swank @@ -56,17 +73,6 @@ :pathname "tools/" :components (;; clog-db-admin app (:file "clog-db-admin") - ;; clog-builder generated clode - (:file "clog-templates") - (:file "image-to-data") - (:file "quick-start") - (:file "threads") - (:file "systems") - (:file "sys-browser") - (:file "projects") - (:file "project-directory") - (:file "clog-builder-repl") - (:file "dir-view") ;; clog-builder code (:file "clog-builder-settings") (:file "clog-builder") @@ -75,4 +81,15 @@ (:file "clog-builder-asdf-browser") (:file "clog-builder-sys-browser") (:file "clog-builder-dir-win") - (:file "clog-builder-images"))) + (:file "clog-builder-images") + ;; clog-builder panels (post-render) + (:file "panel-clog-templates") + (:file "panel-image-to-data") + (:file "panel-quick-start") + (:file "panel-threads") + (:file "panel-systems") + (:file "panel-sys-browser") + (:file "panel-projects") + (:file "panel-project-directory") + (:file "panel-clog-builder-repl") + (:file "panel-dir-view"))) diff --git a/source/asdf-ext.lisp b/source/asdf-ext.lisp index a0267dc..bb5b34e 100644 --- a/source/asdf-ext.lisp +++ b/source/asdf-ext.lisp @@ -1,3 +1,12 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; CLOG - The Common Lisp Omnificent GUI ;;;; +;;;; (c) David Botton ;;;; +;;;; ;;;; +;;;; asdf-ext.lisp ;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;; Extension to asdf to handle clog panel files + (in-package :asdf) (defclass clog-file (asdf:doc-file) ((type :initform "clog"))) diff --git a/source/clog-auth.lisp b/source/clog-auth.lisp index 810890c..c90371c 100644 --- a/source/clog-auth.lisp +++ b/source/clog-auth.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-auth.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-base.lisp b/source/clog-base.lisp index 8141184..dfec400 100644 --- a/source/clog-base.lisp +++ b/source/clog-base.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-base.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -54,7 +53,7 @@ lisp and an HTML DOM element.")) ;;;;;;;;;;;;; (defgeneric html-id (clog-obj) - (:documentation "Internal html-id of CLOG-Obj. (Internal)")) + (:documentation "Internal html-id of clog-obj. (Internal)")) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; connection-data-mutex ;; @@ -76,7 +75,7 @@ lisp and an HTML DOM element.")) ;;;;;;;;;;;;;;; (defgeneric script-id (clog-obj) - (:documentation "Return the script id for OBJ based on the html-id set + (:documentation "Return the script id for CLOG-OBJ based on the html-id set during attachment. (Private)")) (defmethod script-id ((obj clog-obj)) @@ -99,8 +98,9 @@ during attachment. (Private)")) ;;;;;;;;;;;;;;;; (defgeneric js-execute (clog-obj script) - (:documentation "Execure SCRIPT on browser. Result is -discarded, return CLOG-OBJ. (Internal)")) + (:documentation "Execute JavaScript SCRIPT on browser. CLOG-OBJ is used to +obtain the connection the script should run on. Result is discarded, return +CLOG-OBJ. (Internal)")) (defmethod js-execute ((obj clog-obj) script) (cached-execute (connection-id obj) script) @@ -111,7 +111,8 @@ discarded, return CLOG-OBJ. (Internal)")) ;;;;;;;;;;;;;; (defgeneric js-query (clog-obj script &key default-answer) - (:documentation "Execure SCRIPT on browser and return result. (Internal)")) + (:documentation "Execute JavaScript SCRIPT on browser and return result. +CLOG-OBJ us used to obtain the connection the script should run on. (Internal)")) (defmethod js-query ((obj clog-obj) script &key (default-answer nil)) (flush-connection-cache obj) @@ -134,7 +135,7 @@ flushed with FLUSH-CONNECTION-CACHE or a query is made." ;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun flush-connection-cache (clog-obj) - "Flush connection cache if on." + "Flush connection cache if on CLOG-OBJ is located on." (when *connection-cache* (dolist (script (reverse *connection-cache*)) (unless (eq script :cache) @@ -146,8 +147,8 @@ flushed with FLUSH-CONNECTION-CACHE or a query is made." ;;;;;;;;;;;;; (defgeneric execute (clog-obj method) - (:documentation "Execute the JavaScript METHOD on OBJ. Result is -discarded. see JQUERY-EXECUTE (Internal)")) + (:documentation "Execute the JavaScript METHOD on OBJ. Returns +CLOG-OBJ. see JQUERY-EXECUTE (Internal)")) (defmethod execute ((obj clog-obj) method) (js-execute obj (format nil "~A.~A" (script-id obj) method))) @@ -347,7 +348,7 @@ result or if time out DEFAULT-ANSWER. see JQUERY-QUERY (Internal)")) post-eval cancel-event one-time) - (:documentation "Create the hook for incoming events. (Private)")) + (:documentation "Create the low-level hook for incoming events. (Private)")) (defmethod set-event ((obj clog-obj) event handler &key (call-back-script "") @@ -468,45 +469,19 @@ result or if time out DEFAULT-ANSWER. see JQUERY-QUERY (Internal)")) (defgeneric connection-data (clog-obj) (:documentation "Get connection-data that is associated with -clog-obj that will persist regardless of thread. The event hooks -are stored in this string based hash in the format of: +clog-obj's connection that will persist regardless of thread calling. +The event hooks are stored in this string based hash in the format of: \"html-id:event-name\" => #'event-handler. clog-* keys are reserved -for internal use of clog. The key \"clog-body\" is set to the -clog-body of this connection and accessible with CONNECTION-BODY.")) +for internal use of clog. + +The following default keys are set: +\"clog-body\" clog-body of this connection, see CONNECTION-BODY +\"clog-path\" html path used, see CONNECTION-PATH +\"clog-sync\" sempaphore used for syncing events, see CONNECTION-SYNC")) (defmethod connection-data ((obj clog-obj)) (clog-connection:get-connection-data (connection-id obj))) -;;;;;;;;;;;;;;;;;;;;; -;; connection-body ;; -;;;;;;;;;;;;;;;;;;;;; - -(defgeneric connection-body (clog-obj) - (:documentation "Get connection's clog-body.")) - -(defmethod connection-body (clog-obj) - (connection-data-item clog-obj "clog-body")) - -;;;;;;;;;;;;;;;;;;;;; -;; connection-sync ;; -;;;;;;;;;;;;;;;;;;;;; - -(defgeneric connection-sync (clog-obj) - (:documentation "Get connection's clog-sync for optional syncing events.")) - -(defmethod connection-sync (clog-obj) - (connection-data-item clog-obj "clog-sync")) - -;;;;;;;;;;;;;;;;;;;;; -;; with-sync-event ;; -;;;;;;;;;;;;;;;;;;;;; - -(defmacro with-sync-event ((clog-obj) &body body) - "Place at start of event to serialize access to the event. All events in -an application share per connection the same queue of serialized events." - `(bordeaux-threads:with-lock-held (,`(connection-sync ,clog-obj)) - ,@body)) - ;;;;;;;;;;;;;;;;;;;;;;;;;; ;; connection-data-item ;; ;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -527,6 +502,10 @@ an application share per connection the same queue of serialized events." (setf (gethash item-name (connection-data obj)) value))) value) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; remove-connection-data-item ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (defgeneric remove-connection-data-item (clog-obj item-name) (:documentation "Remove item-name from connection-data.")) @@ -535,6 +514,46 @@ an application share per connection the same queue of serialized events." (ignore-errors (remhash item-name (connection-data obj))))) +;;;;;;;;;;;;;;;;;;;;; +;; connection-body ;; +;;;;;;;;;;;;;;;;;;;;; + +(defgeneric connection-body (clog-obj) + (:documentation "Get connection's clog-body.")) + +(defmethod connection-body (clog-obj) + (connection-data-item clog-obj "clog-body")) + +;;;;;;;;;;;;;;;;;;;;; +;; connection-path ;; +;;;;;;;;;;;;;;;;;;;;; + +(defgeneric connection-path (clog-obj) + (:documentation "Get the HTML passed used to make the connection.")) + +(defmethod connection-path (clog-obj) + (connection-data-item clog-obj "clog-path")) + +;;;;;;;;;;;;;;;;;;;;; +;; connection-sync ;; +;;;;;;;;;;;;;;;;;;;;; + +(defgeneric connection-sync (clog-obj) + (:documentation "Get connection's clog-sync for optional syncing events.")) + +(defmethod connection-sync (clog-obj) + (connection-data-item clog-obj "clog-sync")) + +;;;;;;;;;;;;;;;;;;;;; +;; with-sync-event ;; +;;;;;;;;;;;;;;;;;;;;; + +(defmacro with-sync-event ((clog-obj) &body body) + "Place at start of event to serialize access to the event. All events in +an application share per connection the same queue of serialized events." + `(bordeaux-threads:with-lock-held (,`(connection-sync ,clog-obj)) + ,@body)) + ;;;;;;;;;;;;;;;;;; ;; set-on-event ;; ;;;;;;;;;;;;;;;;;; @@ -556,7 +575,6 @@ nil unbind all event handlers. (Internal)")) :cancel-event cancel-event :one-time one-time)) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; set-on-event-with-data ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-body.lisp b/source/clog-body.lisp index 0f9b65a..c778d26 100644 --- a/source/clog-body.lisp +++ b/source/clog-body.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-window.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-canvas.lisp b/source/clog-canvas.lisp index d4f55b0..f6406ae 100644 --- a/source/clog-canvas.lisp +++ b/source/clog-canvas.lisp @@ -1,13 +1,14 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2021 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-canvas.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (cl:in-package :clog) +;;; Canvas and 2d Context, for 3d WebGL2 context see clog-webgl.lisp + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Implementation - clog-canvas ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-connection-websockets.lisp b/source/clog-connection-websockets.lisp index 2bea65c..e685d6f 100644 --- a/source/clog-connection-websockets.lisp +++ b/source/clog-connection-websockets.lisp @@ -1,11 +1,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2024 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-connection-websockets.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Specific implementation using websockets and long polling + (in-package :clog-connection) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-data.lisp b/source/clog-data.lisp index 869495a..7683e1f 100644 --- a/source/clog-data.lisp +++ b/source/clog-data.lisp @@ -1,14 +1,14 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-data.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (cl:in-package :clog) -;;; Various functions for binding data +;;; Various functions for binding data between lisp objects and panels, +;;; particularly useful for database binding ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Implementation - data load and write from objects diff --git a/source/clog-dbi.lisp b/source/clog-dbi.lisp index 6e2c5ed..aa73abe 100644 --- a/source/clog-dbi.lisp +++ b/source/clog-dbi.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-dbi.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-docs.lisp b/source/clog-docs.lisp index e1228a8..671b6b3 100644 --- a/source/clog-docs.lisp +++ b/source/clog-docs.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2021 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-docs.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-document.lisp b/source/clog-document.lisp index aa24816..73f51df 100644 --- a/source/clog-document.lisp +++ b/source/clog-document.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-document.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-element-common.lisp b/source/clog-element-common.lisp index c423555..c39abda 100644 --- a/source/clog-element-common.lisp +++ b/source/clog-element-common.lisp @@ -1,13 +1,14 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-element-commont.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (cl:in-package :clog) +;; Common HTML Elements + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Implementation - clog-a ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-element.lisp b/source/clog-element.lisp index 56a26cd..a255f62 100644 --- a/source/clog-element.lisp +++ b/source/clog-element.lisp @@ -1,14 +1,13 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-element.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (cl:in-package :clog) -;;; clog-elements represent the base object for visual html elements. +;;; clog-elements represent the base object for html elements. (defvar *store-new-objects* nil "Dynamic variable that when true every create-* or attach-* will also @@ -40,11 +39,11 @@ element objects.")) (defun create-with-html (connection-id html &key (clog-type 'clog-element) (html-id nil)) - "Create a new clog-element and attach it to HTML on + "Low-level create a new CLOG-ELEMENT and attach it to HTML element on CONNECTION-ID. There must be a single outer block that will be set to -an internal id. The returned CLOG-Element requires placement or will +an internal id. The returned CLOG-ELEMENT requires placement or will not be visible, ie. place-after, etc. as it exists in the javascript -clog array but is not in the DOM. If HTML-ID is nil one is generated. +clog array but is not in the DOM. If HTML-ID is nil, one is generated. (private)" (let ((web-id (if html-id html-id @@ -60,7 +59,7 @@ clog array but is not in the DOM. If HTML-ID is nil one is generated. ;;;;;;;;;;;; (defun attach (connection-id html-id) - "Create a new clog-obj and attach an existing element with HTML-ID on + "Create a new CLOG-OBJ and attach an existing element with HTML-ID on CONNECTION-ID to it and then return it. The HTML-ID must be unique. (private)" (cached-execute connection-id (format nil "clog['~A']=$('#~A').get(0)" html-id html-id)) @@ -112,7 +111,7 @@ possible tag and keywords.")) ;;;;;;;;;;;;;;;;;; (defgeneric create-child (clog-obj html &key html-id auto-place clog-type) - (:documentation "Create a new CLOG-Element or sub-type of CLOG-TYPE from HTML + (:documentation "Create a new CLOG-ELEMENT or sub-type of CLOG-TYPE from HTML as child of CLOG-OBJ and if :AUTO-PLACE (default t) place-inside-bottom-of CLOG-OBJ. If HTML-ID is nil one will be generated.")) @@ -298,7 +297,6 @@ after attachment is changed to one unique to this session.")) (jquery-execute obj (format nil "append(document.createTextNode('~A'))" (escape-string text))) text) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Properties - clog-element ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-form.lisp b/source/clog-form.lisp index f4051d5..14cbe4b 100644 --- a/source/clog-form.lisp +++ b/source/clog-form.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-form.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-gui.lisp b/source/clog-gui.lisp index d6484f3..d34543a 100644 --- a/source/clog-gui.lisp +++ b/source/clog-gui.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-gui.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -11,7 +10,7 @@ ;;; does not require additional components outside of the css file. In addition ;;; clog-gui uses jQueryUI and its default css file to provide client side ;;; movement when needed, if client side movement is not used it is possible -;;; to pass nil to the initilization function for both. +;;; to pass nil to the initilization function for both the js and css. (mgl-pax:define-package :clog-gui (:documentation "CLOG-GUI a desktop GUI abstraction for CLOG") diff --git a/source/clog-helpers.lisp b/source/clog-helpers.lisp index 1ab0461..008a4b3 100644 --- a/source/clog-helpers.lisp +++ b/source/clog-helpers.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-helpers.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-jquery.lisp b/source/clog-jquery.lisp index 85ec47d..b27f54f 100644 --- a/source/clog-jquery.lisp +++ b/source/clog-jquery.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-jquery.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -55,7 +54,7 @@ Some sample jquery selectors: (defgeneric jquery-execute (clog-obj method) (:documentation "Execute the jQuery METHOD on and CLOG-OBJ. Result is -dicarded, return CLOG-OBJ.")) +dicarded, returns CLOG-OBJ.")) (defmethod jquery-execute ((obj clog-obj) method) (js-execute obj (format nil "~A.~A" (jquery obj) method))) diff --git a/source/clog-location.lisp b/source/clog-location.lisp index ddf88b6..7988e3f 100644 --- a/source/clog-location.lisp +++ b/source/clog-location.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-location.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-multimedia.lisp b/source/clog-multimedia.lisp index 56d3b21..2d65dbc 100644 --- a/source/clog-multimedia.lisp +++ b/source/clog-multimedia.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-mulitmedia.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-navigator.lisp b/source/clog-navigator.lisp index 3082274..01b50b4 100644 --- a/source/clog-navigator.lisp +++ b/source/clog-navigator.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-navigator.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-panel.lisp b/source/clog-panel.lisp index feefdb9..18aec56 100644 --- a/source/clog-panel.lisp +++ b/source/clog-panel.lisp @@ -1,15 +1,15 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-panel.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (cl:in-package :clog) -;;; clog-panels are for doing layouts, base class for pluggins and custom +;;; CLOG-PANELs are for doing layouts, base class for pluggins and custom ;;; widgets and is the base class for CLOG Builder's panels. +;;; CLOG-PANEL-BOXes are to layout a classic 5 panel layout in a panel ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Implementation - clog-panel diff --git a/source/clog-presentations.lisp b/source/clog-presentations.lisp index 967c358..3561d34 100644 --- a/source/clog-presentations.lisp +++ b/source/clog-presentations.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-presentations.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -9,9 +8,10 @@ (cl:in-package :clog) ;;; clog-presentations - link Lisp objects and CLOG objects +;;; see also clog-data.lisp ;;; -;;; set-event is the event to be fired, it must be a one parameter event time -;;; like on-focus, on-click, etc. +;;; set-event is the event to be fired, it must be a CLOG set-on-* event +;;; one parameter event with no data like on-focus, on-click, etc. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Implementation - clog-presentations diff --git a/source/clog-style.lisp b/source/clog-style.lisp index 87e95ba..39bc57a 100644 --- a/source/clog-style.lisp +++ b/source/clog-style.lisp @@ -1,13 +1,14 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-style.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (cl:in-package :clog) +;;; CSS style blocks, see clog-document.lisp for load-css + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Implementation - clog-style-block ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-system.lisp b/source/clog-system.lisp index 29cb26d..424fc03 100644 --- a/source/clog-system.lisp +++ b/source/clog-system.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-system.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-utilities.lisp b/source/clog-utilities.lisp index 0b19f85..cb3a30a 100644 --- a/source/clog-utilities.lisp +++ b/source/clog-utilities.lisp @@ -1,11 +1,12 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-utilities.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; Utilites for use with the CLOG framework + (cl:in-package :clog) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -53,36 +54,6 @@ package." (declare (ignore ,@(set-difference (mapcar #'first let-bindings) used-bindings))) ,@body))))) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Implementation - clog-group -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defclass clog-group () - ((controls - :accessor controls - :initform (make-hash-table* :test 'equalp)))) - -(defun create-group () - "Return a new CLOG-GROUP object for storing CLOG-OBJs. They are indexed by -their HTML-ID or an arbitrary NAME." - (make-instance 'clog-group)) - -(defgeneric add (clog-group clog-obj &key name) - (:documentation "Add CLOG-OBJ to a CLOG-GROUP indexed by the html-id of -CLOG-OBJ unless :NAME is set and is used instead.")) - -(defmethod add ((group clog-group) clog-obj &key (name nil)) - (let ((id (if name - name - (html-id clog-obj)))) - (setf (gethash id (controls group)) clog-obj))) - -(defgeneric obj (clog-group name) - (:documentation "Retrieve from CLOG-GROUP the CLOG-OBJ with name")) - -(defmethod obj ((group clog-group) name) - (gethash name (controls group))) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Implementation - JS Utilities ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-web-dbi.lisp b/source/clog-web-dbi.lisp index 0226454..6e457d2 100644 --- a/source/clog-web-dbi.lisp +++ b/source/clog-web-dbi.lisp @@ -1,12 +1,11 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-web-dbi.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Database components for use with clog-web-website +;; Database components for use with clog-web websites (mgl-pax:define-package :clog-web-dbi (:documentation "CLOG-WEB-DBI - dbi based website helpers") diff --git a/source/clog-web-themes.lisp b/source/clog-web-themes.lisp index 19bbd29..06928f9 100644 --- a/source/clog-web-themes.lisp +++ b/source/clog-web-themes.lisp @@ -1,12 +1,11 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-web-themes.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Built in clog-web-site themese +;; Built in clog-web-site themes (cl:in-package :clog-web) diff --git a/source/clog-web.lisp b/source/clog-web.lisp index 9306d2f..bdf5ead 100644 --- a/source/clog-web.lisp +++ b/source/clog-web.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-web.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/source/clog-webgl.lisp b/source/clog-webgl.lisp index 0cdeeac..d3a01a8 100644 --- a/source/clog-webgl.lisp +++ b/source/clog-webgl.lisp @@ -1,7 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2024 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-webgl.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -15,7 +14,6 @@ ;; Use clog-canvas to create the html element and then use ;; clog-webgl:create-webgl to obtain the WebGL2 context - (defsection @clog-webgl (:title "CLOG WebGL Objects") "CLOG-WebGL - Class for CLOG WebGL objects" (clog-webgl class) diff --git a/source/clog-window.lisp b/source/clog-window.lisp index 65a607c..f90431d 100644 --- a/source/clog-window.lisp +++ b/source/clog-window.lisp @@ -1,65 +1,14 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; -;;;; License BSD 3 Clause ;;;; +;;;; (c) David Botton ;;;; ;;;; ;;;; ;;;; clog-window.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (cl:in-package :clog) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Implementation - clog popup windows -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(defparameter *clog-popup-sync-hash* (make-hash-table :test 'equalp) - "Used for syncing clog popup window creation with the thread creating -them.") - -(defparameter *clog-popup-path* "/clogwin" - "Default URL for popup windows") - -(defun clog-popup-handler (body) - "Handle the connection of a new popup clog window (internal)" - (let ((sync (form-data-item (form-get-data body) "sync"))) - (cond (sync - (clog-popup-openned body sync)) - (t - (create-div body :content "Invalid Access"))))) - -(defun enable-clog-popup (&key (path *clog-popup-path*)) - "Enable handling of clog enabled popups" - (set-on-new-window 'clog-popup-handler :path path)) - -(defun open-clog-popup (obj &key (path *clog-popup-path*) - (add-sync-to-path t) - (sync-key (random-hex-string)) - (name "_blank") - (specs "") - (wait-timeout 10)) - "Open a new browser window/popup in most cases a tab. Since they are controlled -by clog you have full control of the new popups and are more flexible than using -open-windo. Returns the clog-body and the clog-window in the same connnection as -obj of the new window on the new connection or nil if failed within :WAIT-TIMEOUT" - (let* ((sem (bordeaux-threads:make-semaphore)) - (mpath (if add-sync-to-path - (format nil "~A?sync=~A" path sync-key) - path)) - (new-win (open-window (window (connection-body obj)) mpath :specs specs :name name))) - (setf (gethash sync-key *clog-popup-sync-hash*) sem) - (bordeaux-threads:wait-on-semaphore sem :timeout wait-timeout) - (setf sem (gethash sync-key *clog-popup-sync-hash*)) - (if (typep sem 'clog-obj) - (values sem new-win) - nil))) - -(defun clog-popup-openned (obj sync-key) - "Used to notify open-clog-popup the new popup window is ready for custom -clog-popup handlers." - (let ((sem (gethash sync-key *clog-popup-sync-hash*))) - (when sem - (setf (gethash sync-key *clog-popup-sync-hash*) (connection-body obj)) - (bordeaux-threads:signal-semaphore sem)))) +;; clog-window and clop-popup a clog based system to support child windows +;; even without browser support or premissions. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Implementation - clog-window @@ -661,3 +610,56 @@ STORAGE-TYPE. (local = persistant or session)")) (escape-string key-name) (escape-string value))) value) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Implementation - clog popup windows +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defparameter *clog-popup-sync-hash* (make-hash-table :test 'equalp) + "Used for syncing clog popup window creation with the thread creating +them.") + +(defparameter *clog-popup-path* "/clogwin" + "Default URL for popup windows") + +(defun clog-popup-handler (body) + "Handle the connection of a new popup clog window (internal)" + (let ((sync (form-data-item (form-get-data body) "sync"))) + (cond (sync + (clog-popup-openned body sync)) + (t + (create-div body :content "Invalid Access"))))) + +(defun enable-clog-popup (&key (path *clog-popup-path*)) + "Enable handling of clog enabled popups" + (set-on-new-window 'clog-popup-handler :path path)) + +(defun open-clog-popup (obj &key (path *clog-popup-path*) + (add-sync-to-path t) + (sync-key (random-hex-string)) + (name "_blank") + (specs "") + (wait-timeout 10)) + "Open a new browser window/popup in most cases a tab. Since they are controlled +by clog you have full control of the new popups and are more flexible than using +open-windo. Returns the clog-body and the clog-window in the same connnection as +obj of the new window on the new connection or nil if failed within :WAIT-TIMEOUT" + (let* ((sem (bordeaux-threads:make-semaphore)) + (mpath (if add-sync-to-path + (format nil "~A?sync=~A" path sync-key) + path)) + (new-win (open-window (window (connection-body obj)) mpath :specs specs :name name))) + (setf (gethash sync-key *clog-popup-sync-hash*) sem) + (bordeaux-threads:wait-on-semaphore sem :timeout wait-timeout) + (setf sem (gethash sync-key *clog-popup-sync-hash*)) + (if (typep sem 'clog-obj) + (values sem new-win) + nil))) + +(defun clog-popup-openned (obj sync-key) + "Used to notify open-clog-popup the new popup window is ready for custom +clog-popup handlers." + (let ((sem (gethash sync-key *clog-popup-sync-hash*))) + (when sem + (setf (gethash sync-key *clog-popup-sync-hash*) (connection-body obj)) + (bordeaux-threads:signal-semaphore sem)))) diff --git a/source/clog.lisp b/source/clog.lisp index 4a2cb69..7b2f1c9 100644 --- a/source/clog.lisp +++ b/source/clog.lisp @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG - The Common Lisp Omnificent GUI ;;;; -;;;; (c) 2020-2022 David Botton ;;;; +;;;; (c) 2020-2024 David Botton ;;;; ;;;; License BSD 3 Clause ;;;; ;;;; ;;;; ;;;; clog.lisp ;;;; @@ -15,7 +15,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (mgl-pax:define-package :clog - (:documentation "The Common List Omnificent GUI - CLOG") + (:documentation "CLOG - The Common List Omnificent GUI") (:import-from :clog-connection #:make-hash-table* #:escape-string @@ -28,6 +28,7 @@ (defmethod exportable-reference-p ((package (eql (find-package :clog))) symbol (locative-type (eql 'section)) locative-args) + "Extend mgl-pax extension for exporting CLOG" t) (defsection @clog-manual (:title "The CLOG manual") @@ -137,10 +138,11 @@ embedded in a native template application.)" (*store-new-objects* variable) (connection-data generic-function) (connection-data-item generic-function) + (remove-connection-data-item generic-function) (connection-body generic-function) + (connection-path generic-function) (connection-sync generic-function) (with-sync-event macro) - (remove-connection-data-item generic-function) (validp generic-function) (with-connection-cache macro) (flush-connection-cache function) diff --git a/tools/clog-builder-settings.lisp b/tools/clog-builder-settings.lisp index 1263d93..8aebe02 100644 --- a/tools/clog-builder-settings.lisp +++ b/tools/clog-builder-settings.lisp @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG Builder - UI Design tool for CLOG ;;;; -;;;; (c) 2020-2024 David Botton ;;;; +;;;; (c) David Botton ;;;; ;;;; License BSD 3 Clause ;;;; ;;;; ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -8,7 +8,7 @@ (in-package :clog-tools) ;; These are defaults, if the file preferences.lisp exists -;; they will be used instead +;; the values set there will be used instead ;; Open panels and files in new browser tabs by default (defparameter *open-external* nil) diff --git a/tools/clog-builder.lisp b/tools/clog-builder.lisp index e8192b4..ba2f045 100644 --- a/tools/clog-builder.lisp +++ b/tools/clog-builder.lisp @@ -3,6 +3,7 @@ ;;;; (c) 2020-2024 David Botton ;;;; ;;;; License BSD 3 Clause ;;;; ;;;; ;;;; +;;;; clog-buider.lisp ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package :clog-tools) diff --git a/tools/clog-db-admin.lisp b/tools/clog-db-admin.lisp index 5713eed..61ca025 100644 --- a/tools/clog-db-admin.lisp +++ b/tools/clog-db-admin.lisp @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; CLOG Data - Database tool for CLOG ;;;; -;;;; (c) 2020-2022 David Botton ;;;; +;;;; (c) 2020-2024 David Botton ;;;; ;;;; License BSD 3 Clause ;;;; ;;;; ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/tools/clog-builder-repl.clog b/tools/panel-clog-builder-repl.clog similarity index 100% rename from tools/clog-builder-repl.clog rename to tools/panel-clog-builder-repl.clog diff --git a/tools/clog-builder-repl.lisp b/tools/panel-clog-builder-repl.lisp similarity index 100% rename from tools/clog-builder-repl.lisp rename to tools/panel-clog-builder-repl.lisp diff --git a/tools/clog-templates.clog b/tools/panel-clog-templates.clog similarity index 100% rename from tools/clog-templates.clog rename to tools/panel-clog-templates.clog diff --git a/tools/clog-templates.lisp b/tools/panel-clog-templates.lisp similarity index 100% rename from tools/clog-templates.lisp rename to tools/panel-clog-templates.lisp diff --git a/tools/dir-view.clog b/tools/panel-dir-view.clog similarity index 100% rename from tools/dir-view.clog rename to tools/panel-dir-view.clog diff --git a/tools/dir-view.lisp b/tools/panel-dir-view.lisp similarity index 100% rename from tools/dir-view.lisp rename to tools/panel-dir-view.lisp diff --git a/tools/image-to-data.clog b/tools/panel-image-to-data.clog similarity index 100% rename from tools/image-to-data.clog rename to tools/panel-image-to-data.clog diff --git a/tools/image-to-data.lisp b/tools/panel-image-to-data.lisp similarity index 100% rename from tools/image-to-data.lisp rename to tools/panel-image-to-data.lisp diff --git a/tools/project-directory.clog b/tools/panel-project-directory.clog similarity index 100% rename from tools/project-directory.clog rename to tools/panel-project-directory.clog diff --git a/tools/project-directory.lisp b/tools/panel-project-directory.lisp similarity index 100% rename from tools/project-directory.lisp rename to tools/panel-project-directory.lisp diff --git a/tools/projects.clog b/tools/panel-projects.clog similarity index 100% rename from tools/projects.clog rename to tools/panel-projects.clog diff --git a/tools/projects.lisp b/tools/panel-projects.lisp similarity index 100% rename from tools/projects.lisp rename to tools/panel-projects.lisp diff --git a/tools/quick-start.clog b/tools/panel-quick-start.clog similarity index 100% rename from tools/quick-start.clog rename to tools/panel-quick-start.clog diff --git a/tools/quick-start.lisp b/tools/panel-quick-start.lisp similarity index 100% rename from tools/quick-start.lisp rename to tools/panel-quick-start.lisp diff --git a/tools/sys-browser.clog b/tools/panel-sys-browser.clog similarity index 100% rename from tools/sys-browser.clog rename to tools/panel-sys-browser.clog diff --git a/tools/sys-browser.lisp b/tools/panel-sys-browser.lisp similarity index 100% rename from tools/sys-browser.lisp rename to tools/panel-sys-browser.lisp diff --git a/tools/systems.clog b/tools/panel-systems.clog similarity index 100% rename from tools/systems.clog rename to tools/panel-systems.clog diff --git a/tools/systems.lisp b/tools/panel-systems.lisp similarity index 100% rename from tools/systems.lisp rename to tools/panel-systems.lisp diff --git a/tools/threads.clog b/tools/panel-threads.clog similarity index 100% rename from tools/threads.clog rename to tools/panel-threads.clog diff --git a/tools/threads.lisp b/tools/panel-threads.lisp similarity index 100% rename from tools/threads.lisp rename to tools/panel-threads.lisp