Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions assets/mimetype/xps.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<!-- XPS 文档格式 (Microsoft XML Paper Specification) -->
<mime-type type="text/xps">
<comment>XPS document</comment>
<comment xml:lang="zh_CN">XPS 文档</comment>
<comment xml:lang="en">XPS Document</comment>
<acronym>XPS</acronym>
<expanded-acronym>XML Paper Specification</expanded-acronym>
<sub-class-of type="application/zip"/>
<generic-icon name="x-office-document"/>
<glob pattern="*.xps"/>
<magic priority="80">
<match type="string" value="PK" offset="0"/>
<match type="string" value="[Content_Types].xml" offset="30:1000"/>
</magic>
<alias type="application/vnd.ms-xpsdocument"/>
<alias type="application/xps"/>
</mime-type>

<!-- OXPS 文档格式 (Open XML Paper Specification) -->
<mime-type type="text/oxps">
<comment>OpenXPS document</comment>
<comment xml:lang="zh_CN">OpenXPS 文档</comment>
<comment xml:lang="en">OpenXPS Document</comment>
<acronym>OpenXPS</acronym>
<expanded-acronym>Open XML Paper Specification</expanded-acronym>
<sub-class-of type="application/zip"/>
<generic-icon name="x-office-document"/>
<glob pattern="*.oxps"/>
<magic priority="60">
<match type="string" value="PK" offset="0"/>
<match type="string" value="[Content_Types].xml" offset="30:1000"/>
</magic>
</mime-type>
</mime-info>

9 changes: 9 additions & 0 deletions reader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ install(FILES
DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps
)

if (XPS_SUPPORT_ENABLED)
install(FILES
${CMAKE_SOURCE_DIR}/assets/mimetype/xps.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/mime/packages
)
message(STATUS ">>> XPS MIME type definition will be installed to ${CMAKE_INSTALL_DATADIR}/mime/packages")
message(STATUS ">>> Note: After installation, please run 'sudo update-mime-database ${CMAKE_INSTALL_DATADIR}/mime' to update MIME database")
endif()

# 安装帮助文件
install(DIRECTORY
${CMAKE_SOURCE_DIR}/assets/deepin-reader
Expand Down