Commit 535302b8 authored by David O'Toole's avatar David O'Toole

desktop stuff works

parent 097076ca
This diff is collapsed.
......@@ -126,6 +126,16 @@
(zerop (hash-table-count objects)))))
;; Initialization:1 ends here
;; Buffer resize hook
;; [[file:~/xelf/gui.org::*Buffer%20resize%20hook][Buffer resize hook:1]]
(defun resize-current-buffer-to-window ()
(resize (current-buffer) *screen-width* *screen-height*))
(add-hook '*resize-hook* #'resize-current-buffer-to-window)
;; Buffer resize hook:1 ends here
;; Buffers can't have halos or be selected
......@@ -1377,8 +1387,11 @@
(with-shell (call-next-method)))
(defmethod tap ((self buffer) x y)
(with-shell (when *menubar* (close-menus *menubar*))))
(defmethod alternate-tap ((self buffer) x y))
(with-shell (when *menubar* (close-menus *menubar*))
(let ((menus (find-instances self 'context-menu)))
(mapc #'destroy menus))))
(defmethod alternate-tap ((self buffer) x y)
(show-context-menu self))
(defmethod scroll-tap ((self buffer) x y))
(defmethod scroll-up ((self buffer)))
(defmethod scroll-down ((self buffer)))
......@@ -3159,7 +3172,7 @@ See sidebar for more commands to try.
(setf dash 1)
(setf spacing 0)))))
(defun phrasep (x) (is-a 'phrase x))
(defun phrasep (x) (typep x (find-class 'phrase)))
(defun phrase-root (phrase)
(let ((p phrase))
......@@ -3913,10 +3926,10 @@ See sidebar for more commands to try.
(defmethod draw-hover ((self text)) nil)
;; Notification bubbles:1 ends here
;; Collabsible tree browser widget
;; Collapsible tree browser widget
;; [[file:~/xelf/gui.org::*Collabsible%20tree%20browser%20widget][Collabsible tree browser widget:1]]
;; [[file:~/xelf/gui.org::*Collapsible%20tree%20browser%20widget][Collapsible tree browser widget:1]]
(defvar *tree-depth* 0)
(defmacro deeper (&rest body)
......@@ -3946,7 +3959,7 @@ See sidebar for more commands to try.
(visible :initform t)))
(defun treep (thing)
(is-a 'tree thing))
(typep thing (find-class 'tree)))
(defmethod children ((self tree)) (slot-value self 'inputs))
......@@ -4150,7 +4163,7 @@ See sidebar for more commands to try.
(mapcar #'xform item)))
item)))
(xform items)))
;; Collabsible tree browser widget:1 ends here
;; Collapsible tree browser widget:1 ends here
;; Menu widget
......@@ -4207,7 +4220,7 @@ See sidebar for more commands to try.
(defmethod alternate-tap ((self menu) x y)
(when (or (null (slot-value self 'parent))
(not (is-a 'menu (slot-value self 'parent))))
(not (typep (slot-value self 'parent) (find-class 'menu))))
(alternate-tap (slot-value self 'parent) x y)))
(defmethod tap :around ((self menu) x y)
......@@ -4313,59 +4326,3 @@ See sidebar for more commands to try.
(< top y bottom))
(draw-highlight self)))))))
;; Menu widget:1 ends here
;; Show methods definitions in Emacs :emacs:
;; [[file:~/xelf/gui.org::*Show%20methods%20definitions%20in%20Emacs][Show methods definitions in Emacs:1]]
(defmethod show-method ((self node) method)
(let ((sym (definition method (find-object self))))
(assert (symbolp sym))
(let ((name (string-upcase
(format nil "~A::~A"
(package-name (symbol-package sym))
(symbol-name sym)))))
(eval-in-emacs `(glass-show-definition ,name)))))
(defmethod show-definition ((self node))
(let ((name
(concatenate 'string
(package-name *package*)
"::"
(prototype-variable-name
(find-super-prototype-name self)))))
(message "SHOWING DEF ON CL SIDE: ~S" name)
(eval-in-emacs `(glass-show-definition ,name))))
;; Show methods definitions in Emacs:1 ends here
;; Evaluate expressions in emacs
;; [[file:~/xelf/gui.org::*Evaluate%20expressions%20in%20emacs][Evaluate expressions in emacs:1]]
(defun eval-in-emacs (expression)
(if (find-package :swank)
(let ((sym (intern "EVAL-IN-EMACS" (find-package :swank))))
(funcall sym expression))
(message "(eval-in-emacs) failed; swank/emacs not available?")))
;; Evaluate expressions in emacs:1 ends here
;; Switching between the Xelf and Emacs windows
;; [[file:~/xelf/gui.org::*Switching%20between%20the%20Xelf%20and%20Emacs%20windows][Switching between the Xelf and Emacs windows:1]]
(defmethod toggle-other-windows ((self buffer))
(glass-toggle))
(defun glass-toggle ()
(eval-in-emacs '(glass-toggle)))
(defun glass-show ()
(eval-in-emacs '(glass-show)))
(defun glass-hide ()
(eval-in-emacs '(glass-hide)))
(defun glass-show-at (x y)
(eval-in-emacs
`(glass-show :x ,x :y ,y)))
;; Switching between the Xelf and Emacs windows:1 ends here
This diff is collapsed.
standard/icon-caption.png

2.36 KB | W: | H:

standard/icon-caption.png

1.48 KB | W: | H:

standard/icon-caption.png
standard/icon-caption.png
standard/icon-caption.png
standard/icon-caption.png
  • 2-up
  • Swipe
  • Onion skin
standard/icon-document.png

2.11 KB | W: | H:

standard/icon-document.png

1.34 KB | W: | H:

standard/icon-document.png
standard/icon-document.png
standard/icon-document.png
standard/icon-document.png
  • 2-up
  • Swipe
  • Onion skin
standard/icon-empty.png

2.27 KB | W: | H:

standard/icon-empty.png

1.44 KB | W: | H:

standard/icon-empty.png
standard/icon-empty.png
standard/icon-empty.png
standard/icon-empty.png
  • 2-up
  • Swipe
  • Onion skin
standard/icon-folder.png

3.93 KB | W: | H:

standard/icon-folder.png

1.83 KB | W: | H:

standard/icon-folder.png
standard/icon-folder.png
standard/icon-folder.png
standard/icon-folder.png
  • 2-up
  • Swipe
  • Onion skin
standard/icon-grid.png

4.67 KB | W: | H:

standard/icon-grid.png

1.73 KB | W: | H:

standard/icon-grid.png
standard/icon-grid.png
standard/icon-grid.png
standard/icon-grid.png
  • 2-up
  • Swipe
  • Onion skin
standard/icon-open-folder.png

3.79 KB | W: | H:

standard/icon-open-folder.png

1.64 KB | W: | H:

standard/icon-open-folder.png
standard/icon-open-folder.png
standard/icon-open-folder.png
standard/icon-open-folder.png
  • 2-up
  • Swipe
  • Onion skin
(:name "sans-bold-oblique-8" :type :ttf :file "DejaVuSans-BoldOblique.ttf" :properties (:size 8))
(:name "sans-bold-8" :type :ttf :file "DejaVuSans-Bold.ttf" :properties (:size 8))
(:name "sans-condensed-bold-oblique-8" :type :ttf :file "DejaVuSansCondensed-BoldOblique.ttf" :properties (:size 8))
(:name "sans-condensed-bold-8" :type :ttf :file "DejaVuSansCondensed-Bold.ttf" :properties (:size 8))
(:name "sans-condensed-oblique-8" :type :ttf :file "DejaVuSansCondensed-Oblique.ttf" :properties (:size 8))
(:name "sans-condensed-8" :type :ttf :file "DejaVuSansCondensed.ttf" :properties (:size 8))
(:name "sans-extra-light-oblique-8" :type :ttf :file "DejaVuSans-ExtraLight.ttf" :properties (:size 8))
(:name "sans-mono-bold-oblique-8" :type :ttf :file "DejaVuSansMono-BoldOblique.ttf" :properties (:size 8))
(:name "sans-mono-bold-8" :type :ttf :file "DejaVuSansMono-Bold.ttf" :properties (:size 8))
(:name "sans-mono-oblique-8" :type :ttf :file "DejaVuSansMono-Oblique.ttf" :properties (:size 8))
(:name "sans-mono-8" :type :ttf :file "DejaVuSansMono.ttf" :properties (:size 8))
(:name "sans-oblique-8" :type :ttf :file "DejaVuSans-Oblique.ttf" :properties (:size 8))
(:name "sans-8" :type :ttf :file "DejaVuSans.ttf" :properties (:size 8))
(:name "serif-bold-italic-8" :type :ttf :file "DejaVuSerif-BoldItalic.ttf" :properties (:size 8))
(:name "serif-bold-8" :type :ttf :file "DejaVuSerif-Bold.ttf" :properties (:size 8))
(:name "serif-condensed-bold-italic-8" :type :ttf :file "DejaVuSerifCondensed-BoldItalic.ttf" :properties (:size 8))
(:name "serif-condensed-bold-8" :type :ttf :file "DejaVuSerifCondensed-Bold.ttf" :properties (:size 8))
(:name "serif-condensed-italic-8" :type :ttf :file "DejaVuSerifCondensed-Italic.ttf" :properties (:size 8))
(:name "serif-condensed-8" :type :ttf :file "DejaVuSerifCondensed.ttf" :properties (:size 8))
(:name "serif-italic-8" :type :ttf :file "DejaVuSerif-Italic.ttf" :properties (:size 8))
(:name "serif-8" :type :ttf :file "DejaVuSerif.ttf" :properties (:size 8))
(:name "sans-bold-oblique-9" :type :ttf :file "DejaVuSans-BoldOblique.ttf" :properties (:size 9))
(:name "sans-bold-9" :type :ttf :file "DejaVuSans-Bold.ttf" :properties (:size 9))
(:name "sans-condensed-bold-oblique-9" :type :ttf :file "DejaVuSansCondensed-BoldOblique.ttf" :properties (:size 9))
(:name "sans-condensed-bold-9" :type :ttf :file "DejaVuSansCondensed-Bold.ttf" :properties (:size 9))
(:name "sans-condensed-oblique-9" :type :ttf :file "DejaVuSansCondensed-Oblique.ttf" :properties (:size 9))
(:name "sans-condensed-9" :type :ttf :file "DejaVuSansCondensed.ttf" :properties (:size 9))
(:name "sans-extra-light-oblique-9" :type :ttf :file "DejaVuSans-ExtraLight.ttf" :properties (:size 9))
(:name "sans-mono-bold-oblique-9" :type :ttf :file "DejaVuSansMono-BoldOblique.ttf" :properties (:size 9))
(:name "sans-mono-bold-9" :type :ttf :file "DejaVuSansMono-Bold.ttf" :properties (:size 9))
(:name "sans-mono-oblique-9" :type :ttf :file "DejaVuSansMono-Oblique.ttf" :properties (:size 9))
(:name "sans-mono-9" :type :ttf :file "DejaVuSansMono.ttf" :properties (:size 9))
(:name "sans-oblique-9" :type :ttf :file "DejaVuSans-Oblique.ttf" :properties (:size 9))
(:name "sans-9" :type :ttf :file "DejaVuSans.ttf" :properties (:size 9))
(:name "serif-bold-italic-9" :type :ttf :file "DejaVuSerif-BoldItalic.ttf" :properties (:size 9))
(:name "serif-bold-9" :type :ttf :file "DejaVuSerif-Bold.ttf" :properties (:size 9))
(:name "serif-condensed-bold-italic-9" :type :ttf :file "DejaVuSerifCondensed-BoldItalic.ttf" :properties (:size 9))
(:name "serif-condensed-bold-9" :type :ttf :file "DejaVuSerifCondensed-Bold.ttf" :properties (:size 9))
(:name "serif-condensed-italic-9" :type :ttf :file "DejaVuSerifCondensed-Italic.ttf" :properties (:size 9))
(:name "serif-condensed-9" :type :ttf :file "DejaVuSerifCondensed.ttf" :properties (:size 9))
(:name "serif-italic-9" :type :ttf :file "DejaVuSerif-Italic.ttf" :properties (:size 9))
(:name "serif-9" :type :ttf :file "DejaVuSerif.ttf" :properties (:size 9))
(:name "sans-bold-oblique-10" :type :ttf :file "DejaVuSans-BoldOblique.ttf" :properties (:size 10))
(:name "sans-bold-10" :type :ttf :file "DejaVuSans-Bold.ttf" :properties (:size 10))
......@@ -198,6 +241,13 @@
(:name "serif-italic-32" :type :ttf :file "DejaVuSerif-Italic.ttf" :properties (:size 32))
(:name "serif-32" :type :ttf :file "DejaVuSerif.ttf" :properties (:size 32))
(:name "icon-empty.png" :type :image :file "icon-empty.png" :properties (:filter :nearest))
(:name "icon-caption.png" :type :image :file "icon-caption.png" :properties (:filter :nearest))
(:name "icon-document.png" :type :image :file "icon-document.png" :properties (:filter :nearest))
(:name "icon-folder.png" :type :image :file "icon-folder.png" :properties (:filter :nearest))
(:name "icon-grid.png" :type :image :file "icon-grid.png" :properties (:filter :nearest))
(:name "icon-open-folder.png" :type :image :file "icon-open-folder.png" :properties (:filter :nearest))
(:name "icon-project.png" :type :image :file "icon-project.png" :properties (:filter :nearest))
(:name "asterisk" :type :image :file "asterisk.png" :properties (:filter :linear))
(:name "circle-outline-flat-128" :type :image :file "circle-outline-flat-128.png" :properties (:filter :linear))
......
* Task list
** TODO [#A] revise/clean up/document new GUI code
** TODO [#A] command undo/redo
** TODO [#A] design layered tile map editing
** TODO [#A] snap-to-grid and offset
** TODO [#A] modeline and mousewheel controls for scrolling the buffer window
** DONE [#A] revise/clean up/document new GUI code
CLOSED: [2017-04-24 Mon 20:18]
** TODO [#A] Desktop buffer-class for workspace / task / folder management
*** TODO Icon class
*** TODO auto layout simple line rules with spacing
......@@ -13,6 +10,11 @@
*** TODO Design user experience
**** TODO launching external programs to edit assets. gimp, audacity, switch-to-emacs,. etc
**** TODO folders are virtual views, they don't nest
** TODO [#A] change-buffer-class
** TODO [#A] command undo/redo
** TODO [#A] design layered tile map editing
** TODO [#A] snap-to-grid and offset
** TODO [#A] modeline and mousewheel controls for scrolling the buffer window
** TODO [#A] toggle-snap-to-grid
** TODO save/load functionality
*** TODO [#A] test serialization
......
......@@ -78,5 +78,13 @@
;; ;; (trace xelf::draw-focus)
;; (trace xelf::destroy)
;; (trace xelf::find-root-desktop)
;; (trace xelf::find-buffer)
;; (trace xelf::show-root-desktop)
;; (trace xelf::auto-arrange)
;; (trace xelf::default-icons)
;; (trace xelf::populate)
;; (trace xelf::add-node)
(test-gui)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment