;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\301\302!\210\303\304\"\203$\305\306\307\"\210\305\310\311\"\210\312\306\313\314#\210\312\310\313\315#\210\202.\305\306\316\"\210\305\310\317\"\210\320\321\322\323\324DD\325\326\327\330\331&\210\320\332\322\323\333DD\334\326\335\330\331&\207" [emacs-version require image version< "26" defalias vscode-icon-if-let* if-let vscode-icon-when-let* when-let function-put lisp-indent-function 2 1 if-let* when-let* custom-declare-variable vscode-icon-size funcall function #[0 "\300\207" [23] 1] "The size of the icon when creating an icon.\n\nA number other than 23 is only available if there are icons of that size.\n\nSee `vscode-icon-extra-icon-directory'." :type number :group vscode-icon vscode-icon-extra-icon-directory #[0 "\300\207" [#1="~/.emacs.d/icons/"] 1 #1#] "Directory to install vscode icons in.\n\nThis directory is searched when icons are being searched for in addition to\n`vscode-icon-dir'." string] 8) #@55 Store the directory dired-sidebar.el was loaded from. (defvar vscode-icon-root (file-name-directory load-file-name) (#$ . 1022)) #@45 Store the icons directory of `vscode-icon'. (defvar vscode-icon-dir (format "%sicons/" vscode-icon-root) (#$ . 1157)) #@72 Store the source directory of `vscode-icon' containing the svg images. (defvar vscode-icon-source-dir (format "%ssource/" vscode-icon-root) (#$ . 1281)) (defvar vscode-icon-dir-alist '(("scripts" . "script") ("build" . "binary") ("node_modules" . "npm") ("tests" . "test") ("out" . "binary"))) (defvar vscode-icon-file-alist '((".clang-format" . "cpp") (".projectile" . "emacs") ("projectile.cache" . "emacs") ("gradle.properties" . "gradle") ("gradlew" . "gradle") ("gradlew.bat" . "gradle") (".gitignore" . "git") (".gitattributes" . "git") ("yarn.lock" . "yarn") ("Info.plist" . "objectivec") ("Cask" . "emacs") (".luminus" . "clojure") ("Dockerfile" . "docker") ("docker-compose.yml" . "docker") ("docker-compose.yaml" . "docker") ("mix.lock" . "elixir") ("recentf" . "emacs") (".flowconfig" . "flow") (".editorconfig" . "editorconfig") (".babelrc" . "babel") ("cargo.lock" . "cargo") ("cargo.toml" . "cargo") (".tramp" . "emacs") (".npmignore" . "npm") (".npmrc" . "npm") ("LICENSE" . "license") ("Makefile" . "makefile") ("zsh" . "shell") ("rb" . "ruby") ("restclient" . "rest") ("txt" . "text") ("ts" . "typescript") ("exs" . "elixir") ("cljc" . "clojure") ("clj" . "clojure") ("cljs" . "clojure") ("py" . "python") ("sh" . "shell") ("rs" . "rust") ("go" . "go") ("md" . "markdown") ("yml" . "yaml") ("yaml" . "yaml") ("hpp" . "cppheader") ("cc" . "cpp") ("m" . "objectivec") ("png" . "image") ("h" . "cppheader") ("elc" . "emacs") ("el" . "emacs"))) #@111 Return an vscode icon image given FILE. Icon Source: https://github.com/vscode-icons/vscode-icons (fn FILE) (defalias 'vscode-icon-for-file #[257 "\303 \203 \304P\202\305 !\306Q\307!\203\300!\202!\310!)\207" [vscode-icon-dir vscode-icon-size default-directory vscode-icon-can-scale-image-p "128/" number-to-string "/" file-directory-p vscode-icon-file] 4 (#$ . 2746)]) #@43 Get directory icon given FILE. (fn FILE) (defalias 'vscode-icon-dir #[257 "\301\302!!\211\203 \303!\207\304\302!\"A\211\203&\301!\211\203#\303!\207\305 \207\305 \207" [vscode-icon-dir-alist vscode-icon-dir-exists-p file-name-base vscode-icon-create-image assoc vscode-icon-default-folder] 6 (#$ . 3135)]) #@38 Get file icon given FILE. (fn FILE) (defalias 'vscode-icon-file #[257 "\301\302!!\211\203 \303!\207\304\305!\"A\206&\304\"A\206&\304\302!\"A\211\2038\301!\211\2035\303!\207\306 \207\306 \207" [vscode-icon-file-alist vscode-icon-file-exists-p file-name-extension vscode-icon-create-image assoc vscode-icon-basefile-with-extension vscode-icon-default-file] 6 (#$ . 3456)]) #@78 Check if there is an icon for KEY. Return filepath of icon if so. (fn KEY) (defalias 'vscode-icon-file-exists-p #[257 "\302\303\304\"!\302\303\305# \"\306!\203\207\306!\203\207\307\207" [vscode-icon-size vscode-icon-extra-icon-directory expand-file-name format "file_type_%s.png" "%d/file_type_%s.png" file-exists-p nil] 7 (#$ . 3849)]) #@78 Check if there is an icon for KEY. Return filepath of icon if so. (fn KEY) (defalias 'vscode-icon-dir-exists-p #[257 "\302\303\304\"!\302\303\305# \"\306!\203\207\306!\203\207\307\207" [vscode-icon-size vscode-icon-extra-icon-directory expand-file-name format "folder_type_%s.png" "%d/folder_type_%s.png" file-exists-p nil] 7 (#$ . 4204)]) #@76 Helper method to create and return an image given FILENAME. (fn FILENAME) (defalias 'vscode-icon-create-image #[257 "\301!\302\303\304\305\306\307&\207" [vscode-icon-size vscode-icon-get-scale create-image png nil :scale :ascent center] 10 (#$ . 4562)]) #@34 Return image for default folder. (defalias 'vscode-icon-default-folder #[0 "\300\301\302!!\207" [vscode-icon-create-image expand-file-name "default_folder.png"] 3 (#$ . 4827)]) #@32 Return image for default file. (defalias 'vscode-icon-default-file #[0 "\300\301\302!!\207" [vscode-icon-create-image expand-file-name "default_file.png"] 3 (#$ . 5010)]) #@47 Return whether or not Emacs can scale images. (defalias 'vscode-icon-can-scale-image-p #[0 "\301=\203\302\303!\206\304\305!\205\305 \207\304\305!\205\305 \207" [system-type darwin image-type-available-p imagemagick fboundp image-transforms-p] 2 (#$ . 5187)]) #@53 Get scale according to IMAGE-SIZE. (fn IMAGE-SIZE) (defalias 'vscode-icon-get-scale #[257 "\211\300\245\301\245\207" [1.0 128] 3 (#$ . 5461)]) #@143 Return base filename with extension given FILE. : ~/a/b.json -> b.json If there is no extension, just return the base file name. (fn FILE) (defalias 'vscode-icon-basefile-with-extension #[257 "\300!\301!\203\211\203\302\303#\207\207" [file-name-base file-name-extension format "%s.%s"] 7 (#$ . 5612)]) #@70 Convert svg images to pngs sizing them to ICON-SIZE. (fn ICON-SIZE) (defalias 'vscode-icon-convert-from-big-png #[257 "\302\303!\204\n\304\305!\210\203\306\307\310\"\"\202\306\311\"\312!\204)\313!\210)\266\314\315\316\"\317\307\320\"\321\"\"\207" [vscode-icon-root default-directory executable-find "convert" user-error "Executable convert not found! Install imagemagick? " expand-file-name format "icons/%d" "icons" file-directory-p make-directory mapcar make-closure #[257 "\302!\303!\304\232\205.\300\305_\306\307\310\300!_!\311\312\311\313 \300 $%\314!B\262\266\203\207" [V0 vscode-icon-root file-name-extension file-name-base "png" 3 truncate 100 vscode-icon-get-scale format "convert -depth 8 -density %d -background transparent -scale %d%% %s PNG32:%s" "%sicons/%d/%s.png" shell-command] 15 "\n\n(fn FILE)"] directory-files "%sicons/128/" t] 7 (#$ . 5933)]) #@228 Create source png from svg to convert to smaller icons. Only create source icons if FORCE is non nil or if the directory is empty. i.e. Don't create source pngs if there are already source pngs created. (fn &optional FORCE) (defalias 'vscode-icon-create-source-pngs #[256 "\303\304!\204\n\305\306!\210\307\310\"\311!\204\312!\210\204,\313!G\314V\203,\315\2023\316\317\313\n\320\"\")\207" [vscode-icon-root default-directory vscode-icon-source-dir executable-find "convert" user-error "Executable convert not found! Install imagemagick? " expand-file-name "icons/128" file-directory-p make-directory directory-files 2 skip mapcar #[257 "\301!\302!\303\232\205!\304\305\306\304\307#$\310!B\262\262\207" [vscode-icon-root file-name-extension file-name-base "svg" format "convert -depth 8 -density %d -background transparent -size 128x128 %s PNG32:%s" 384 "%sicons/128/%s.png" shell-command] 11 "\n\n(fn FILE)"] t] 8 (#$ . 6837)]) #@181 Run `vscode-icon-create-source-pngs', `vscode-icon-convert-from-big-png' and `vscode-icon-copy-icons-to-user-directory' in another Emacs process. (fn &optional CONVERT-SIZE COPY) (defalias 'vscode-icon-convert-icons-async #[512 "\300\301!\203\301\302\303\304\305\306!D\307BBB\310\311#\"\207\312\313!\207" [fboundp async-start lambda nil load locate-library "vscode-icon" ((require 'vscode-icon) (vscode-icon-create-source-pngs)) make-closure #[257 "\211\302=\203 \303\304!\210\202\303\305!\210\306\307\310\301\"\300\203\300\202\311C\"\207" [V0 V1 skip message "Skipped creating source pngs... Converting icons.." "Finished creating source pngs.. Converting icons.." mapcar make-closure #[257 "\301\302\303\304\305\306!D\307\310D\257\302\311\312\313\300\314BBF\"\207" [V0 async-start lambda nil load locate-library "vscode-icon" (require 'vscode-icon) vscode-icon-convert-from-big-png (result) (message "Finished converting icons. Result: %s" result) when ((vscode-icon-copy-icons-to-user-directory))] 9 "\n\n(fn ICON-SIZE)"] 23] 5 "\n\n(fn CREATE-SOURCE-ICON-RESULT)"] user-error "Package `async' not installed? "] 8 (#$ . 7801) "nIcon Size: "]) #@162 Copy `vscode-icon-dir' to `vscode-icon-extra-icon-directory'. This is useful after generating icons of a different size with `vscode-icon-convert-icons-async'. (defalias 'vscode-icon-copy-icons-to-user-directory #[0 "\302\303!\203\304\305!\210\303\306\307\310\311\312!D\313\314 \315BBB\257\316\"\207\317\320!\207" [vscode-icon-dir vscode-icon-extra-icon-directory fboundp async-start message "Copying icons asynchronously.." lambda nil load locate-library "vscode-icon" (require 'vscode-icon) copy-directory (t t t) #[257 "\300\301!\207" [message "Finished copying icons."] 3 "\n\n(fn _)"] user-error "Package `async' not installed? "] 9 (#$ . 8969) nil]) #@133 Run `vscode-icon-convert-icons-async' and then copy those icons to `vscode-icon-extra-icon-directory'. (fn &optional CONVERT-SIZE) (defalias 'vscode-icon-convert-and-copy #[256 "\300\301\"\207" [vscode-icon-convert-icons-async :copy] 4 (#$ . 9637) "nIcon Size: "]) (provide 'vscode-icon)