1
0
Fork 0
tinmop/src/gui/server/main-window-server-side.lisp

47 lines
1.5 KiB
Common Lisp

;; tinmop: an humble gemini and pleroma client
;; Copyright (C) 2023 cage
;; 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 this program.
;; If not, see [[http://www.gnu.org/licenses/][http://www.gnu.org/licenses/]].
(in-package :json-rpc-communication)
(defclass gemini-window ()
((metadata
:initform nil
:initarg :metadata
:accessor metadata)))
(defparameter *gemini-window* nil)
(defmethod message-window:metadata ((object gemini-window))
(slot-value object 'metadata))
(defmethod (setf message-window:metadata) (value (object gemini-window))
(setf (slot-value object 'metadata) value))
(defun init-gemini-window ()
(setf *gemini-window*
(make-instance 'gemini-window))
(gw:maybe-initialize-metadata *gemini-window*))
(defmethod gemini-window-p ((win gemini-window))
t)
(defun gemini-current-url ()
(gw:current-gemini-url *gemini-window*))
(defun gemini-pop-url-from-history ()
(gw:pop-url-from-history *gemini-window*))