1
0
Fork 0
tinmop/src/gui/client/icons.lisp

105 lines
3.5 KiB
Common Lisp
Raw Normal View History

(in-package :icons)
(a:define-constant +icon-dir+ "/data/icons/" :test #'string=)
(a:define-constant +search+ "fmw_search" :test #'string=)
(a:define-constant +back+ "fmw_back" :test #'string=)
2023-02-05 14:57:31 +01:00
(a:define-constant +go+ "fmw_go" :test #'string=)
2023-02-05 14:57:31 +01:00
(a:define-constant +open-tour+ "fmw_open_tour" :test #'string=)
2023-02-05 14:57:31 +01:00
(a:define-constant +refresh+ "fmw_refresh" :test #'string=)
2023-02-05 14:57:31 +01:00
(a:define-constant +up+ "fmw_uparrow" :test #'string=)
2023-02-18 13:02:56 +01:00
(a:define-constant +document-delete+ "fmw_document-delete" :test #'string=)
2023-02-05 14:57:31 +01:00
(a:define-constant +document-add+ "fmw_document-add" :test #'string=)
(a:define-constant +document-accept+ "fmw_document-accept" :test #'string=)
(a:define-constant +document-edit+ "fmw_document-edit" :test #'string=)
(a:define-constant +folder+ "fmw_folder" :test #'string=)
2023-02-05 14:57:31 +01:00
(a:define-constant +star-yellow+ "fmw_star-yellow.png" :test #'string=)
(a:define-constant +star-blue+ "fmw_star-blue.png" :test #'string=)
(a:define-constant +arrow-up+ "fmw_arrow-up" :test #'string=)
(a:define-constant +arrow-down+ "fmw_arrow-down" :test #'string=)
(a:define-constant +cross+ "fmw_cross" :test #'string=)
(a:define-constant +bus-go+ "fmw_bus-go" :test #'string=)
(a:define-constant +dice+ "fmw_dice" :test #'string=)
(defparameter *search* nil)
2023-02-05 14:57:31 +01:00
(defparameter *back* nil)
2023-02-05 14:57:31 +01:00
(defparameter *open-iri* nil)
(defparameter *open-tour* nil)
(defparameter *refresh* nil)
(defparameter *up* nil)
(defparameter *document-delete* nil)
(defparameter *document-add* nil)
2023-02-18 13:02:56 +01:00
(defparameter *document-accept* nil)
(defparameter *document-edit* nil)
(defparameter *folder* nil)
(defparameter *star-yellow* nil)
(defparameter *star-blue* nil)
(defparameter *arrow-up* nil)
(defparameter *arrow-down* nil)
(defparameter *cross* nil)
(defparameter *bus-go* nil)
(defparameter *dice* nil)
(defun load-icon (filename)
(let ((path (if (not (re:scan "(?i)png$" filename))
(res:get-data-file (fs:cat-parent-dir +icon-dir+
(strcat filename ".png")))
(res:get-data-file (fs:cat-parent-dir +icon-dir+ filename)))))
(with-open-file (stream path :element-type '(unsigned-byte 8))
(let ((data (gui-utils:read-into-array stream (file-length stream))))
(gui:make-image data)))))
(defun load-icons ()
(setf *search* (load-icon +search+))
(setf *back* (load-icon +back+))
(setf *open-iri* (load-icon +go+))
(setf *open-tour* (load-icon +open-tour+))
(setf *refresh* (load-icon +refresh+))
(setf *up* (load-icon +up+))
(setf *document-delete* (load-icon +document-delete+))
(setf *document-add* (load-icon +document-add+))
(setf *document-accept* (load-icon +document-accept+))
(setf *document-edit* (load-icon +document-edit+))
(setf *folder* (load-icon +folder+))
(setf *star-yellow* (load-icon +star-yellow+))
(setf *star-blue* (load-icon +star-blue+))
(setf *arrow-up* (load-icon +arrow-up+))
(setf *arrow-down* (load-icon +arrow-down+))
(setf *cross* (load-icon +cross+))
(setf *bus-go* (load-icon +bus-go+))
(setf *dice* (load-icon +dice+)))