From 9264c826689c05ab84c789d3fdf381a7c7e31071 Mon Sep 17 00:00:00 2001
From: David Botton
Date: Wed, 30 Dec 2020 19:05:58 -0500
Subject: [PATCH] Added screen object as part of CLOG-Window
---
clog-window.lisp | 70 ++++++++++++++++++++++++++++++++++++++++++++
clog.lisp | 28 +++++++++++-------
doc/clog-manual.html | 66 ++++++++++++++++++++++++++++++++++++++---
3 files changed, 150 insertions(+), 14 deletions(-)
diff --git a/clog-window.lisp b/clog-window.lisp
index 3a30508..2c75266 100644
--- a/clog-window.lisp
+++ b/clog-window.lisp
@@ -196,6 +196,76 @@ window."))
(defmethod pixel-ratio ((obj clog-window))
(query obj "devicePixelRatio"))
+;;;;;;;;;;;;;;;;;;
+;; screen-width ;;
+;;;;;;;;;;;;;;;;;;
+
+(defgeneric screen-width (clog-window)
+ (:documentation "Get screen width."))
+
+(defmethod screen-width ((obj clog-window))
+ (query obj "screen.width"))
+
+;;;;;;;;;;;;;;;;;;;
+;; screen-height ;;
+;;;;;;;;;;;;;;;;;;;
+
+(defgeneric screen-height (clog-window)
+ (:documentation "Get screen height."))
+
+(defmethod screen-height ((obj clog-window))
+ (query obj "screen.height"))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; screen-available-width ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defgeneric screen-available-width (clog-window)
+ (:documentation "Get available screen width."))
+
+(defmethod screen-available-width ((obj clog-window))
+ (query obj "screen.availWidth"))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; screen-available-height ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defgeneric screen-available-height (clog-window)
+ (:documentation "Get available screen height."))
+
+(defmethod screen-available-height ((obj clog-window))
+ (query obj "screen.availHeight"))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; screen-available-left ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defgeneric screen-available-left (clog-window)
+ (:documentation "Get available screen left."))
+
+(defmethod screen-available-left ((obj clog-window))
+ (query obj "screen.availLeft"))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; screen-available-top ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defgeneric screen-available-top (clog-window)
+ (:documentation "Get available screen top."))
+
+(defmethod screen-available-top ((obj clog-window))
+ (query obj "screen.availTop"))
+
+;;;;;;;;;;;;;;;;;;;;;;;;
+;; screen-color-depth ;;
+;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defgeneric screen-color-depth (clog-window)
+ (:documentation "Get screen color depth."))
+
+(defmethod screen-color-depth ((obj clog-window))
+ (query obj "screen.colorDepth"))
+
;;;;;;;;;;;
;; alert ;;
;;;;;;;;;;;
diff --git a/clog.lisp b/clog.lisp
index 6b6d881..ba05363 100644
--- a/clog.lisp
+++ b/clog.lisp
@@ -123,16 +123,23 @@ application."
(clog-window class)
"CLOG-Window - Properties"
- (window-name generic-function)
- (inner-height generic-function)
- (inner-width generic-function)
- (outer-height generic-function)
- (outer-width generic-function)
- (x-offset generic-function)
- (y-offset generic-function)
- (left generic-function)
- (top generic-function)
- (pixel-ratio generic-function)
+ (window-name generic-function)
+ (inner-height generic-function)
+ (inner-width generic-function)
+ (outer-height generic-function)
+ (outer-width generic-function)
+ (x-offset generic-function)
+ (y-offset generic-function)
+ (left generic-function)
+ (top generic-function)
+ (pixel-ratio generic-function)
+ (screen-width generic-function)
+ (screen-height generic-function)
+ (screen-available-width generic-function)
+ (screen-available-height generic-function)
+ (screen-available-top generic-function)
+ (screen-available-left generic-function)
+ (screen-color-depth generic-function)
"CLOG-Window - Methods"
(alert generic-function)
@@ -182,6 +189,7 @@ application."
"CLOG-Navigator - CLOG Navigator Objects"
(clog-navigator class)
+ "CLOG-Navigator - Properties"
(cookie-enabled generic-function)
(language generic-function)
(user-agent generic-function)
diff --git a/doc/clog-manual.html b/doc/clog-manual.html
index 95a4650..e70923b 100644
--- a/doc/clog-manual.html
+++ b/doc/clog-manual.html
@@ -711,6 +711,62 @@ window.
Get device pixel ratio.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
CLOG-Window - Methods
@@ -1141,10 +1197,12 @@ is nil unbind the event.
CLOG Navigator Objects encapsulate the navigator.
+CLOG-Navigator - Properties
+
@@ -1152,7 +1210,7 @@ is nil unbind the event.
-[generic-function] LANGUAGE CLOG-LOCATION
+[generic-function] LANGUAGE CLOG-NAVIGATOR
Get user prefered language.
@@ -1160,7 +1218,7 @@ is nil unbind the event.
@@ -1168,7 +1226,7 @@ is nil unbind the event.