two-viewports.lisp 6.65 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
;;
;; Copyright 2002, 2009 Genworks International and Genworks BV 
;;
;; This source file is part of the General-purpose Declarative
;; Language project (GDL).
;;
;; This source file contains free software: you can redistribute it
;; and/or modify it under the terms of the GNU Affero General Public
;; License as published by the Free Software Foundation, either
;; version 3 of the License, or (at your option) any later version.
;; 
;; This source file 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
;; Affero General Public License for more details.
;; 
;; You should have received a copy of the GNU Affero General Public
;; License along with this source file.  If not, see
;; <http://www.gnu.org/licenses/>.
;; 


;;
;; FLAG -- experimental, needs a lot of cleaning up to truly support two viewports.
;; 
26
#+nil
27 28
(in-package :tasty)

29
#+nil
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
(define-object two-viewports (assembly)

  :computed-slots
  ((html-sections (list (the tree) 
			(the tree-status-object) 
			(the viewport) 
			;;(the inspector)
			(the viewport2)
			(the viewport-status-object) 
			(the image-status-object)
			)))
  
  :objects
  ((part-type-form :type 'part-type-form
		   :pass-down (package-default)
		   :object-type "sppa::test-node"
		   :tatu-root self
		   :set-root-function #'(lambda(object) (the (set-root! object)))
		   :make-instance-function #'(lambda(type) 
					       (the (make-root-instance type))))
   
   (viewport2 :type 'viewport
	      :pass-down (root-object color-selected line-thickness-selected)
	      :image-format-default :png
	      ;;:display-list-objects (list (the-child inspected-object))
	      :display-list-object-roots 
	      (append (with-error-handling() (the-child inspected-object input-objects))
		      (with-error-handling() (the-child inspected-object explode-lines)))
						
	      :inspected-object (the inspector node)
	      :projection-vector (getf *standard-views* :trimetric)
	      
	      :length 400
	      :width 500
	      :tatu-root self)

   
   (viewport :type 'viewport
	     :pass-down (root-object color-selected line-thickness-selected)
	     :image-format-default :png
	     ;;:display-list-objects (list (the-child inspected-object))
	     :display-list-object-roots 
	     (when (typep (the-child inspected-object) (read-from-string "sppa::process-object"))
	       (list (the-child inspected-object output-object)))
						
	     :inspected-object (the inspector node)
	     
	     :projection-vector (getf *standard-views* :trimetric)
	     
	     :length 400
	     :width 500
	     :tatu-root self)
   )
  )

85
#+nil
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
(define-lens (html-format two-viewports)()
  
  :output-functions
  ((main-sheet-body 
    ()
    (print-messages have-valid-instance?)
    (if (the have-valid-instance?)
	(write-the ui-sheet)
	(write-the part-type-form main-sheet)))
   
   (ui-sheet
    ()
    (with-cl-who () 
      ;; This is the content of the Body of the basic
      ;; tasty layout Outer layout: center (has a Layout), west (has
      ;; additional Layout), north (menu), south (footer) Inner layout
      ;; in outer-center: center (main viewport), east (auxilary
      ;; views+help), north (contexthelp), west (inspector in 3 panes
      ;; side by side) Inner layout in outer-west: center (main tree),
      ;; south (inspector when traditional ta layout selected)
      
      ((:div :id "loader-message")
	((:span :class "ui-icon ui-icon info" style"float: left; margin: 0.3em;")
       (:span "Application is Loading")))
      
      ((:div :id "tabs" :class "page-layout-center")
       
       ((:ul :id "TabButtons" :class "pane")
	(:li ((:a :href "#ApplicationLayout")(:span "Application")))
	(:li ((:a :href "#Documentation")(:span "Documentation")))
	)
       
       ;; wrap tab-panels in ui-layout-content div 
       ((:div :id "TabPanelsContainer" :class "pane")
	
	;; TAB #1 
	((:div :id "ApplicationLayout")
	 
	 ((:div :id "InnerLayout" :class "outer-center pane")
	  
	  ((:div :class "inner-center ui-widget pane")
	   ((:div :class "header ui-widget-header")"After")
	   ((:div :class "ui-widget-content")(str (the viewport main-div)))
	   
	   ((:div :class "footer ui-widget-header") 
	    (:span "Click-mode: " (str (the viewport-status-object main-div))
		   " | Image format: " (str (the image-status-object main-div)))))
	  
	  
	  ((:div :class "inner-west ui-widget pane")
	   ((:div :class "header ui-widget-header")"Before")
	   ((:div :class "ui-widget-content")
	    (str (the viewport2 main-div))
	    ))
	  
	  
	  #+nil
	  ((:div :class "inner-west ui-widget pane")
	   ((:div :class "header ui-widget-header")"Inspector")
	   ((:div :class "ui-widget-content")
	    (str (the inspector main-div))
	    ))
	  
	  ((:div :class "inner-north ui-widget pane")
	   ((:div :class "header ui-widget-header")"Inner North")
	   ((:div :class "ui-widget-content")(:span "Inner North"))))
	 
	 ((:div :class "outer-west ui-widget pane")
	  ((:div :class "header ui-widget-header")"Tree")
	  ((:div :class "ui-widget-content")(str (the tree main-div)))
	  ((:div :class "footer ui-widget-header") 
	   "Click-mode:" (str (the tree-status-object main-div)))
	  )
	 
	 ((:div :class "outer-north ui-widget pane")
	    (str (the menu-section main-div))
	  )
	 
	 ((:div :class "outer-south ui-widget pane")
	  ((:div :class "footer ui-widget-header")
	   ((:span :class "fltrt") 
	    "powered by " ((:a :href "http://www.genworks.com" :target "_new")"Genworks GDL")
	    "- empowered by " ((:a :href "http://www.ke-works.com" :target "_new")"KE-works"))
	   ((:span) "GDL status: ")
	   ((:span :id "gdlStatus")"Done.")
	   (:span " | ")
	   (:span
	    (when *developing?*
	      (write-the development-links)
	      
	      ;;(write-the break-link) (htm " | ")(write-the update-full-link)

	      ))
	   
	   #+nil
	   (when (typep (the root-object) 'base-html-sheet)
	     (htm (:span " | ")
		  ((:a :href (the root-object url)) "Visit UI")))))

	 
	 ((:div :class "outer-east ui-widget pane")
	  ((:div :class "header ui-widget-header")"Auxiliary")
	  ((:div :class "ui-widget-content")(:span "Auxiliary Pane Content"))
	  
	  )
	 
	 );; #ApplicationLayout 
	
	;; TAB #2 
	((:div :id "Documentation" :class "ui-tabs-hide pane")
	 ((:iframe :class "ui-widget-content" :src "/yadd" :width "100%" :height "500px"))
	 )
	
	);; END TabPanelsContainer 
       
       )
      
      ))))


206
;;(publish-gwl-app "/t2v" "tasty::two-viewports" :make-object-args (list :title "Genworks tasty 2vp"))