From: MORIOKA Tomohiko Date: Tue, 28 Jun 2016 08:01:51 +0000 (+0900) Subject: (est-eval-value-as-glyph-image): New function. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca4ef644f37411f9f215620b669dd9fafec2957a;p=chise%2Fest.git (est-eval-value-as-glyph-image): New function. (est-eval-value-as-object): Use `est-eval-value-as-glyph-image' for genre `glyph-image'. (est-eval-value-as-location): New function. (est-eval-value-as-name): New function. (est-eval-value-as-location-list): New function. (est-eval-value-as-name-list): New function. (est-eval-apply-value): - Use `est-eval-value-as-location-list' for format `location-list'. - Use `est-eval-value-as-name-list' for format `name-list'. --- diff --git a/est-eval.el b/est-eval.el index 3cd848a..835d5b4 100644 --- a/est-eval.el +++ b/est-eval.el @@ -73,6 +73,10 @@ (list :alt name)))) name))) +(defun est-eval-value-as-glyph-image (value) + (let ((image-resource (car (concord-object-get value '->image-resource)))) + (est-eval-value-as-image-resource image-resource))) + ;; (defun est-journal-volume-object-get-volume-format (spec feature) ;; (when (integerp spec) ;; (setq spec (format "%02d" spec))) @@ -339,6 +343,9 @@ ((eq genre 'image-resource) (est-eval-value-as-image-resource value) ) + ((eq genre 'glyph-image) + (est-eval-value-as-glyph-image value) + ) (t (setq genre-o (concord-decode-object '=id genre 'genre)) (or (and genre-o @@ -366,6 +373,22 @@ (mapconcat #'char-to-string ret "")) (est-eval-value-as-object value)))) +(defun est-eval-value-as-location (value) + (let (ret) + (if (and (concord-object-p value) + (setq ret (concord-object-get value '=location))) + (list 'object (list :object value) + ret) + (est-eval-value-as-object value)))) + +(defun est-eval-value-as-name (value) + (let (ret) + (if (and (concord-object-p value) + (setq ret (concord-object-get value 'name))) + (list 'object (list :object value) + ret) + (est-eval-value-as-object value)))) + (defun est-eval-value-as-HEX (value) (if (integerp value) (list 'HEX nil (format "%X" value)) @@ -417,6 +440,34 @@ (error (format "%s" value))) (format "%s" value))) +(defun est-eval-value-as-location-list (value &optional separator subtype) + (if (and (listp value) + (listp (cdr value))) + (condition-case nil + (let (props) + (if separator + (setq props (list :separator separator))) + (if subtype + (setq props (list* :subtype subtype props))) + (list* 'list props + (mapcar #'est-eval-value-as-location value))) + (error (format "%s" value))) + (format "%s" value))) + +(defun est-eval-value-as-name-list (value &optional separator subtype) + (if (and (listp value) + (listp (cdr value))) + (condition-case nil + (let (props) + (if separator + (setq props (list :separator separator))) + (if subtype + (setq props (list* :subtype subtype props))) + (list* 'list props + (mapcar #'est-eval-value-as-name value))) + (error (format "%s" value))) + (format "%s" value))) + (defun est-eval-value-as-composition-list (value &optional separator subtype) (if (and (listp value) (listp (cdr value))) @@ -711,6 +762,10 @@ (est-eval-value-as-object-list value " ")) ((eq format 'char-list) (est-eval-value-as-char-list value nil)) + ((eq format 'location-list) + (est-eval-value-as-location-list value nil)) + ((eq format 'name-list) + (est-eval-value-as-name-list value nil)) ((eq format 'unordered-list) (est-eval-value-as-object-list value nil 'unordered-list)) ((eq format 'unordered-composition-list)