147 lines
4.8 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<language id="desktop" _name=".desktop" version="2.0" _section="Others">
<metadata>
<property name="mimetypes">application/x-gnome-app-info;application/x-desktop</property>
<property name="globs">*.desktop;*.kdelnk</property>
</metadata>
<styles>
<style id="comment" _name="Comment" map-to="def:comment"/>
<style id="group" _name="Group" map-to="def:keyword"/>
<style id="key" _name="Key" map-to="def:data-type"/>
<style id="language" _name="Translation" map-to="def:decimal"/>
<style id="number" _name="Number" map-to="def:floating-point"/>
<style id="boolean" _name="Boolean" map-to="def:floating-point"/>
<style id="exec-parameter" _name="Exec parameter" map-to="def:floating-point"/>
<style id="encoding" _name="Encoding" map-to="def:floating-point"/>
<style id="category" _name="Category" map-to="def:floating-point"/>
</styles>
<definitions>
<context id="line-comment" style-ref="comment" end-at-line-end="true">
<start>#</start>
<include>
<context ref="def:comment:*"/>
</include>
</context>
<context id="group" style-ref="group">
<start>^\[</start>
<end>\]$</end>
</context>
<context id="standard-key" style-ref="key">
<prefix>^_?</prefix>
<keyword>Actions</keyword>
<keyword>BinaryPattern</keyword>
<keyword>Categories</keyword>
<keyword>Comment</keyword>
<keyword>DefaultApp</keyword>
<keyword>Dev</keyword>
<keyword>Encoding</keyword>
<keyword>Exec</keyword>
<keyword>Extensions</keyword>
<keyword>FilePattern</keyword>
<keyword>FSType</keyword>
<keyword>GenericName</keyword>
<keyword>Hidden</keyword>
<keyword>Icon</keyword>
<keyword>MapNotify</keyword>
<keyword>MimeType</keyword>
<keyword>MiniIcon</keyword>
<keyword>MountPoint</keyword>
<keyword>Name</keyword>
<keyword>NoDisplay</keyword>
<keyword>NotShowIn</keyword>
<keyword>OnlyShowIn</keyword>
<keyword>Path</keyword>
<keyword>Patterns</keyword>
<keyword>Protocols</keyword>
<keyword>ReadOnly</keyword>
<keyword>SortOrder</keyword>
<keyword>StartupNotify</keyword>
<keyword>StartupWMClass</keyword>
<keyword>SwallowExec</keyword>
<keyword>SwallowTitle</keyword>
<keyword>Terminal</keyword>
<keyword>TerminalOptions</keyword>
<keyword>TryExec</keyword>
<keyword>Type</keyword>
<keyword>UnmountIcon</keyword>
<keyword>URL</keyword>
<keyword>Version</keyword>
</context>
<context id="non-standard-key" style-ref="key">
<match>^_?X\-[a-zA-Z\-]+</match>
</context>
<context id="language" style-ref="language">
<match>\[[a-zA-Z_]+\]</match>
</context>
<context id="boolean" style-ref="boolean">
<keyword>true</keyword>
<keyword>false</keyword>
</context>
<context id="exec-parameter" style-ref="exec-parameter">
<prefix></prefix>
<keyword>%f</keyword>
<keyword>%F</keyword>
<keyword>%u</keyword>
<keyword>%U</keyword>
<keyword>%d</keyword>
<keyword>%D</keyword>
<keyword>%n</keyword>
<keyword>%N</keyword>
<keyword>%i</keyword>
<keyword>%m</keyword>
<keyword>%c</keyword>
<keyword>%k</keyword>
<keyword>%v</keyword>
</context>
<context id="encoding" style-ref="encoding">
<keyword>UTF\-8</keyword>
<keyword>Legacy\-Mixed</keyword>
</context>
<context id="number" style-ref="number">
<match>(.\b[0-9]+([Ll]?|[Ff]?)\b)|(b[0-9]*\.\W)</match>
</context>
<context id="key-categories" end-at-line-end="true">
<start>^(_?Categories)\s*=\s*</start>
<include>
<context sub-pattern="1" where="start" style-ref="key"/>
<context style-ref="category">
<keyword>Application</keyword>
<keyword>Utility</keyword>
<keyword>TextEditor</keyword>
</context>
</include>
</context>
<context id="key">
<include>
<context ref="key-categories"/>
<context ref="standard-key"/>
<context ref="non-standard-key"/>
</include>
</context>
<context id="desktop">
<include>
<context ref="line-comment"/>
<context ref="group"/>
<context ref="key:*"/>
<context id="lang-and-value" end-at-line-end="true">
<start>(\[[a-zA-Z_]+\])?\s*=\s*</start>
<include>
<context sub-pattern="1" where="start" style-ref="language"/>
<context ref="boolean"/>
<context ref="exec-parameter"/>
<context ref="encoding"/>
<context ref="number"/>
</include>
</context>
</include>
</context>
</definitions>
</language>