pax_global_header 0000666 0000000 0000000 00000000064 14762266606 0014531 g ustar 00root root 0000000 0000000 52 comment=06bb511db1256eec27501f686c5ec17cbde76af4
dtkcore-5.7.12/ 0000775 0000000 0000000 00000000000 14762266606 0013260 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/.clang-format 0000664 0000000 0000000 00000016450 14762266606 0015641 0 ustar 00root root 0000000 0000000 ---
# 语言: None, Cpp, Java, JavaScript, ObjC, Proto, TableGen, TextProto
Language: Cpp
# BasedOnStyle: LLVM
# 访问说明符(public、private等)的偏移
AccessModifierOffset: -4
# 开括号(开圆括号、开尖括号、开方括号)后的对齐: Align, DontAlign, AlwaysBreak(总是在开括号后换行)
AlignAfterOpenBracket: Align
# 连续赋值时,对齐所有等号
AlignConsecutiveAssignments: None
# 连续声明时,对齐所有声明的变量名
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Right
# 左对齐逃脱换行(使用反斜杠换行)的反斜杠
#AlignEscapedNewlinesLeft: true
# 水平对齐二元和三元表达式的操作数
AlignOperands: true
# 对齐连续的尾随的注释
AlignTrailingComments: true
# 允许函数声明的所有参数在放在下一行
AllowAllParametersOfDeclarationOnNextLine: true
# 允许短的块放在同一行
AllowShortBlocksOnASingleLine: Empty
# 允许短的case标签放在同一行
AllowShortCaseLabelsOnASingleLine: false
# 允许短的函数放在同一行: None, InlineOnly(定义在类中), Empty(空函数), Inline(定义在类中,空函数), All
AllowShortFunctionsOnASingleLine: Inline
# 允许短的if语句保持在同一行
AllowShortIfStatementsOnASingleLine: false
# 允许短的循环保持在同一行
AllowShortLoopsOnASingleLine: false
# 总是在定义返回类型后换行(deprecated)
AlwaysBreakAfterDefinitionReturnType: None
# 总是在返回类型后换行: None, All, TopLevel(顶级函数,不包括在类中的函数),
# AllDefinitions(所有的定义,不包括声明), TopLevelDefinitions(所有的顶级函数的定义)
AlwaysBreakAfterReturnType: None
# 总是在多行string字面量前换行
AlwaysBreakBeforeMultilineStrings: false
# 总是在template声明后换行
AlwaysBreakTemplateDeclarations: Yes
# false表示函数实参要么都在同一行,要么都各自一行
BinPackArguments: false
# false表示所有形参要么都在同一行,要么都各自一行
BinPackParameters: false
# 大括号换行,只有当BreakBeforeBraces设置为Custom时才有效
BraceWrapping:
# class定义后面
AfterClass: true
# 控制语句后面
AfterControlStatement: Never
# enum定义后面
AfterEnum: false
# 函数定义后面
AfterFunction: true
# 命名空间定义后面
AfterNamespace: false
# ObjC定义后面
AfterObjCDeclaration: false
# struct定义后面
AfterStruct: true
# union定义后面
AfterUnion: true
AfterExternBlock: false
# catch之前
BeforeCatch: false
# else之前
BeforeElse: false
# 缩进大括号
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
# 在二元运算符前换行: None(在操作符后换行), NonAssignment(在非赋值的操作符前换行), All(在操作符前换行)
BreakBeforeBinaryOperators: None
# 在大括号前换行: Attach(始终将大括号附加到周围的上下文), Linux(除函数、命名空间和类定义,与Attach类似),
# Mozilla(除枚举、函数、记录定义,与Attach类似), Stroustrup(除函数定义、catch、else,与Attach类似),
# Allman(总是在大括号前换行), GNU(总是在大括号前换行,并对于控制语句的大括号增加额外的缩进), WebKit(在函数前换行), Custom
# 注:这里认为语句块也属于函数
BreakBeforeBraces: Custom
# 在三元运算符前换行
BreakBeforeTernaryOperators: false
# 在构造函数的初始化列表的逗号前换行
BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: BeforeColon
# 每行字符的限制,0表示没有限制
ColumnLimit: 130
# 描述具有特殊意义的注释的正则表达式,它不应该被分割为多行或以其它方式改变
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
# 构造函数的初始化列表要么都在同一行,要么都各自一行
ConstructorInitializerAllOnOneLineOrOnePerLine: false
# 构造函数的初始化列表的缩进宽度
ConstructorInitializerIndentWidth: 4
# 延续的行的缩进宽度
ContinuationIndentWidth: 4
# 去除C++11的列表初始化的大括号{后和}前的空格
Cpp11BracedListStyle: true
# 继承最常用的指针和引用的对齐方式
DerivePointerAlignment: false
# 关闭格式化
DisableFormat: false
# 自动检测函数的调用和定义是否被格式为每行一个参数(Experimental)
ExperimentalAutoDetectBinPacking: false
# 需要被解读为foreach循环而不是函数调用的宏
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
# 对#include进行排序,匹配了某正则表达式的#include拥有对应的优先级,匹配不到的则默认优先级为INT_MAX(优先级越小排序越靠前),
# 可以定义负数优先级从而保证某些#include永远在最前面
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
# 缩进case标签
IndentCaseLabels: true
#IndentPPDirectives: AfterHash
# 缩进宽度
IndentWidth: 4
# 函数返回类型换行时,缩进函数声明或函数定义的函数名
IndentWrappedFunctionNames: false
# 保留在块开始处的空行
KeepEmptyLinesAtTheStartOfBlocks: false
# 开始一个块的宏的正则表达式
MacroBlockBegin: ''
# 结束一个块的宏的正则表达式
MacroBlockEnd: ''
# 连续空行的最大数量
MaxEmptyLinesToKeep: 1
# 命名空间的缩进: None, Inner(缩进嵌套的命名空间中的内容), All
NamespaceIndentation: Inner
# 使用ObjC块时缩进宽度
ObjCBlockIndentWidth: 4
# 在ObjC的@property后添加一个空格
ObjCSpaceAfterProperty: false
# 在ObjC的protocol列表前添加一个空格
ObjCSpaceBeforeProtocolList: true
# 在call(后对函数调用换行的penalty
PenaltyBreakBeforeFirstCallParameter: 19
# 在一个注释中引入换行的penalty
PenaltyBreakComment: 300
# 第一次在<<前换行的penalty
PenaltyBreakFirstLessLess: 120
# 在一个字符串字面量中引入换行的penalty
PenaltyBreakString: 1000
# 对于每个在行字符数限制之外的字符的penalty
PenaltyExcessCharacter: 1000000
# 将函数的返回类型放到它自己的行的penalty
PenaltyReturnTypeOnItsOwnLine: 60
# 指针和引用的对齐: Left, Right, Middle
PointerAlignment: Right
# 允许重新排版注释
ReflowComments: true
# 允许排序#include
SortIncludes: Never
# 在C风格类型转换后添加空格
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
# 在赋值运算符之前添加空格
SpaceBeforeAssignmentOperators: true
# 开圆括号之前添加一个空格: Never, ControlStatements, Always
SpaceBeforeParens: ControlStatements
# 在空的圆括号中添加空格
SpaceInEmptyParentheses: false
# 在尾随的评论前添加的空格数(只适用于//)
SpacesBeforeTrailingComments: 2
# 在尖括号的<后和>前添加空格
SpacesInAngles: false
# 在容器(ObjC和JavaScript的数组和字典等)字面量中添加空格
SpacesInContainerLiterals: false
# 在C风格类型转换的括号中添加空格
SpacesInCStyleCastParentheses: false
# 在圆括号的(后和)前添加空格
SpacesInParentheses: false
# 在方括号的[后和]前添加空格,lamda表达式和未指明大小的数组的声明不受影响
SpacesInSquareBrackets: false
# 标准: Cpp03, Cpp11, Auto
Standard: Auto
# tab宽度
TabWidth: 4
# 使用tab字符: Never, ForIndentation, ForContinuationAndIndentation, Always
UseTab: Never
dtkcore-5.7.12/.clog.toml 0000664 0000000 0000000 00000000160 14762266606 0015154 0 ustar 00root root 0000000 0000000 [clog]
repository = "https://github.com/linuxdeepin/dtkcore"
from-latest-tag = true
changelog = "CHANGELOG.md"
dtkcore-5.7.12/.github/ 0000775 0000000 0000000 00000000000 14762266606 0014620 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/.github/ISSUE_TEMPLATE/ 0000775 0000000 0000000 00000000000 14762266606 0017003 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/.github/ISSUE_TEMPLATE/config.yml 0000664 0000000 0000000 00000002365 14762266606 0021001 0 ustar 00root root 0000000 0000000 blank_issues_enabled: false
contact_links:
- name: BUG Report | 缺陷报告
url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=bug-report.yml
about: Please create bug reports to the issue board in our dtk repo.
- name: docs-update | 文档补充
url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=docs-update.yml
about: Please create docs-update to the issue board in our dtk repo.
- name: unit-test-report | 单元测试报告
url: https://github.com/linuxdeepin/dtk/issues/new?assignees=&labels=&template=unit-test-report.yml
about: Please create unit-test-report to the issue board in our dtk repo.
- name: Feature Request | 特性请求
url: https://github.com/linuxdeepin/developer-center/discussions/new?category=features-request-ideas-%E7%89%B9%E6%80%A7%E8%AF%B7%E6%B1%82-%E5%A4%B4%E8%84%91%E9%A3%8E%E6%9A%B4
about: Please create feature requests to the discussion board in our developer-center repo.
- name: General Discussion & Questions | 常规讨论与问答
url: https://github.com/linuxdeepin/developer-center/discussions/categories/q-a-%E9%97%AE%E7%AD%94%E6%9D%BF%E5%9D%97
about: Please use the discussion board in our developer-center repo.
dtkcore-5.7.12/.github/ISSUE_TEMPLATE/document.md 0000664 0000000 0000000 00000000524 14762266606 0021144 0 ustar 00root root 0000000 0000000 ---
name: Docs update
about: Document Normalization
title: 'Doc: [Document Type][file name]'
labels: 'Doc'
assignees: ''
---
## Target files (目标文件)
## Planned completion time (计划完成时间)
## Document Type (文档类型)
[] New documents
[] Standardized documents
[] Internationalization of documents
[] Example documents
dtkcore-5.7.12/.github/workflows/ 0000775 0000000 0000000 00000000000 14762266606 0016655 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/.github/workflows/backup-to-gitlab.yml 0000664 0000000 0000000 00000000537 14762266606 0022532 0 ustar 00root root 0000000 0000000 name: backup to gitlab
on: [push]
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
backup-to-gitlabwh:
uses: linuxdeepin/.github/.github/workflows/backup-to-gitlabwh.yml@master
secrets: inherit
backup-to-gitee:
uses: linuxdeepin/.github/.github/workflows/backup-to-gitee.yml@master
secrets: inherit
dtkcore-5.7.12/.github/workflows/call-auto-tag.yml 0000664 0000000 0000000 00000000517 14762266606 0022035 0 ustar 00root root 0000000 0000000 name: auto tag
on:
pull_request_target:
types: [opened, synchronize, closed]
paths:
- "debian/changelog"
concurrency:
group: ${{ github.workflow }}-pull/${{ github.event.number }}
cancel-in-progress: true
jobs:
auto_tag:
uses: linuxdeepin/.github/.github/workflows/auto-tag.yml@master
secrets: inherit
dtkcore-5.7.12/.github/workflows/call-build-distribution.yml 0000664 0000000 0000000 00000000432 14762266606 0024124 0 ustar 00root root 0000000 0000000 name: Call build-distribution
on:
push:
paths-ignore:
- ".github/workflows/**"
pull_request_target:
paths-ignore:
- ".github/workflows/**"
jobs:
check_job:
uses: linuxdeepin/.github/.github/workflows/build-distribution.yml@master
secrets: inherit
dtkcore-5.7.12/.github/workflows/call-chatOps.yml 0000664 0000000 0000000 00000000242 14762266606 0021710 0 ustar 00root root 0000000 0000000 name: chatOps
on:
issue_comment:
types: [created]
jobs:
chatopt:
uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master
secrets: inherit
dtkcore-5.7.12/.github/workflows/call-clacheck.yml 0000664 0000000 0000000 00000000525 14762266606 0022050 0 ustar 00root root 0000000 0000000 name: Call CLA check
on:
issue_comment:
types: [created]
pull_request_target:
types: [opened, closed, synchronize]
concurrency:
group: ${{ github.workflow }}-pull/${{ github.event.number }}
cancel-in-progress: true
jobs:
clacheck:
uses: linuxdeepin/.github/.github/workflows/cla-check.yml@master
secrets: inherit
dtkcore-5.7.12/.github/workflows/call-commitlint.yml 0000664 0000000 0000000 00000000364 14762266606 0022473 0 ustar 00root root 0000000 0000000 name: Call commitlint
on:
pull_request_target:
concurrency:
group: ${{ github.workflow }}-pull/${{ github.event.number }}
cancel-in-progress: true
jobs:
check_job:
uses: linuxdeepin/.github/.github/workflows/commitlint.yml@master
dtkcore-5.7.12/.github/workflows/call-deploy-dev-doc.yml 0000664 0000000 0000000 00000000740 14762266606 0023125 0 ustar 00root root 0000000 0000000 name: deploy docs
on:
push:
branches: ["master"]
workflow_dispatch:
inputs:
tag:
required: true
type: string
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
deploydocs:
uses: linuxdeepin/.github/.github/workflows/deploy-dev-doc.yml@master
with:
ref: ${{ inputs.tag }}
secrets: inherit
dtkcore-5.7.12/.github/workflows/call-doc-check.yml 0000664 0000000 0000000 00000000467 14762266606 0022140 0 ustar 00root root 0000000 0000000 name: doxygen-check
on:
pull_request_target:
paths-ignore:
- ".github/workflows/**"
concurrency:
group: ${{ github.workflow }}-pull/${{ github.event.number }}
cancel-in-progress: true
jobs:
check_job:
uses: linuxdeepin/.github/.github/workflows/doc-check.yml@master
secrets: inherit
dtkcore-5.7.12/.github/workflows/call-license-check.yml 0000664 0000000 0000000 00000000552 14762266606 0023010 0 ustar 00root root 0000000 0000000 name: Call License and README Check
on:
pull_request_target:
types: [opened, synchronize, reopened]
permissions:
pull-requests: write
contents: read
concurrency:
group: ${{ github.workflow }}-pull/${{ github.event.number }}
cancel-in-progress: true
jobs:
license-check:
uses: linuxdeepin/.github/.github/workflows/license-check.yml@master
dtkcore-5.7.12/.github/workflows/call-synchronize-to-dtk6.yml 0000664 0000000 0000000 00000001031 14762266606 0024145 0 ustar 00root root 0000000 0000000 name: Call synchronize to dtk6
on:
pull_request_target:
paths-ignore:
- "debian/**"
- "archlinux/**"
- "rpm/**"
- ".obs/**"
- ".github/**"
jobs:
call-synchronize:
uses: linuxdeepin/dtk/.github/workflows/synchronize-to-dtk6.yml@master
secrets: inherit
with:
dest_repo: linuxdeepin/dtk6core
source_repo: ${{ github.event.pull_request.head.repo.full_name }}
source_ref: ${{ github.event.pull_request.head.ref }}
pull_number: ${{ github.event.pull_request.number }}
dtkcore-5.7.12/.github/workflows/cppcheck.yml 0000664 0000000 0000000 00000001265 14762266606 0021164 0 ustar 00root root 0000000 0000000 name: cppcheck
on:
pull_request_target:
paths-ignore:
- ".github/workflows/**"
concurrency:
group: ${{ github.workflow }}-pull/${{ github.event.number }}
cancel-in-progress: true
jobs:
cppchceck:
name: cppcheck
runs-on: ubuntu-latest
steps:
- run: export
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- uses: linuxdeepin/action-cppcheck@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{ github.repository }}
pull_request_id: ${{ github.event.pull_request.number }}
allow_approve: false
dtkcore-5.7.12/.gitignore 0000664 0000000 0000000 00000000540 14762266606 0015247 0 ustar 00root root 0000000 0000000 # Compiled Object files
*.slo
*.lo
*.o
# Compiled Dynamic libraries
*.so
*.dylib
# Compiled Static libraries
*.lai
*.la
*.a
build*/
*.pro.user*
*.DS_Store
# executeable files
*.qm
src/DtkCores
bin/
.qmake*
Makefile
cmake/DtkCore*
.cache
*.pc
*.pri
dtkcore_config.h
*.user
#tools
.vscode
.idea
# Ignore Doxygen theme files
docs/doxygen-theme/
dtkcore-5.7.12/.gitlab-ci.yml 0000664 0000000 0000000 00000000227 14762266606 0015715 0 ustar 00root root 0000000 0000000 include:
- remote: 'https://gitlab.deepin.io/dev-tools/letmeci/raw/master/gitlab-ci/dde.yml'
variables:
CPPCHECK: "true"
CODESPELL: "true"
dtkcore-5.7.12/.obs/ 0000775 0000000 0000000 00000000000 14762266606 0014121 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/.obs/workflows.yml 0000664 0000000 0000000 00000002312 14762266606 0016677 0 ustar 00root root 0000000 0000000 test_build:
steps:
- link_package:
source_project: deepin:Develop:dde
source_package: %{SCM_REPOSITORY_NAME}
target_project: deepin:CI
- configure_repositories:
project: deepin:CI
repositories:
- name: deepin_develop
paths:
- target_project: deepin:CI
target_repository: deepin_develop
architectures:
- x86_64
- aarch64
- name: debian
paths:
- target_project: deepin:CI
target_repository: debian_sid
architectures:
- x86_64
- name: archlinux
paths:
- target_project: deepin:CI
target_repository: archlinux
architectures:
- x86_64
filters:
event: pull_request
tag_build:
steps:
- branch_package:
source_project: deepin:Develop:dde
source_package: %{SCM_REPOSITORY_NAME}
target_project: deepin:Unstable:dde
filters:
event: tag_push
commit_build:
steps:
- trigger_services:
project: deepin:Develop:dde
package: %{SCM_REPOSITORY_NAME}
filters:
event: push
dtkcore-5.7.12/.packit.yaml 0000664 0000000 0000000 00000000724 14762266606 0015500 0 ustar 00root root 0000000 0000000 # See the documentation for more information:
# https://packit.dev/docs/configuration/
specfile_path: rpm/dtkcore.spec
# add or remove files that should be synced
synced_files:
- rpm/dtkcore.spec
- .packit.yaml
upstream_package_name: dtkcore
# downstream (Fedora) RPM package name
downstream_package_name: dtkcore
actions:
fix-spec-file: |
bash -c "sed -i -r \"0,/Version:/ s/Version:(\s*)\S*/Version:\1${PACKIT_PROJECT_VERSION}/\" rpm/dtkcore.spec"
dtkcore-5.7.12/.project.json 0000664 0000000 0000000 00000000242 14762266606 0015675 0 ustar 00root root 0000000 0000000 {
"Type": "homebrew",
"3rdparty": ["tools/qdbusxml2cpp"],
"ignore": ["src/translations","src/widgets/assets","doc",".tx"],
"license": ["GPLv3"]
}
dtkcore-5.7.12/.release.json 0000664 0000000 0000000 00000001045 14762266606 0015651 0 ustar 00root root 0000000 0000000 {
"commit": {
"quilt": false,
"pkgver": "echo $(git tag | sort -V | tail -n1)'+r'$(git log $(git describe --abbrev=0 --tags)..HEAD --oneline|wc -l)'+g'$(git rev-parse --short HEAD);",
"dist": "experimental"
},
"release": {
"quilt": true,
"pkgver": "git describe --abbrev=0 --tags %(ref)s",
"dist": "unstable"
},
"release-candidate": {
"quilt": true,
"dist": "unstable"
}
}
dtkcore-5.7.12/.reuse/ 0000775 0000000 0000000 00000000000 14762266606 0014461 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/.reuse/dep5 0000664 0000000 0000000 00000003122 14762266606 0015237 0 ustar 00root root 0000000 0000000 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: dtkcore
Upstream-Contact: UnionTech Software Technology Co., Ltd. <>
Source: https://github.com/linuxdeepin/dtkcore
# Sample paragraph, commented out:
#
# Files: src/*
# Copyright: $YEAR $NAME <$CONTACT>
# License: ...
# ci
Files: .github/* *.yml *.yaml .obs/* .syncexclude
Copyright: None
License: CC0-1.0
# git
Files: .gitignore
Copyright: None
License: CC0-1.0
# config
Files: *.toml *.conf *.json .clang-format
Copyright: None
License: CC0-1.0
# qt
Files: *.pro *.pri *.qrc *.prf
Copyright: None
License: CC0-1.0
# cmake
Files: *.cmake *CMakeLists.txt *.pc.in
Copyright: None
License: CC0-1.0
# debian
Files: debian/*
Copyright: None
License: CC0-1.0
# Arch
Files: archlinux/*
Copyright: None
License: CC0-1.0
# rpm
Files: rpm/*
Copyright: None
License: CC0-1.0
# docs
Files: *.dox *.md src/util/README.dpinyin tools/qdbusxml2cpp/README
Copyright: UnionTech Software Technology Co., Ltd.
License: CC-BY-4.0
# doxygen src
Files: docs/src/*
Copyright: None
License: CC0-1.0
# interface
Files: include/DtkCore/D*
Copyright: None
License: CC0-1.0
# others
Files: src/util/resources/dpinyin.dict tests/data/LGPLv3.txt
Copyright: None
License: CC0-1.0
Files: src/log/*
Copyright: UnionTech Software Technology Co., Ltd.
License: LGPL-3.0-or-later
#doxygentheme
Files: docs/doxygentheme/*
Copyright: Copyright (c) 2021 - 2022 jothepro
License: MIT
#reference
Files: docs/references/*
Copyright: UnionTech Software Technology Co., Ltd.
License: CC-BY-4.0
Files: toolGenerate/**/*
Copyright: None
License: CC0-1.0
dtkcore-5.7.12/.syncexclude 0000664 0000000 0000000 00000000365 14762266606 0015613 0 ustar 00root root 0000000 0000000 # Paths that will be exclude from synchronize workflow
# Please use relative path which use project directory as root
# Notice that
# * .git
# * debian
# * archlinux
# * .obs
# * .github
# are always ignored
linglong.yaml
conanfile.py
dtkcore-5.7.12/CHANGELOG.md 0000664 0000000 0000000 00000022120 14762266606 0015066 0 ustar 00root root 0000000 0000000
## 2.0.14 (2019-05-23)
#### Bug Fixes
* **DSettings:** crash when calling getOption() if option doesn't exist ([90ac734b](https://github.com/linuxdeepin/dtkcore/commit/90ac734b872203ea698808a7197aa7a9c7e2b5bd))
## 2.0.12 (2019-04-18)
## 2.0.11 (2019-04-17)
#### Bug Fixes
* Cross-builds incorrectly, built packages contain paths from build architecture ([8d32577a](https://github.com/linuxdeepin/dtkcore/commit/8d32577a89e54b5c9c834caae83d98e50f59df77))
* https://github.com/linuxdeepin/dtkcore/issues/10 ([3f99873a](https://github.com/linuxdeepin/dtkcore/commit/3f99873a786f6830688ecd0d8d2e2bf8dfb63ce0))
## 2.0.10 (2019-03-27)
#### Bug Fixes
* crash at application ([d852a218](https://github.com/linuxdeepin/dtkcore/commit/d852a21811f9f86e04274fc9f732d7c7a210ef3f))
#### Features
* add DNotifySender ([89bbcd7c](https://github.com/linuxdeepin/dtkcore/commit/89bbcd7c3821985bb2bca51247394fd4a65b25bf))
## 2.0.9.17 (2019-02-26)
## 2.0.9.16 (2019-02-26)
#### Bug Fixes
* deepin-os-release support cpu model and other info query ([cbeb47c9](https://github.com/linuxdeepin/dtkcore/commit/cbeb47c97e31d2b5dd3c198c60ee74332fecb293))
## 2.0.9.15 (2019-01-25)
#### Bug Fixes
* failed build the deepin-os-release on Qt 5.7.1 ([8bae8654](https://github.com/linuxdeepin/dtkcore/commit/8bae8654bdb20a7f773130d22b9db139460ba575))
* use main project c/cxx/ld flags on build deepin-os-release ([86dbd507](https://github.com/linuxdeepin/dtkcore/commit/86dbd507c1b3b101c1816f091782430ec1ce20ce))
## 2.0.9.14 (2019-01-02)
## 2.0.9.13 (2018-12-28)
## 2.0.9.12 (2018-12-24)
#### Bug Fixes
* **DPathBuf:** missing default constructor ([74374cb4](https://github.com/linuxdeepin/dtkcore/commit/74374cb4cf0245ab1fe73f62fe0d13566f945db3))
#### Features
* support connan build ([ba2d213f](https://github.com/linuxdeepin/dtkcore/commit/ba2d213fd6c7e36e118288305e5892c339250623))
## 2.0.9.11 (2018-12-14)
## 2.0.9.10 (2018-12-05)
#### Bug Fixes
* include unistd.h instead of sys/unistd.h ([39c50a13](https://github.com/linuxdeepin/dtkcore/commit/39c50a1398c34123e3806a3060a4c64e7f45ed68))
* url encoding ([4a6b7b61](https://github.com/linuxdeepin/dtkcore/commit/4a6b7b61bb3ad9ab417eda69249b5e9aced0aa97))
## 2.0.9.9 (2018-11-19)
#### Features
* add DRecentManager class. ([a2defafd](https://github.com/linuxdeepin/dtkcore/commit/a2defafdcf57078461221c665e322287a43d24a8))
#### Bug Fixes
* compatibility with Qt 5.6 ([0ec7f3ce](https://github.com/linuxdeepin/dtkcore/commit/0ec7f3ce389b323ecb2b103801c1cd1d55f100fa))
* **drecentmanager:**
* xbel file does not exist. ([c57ffe71](https://github.com/linuxdeepin/dtkcore/commit/c57ffe714f26b1a8a8859e2ffbeeed3d75ee11a1))
* uniform url format. ([413a8988](https://github.com/linuxdeepin/dtkcore/commit/413a8988116708ab8bcf9efbb9bc8f52e048efa5))
* url encoded. ([e234a8cc](https://github.com/linuxdeepin/dtkcore/commit/e234a8cc5ad9d2c14a16950838115c4f2f27c605))
* **recent:** chinese doc ([fb256461](https://github.com/linuxdeepin/dtkcore/commit/fb256461d1bdb0862b1a3a129978fc3932a6bcab))
## 2.0.9.8 (2018-11-09)
#### Bug Fixes
* can't get correct disk size in some case ([20a12b62](https://github.com/linuxdeepin/dtkcore/commit/20a12b622ea7b01f0616c15a8af85e31fc2d36cb))
## 2.0.9.5 (2018-10-26)
#### Features
* update version number for expermimental ([02b5d5c1](https://github.com/linuxdeepin/dtkcore/commit/02b5d5c1e01a05f57651b774b02cae31ef9a549f))
## 2.0.9 (2018-07-20)
#### Bug Fixes
* remove qt symbols ([57ec78ba](https://github.com/linuxdeepin/dtkcore/commit/57ec78ba685a53692b0260d3d558d8b0915fc3e4))
* non array type value is wrong on parse josn file ([9f138664](https://github.com/linuxdeepin/dtkcore/commit/9f13866439d8d650893434594da023e7d331d866))
### 2.0.8.1 (2018-05-14)
#### Bug Fixes
* update symbols ([f6c53cc4](https://github.com/linuxdeepin/dtkcore/commit/f6c53cc493c1bcf55dca54dbf500e2e484af73c9))
* add LIBDTKCORESHARED_EXPORT for windows ([6fb1096f](https://github.com/linuxdeepin/dtkcore/commit/6fb1096f6d0784937cf84f0e4ae1f5f7587085e5))
* **changelog:** update email format ([cb09a0ca](https://github.com/linuxdeepin/dtkcore/commit/cb09a0cadcf2fa0ba271b1d98d3b96a993eb892b))
## 2.0.8 (2018-05-02)
#### Features
* add symbols ([048de455](https://github.com/linuxdeepin/dtkcore/commit/048de4551bdd770aca5e9c12798362f913061654))
## 2.0.7 (2018-03-01)
#### Bug Fixes
* cmake link depends ([cdfcff9e](https://github.com/linuxdeepin/dtkcore/commit/cdfcff9e2f3e92bc6dbb45644d2714d6c4dbdda0))
* better static lib support ([99886406](https://github.com/linuxdeepin/dtkcore/commit/99886406a0cae849fad23286fdf64bb399e37da0))
* read settings value failed ([cf1c7698](https://github.com/linuxdeepin/dtkcore/commit/cf1c769893773794dff5a67c235c5d1f3234541a))
* set default should not use ([146529f6](https://github.com/linuxdeepin/dtkcore/commit/146529f6887e798606f2bf763ab8a760969bff26))
* fix dtk-settings install path ([1893cff3](https://github.com/linuxdeepin/dtkcore/commit/1893cff301dacb546a246a4f824dab68eac51351))
* develop package no install the "version.pri" file ([5667b562](https://github.com/linuxdeepin/dtkcore/commit/5667b562630565fca5abed690f3d3478dd3c7603))
* awk script failed ([524a3fa6](https://github.com/linuxdeepin/dtkcore/commit/524a3fa6021ee54db416503520aea65ef0e2c3a0))
* set default build version for debian changelog ([ec6e2a83](https://github.com/linuxdeepin/dtkcore/commit/ec6e2a8376c7aca7162b4fbb782b998c9a6ab630))
* set its value only if VERSION is empty ([1836000c](https://github.com/linuxdeepin/dtkcore/commit/1836000c49eb149a6495322c4cbb1474d5d48204))
#### Features
* add hide support for group ([e7e4fb66](https://github.com/linuxdeepin/dtkcore/commit/e7e4fb669276fbce61c6378e74ae82573e7c0313))
* add get option interface ([d8682485](https://github.com/linuxdeepin/dtkcore/commit/d8682485a6737da83fb28f22335f1da1afb8956c))
* add group interface for DSettingsGroup ([c876180f](https://github.com/linuxdeepin/dtkcore/commit/c876180f535e3027dce63628f31379ef874367ed))
* support generate cmake with qt function ([524b0559](https://github.com/linuxdeepin/dtkcore/commit/524b055929b7be84375a45f9d10cbc3a0ecac6de))
* config pkg config with dtk_module ([137b9138](https://github.com/linuxdeepin/dtkcore/commit/137b91388d9b9db24c8136dd4e2c6e690a5712c5))
* support qt module ([17ca0de9](https://github.com/linuxdeepin/dtkcore/commit/17ca0de9156a320cea32208dcff2f8cdf7d6a237))
* add the "version.pri" file ([07aab9fd](https://github.com/linuxdeepin/dtkcore/commit/07aab9fd6478c83c7bae1062f64b4bd20b21869c))
* remove build version from install path ([3bf0bfb5](https://github.com/linuxdeepin/dtkcore/commit/3bf0bfb5f49c3e83d4c36cc33f219150bf3731d8))
* make version parser easier ([6d3b4ead](https://github.com/linuxdeepin/dtkcore/commit/6d3b4ead7080158d1d8977bf7cf99ae842e574ec))
* set verion when build ([9083dbd3](https://github.com/linuxdeepin/dtkcore/commit/9083dbd3e29bf9d06b1032901ba13848fa964f4c))
* add .qmake.conf file ([2890f643](https://github.com/linuxdeepin/dtkcore/commit/2890f643a57c3532ab623410f7c6c6dbfdd6788d))
* add DtkCore and dtkcore_config.h headers ([308a0cc4](https://github.com/linuxdeepin/dtkcore/commit/308a0cc41101499c04308b4ef3bb2fff4ab8d783))
* **DSettings:** support set default value ([5fe9bfd0](https://github.com/linuxdeepin/dtkcore/commit/5fe9bfd0a5e20cef7393639712302825b803db29))
## 2.0.6 (2018-01-15)
## 2.0.5.3 (2017-12-27)
#### Bug Fixes
* Adapt lintian ([27df15df](https://github.com/linuxdeepin/dtkcore/commit/27df15df32788002491a24f06f098a5f849a4988))
* break forever loop for syncing backend data ([f70e500e](https://github.com/linuxdeepin/dtkcore/commit/f70e500ec2fd5c751e40833bdc4df586614bcff2))
#### Features
* **util:** add dpinyin ([128d7d67](https://github.com/linuxdeepin/dtkcore/commit/128d7d678e921bc580dd732b14a454973397899c))
## 2.0.5.2 (2017-11-28)
#### Bug Fixes
* make macosx build success ([af04bbe1](https://github.com/linuxdeepin/dtkcore/commit/af04bbe193a4b4251908f830d927ebdc8f4459e7))
* windows build failed ([66c4c812](https://github.com/linuxdeepin/dtkcore/commit/66c4c812eb29634710642f4e9d6b3d69cc692cb2))
#### Features
* add macro D_DECL_DEPRECATED ([89e49868](https://github.com/linuxdeepin/dtkcore/commit/89e49868f113ef01c03bcf5b6846eec95c428382))
## 2.0.5 (2017-11-06)
#### Bug Fixes
* build failed on used dbasefilewatcher.h project ([34fbe4b3](34fbe4b3))
* add miss libgsettings-qt-dev ([f61c1b54](f61c1b54))
* not select python version ([7e7e8832](7e7e8832))
#### Features
* support gsettingsbackend, remove dsettings-key ([26a29800](26a29800))
* create gsettingsbackend ([b94b97b1](b94b97b1))
dtkcore-5.7.12/CMakeLists.txt 0000664 0000000 0000000 00000001300 14762266606 0016012 0 ustar 00root root 0000000 0000000 cmake_minimum_required (VERSION 3.13)
set (DTK_VERSION "5.6.12" CACHE STRING "define project version")
project (DtkCore
VERSION ${DTK_VERSION}
DESCRIPTION "DTK Core module"
HOMEPAGE_URL "https://github.com/linuxdeepin/dtkcore"
LANGUAGES CXX C
)
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr)
endif ()
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
if("${PROJECT_VERSION_MAJOR}" STREQUAL "5")
set(QT_VERSION_MAJOR "5")
elseif("${PROJECT_VERSION_MAJOR}" STREQUAL "6")
set(QT_VERSION_MAJOR "6")
set(DTK_VERSION_MAJOR "6")
else()
message(SEND_ERROR "not support Prject Version ${PROJECT_VERSION}.")
endif()
include(dtkcore.cmake)
dtkcore-5.7.12/LICENSE 0000664 0000000 0000000 00000122162 14762266606 0014271 0 ustar 00root root 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License.
"The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version".
The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see .
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read .
dtkcore-5.7.12/LICENSES/ 0000775 0000000 0000000 00000000000 14762266606 0014465 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/LICENSES/BSD-3-Clause.txt 0000664 0000000 0000000 00000002664 14762266606 0017220 0 ustar 00root root 0000000 0000000 Copyright (c) .
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dtkcore-5.7.12/LICENSES/CC-BY-4.0.txt 0000664 0000000 0000000 00000041177 14762266606 0016334 0 ustar 00root root 0000000 0000000 Creative Commons Attribution 4.0 International
Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors.
Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public.
Creative Commons Attribution 4.0 International Public License
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
Section 1 – Definitions.
a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights under this Public License.
i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
Section 2 – Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
A. reproduce and Share the Licensed Material, in whole or in part; and
B. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
3. Term. The term of this Public License is specified in Section 6(a).
4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
5. Downstream recipients.
A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this Public License.
3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties.
Section 3 – License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified form), You must:
A. retain the following if it is supplied by the Licensor with the Licensed Material:
i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of warranties;
v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License.
Section 4 – Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database;
b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
Section 5 – Disclaimer of Warranties and Limitation of Liability.
a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 6 – Term and Termination.
a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
2. upon express reinstatement by the Licensor.
c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 – Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
Section 8 – Interpretation.
a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses.
Creative Commons may be contacted at creativecommons.org.
dtkcore-5.7.12/LICENSES/CC0-1.0.txt 0000664 0000000 0000000 00000015610 14762266606 0016072 0 ustar 00root root 0000000 0000000 Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
dtkcore-5.7.12/LICENSES/LGPL-2.1-or-later.txt 0000664 0000000 0000000 00000062462 14762266606 0020017 0 ustar 00root root 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts as the
successor of the GNU Library Public License, version 2, hence the version
number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to share
and change it. By contrast, the GNU General Public Licenses are intended to
guarantee your freedom to share and change free software--to make sure the
software is free for all its users.
This license, the Lesser General Public License, applies to some specially
designated software packages--typically libraries--of the Free Software Foundation
and other authors who decide to use it. You can use it too, but we suggest
you first think carefully about whether this license or the ordinary General
Public License is the better strategy to use in any particular case, based
on the explanations below.
When we speak of free software, we are referring to freedom of use, not price.
Our General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish); that you receive source code or can get it if you want it; that you
can change the software and use pieces of it in new free programs; and that
you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid distributors
to deny you these rights or to ask you to surrender these rights. These restrictions
translate to certain responsibilities for you if you distribute copies of
the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or for
a fee, you must give the recipients all the rights that we gave you. You must
make sure that they, too, receive or can get the source code. If you link
other code with the library, you must provide complete object files to the
recipients, so that they can relink them with the library after making changes
to the library and recompiling it. And you must show them these terms so they
know their rights.
We protect your rights with a two-step method: (1) we copyright the library,
and (2) we offer you this license, which gives you legal permission to copy,
distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is no
warranty for the free library. Also, if the library is modified by someone
else and passed on, the recipients should know that what they have is not
the original version, so that the original author's reputation will not be
affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any free
program. We wish to make sure that a company cannot effectively restrict the
users of a free program by obtaining a restrictive license from a patent holder.
Therefore, we insist that any patent license obtained for a version of the
library must be consistent with the full freedom of use specified in this
license.
Most GNU software, including some libraries, is covered by the ordinary GNU
General Public License. This license, the GNU Lesser General Public License,
applies to certain designated libraries, and is quite different from the ordinary
General Public License. We use this license for certain libraries in order
to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a shared
library, the combination of the two is legally speaking a combined work, a
derivative of the original library. The ordinary General Public License therefore
permits such linking only if the entire combination fits its criteria of freedom.
The Lesser General Public License permits more lax criteria for linking other
code with the library.
We call this license the "Lesser" General Public License because it does Less
to protect the user's freedom than the ordinary General Public License. It
also provides other free software developers Less of an advantage over competing
non-free programs. These disadvantages are the reason we use the ordinary
General Public License for many libraries. However, the Lesser license provides
advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage the
widest possible use of a certain library, so that it becomes a de-facto standard.
To achieve this, non-free programs must be allowed to use the library. A more
frequent case is that a free library does the same job as widely used non-free
libraries. In this case, there is little to gain by limiting the free library
to free software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free programs
enables a greater number of people to use a large body of free software. For
example, permission to use the GNU C Library in non-free programs enables
many more people to use the whole GNU operating system, as well as its variant,
the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the users'
freedom, it does ensure that the user of a program that is linked with the
Library has the freedom and the wherewithal to run that program using a modified
version of the Library.
The precise terms and conditions for copying, distribution and modification
follow. Pay close attention to the difference between a "work based on the
library" and a "work that uses the library". The former contains code derived
from the library, whereas the latter must be combined with the library in
order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program
which contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Lesser General
Public License (also called "this License"). Each licensee is addressed as
"you".
A "library" means a collection of software functions and/or data prepared
so as to be conveniently linked with application programs (which use some
of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has
been distributed under these terms. A "work based on the Library" means either
the Library or any derivative work under copyright law: that is to say, a
work containing the Library or a portion of it, either verbatim or with modifications
and/or translated straightforwardly into another language. (Hereinafter, translation
is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications
to it. For a library, complete source code means all the source code for all
modules it contains, plus any associated interface definition files, plus
the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered
by this License; they are outside its scope. The act of running a program
using the Library is not restricted, and output from such a program is covered
only if its contents constitute a work based on the Library (independent of
the use of the Library in a tool for writing it). Whether that is true depends
on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and disclaimer
of warranty; keep intact all the notices that refer to this License and to
the absence of any warranty; and distribute a copy of this License along with
the Library.
You may charge a fee for the physical act of transferring a copy, and you
may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it,
thus forming a work based on the Library, and copy and distribute such modifications
or work under the terms of Section 1 above, provided that you also meet all
of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that
you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all
third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of
data to be supplied by an application program that uses the facility, other
than as an argument passed when the facility is invoked, then you must make
a good faith effort to ensure that, in the event an application does not supply
such function or table, the facility still operates, and performs whatever
part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose
that is entirely well-defined independent of the application. Therefore, Subsection
2d requires that any application-supplied function or table used by this function
must be optional: if the application does not supply it, the square root function
must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable
sections of that work are not derived from the Library, and can be reasonably
considered independent and separate works in themselves, then this License,
and its terms, do not apply to those sections when you distribute them as
separate works. But when you distribute the same sections as part of a whole
which is a work based on the Library, the distribution of the whole must be
on the terms of this License, whose permissions for other licensees extend
to the entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest your
rights to work written entirely by you; rather, the intent is to exercise
the right to control the distribution of derivative or collective works based
on the Library.
In addition, mere aggregation of another work not based on the Library with
the Library (or with a work based on the Library) on a volume of a storage
or distribution medium does not bring the other work under the scope of this
License.
3. You may opt to apply the terms of the ordinary GNU General Public License
instead of this License to a given copy of the Library. To do this, you must
alter all the notices that refer to this License, so that they refer to the
ordinary GNU General Public License, version 2, instead of to this License.
(If a newer version than version 2 of the ordinary GNU General Public License
has appeared, then you can specify that version instead if you wish.) Do not
make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy,
so the ordinary GNU General Public License applies to all subsequent copies
and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library
into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of
it, under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you accompany it with the complete corresponding
machine-readable source code, which must be distributed under the terms of
Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated
place, then offering equivalent access to copy the source code from the same
place satisfies the requirement to distribute the source code, even though
third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but
is designed to work with the Library by being compiled or linked with it,
is called a "work that uses the Library". Such a work, in isolation, is not
a derivative work of the Library, and therefore falls outside the scope of
this License.
However, linking a "work that uses the Library" with the Library creates an
executable that is a derivative of the Library (because it contains portions
of the Library), rather than a "work that uses the library". The executable
is therefore covered by this License. Section 6 states terms for distribution
of such executables.
When a "work that uses the Library" uses material from a header file that
is part of the Library, the object code for the work may be a derivative work
of the Library even though the source code is not. Whether this is true is
especially significant if the work can be linked without the Library, or if
the work is itself a library. The threshold for this to be true is not precisely
defined by law.
If such an object file uses only numerical parameters, data structure layouts
and accessors, and small macros and small inline functions (ten lines or less
in length), then the use of the object file is unrestricted, regardless of
whether it is legally a derivative work. (Executables containing this object
code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute
the object code for the work under the terms of Section 6. Any executables
containing that work also fall under Section 6, whether or not they are linked
directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a "work
that uses the Library" with the Library to produce a work containing portions
of the Library, and distribute that work under terms of your choice, provided
that the terms permit modification of the work for the customer's own use
and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library
is used in it and that the Library and its use are covered by this License.
You must supply a copy of this License. If the work during execution displays
copyright notices, you must include the copyright notice for the Library among
them, as well as a reference directing the user to the copy of this License.
Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source
code for the Library including whatever changes were used in the work (which
must be distributed under Sections 1 and 2 above); and, if the work is an
executable linked with the Library, with the complete machine-readable "work
that uses the Library", as object code and/or source code, so that the user
can modify the Library and then relink to produce a modified executable containing
the modified Library. (It is understood that the user who changes the contents
of definitions files in the Library will not necessarily be able to recompile
the application to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the Library. A
suitable mechanism is one that (1) uses at run time a copy of the library
already present on the user's computer system, rather than copying library
functions into the executable, and (2) will operate properly with a modified
version of the library, if the user installs one, as long as the modified
version is interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three years,
to give the same user the materials specified in Subsection 6a, above, for
a charge no more than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy from a designated
place, offer equivalent access to copy the above specified materials from
the same place.
e) Verify that the user has already received a copy of these materials or
that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must
include any data and utility programs needed for reproducing the executable
from it. However, as a special exception, the materials to be distributed
need not include anything that is normally distributed (in either source or
binary form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component itself
accompanies the executable.
It may happen that this requirement contradicts the license restrictions of
other proprietary libraries that do not normally accompany the operating system.
Such a contradiction means you cannot use both them and the Library together
in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side
in a single library together with other library facilities not covered by
this License, and distribute such a combined library, provided that the separate
distribution of the work based on the Library and of the other library facilities
is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities. This must be distributed
under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of
it is a work based on the Library, and explaining where to find the accompanying
uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library
except as expressly provided under this License. Any attempt otherwise to
copy, modify, sublicense, link with, or distribute the Library is void, and
will automatically terminate your rights under this License. However, parties
who have received copies, or rights, from you under this License will not
have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed
it. However, nothing else grants you permission to modify or distribute the
Library or its derivative works. These actions are prohibited by law if you
do not accept this License. Therefore, by modifying or distributing the Library
(or any work based on the Library), you indicate your acceptance of this License
to do so, and all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library),
the recipient automatically receives a license from the original licensor
to copy, distribute, link with or modify the Library subject to these terms
and conditions. You may not impose any further restrictions on the recipients'
exercise of the rights granted herein. You are not responsible for enforcing
compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement
or for any other reason (not limited to patent issues), conditions are imposed
on you (whether by court order, agreement or otherwise) that contradict the
conditions of this License, they do not excuse you from the conditions of
this License. If you cannot distribute so as to satisfy simultaneously your
obligations under this License and any other pertinent obligations, then as
a consequence you may not distribute the Library at all. For example, if a
patent license would not permit royalty-free redistribution of the Library
by all those who receive copies directly or indirectly through you, then the
only way you could satisfy both it and this License would be to refrain entirely
from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents
or other property right claims or to contest validity of any such claims;
this section has the sole purpose of protecting the integrity of the free
software distribution system which is implemented by public license practices.
Many people have made generous contributions to the wide range of software
distributed through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing to
distribute software through any other system and a licensee cannot impose
that choice.
This section is intended to make thoroughly clear what is believed to be a
consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain
countries either by patents or by copyrighted interfaces, the original copyright
holder who places the Library under this License may add an explicit geographical
distribution limitation excluding those countries, so that distribution is
permitted only in or among countries not thus excluded. In such case, this
License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of
the Lesser General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies
a version number of this License which applies to it and "any later version",
you have the option of following the terms and conditions either of that version
or of any later version published by the Free Software Foundation. If the
Library does not specify a license version number, you may choose any version
ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs
whose distribution conditions are incompatible with these, write to the author
to ask for permission. For software which is copyrighted by the Free Software
Foundation, write to the Free Software Foundation; we sometimes make exceptions
for this. Our decision will be guided by the two goals of preserving the free
status of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE
STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY
"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES
OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH
HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible
use to the public, we recommend making it free software that everyone can
redistribute and change. You can do so by permitting redistribution under
these terms (or, alternatively, under the terms of the ordinary General Public
License).
To apply these terms, attach the following notices to the library. It is safest
to attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the "copyright"
line and a pointer to where the full notice is found.
Copyright (C)
This library is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2.1 of the License, or (at your option)
any later version.
This library 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 Lesser General Public License for more
details.
You should have received a copy of the GNU Lesser General Public License along
with this library; if not, write to the Free Software Foundation, Inc., 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school,
if any, to sign a "copyright disclaimer" for the library, if necessary. Here
is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
< signature of Ty Coon > , 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
dtkcore-5.7.12/LICENSES/LGPL-3.0-or-later.txt 0000664 0000000 0000000 00000122162 14762266606 0020011 0 ustar 00root root 0000000 0000000 GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License.
"The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version".
The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see .
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read .
dtkcore-5.7.12/README.md 0000664 0000000 0000000 00000003215 14762266606 0014540 0 ustar 00root root 0000000 0000000 ## Deepin Tool Kit Core
Deepin Tool Kit (DtkCore) is the base development tool of all C++/Qt Developer work on Deepin.
You should read the Deepin Application Specification firstly.
中文说明:[README.zh_CN.md](./README.zh_CN.md)
## Document
中文文档:[dtkcore文档](https://linuxdeepin.github.io/dtkcore/index.html)
## Dependencies
### Build dependencies
* Qt >= 5.10
## Compile option
| **Compile option** | **meaning** | **Default state** |
|--------------------|-------------|---------------|
| BUILD_DOCS | Compile document | ON |
| BUILD_TESTING | Compile test | Default is ON in debug mode |
| BUILD_EXAMPLES | Compile example | ON |
| BUILD_WITH_SYSTEMD | Support Systemd function | OFF |
| BUILD_THEME | Add themes to the document | OFF |
## Installation
### Build from source code
1. Make sure you have installed all dependencies.
2. Build:
```bash
mkdir build
cd build
cmake ..
make
```
3. Install:
```bash
sudo make install
```
## Getting help
Any usage issues can ask for help via
* [Telegram group](https://t.me/deepin)
* [Matrix](https://matrix.to/#/#deepin-community:matrix.org)
* [IRC (libera.chat)](https://web.libera.chat/#deepin-community)
* [Forum](https://bbs.deepin.org)
* [WiKi](https://wiki.deepin.org/)
## Getting involved
We encourage you to report issues and contribute changes
* [Contribution guide for developers](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers-en).
## License
deepin-tool-kit is licensed under [LGPL-3.0-or-later](LICENSE).
dtkcore-5.7.12/README.zh_CN.md 0000664 0000000 0000000 00000003025 14762266606 0015537 0 ustar 00root root 0000000 0000000 ## Deepin Tool Kit Core
Deepin Tool Kit Core(DtkCore) 是所有C++/Qt开发人员在Deepin上工作的基础开发工具.
您应该首先阅读 Deepin应用程序规范.
## 文档
中文文档:[dtkcore文档](https://linuxdeepin.github.io/dtkcore/index.html)
## 依赖
### 编译依赖
* Qt >= 5.10
## 编译选项
| **编译选项** | **含义** | **默认状态** |
|--------------------|-------------|---------------|
| BUILD_DOCS | 编译文档 | ON |
| BUILD_TESTING | 编译测试 | Debug模式下默认为ON |
| BUILD_EXAMPLES | 编译示例 | ON |
| BUILD_WITH_SYSTEMD | 支持Systmed功能 | OFF |
| BUILD_THEME | 为文档添加主题 | OFF |
## 安装
### 从源代码构建
1. 确保已经安装了所有的编译依赖.
2. 构建:
```bash
mkdir build
cd build
cmake ..
make
```
3. 安装:
```bash
sudo make install
```
## 帮助
任何使用问题都可以通过以下方式寻求帮助:
* [Telegram 群组](https://t.me/deepin)
* [Matrix](https://matrix.to/#/#deepin-community:matrix.org)
* [IRC (libera.chat)](https://web.libera.chat/#deepin-community)
* [Forum](https://bbs.deepin.org)
* [WiKi](https://wiki.deepin.org/)
## 参与贡献
我们鼓励您报告问题并作出更改
* [开发者代码贡献指南](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers)
## 协议
DTK工具包遵循协议 [LGPL-3.0-or-later](LICENSE).
dtkcore-5.7.12/archlinux/ 0000775 0000000 0000000 00000000000 14762266606 0015255 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/archlinux/PKGBUILD 0000664 0000000 0000000 00000002165 14762266606 0016405 0 ustar 00root root 0000000 0000000 # Maintainer: justforlxz
pkgname=dtkcore-git
pkgver=5.6.16
pkgrel=1
sourcename=dtkcore
sourcetars=("$sourcename"_"$pkgver".tar.xz)
sourcedir="$sourcename"
pkgdesc='DTK core modules'
arch=('x86_64' 'aarch64')
url="https://github.com/linuxdeepin/dtkcore"
license=('LGPL3')
depends=('deepin-desktop-base-git' 'gsettings-qt' 'dtkcommon-git' 'lshw' 'uchardet' 'icu' 'libsystemd' 'spdlog')
makedepends=('git' 'qt5-tools' 'ninja' 'cmake' 'doxygen')
conflicts=('dtkcore')
provides=('dtkcore')
groups=('deepin-git')
source=("${sourcetars[@]}")
sha512sums=('SKIP')
build() {
cd $sourcedir
version=$(echo $pkgver | awk -F'[+_~-]' '{print $1}')
cmake \
-GNinja \
-DMKSPECS_INSTALL_DIR=lib/qt/mkspecs/modules \
-DBUILD_DOCS=ON \
-DBUILD_WITH_SYSTEMD=ON \
-DBUILD_EXAMPLES=OFF \
-DQCH_INSTALL_DESTINATION=share/doc/qt \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DD_DSG_APP_DATA_FALLBACK=/var/dsg/appdata \
-DBUILD_WITH_SYSTEMD=ON \
-DDTK_VERSION=$version
ninja
}
package() {
cd $sourcedir
DESTDIR="$pkgdir" ninja install
}
dtkcore-5.7.12/cmake/ 0000775 0000000 0000000 00000000000 14762266606 0014340 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/cmake/DtkCMake/ 0000775 0000000 0000000 00000000000 14762266606 0015763 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/cmake/DtkCMake/DtkCMakeConfig.cmake 0000664 0000000 0000000 00000005047 14762266606 0021544 0 ustar 00root root 0000000 0000000 function(addDefinitions macro)
string(TOUPPER ${macro} macro)
add_definitions(-D${macro})
endfunction()
add_definitions(-DQ_HOST_NAME=\"${CMAKE_HOST_SYSTEM_PROCESSOR}\")
addDefinitions(Q_HOST_${CMAKE_HOST_SYSTEM_PROCESSOR})
find_package(DtkCore REQUIRED)
set(DEEPIN_OS_RELEASE_TOOL_PATH ${DtkCore_TOOL_DIRS})
set(DEEPIN_OS_RELEASE_TOOL ${DEEPIN_OS_RELEASE_TOOL_PATH}/deepin-os-release)
if(NOT EXISTS "${DEEPIN_OS_RELEASE_TOOL}")
message(FATAL_ERROR "\"${DEEPIN_OS_RELEASE_TOOL}\" is not exists. Install \"dtkcore-bin\" first")
endif()
function(formatString string)
string(REGEX REPLACE "\\s+" "_" string ${string})
endfunction()
macro(execDeepinOsRelease args output)
exec_program(${DEEPIN_OS_RELEASE_TOOL} ARGS ${args} OUTPUT_VARIABLE ${output} RETURN_VALUE exitCode)
if(NOT ${exitCode} EQUAL 0)
message(FATAL_ERROR "exec deepin-os-release failed, with args: ${args}, error message: ${output}")
endif()
endmacro()
execDeepinOsRelease(--deepin-type DEEPIN_OS_TYPE)
execDeepinOsRelease(--deepin-version DEEPIN_OS_VERSION)
execDeepinOsRelease(--product-type CMAKE_PLATFORM_ID)
execDeepinOsRelease(--product-version CMAKE_PLATFORM_VERSION)
if("${CMAKE_PLATFORM_ID}" STREQUAL "")
message(WARNING "No value of the \"--product-type\" in the process \"${DEEPIN_OS_RELEASE_TOOL}\"")
else()
formatString(CMAKE_PLATFORM_ID)
message("OS: ${CMAKE_PLATFORM_ID}, Version: ${CMAKE_PLATFORM_VERSION}")
if(NOT "${CMAKE_PLATFORM_ID}" STREQUAL "")
addDefinitions(Q_OS_${CMAKE_PLATFORM_ID})
string(TOUPPER ${CMAKE_PLATFORM_ID} CMAKE_PLATFORM_ID)
set(OS_${CMAKE_PLATFORM_ID} TRUE)
endif()
formatString(CMAKE_PLATFORM_VERSION)
add_definitions(-DQ_OS_VERSION=\"${CMAKE_PLATFORM_VERSION}\")
#uos base with deepin
if("${CMAKE_PLATFORM_ID}" STREQUAL "UOS")
addDefinitions(Q_OS_DEEPIN)
set(OS_DEEPIN TRUE)
endif()
endif()
if("${DEEPIN_OS_TYPE}" STREQUAL "")
message(WARNING "No value of the \"--deepin-type\" in the process \"${DEEPIN_OS_RELEASE_TOOL}\"")
else()
formatString(DEEPIN_OS_TYPE)
message("Deepin OS Type: ${DEEPIN_OS_TYPE}")
message("Deepin OS Version: ${DEEPIN_OS_VERSION}")
if(NOT "${DEEPIN_OS_TYPE}" STREQUAL "")
addDefinitions(Q_OS_DEEPIN_${DEEPIN_OS_TYPE})
addDefinitions(DEEPIN_DDE)
string(TOUPPER ${DEEPIN_OS_TYPE} DEEPIN_OS_TYPE)
set(OS_DEEPIN_${DEEPIN_OS_TYPE} TRUE)
set(DEEPIN_DDE TRUE)
endif()
formatString(DEEPIN_OS_VERSION)
add_definitions(-DQ_OS_DEEPIN_VERSION=\"${DEEPIN_OS_VERSION}\")
endif()
dtkcore-5.7.12/cmake/DtkCMake/DtkCMakeConfig.cmake.in 0000664 0000000 0000000 00000005072 14762266606 0022147 0 ustar 00root root 0000000 0000000 function(addDefinitions macro)
string(TOUPPER ${macro} macro)
add_definitions(-D${macro})
endfunction()
add_definitions(-DQ_HOST_NAME=\"${CMAKE_HOST_SYSTEM_PROCESSOR}\")
addDefinitions(Q_HOST_${CMAKE_HOST_SYSTEM_PROCESSOR})
find_package(Dtk@DTK_VERSION_MAJOR@Core REQUIRED)
set(DEEPIN_OS_RELEASE_TOOL_PATH ${DtkCore_TOOL_DIRS})
set(DEEPIN_OS_RELEASE_TOOL ${DEEPIN_OS_RELEASE_TOOL_PATH}/deepin-os-release)
if(NOT EXISTS "${DEEPIN_OS_RELEASE_TOOL}")
message(FATAL_ERROR "\"${DEEPIN_OS_RELEASE_TOOL}\" is not exists. Install \"dtkcore-bin\" first")
endif()
function(formatString string)
string(REGEX REPLACE "\\s+" "_" string ${string})
endfunction()
macro(execDeepinOsRelease args output)
exec_program(${DEEPIN_OS_RELEASE_TOOL} ARGS ${args} OUTPUT_VARIABLE ${output} RETURN_VALUE exitCode)
if(NOT ${exitCode} EQUAL 0)
message(FATAL_ERROR "exec deepin-os-release failed, with args: ${args}, error message: ${output}")
endif()
endmacro()
execDeepinOsRelease(--deepin-type DEEPIN_OS_TYPE)
execDeepinOsRelease(--deepin-version DEEPIN_OS_VERSION)
execDeepinOsRelease(--product-type CMAKE_PLATFORM_ID)
execDeepinOsRelease(--product-version CMAKE_PLATFORM_VERSION)
if("${CMAKE_PLATFORM_ID}" STREQUAL "")
message(WARNING "No value of the \"--product-type\" in the process \"${DEEPIN_OS_RELEASE_TOOL}\"")
else()
formatString(CMAKE_PLATFORM_ID)
message("OS: ${CMAKE_PLATFORM_ID}, Version: ${CMAKE_PLATFORM_VERSION}")
if(NOT "${CMAKE_PLATFORM_ID}" STREQUAL "")
addDefinitions(Q_OS_${CMAKE_PLATFORM_ID})
string(TOUPPER ${CMAKE_PLATFORM_ID} CMAKE_PLATFORM_ID)
set(OS_${CMAKE_PLATFORM_ID} TRUE)
endif()
formatString(CMAKE_PLATFORM_VERSION)
add_definitions(-DQ_OS_VERSION=\"${CMAKE_PLATFORM_VERSION}\")
#uos base with deepin
if("${CMAKE_PLATFORM_ID}" STREQUAL "UOS")
addDefinitions(Q_OS_DEEPIN)
set(OS_DEEPIN TRUE)
endif()
endif()
if("${DEEPIN_OS_TYPE}" STREQUAL "")
message(WARNING "No value of the \"--deepin-type\" in the process \"${DEEPIN_OS_RELEASE_TOOL}\"")
else()
formatString(DEEPIN_OS_TYPE)
message("Deepin OS Type: ${DEEPIN_OS_TYPE}")
message("Deepin OS Version: ${DEEPIN_OS_VERSION}")
if(NOT "${DEEPIN_OS_TYPE}" STREQUAL "")
addDefinitions(Q_OS_DEEPIN_${DEEPIN_OS_TYPE})
addDefinitions(DEEPIN_DDE)
string(TOUPPER ${DEEPIN_OS_TYPE} DEEPIN_OS_TYPE)
set(OS_DEEPIN_${DEEPIN_OS_TYPE} TRUE)
set(DEEPIN_DDE TRUE)
endif()
formatString(DEEPIN_OS_VERSION)
add_definitions(-DQ_OS_DEEPIN_VERSION=\"${DEEPIN_OS_VERSION}\")
endif()
dtkcore-5.7.12/cmake/DtkDConfig/ 0000775 0000000 0000000 00000000000 14762266606 0016314 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/cmake/DtkDConfig/DtkDConfigConfig.cmake 0000664 0000000 0000000 00000007322 14762266606 0022424 0 ustar 00root root 0000000 0000000 # SPDX-FileCopyrightText: 2022 - 2023 Uniontech Software Technology Co.,Ltd.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
# This cmake file is used to deploy files that dconfig's meta and override configure.
include(CMakeParseArguments)
# get subpath according `FILE` and `BASE`.
# e.g: FILE = /a/b/c/d/foo.json, BASE = /a/b, then return SUBPATH = /c/d/
function(get_subpath FILE BASE SUBPATH)
get_filename_component(BASE_FILE_PATH ${BASE} REALPATH)
get_filename_component(FILE_PATH ${FILE} REALPATH)
string(REPLACE ${BASE_FILE_PATH} "" SUBPATH_FILE_NAME ${FILE_PATH})
get_filename_component(SUBPATH_PATH ${SUBPATH_FILE_NAME} DIRECTORY)
set(${SUBPATH} ${SUBPATH_PATH} PARENT_SCOPE)
endfunction()
if(NOT DEFINED DSG_DATA_DIR)
set(DSG_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/dsg)
endif()
add_definitions(-DDSG_DATA_DIR=\"${DSG_DATA_DIR}\")
# deploy some `meta` 's configure.
#
# FILES - deployed files.
# BASE - used to get subpath, if it's empty, only copy files, and ignore it's subpath structure.
# APPID - working for the app.
# COMMONID - working for common.
#
# e.g:
# dtk_add_config_meta_files(APPID dconfigexample BASE ./configs FILES ./configs/example.json ./configs/a/example.json)
#
function(dtk_add_config_meta_files)
set(oneValueArgs BASE APPID COMMONID)
set(multiValueArgs FILES)
cmake_parse_arguments(METAITEM "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
foreach(_current_FILE ${METAITEM_FILES})
set(SUBPATH "")
if (DEFINED METAITEM_BASE)
GET_SUBPATH(${_current_FILE} ${METAITEM_BASE} SUBPATH)
endif()
if (DEFINED METAITEM_APPID)
install(FILES "${_current_FILE}" DESTINATION ${DSG_DATA_DIR}/configs/${METAITEM_APPID}/${SUBPATH})
elseif (DEFINED METAITEM_COMMONID)
install(FILES ${_current_FILE} DESTINATION ${DSG_DATA_DIR}/configs/${SUBPATH})
else()
message(FATAL_ERROR "Please set APPID or COMMONID for the meta item." ${_current_FILE})
endif()
endforeach()
endfunction()
# deploy some `meta` 's override configure.
#
# configuration for the `meta_name` 's override configure.
#
# FILES - deployed files.
# BASE - used to get subpath, if it's empty, only copy files, and ignore it's subpath structure.
# APPID - working for the app, if it's empty, working for all app.
# META_NAME - override for the meta configure.
#
# e.g :
#dtk_add_config_override_files(APPID dconfigexample BASE ./configs META_NAME example FILES ./configs/dconf-example.override.json ./configs/a/dconf-example.override.a.json)
#
function(dtk_add_config_override_files)
set(options)
set(oneValueArgs BASE APPID META_NAME)
set(multiValueArgs FILES)
cmake_parse_arguments(OVERRIDEITEM "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (NOT DEFINED OVERRIDEITEM_META_NAME)
message(FATAL_ERROR "Please set meta_name for the override configuration." ${FILES})
endif()
foreach(_current_FILE ${OVERRIDEITEM_FILES})
set(SUBPATH "")
if (DEFINED OVERRIDEITEM_BASE)
GET_SUBPATH(${_current_FILE} ${OVERRIDEITEM_BASE} SUBPATH)
endif()
if (DEFINED OVERRIDEITEM_APPID)
install(FILES "${_current_FILE}" DESTINATION ${DSG_DATA_DIR}/configs/overrides/${OVERRIDEITEM_APPID}/${OVERRIDEITEM_META_NAME}/${SUBPATH})
else()
install(FILES "${_current_FILE}" DESTINATION ${DSG_DATA_DIR}/configs/overrides/${OVERRIDEITEM_META_NAME}/${SUBPATH})
endif()
endforeach()
endfunction()
# deprecated since dtk6
function(dconfig_meta_files)
dtk_add_config_meta_files(${ARGV})
endfunction()
function(dconfig_override_files)
dtk_add_config_override_files(${ARGV})
endfunction()
dtkcore-5.7.12/cmake/DtkDConfig/DtkDConfigConfig.cmake.in 0000664 0000000 0000000 00000007051 14762266606 0023030 0 ustar 00root root 0000000 0000000 # SPDX-FileCopyrightText: 2022 - 2023 Uniontech Software Technology Co.,Ltd.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
# This cmake file is used to deploy files that dconfig's meta and override configure.
include(CMakeParseArguments)
# get subpath according `FILE` and `BASE`.
# e.g: FILE = /a/b/c/d/foo.json, BASE = /a/b, then return SUBPATH = /c/d/
function(get_subpath FILE BASE SUBPATH)
get_filename_component(BASE_FILE_PATH ${BASE} REALPATH)
get_filename_component(FILE_PATH ${FILE} REALPATH)
string(REPLACE ${BASE_FILE_PATH} "" SUBPATH_FILE_NAME ${FILE_PATH})
get_filename_component(SUBPATH_PATH ${SUBPATH_FILE_NAME} DIRECTORY)
set(${SUBPATH} ${SUBPATH_PATH} PARENT_SCOPE)
endfunction()
if(NOT DEFINED DSG_DATA_DIR)
set(DSG_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/dsg)
endif()
add_definitions(-DDSG_DATA_DIR=\"${DSG_DATA_DIR}\")
# deploy some `meta` 's configure.
#
# FILES - deployed files.
# BASE - used to get subpath, if it's empty, only copy files, and ignore it's subpath structure.
# APPID - working for the app.
# COMMONID - working for common.
#
# e.g:
# dtk_add_config_meta_files(APPID dconfigexample BASE ./configs FILES ./configs/example.json ./configs/a/example.json)
#
function(dtk_add_config_meta_files)
set(oneValueArgs BASE APPID COMMONID)
set(multiValueArgs FILES)
cmake_parse_arguments(METAITEM "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
foreach(_current_FILE ${METAITEM_FILES})
set(SUBPATH "")
if (DEFINED METAITEM_BASE)
GET_SUBPATH(${_current_FILE} ${METAITEM_BASE} SUBPATH)
endif()
if (DEFINED METAITEM_APPID)
install(FILES "${_current_FILE}" DESTINATION ${DSG_DATA_DIR}/configs/${METAITEM_APPID}/${SUBPATH})
elseif (DEFINED METAITEM_COMMONID)
install(FILES ${_current_FILE} DESTINATION ${DSG_DATA_DIR}/configs/${SUBPATH})
else()
message(FATAL_ERROR "Please set APPID or COMMONID for the meta item." ${_current_FILE})
endif()
endforeach()
endfunction()
# deploy some `meta` 's override configure.
#
# configuration for the `meta_name` 's override configure.
#
# FILES - deployed files.
# BASE - used to get subpath, if it's empty, only copy files, and ignore it's subpath structure.
# APPID - working for the app, if it's empty, working for all app.
# META_NAME - override for the meta configure.
#
# e.g :
#dtk_add_config_override_files(APPID dconfigexample BASE ./configs META_NAME example FILES ./configs/dconf-example.override.json ./configs/a/dconf-example.override.a.json)
#
function(dtk_add_config_override_files)
set(options)
set(oneValueArgs BASE APPID META_NAME)
set(multiValueArgs FILES)
cmake_parse_arguments(OVERRIDEITEM "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (NOT DEFINED OVERRIDEITEM_META_NAME)
message(FATAL_ERROR "Please set meta_name for the override configuration." ${FILES})
endif()
foreach(_current_FILE ${OVERRIDEITEM_FILES})
set(SUBPATH "")
if (DEFINED OVERRIDEITEM_BASE)
GET_SUBPATH(${_current_FILE} ${OVERRIDEITEM_BASE} SUBPATH)
endif()
if (DEFINED OVERRIDEITEM_APPID)
install(FILES "${_current_FILE}" DESTINATION ${DSG_DATA_DIR}/configs/overrides/${OVERRIDEITEM_APPID}/${OVERRIDEITEM_META_NAME}/${SUBPATH})
else()
install(FILES "${_current_FILE}" DESTINATION ${DSG_DATA_DIR}/configs/overrides/${OVERRIDEITEM_META_NAME}/${SUBPATH})
endif()
endforeach()
endfunction()
@DCONFIG_DEPRECATED_FUNCS@
dtkcore-5.7.12/cmake/DtkTools/ 0000775 0000000 0000000 00000000000 14762266606 0016103 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/cmake/DtkTools/DtkDBusMacros.cmake 0000664 0000000 0000000 00000005322 14762266606 0021554 0 ustar 00root root 0000000 0000000 # Copyright 2005-2011 Kitware, Inc.
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
include(MacroAddFileDependencies)
include(CMakeParseArguments)
function(dtk_add_dbus_interface _sources _interface _relativename)
get_filename_component(_infile ${_interface} ABSOLUTE)
get_filename_component(_basepath ${_relativename} DIRECTORY)
get_filename_component(_basename ${_relativename} NAME)
set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_relativename}.h")
set(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_relativename}.cpp")
if(${QT_VERSION_MAJOR} EQUAL "5")
if(_basepath)
set(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/${_basename}.moc")
else()
set(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc")
endif()
else()
if(_basepath)
set(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basepath}/moc_${_basename}.cpp")
else()
set(_moc "${CMAKE_CURRENT_BINARY_DIR}/moc_${_basename}.cpp")
endif()
endif()
get_source_file_property(_nonamespace ${_interface} NO_NAMESPACE)
if(_nonamespace)
set(_params -N -m)
else()
set(_params -m)
endif()
get_source_file_property(_skipincludeannotations ${_interface} SKIP_INCLUDE_ANNOTATIONS)
if(_skipincludeannotations)
set(_params ${_params} -S)
endif()
get_source_file_property(_classname ${_interface} CLASSNAME)
if(_classname)
set(_params ${_params} -c ${_classname})
endif()
get_source_file_property(_include ${_interface} INCLUDE)
if(_include)
set(_params ${_params} -i ${_include})
endif()
add_custom_command(OUTPUT "${_impl}" "${_header}"
COMMAND ${DTK_XML2CPP} ${_params} -p ${_relativename} ${_infile}
DEPENDS ${_infile} ${DTK_XML2CPP}
VERBATIM
)
set_source_files_properties("${_impl}" "${_header}" PROPERTIES
SKIP_AUTOMOC TRUE
SKIP_AUTOUIC TRUE
)
qt_generate_moc("${_header}" "${_moc}")
list(APPEND ${_sources} "${_impl}" "${_header}")
set_property(SOURCE "${_impl}" APPEND PROPERTY OBJECT_DEPENDS "${_moc}")
set(${_sources} ${${_sources}} PARENT_SCOPE)
endfunction()
function(dtk_add_dbus_interfaces _sources)
foreach(_current_FILE ${ARGN})
get_filename_component(_infile ${_current_FILE} ABSOLUTE)
get_filename_component(_basename ${_current_FILE} NAME)
# get the part before the ".xml" suffix
string(TOLOWER ${_basename} _basename)
string(REGEX REPLACE "(.*\\.)?([^\\.]+)\\.xml" "\\2" _basename ${_basename})
dtk_add_dbus_interface(${_sources} ${_infile} ${_basename}interface)
endforeach()
set(${_sources} ${${_sources}} PARENT_SCOPE)
endfunction()
dtkcore-5.7.12/cmake/DtkTools/DtkDConfigMacros.cmake 0000664 0000000 0000000 00000002701 14762266606 0022226 0 ustar 00root root 0000000 0000000 # SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
# SPDX-License-Identifier: LGPL-3.0-or-later
include(MacroAddFileDependencies)
include(CMakeParseArguments)
# Define the helper function
function(dtk_add_config_to_cpp OUTPUT_VAR JSON_FILE)
if(NOT EXISTS ${JSON_FILE})
message(FATAL_ERROR "JSON file ${JSON_FILE} does not exist.")
endif()
cmake_parse_arguments(
"arg"
""
"OUTPUT_FILE_NAME;CLASS_NAME"
""
${ARGN}
)
# Generate the output header file name
get_filename_component(FILE_NAME_WLE ${JSON_FILE} NAME_WLE)
if(DEFINED arg_OUTPUT_FILE_NAME)
set(OUTPUT_HEADER "${CMAKE_CURRENT_BINARY_DIR}/${arg_OUTPUT_FILE_NAME}")
else()
set(OUTPUT_HEADER "${CMAKE_CURRENT_BINARY_DIR}/dconfig_${FILE_NAME_WLE}.hpp")
endif()
# Check if CLASS_NAME is set
if(DEFINED arg_CLASS_NAME)
set(CLASS_NAME_ARG -c ${arg_CLASS_NAME})
else()
set(CLASS_NAME_ARG "")
endif()
# Add a custom command to run dconfig2cpp
add_custom_command(
OUTPUT ${OUTPUT_HEADER}
COMMAND ${DTK_DCONFIG2CPP} -o ${OUTPUT_HEADER} ${CLASS_NAME_ARG} ${JSON_FILE}
DEPENDS ${JSON_FILE} ${DTK_XML2CPP}
COMMENT "Generating ${OUTPUT_HEADER} from ${JSON_FILE}"
VERBATIM
)
# Add the generated header to the specified output variable
set(${OUTPUT_VAR} ${${OUTPUT_VAR}} ${OUTPUT_HEADER} PARENT_SCOPE)
endfunction()
dtkcore-5.7.12/cmake/DtkTools/DtkSettingsToolsMacros.cmake 0000664 0000000 0000000 00000005357 14762266606 0023550 0 ustar 00root root 0000000 0000000 #=============================================================================
# Copyright 2019 Deepin Technology Co., Ltd.
# Copyright 2019 Gary Wang
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# * Neither the name of authors nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#=============================================================================
function(DTK_CREATE_I18N_FROM_JSON _generated_file_list _input_json_file _output_cpp_file_name)
set (generated_file_list) # 0(failed) or 1(succeeded) files in the list.
get_filename_component(_input_json_abs_path ${_input_json_file} ABSOLUTE)
get_filename_component(_input_json_abs_dir ${_input_json_abs_path} DIRECTORY)
set (_output_cpp_abs_path ${_input_json_abs_dir}/${_output_cpp_file_name})
if (DTK_SETTINGS_TOOLS_FOUND)
add_custom_command(OUTPUT ${_output_cpp_abs_path}
COMMAND ${DTK_SETTINGS_TOOLS_EXECUTABLE}
ARGS ${_input_json_abs_path} -o ${_output_cpp_abs_path}
DEPENDS ${_input_json_abs_path} VERBATIM)
list(APPEND generated_file_list ${_output_cpp_abs_path})
else ()
message (WARNING "The dtk-settings tools could not be found at ${DTK_SETTINGS_TOOLS_EXECUTABLE}")
message (WARNING "Package distributor may create a separated package for tools like `libdtkcore-bin`.")
endif ()
set(${_generated_file_list} ${generated_file_list} PARENT_SCOPE)
endfunction()
dtkcore-5.7.12/cmake/DtkTools/DtkToolsConfig.cmake.in 0000664 0000000 0000000 00000001262 14762266606 0022404 0 ustar 00root root 0000000 0000000 include(CMakeFindDependencyMacro)
find_dependency(Dtk@DTK_VERSION_MAJOR@Core REQUIRED)
set (DTK_SETTINGS_TOOLS_EXECUTABLE ${DtkCore_TOOL_DIRS}/dtk-settings)
if (EXISTS ${DTK_SETTINGS_TOOLS_EXECUTABLE})
set(DTK_SETTINGS_TOOLS_FOUND TRUE)
endif ()
include("${CMAKE_CURRENT_LIST_DIR}/Dtk@DTK_VERSION_MAJOR@SettingsToolsMacros.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/Dtk@DTK_VERSION_MAJOR@ToolsTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/DtkDBusMacros.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/DtkDConfigMacros.cmake")
get_target_property(DTK_XML2CPP Dtk@DTK_VERSION_MAJOR@::Xml2Cpp LOCATION)
get_target_property(DTK_DCONFIG2CPP Dtk@DTK_VERSION_MAJOR@::DConfig2Cpp LOCATION)
dtkcore-5.7.12/conanfile.py 0000664 0000000 0000000 00000006617 14762266606 0015602 0 ustar 00root root 0000000 0000000 # SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from conans import ConanFile, tools
class DtkcoreConan(ConanFile):
name = 'dtkcore'
version = '2.0.9'
license = 'GPL'
author = 'Iceyer me@iceyer.net'
url = 'https://github.com/linuxdeepin/dtkcore'
description = 'cross platform ui library'
topics = ('qt', 'dtk')
settings = 'os', 'compiler', 'build_type', 'arch'
options = {'shared': [True, False]}
default_options = 'shared=False'
generators = 'qmake'
exports_sources = '*'
requires = 'jom_installer/1.1.2@bincrafters/stable', 'qt/5.6.3@iceyer/stable'
def extend_include_path(self):
return '%s/include/libdtk-%s/DCore' % (self.package_folder, self.version)
# def source(self):
# self.run('git clone https://github.com/linuxdeepin/dtkcore.git source')
# self.run('cd source && git checkout 2.0.9.9')
def build(self):
outdir = self.build_folder
# includedir = outdir + '/include'
mkspecsdir = outdir + '/mkspecs'
# libdir = outdir + '/lib'
env_vars = tools.vcvars_dict(self.settings)
env_vars['_CL_'] = '/utf-8'
with tools.environment_append(env_vars):
command = 'qmake -r'
command += ' VERSION=%s' % self.version
# command += ' CONFIG-=debug_and_release'
# command += ' CONFIG-=debug_and_release_target'
command += ' CONFIG+=release'
command += ' PREFIX=%s' % outdir
command += ' MKSPECS_INSTALL_DIR=%s' % mkspecsdir
command += ' DTK_STATIC_LIB=YES'
command += ' DTK_STATIC_TRANSLATION=YES'
command += ' DTK_NO_MULTIMEDIA=YES'
command += ' %s' % self.source_folder
self.run(command)
self.run('jom clean')
self.run('jom')
self.run('jom install')
def package(self):
self.deploy()
outdir = self.build_folder
self.copy('*', dst='include', src=outdir+'/include')
self.copy('*.lib', dst='lib', src=outdir+'/lib')
self.copy('*', dst='mkspecs', src=outdir+'/mkspecs')
def package_info(self):
self.cpp_info.libs = ['dtkcore']
self.cpp_info.includedirs.append(self.extend_include_path())
self.env_info.QMAKEPATH = self.cpp_info.rootpath
self.env_info.QMAKEFEATURES = self.cpp_info.rootpath + '/mkspecs/features'
def deploy(self):
try:
content = []
module_pri = self.build_folder + '/mkspecs/modules/qt_lib_dtkcore.pri'
s = open(module_pri)
for line in s.readlines():
if line.startswith('QT.dtkcore.tools'):
line = 'QT.dtkcore.tools = %s\n' % (
self.package_folder + '/bin')
elif line.startswith('QT.dtkcore.libs'):
line = 'QT.dtkcore.libs = %s\n' % (
self.package_folder + '/lib')
elif line.startswith('QT.dtkcore.includes'):
line = 'QT.dtkcore.includes = %s\n' % (
self.extend_include_path())
content.append(line)
s.close()
# print('create module file', content)
s = open(module_pri, 'w')
s.writelines(content)
except FileNotFoundError:
print('skip update qt module file')
dtkcore-5.7.12/debian/ 0000775 0000000 0000000 00000000000 14762266606 0014502 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/debian/changelog 0000664 0000000 0000000 00000027632 14762266606 0016366 0 ustar 00root root 0000000 0000000 dtkcore (5.7.12) unstable; urgency=medium
* feat: dconfig2cpp always add bindableFoo functions on Qt6
* feat: Add files generated by qdbusXML2cpp and DCONG2cpp
-- YeShanShan Thu, 06 Mar 2025 17:29:21 +0800
dtkcore (5.7.11) unstable; urgency=medium
* feat: dconfig2cpp generated codes supports qml
* feat: export ProductType for QML
* feat: async get dconfig value for DLog
* feat: support auto generate the Qt code from a dconfig's json
-- YeShanShan Thu, 27 Feb 2025 20:47:22 +0800
dtkcore (5.7.10) unstable; urgency=medium
* Release 5.7.10
-- YeShanShan Thu, 13 Feb 2025 17:18:04 +0800
dtkcore (5.7.9) unstable; urgency=medium
[ root ]
* UNRELEASED
-- Deepin Packages Builder Thu, 23 Jan 2025 09:07:08 +0000
dtkcore (5.7.8) unstable; urgency=medium
[ root ]
* UNRELEASED
-- Deepin Packages Builder Tue, 14 Jan 2025 11:17:31 +0000
dtkcore (5.7.7) unstable; urgency=medium
[ root ]
* UNRELEASED
-- Deepin Packages Builder Thu, 09 Jan 2025 09:28:38 +0000
dtkcore (5.7.6) unstable; urgency=medium
[ root ]
* UNRELEASED
-- Deepin Packages Builder Thu, 02 Jan 2025 05:43:52 +0000
dtkcore (5.7.5) unstable; urgency=medium
* fix: pidfd leak
-- Deepin Packages Builder Thu, 12 Dec 2024 03:03:54 +0000
dtkcore (5.7.4) unstable; urgency=medium
* fix: hasVtable is incorrect when destructing
-- Deepin Packages Builder Tue, 03 Dec 2024 02:00:45 +0000
dtkcore (5.7.3) unstable; urgency=medium
[ root ]
* UNRELEASED
-- Deepin Packages Builder Wed, 20 Nov 2024 02:19:06 +0000
dtkcore (5.7.2) unstable; urgency=medium
[ root ]
* UNRELEASED
-- Deepin Packages Builder Wed, 13 Nov 2024 01:53:26 +0000
dtkcore (5.7.1) unstable; urgency=medium
* feat: 增加智能终端设备类型 (#434)
Thanks to Whale107
* fix: remove unnecessary link libraries
* fix: DDBusInterface signal loss
* fix(util): error appid from `getAppIdFromAbsolutePath`
-- Deepin Packages Builder Wed, 16 Oct 2024 03:30:45 +0000
dtkcore (5.6.34) unstable; urgency=medium
[ root ]
* UNRELEASED
-- Deepin Packages Builder Tue, 20 Aug 2024 05:03:51 +0000
dtkcore (5.6.32) unstable; urgency=medium
* refactor: log files move to dtklog(Issue: #182)
-- Deepin Packages Builder Mon, 08 Jul 2024 02:29:21 +0000
dtkcore (5.6.31) unstable; urgency=medium
* chore: use '&&' and '||' instead of 'and' and 'or'
-- Deepin Packages Builder Thu, 27 Jun 2024 09:11:34 +0000
dtkcore (5.6.30) unstable; urgency=medium
* feat: 允许基于dtk开发的应用动态控制其日志输出等级(Task: 307567)(Influence: 允许基于dtk开发的应用动态控制其日志输出等级)
* fix: lshw查询内存大小时返回多元素数组,修正解析过程(Bug: 228681)(Influence: DSysInfo::memoryInstalledSize解析过程)
* fix: 从文件中读取deepinType和productType值时因为权限问题会失败(Influence: 正常显示版本和说明)
* feat: 增加registerLoggingRulesWatcher接口(Task: 303379)
* fix: 修复计算 build 版本号错误的问题(Influence: 构建版本号(BUILD_VERSION ))
* feat: DeepinType类型增加军用版(Task: 316703)(Influence: DeepinType类型)
* fix: 修复日志格式时间戳显示异常问题(Bug: 236239)(Influence: 使用DLogManager的应用日志输出格式)
* chore: loggingrules config move to preference
* refactor: remove LoggingRules interface
* fix: crashed when access DSGApplication::id early
* chore: fallback to dsgconfig value
* fix(build): build faild on Qt 6.7.1
-- Deepin Packages Builder Thu, 30 May 2024 02:46:32 +0000
dtkcore (5.6.29) unstable; urgency=medium
* chore: remove warning for dbusxml2cpp in qt6
-- Deepin Packages Builder Mon, 13 May 2024 03:02:53 +0000
dtkcore (5.6.28) unstable; urgency=medium
* fix: fix undefined reference errors on spdlog 1.14.0
Thanks to hillwoodroc
-- Deepin Packages Builder Mon, 29 Apr 2024 08:23:39 +0000
dtkcore (5.6.27) unstable; urgency=medium
* fix: lossing value when save DConfig
* fix(qdbusxml2cpp): support qt 6.7
-- Deepin Packages Builder Fri, 19 Apr 2024 08:55:35 +0000
dtkcore (5.6.26) unstable; urgency=medium
[ root ]
* UNRELEASED
-- Deepin Packages Builder Tue, 26 Mar 2024 05:47:35 +0000
dtkcore (5.6.25) unstable; urgency=medium
* chore: fix docs typo
* feat: support to set appId for DConfig
* fix: DConfig add check for name(Issue: #1211374)
-- Deepin Packages Builder Mon, 11 Mar 2024 01:16:26 +0000
dtkcore (5.6.22) unstable; urgency=medium
* Release 5.6.22
-- Deepin Packages Builder Wed, 10 Jan 2024 02:30:59 +0000
dtkcore (5.6.21) unstable; urgency=medium
* fix: app blocked when AM is unavailable
* chore: remove decltype(auto) for dutil
* chore: fix relative path invalid link
* feat: allow skip including headers of annotations(Issue: #147)
-- Deepin Packages Builder Tue, 09 Jan 2024 01:45:43 +0000
dtkcore (5.6.20) unstable; urgency=medium
* feat: add utils function
* chore: Implement DSGApplication::getId
* feat(dstandardpaths): add XDG_STATE_HOME
* chore: keep order when deduplication
* fix: log files limit not work
* chore: add dtk dbus generate function
-- Deepin Packages Builder Tue, 28 Nov 2023 05:40:53 +0000
dtkcore (5.6.19) unstable; urgency=medium
* fix: Type error for qdbusxml2cpp
* fix: correct Dtk6SettingsToolsMacros.cmake path
* chore: add flag UserPublic(Issue: https://github.com/linuxdeepin/developer-center/issues/5928)
-- Deepin Packages Builder Mon, 23 Oct 2023 07:33:19 +0000
dtkcore (5.6.18) unstable; urgency=medium
* fix: Can't clear cache when reset for DConfig in FileBackend
* feat: Add isDefaultValue for DConfig(Issue: #3)
* fix: Compiling failed in lower libspdlog-dev
* fix: missing parameter passing for synchronization
* fix(build): skip failed unit test
* chore(tools): show help if argc < 2
* fix: Compiling failed in libspdlog-dev before 1.4.0
Thanks to Shiroko
* fix: cmake failure when env is null
* chore: correct typos in DtkSettingsToolsMacros.cmake
Thanks to Felix Yan
* chore: dpinyin tweak(Issue: #109)
-- Deepin Packages Builder Wed, 18 Oct 2023 06:01:45 +0000
dtkcore (5.6.17) unstable; urgency=medium
* Release 5.6.17
-- Deepin Packages Builder Fri, 08 Sep 2023 15:12:36 +0800
dtkcore (5.6.16) unstable; urgency=medium
* fix: FileAppender log level not set
* chore: ut linked dtkcore instead of source code
* chore: tweak CMakeLists
* chore: support Qt 6.4 build
* chore: qch docs tweak
* chore: add DtkBuildHelper depends
* chore: console with color at tty
* fix: missing dependency qttools5-dev
* feat: add synchronization workflow
-- Deepin Packages Builder Tue, 22 Aug 2023 06:13:45 +0000
dtkcore (5.6.15) unstable; urgency=medium
* chore: dlog example tweak
-- Yixue Wang Fri, 11 Aug 2023 13:42:20 +0800
dtkcore (5.6.14) unstable; urgency=medium
* chore: function need to be marked as override
* chore: ignore doxygen-theme folder
Thanks to Skye-rs
* chore: change OUTPUT_DIR variable in cmake
* chore: remove unused pro files
* refactor!: deprecate some interfaces in dtk6
* fix: updateProp cannot convert to property type
* fix: typo in xdg
* chore: reduce compilation warnings
Thanks to SPUER(Issue: #96)
* chore(dcapmanager): RuntimeTime -> RuntimeDir
* chore: Sync by https://github.com/linuxdeepin/.github/commit/559e91167d4919644f37bbcf123eb0651c1528ea(Influence: none)
* chore: make test-recoverage.sh runable again
* chore: add ut for DDbusSender
* feat: add systembus send support
* fix: internalPropSet nerver emit propertyChanged
* chore: should include QVector headers
* chore: dsysinfo tweak
* chore: add some unit test
-- Deepin Packages Builder Thu, 27 Jul 2023 06:56:33 +0000
dtkcore (5.6.13) unstable; urgency=medium
* feat: DConfig add check for no existed item when override
* fix(cmake): wrong use of option and wrong macro
* fix: calling delay in DDBusSender(Issue: https://github.com/linuxdeepin/developer-center/issues/4415)
* feat: DConfig add check for subpath(Issue: #54)
* feat: DConfig exports metadir's implementation(Issue: #10)
* fix(dccinterface): fix cannot get the right type
* fix: DConfig's `subpathIsValid` produces error
* fix(ut): failed ut
* fix(build): build faild on Qt6
* fix: fix build failed due to gcc compiler bug
* fix: ut_dfilewater failed on Qt6
* fix: DTextEncoding ut failed in Qt6.
* fix: fix DTextEncoding warnings.
* feat: support dtk6core build
* feat: add DThreadUtils class
* fix: move Qt CorePrivate to target private link
* fix: qdbusxml2cpp-fix not in path
* chore: remove ddbusinterface property cache
* chore: remove libdtkcommon depends
-- Deepin Packages Builder Sun, 25 Jun 2023 14:40:49 +0800
dtkcore (5.6.12) unstable; urgency=medium
* Release 5.6.12
* add DLicenseInfo
* cached memoryInstalledSize
* FIX developer-center#4348
-- Deepin Packages Builder Mon, 15 May 2023 11:18:15 +0800
dtkcore (5.6.11) unstable; urgency=medium
* Release 5.6.11
* add color to ConsoleAppender
* remove build warning
-- Deepin Packages Builder Mon, 08 May 2023 11:48:45 +0800
dtkcore (5.6.10) unstable; urgency=medium
* Release 5.6.10
* support XDG_SESSION_DESKTOP set to DDE
-- Deepin Packages Builder Mon, 17 Apr 2023 17:08:28 +0800
dtkcore (5.6.9) unstable; urgency=medium
* Release 5.6.9
-- Deepin Packages Builder Mon, 03 Apr 2023 09:48:07 +0800
dtkcore (5.6.8) unstable; urgency=medium
* Release 5.6.8
-- Deepin Packages Builder Wed, 22 Feb 2023 14:09:56 +0800
dtkcore (5.6.6) unstable; urgency=medium
* Release 5.6.6
-- Deepin Packages Builder Tue, 21 Feb 2023 12:25:24 +0800
dtkcore (5.6.5) unstable; urgency=medium
* Release 5.6.5
-- Deepin Packages Builder Thu, 02 Feb 2023 14:25:36 +0800
dtkcore (5.6.4) unstable; urgency=medium
* Release 5.6.4
-- Deepin Packages Builder Fri, 06 Jan 2023 16:30:40 +0800
dtkcore (5.6.3) unstable; urgency=medium
* Release 5.6.3
-- Deepin Packages Builder Mon, 12 Dec 2022 14:40:31 +0800
dtkcore (5.6.2.2) unstable; urgency=medium
* release 5.6.2.2
-- Deepin Packages Builder Thu, 17 Nov 2022 17:41:10 +0800
dtkcore (5.6.2.1) unstable; urgency=medium
* snipe release 5.6.2.1
-- Deepin Packages Builder Mon, 31 Oct 2022 16:53:16 +0800
dtkcore (5.6.2) unstable; urgency=medium
* snipe release 5.6.2
-- Deepin Packages Builder Wed, 21 Sep 2022 13:57:29 +0800
dtkcore (5.6.0) unstable; urgency=medium
* snipe release 5.6.0
-- Deepin Packages Builder Mon, 11 Jul 2022 17:47:56 +0800
dtkcore (5.0.3) unstable; urgency=medium
* Release 5.0.3
-- Deepin Packages Builder Tue, 21 Sep 2019 13:31:03 +0800
dtkcore (5.0.0) unstable; urgency=medium
* Release 5.0.0
-- Deepin Packages Builder Tue, 03 Sep 2019 08:47:03 +0800
dtkcore (2.0.8) unstable; urgency=medium
* Release 2.0.8
-- Deepin Packages Builder Wed, 02 May 2018 10:52:03 +0800
dtkcore (0.3.3-1) unstable; urgency=medium
* Initial release
-- Deepin Packages Builder Mon, 10 Oct 2016 16:58:07 +0800
dtkcore-5.7.12/debian/control 0000664 0000000 0000000 00000002642 14762266606 0016111 0 ustar 00root root 0000000 0000000 Source: dtkcore
Section: libdevel
Priority: optional
Maintainer: Deepin Packages Builder
Build-Depends: debhelper-compat ( =12), pkg-config,
qttools5-dev-tools, qttools5-dev, qtbase5-private-dev, doxygen,
libgsettings-qt-dev, libgtest-dev, libdtkcommon-dev, cmake,
libuchardet-dev, libicu-dev, libdtklog-dev
Standards-Version: 3.9.8
Package: libdtkcore5
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, lshw
Multi-Arch: same
Description: Deepin Tool Kit Core library
DtkCore is base library of Deepin Qt/C++ applications.
.
This package contains the shared libraries.
Package: libdtkcore5-bin
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends},
libdtkcore5( =${binary:Version})
Description: Deepin Tool Kit Core Utilities
DtkCore is base devel library of Deepin Qt/C++ applications.
.
This package contains the utilities of DtkCore
Package: libdtkcore-dev
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, libdtkcore5( =${binary:Version}),
libdtkcommon-dev(>=5.6.16), libdtklog-dev
Description: Deepin Tool Kit Core Devel library
DtkCore is base devel library of Deepin Qt/C++ applications.
.
This package contains the header files and static libraries of DtkCore
Package: libdtkcore-doc
Architecture: any
Description: Deepin Tool Kit Core (document)
DtkCore is base devel library of Deepin Qt/C++ applications.
.
This package contains the doc files of DtkCore
dtkcore-5.7.12/debian/copyright 0000664 0000000 0000000 00000001760 14762266606 0016441 0 ustar 00root root 0000000 0000000 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: dtkcore
Source: https://github.com/linuxdeepin/dtkcore
Files: *
Copyright: 2017 Deepin Technology Co., Ltd.
License: LGPL-3+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This package 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 Lesser General Public License for more details.
.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see
.
On Debian systems, the complete text of the GNU Lesser General
Public License version 3 can be found in "/usr/share/common-licenses/LGPL-3".
dtkcore-5.7.12/debian/libdtkcore-dev.install 0000664 0000000 0000000 00000000141 14762266606 0020764 0 ustar 00root root 0000000 0000000 usr/lib/*/lib*.so
usr/include
usr/lib/*/pkgconfig/*.pc
usr/lib/*/cmake/*/*.cmake
usr/lib/*/qt5/*
dtkcore-5.7.12/debian/libdtkcore-doc.install 0000664 0000000 0000000 00000000036 14762266606 0020756 0 ustar 00root root 0000000 0000000 usr/share/qt5/doc/dtkcore.qch
dtkcore-5.7.12/debian/libdtkcore5-bin.install 0000664 0000000 0000000 00000000023 14762266606 0021042 0 ustar 00root root 0000000 0000000 usr/*/*/DCore/bin/* dtkcore-5.7.12/debian/libdtkcore5.install 0000664 0000000 0000000 00000000024 14762266606 0020275 0 ustar 00root root 0000000 0000000 usr/lib/*/lib*.so.*
dtkcore-5.7.12/debian/rules 0000775 0000000 0000000 00000002227 14762266606 0015565 0 ustar 00root root 0000000 0000000 #!/usr/bin/make -f
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk
export QT_SELECT = qt5
export DEB_CXXFLAGS_MAINT_APPEND = -Ofast
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
VERSION = $(DEB_VERSION_UPSTREAM)
PACK_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}')
# Calculate build version:
# 5.6.8 -> 0; 5.6.8.7 -> 7; 5.6.8+u001 -> 1; 5.6.8.7+u001 -> 7; 5.6.8.0+u001 -> 0
BUILD_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}' | awk -F'.' '{print $$4}' | sed 's/[^0-9]//g' | awk '{print int($$1)}')
ifeq ($(BUILD_VER), 0)
ifeq ($(shell expr $(shell echo "$(VERSION)" | awk -F. '{print NF-1}') '<' 3), 1)
BUILD_VER=$(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$2}' | sed 's/[^0-9]//g' | awk '{print int($$1)}')
endif
endif
%:
dh $@
override_dh_auto_configure:
dh_auto_configure -- -DBUILD_WITH_SYSTEMD=ON -DBUILD_EXAMPLES=OFF -DBUILD_DOCS=ON -DBUILD_VERSION=$(BUILD_VER) -DDTK_VERSION=$(PACK_VER) -DD_DSG_APP_DATA_FALLBACK=/var/dsg/appdata
#override_dh_auto_test:
# echo "skip auto test"
override_dh_makeshlibs:
dh_makeshlibs -V "libdtkcore5 (>= $(shell echo $(VERSION) | cut -d '.' -f 1,2))"
dtkcore-5.7.12/debian/source/ 0000775 0000000 0000000 00000000000 14762266606 0016002 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/debian/source/format 0000664 0000000 0000000 00000000015 14762266606 0017211 0 ustar 00root root 0000000 0000000 3.0 (native)
dtkcore-5.7.12/docs/ 0000775 0000000 0000000 00000000000 14762266606 0014210 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/docs/CMakeLists.txt 0000664 0000000 0000000 00000007246 14762266606 0016761 0 ustar 00root root 0000000 0000000 cmake_minimum_required (VERSION 3.10)
find_package (Doxygen REQUIRED)
set (QCH_INSTALL_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/qt${QT_VERSION_MAJOR}/doc CACHE STRING "QCH install location")
set (DOXYGEN_GENERATE_HTML YES CACHE STRING "Doxygen HTML output")
set (DOXYGEN_GENERATE_XML YES CACHE STRING "Doxygen XML output")
set (DOXYGEN_GENERATE_QHP YES CACHE STRING "Doxygen QHP output")
set (DOXYGEN_FILE_PATTERNS *.cpp *.h *.zh_CN.md *.zh_CN.dox CACHE STRING "Doxygen File Patterns")
set (DOXYGEN_PROJECT_NUMBER ${CMAKE_PROJECT_VERSION} CACHE STRING "") # Should be the same as this project is using.
set (DOXYGEN_EXTRACT_STATIC YES)
set (DOXYGEN_OUTPUT_LANGUAGE "Chinese")
if("${QT_VERSION_MAJOR}" STREQUAL "5")
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Help)
else()
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS ToolsTools)
endif()
get_target_property(_qhelpgenerator_location Qt${QT_VERSION_MAJOR}::qhelpgenerator IMPORTED_LOCATION)
if("${_qhelpgenerator_location}" STREQUAL "")
set(_qhelpgenerator_location "qhelpgenerator")
endif()
set (DOXYGEN_QHG_LOCATION ${_qhelpgenerator_location} CACHE STRING "Doxygen QHG path")
set (DOXYGEN_QHP_NAMESPACE "org.deepin.dtk.core")
set (DOXYGEN_QCH_FILE "dtkcore.qch")
set (DOXYGEN_QHP_VIRTUAL_FOLDER "dtkcore")
set (DOXYGEN_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/docs/)
set (DOXYGEN_HTML_EXTRA_STYLESHEET "" CACHE STRING "Doxygen custom stylesheet for HTML output")
set (DOXYGEN_TAGFILES "qtcore.tags=qthelp://org.qt-project.qtcore/qtcore/" CACHE STRING "Doxygen tag files")
set (DOXYGEN_IMAGE_PATH ${PROJECT_SOURCE_DIR}/docs/src)
set (DOXYGEN_SOURCE_BROWSE "YES")
set (BUILD_THEME OFF CACHE BOOL "Build doxgen theme")
if(BUILD_THEME)
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/doxygen-theme")
message(STATUS "doxygen-theme exists")
else()
execute_process(COMMAND git clone https://github.com/linuxdeepin/doxygen-theme.git --depth=1
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
TIMEOUT 60
)
execute_process(COMMAND bash themesetting.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/doxygen-theme/
)
endif()
set (DOXYGEN_HTML_EXTRA_STYLESHEET "docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome.css"
"docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-sidebar-only.css"
"docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-sidebar-only-darkmode-toggle.css"
)
set (DOXYGEN_HTML_EXTRA_FILES "docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-darkmode-toggle.js"
"docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-fragment-copy-button.js"
"docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-paragraph-link.js"
"docs/doxygen-theme/doxygen-awesome-css/doxygen-awesome-interactive-toc.js"
)
set (DOXYGEN_GENERATE_TREEVIEW "YES")
set (DOXYGEN_DISABLE_INDEX "NO")
set (DOXYGEN_FULL_SIDEBAR "NO")
set (DOXYGEN_HTML_HEADER "docs/doxygen-theme/doxygen-awesome-css/header.html")
set (DOXYGEN_HTML_FOOTER "docs/doxygen-theme/doxygen-awesome-css/footer.html")
endif()
set (DOXYGEN_MACRO_EXPANSION "YES")
set (DOXYGEN_PREDEFINED
"DCORE_BEGIN_NAMESPACE=namespace Dtk { namespace Core {"
"DCORE_END_NAMESPACE=}}"
"DCORE_USE_NAMESPACE=using namespace Dtk::Core;"
"Q_OS_LINUX=1"
)
set (DOXYGEN_EXPAND_ONLY_PREDEF "YES")
doxygen_add_docs (doxygen
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/docs
ALL
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generate documentation via Doxygen"
)
install (FILES ${PROJECT_BINARY_DIR}/docs/html/dtkcore.qch DESTINATION ${QCH_INSTALL_DESTINATION})
dtkcore-5.7.12/docs/MainPage.zh_CN.md 0000664 0000000 0000000 00000003565 14762266606 0017224 0 ustar 00root root 0000000 0000000 \mainpage dtkcore
@brief dtk
# dtkcore
## 简介
dtkcore 是一个基于Qt的C++库,它提供了一些常用的工具类,以及一些基础的模块,如日志、插件、网络、线程、数据库、文件、图形、音频、视频、系统信息等
## 使用
现在的dtkcore>=5.6版本使用CMake来管理各个模块,所以使用dtkcore时,需要先安装CMake(CMake>=3.10),然后需要在你的CMake项目中引入dtkcore的CMake模块,如下:
```cmake
find_package(Dtk6Core REQUIRED)
target_link_libraries(
Dtk6::Core
)
```
```qmake
QT += dtkcore
```
```bash
pkg-config --cflags --libs dtk6core
# pkgconfig find Dtk6Core in qmake
# CONFIG += link_pkgconfig
# PKGCONFIG += dtk6core
# pkgconfig find Dtk6Core in cmake
# find_package(PkgConfig REQUIRED)
# pkg_check_modules(Dtk6Core REQUIRED IMPORTED_TARGET dtk6core)
# target_link_libraries( PkgConfig::Dtk6Core )
```
以上示例仅为最小示例,并不能单独作为CMake项目使用,需要你自己添加其他的CMake模块,如Qt的CMake模块,以及你自己的CMake模块.
@note 注意:dtkcore的QMake模块会自动引入Qt5的QMake模块,所以不需要再次引入Qt5的QMake模块,但是在使用CMake的时候必须手动引入Qtcore的CMake模块
## 文档
阅读文档建议从模块页面开始,模块页面提供了dtkcore的各个模块的简介,以及各个模块的使用示例。
@subpage DLog
dtkcore的文档使用doxygen管理,由deepin_doc_doc_go_sig提供维护支持, 如果你也想加入sig,请访问[deepin_doc_doc_go_sig](https://matrix.to/#/#deepin_doc_doc_go:matrix.org)
## 许可
dtkcore使用LGPLv3许可证,你可在此许可证下自由使用dtkcore
dtkcore的文档使用[CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/)许可证,你可在此许可证下自由使用dtkcore的文档,但是转发或者引用时必须注明出处。
dtkcore-5.7.12/docs/Specification.md 0000664 0000000 0000000 00000004641 14762266606 0017317 0 ustar 00root root 0000000 0000000 # Deepin Application Specification {#Specification}
Every application should keep the rule in this document.
## 1. Application Information
Application should set the property Organization-name and Application-name.
Organization/Application name can contains alphabet, number and other visible ASCII code, BUT space MUST NOT appear in the name. And we do not approve
of no-ASCII code character in the Organization/Application name
Application can stay Organization-name empty, but it should always set an Application-name.
## 2. Standard Path
The log, configure and runtime cache of Application should store in specific path.
**If Organization-name is empty, "{Organization-name}/" would not appear in path.**
### 2.1 User Application Standard Path
As an application run for user session, the Standard path should be:
````bash
XGD_LOG_HOME_DEEPIN:
Where deepin-user-specific log should be written.
XGD_USER_HOME/.log
DAPP_CONFIG_HOME:
Where application-specific configurations should be written.
XDG_CONFIG_HOME/{Organization-name}/{Application-name}
DAPP_LOG_HOME:
Where application-specific log should be written.
XGD_LOG_HOME_DEEPIN/{Organization-name}/{Application-name}
DAPP_CACHE_HOME:
Where application-specific cache files should be written.
XGD_CACHE_HOME/{Organization-name}/{Application-name}
DAPP_DATA_HOME:
Where application-specific data files should be written.
$XDG_DATA_HOME/{Organization-name}/{Application-name}
````
Simple example:
The dde-dock is offcial application of deepin and the standard path will be:
````bash
DAPP_CONFIG_HOME: $HOME/.config/deepin/dde-dock
DAPP_LOG_HOME: $HOME/.log/deepin/dde-dock
DAPP_CACHE_HOME: $HOME/.cache/deepin/dde-dock
DAPP_DATA_HOME: $HOME/.local/share/deepin/dde-dock
````
### 2.2 System Application Standard Path
Application run as system daemon, or with user with no home directory should place it's file in this standard path:
````bash
DAPP_CONFIG_SYS:
/etc/{Organization-name}/{Application-name}
DAPP_LOG_SYS:
/var/log/{Organization-name}/{Application-name}
DAPP_DATA_SYS:
/usr/share/{Organization-name}/{Application-name}
DAPP_CACHE_SYS:
/var/cache/{Organization-name}/{Application-name}
````
Refs:
[XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-0.8.html)
[XDG Base Directory support](https://wiki.archlinux.org/index.php/XDG_Base_Directory_support)
dtkcore-5.7.12/docs/dci/ 0000775 0000000 0000000 00000000000 14762266606 0014747 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/docs/dci/ddcifile.zh_CN.dox 0000664 0000000 0000000 00000011763 14762266606 0020236 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@file include/dci/ddcifile.h
@ingroup dci
@class Dtk::Core::DDciFile ddcifile.h
@brief ddcifile.h 是关于dci文件相关操作的一个类,实现了 DCI 文件的逻辑。其只是对数据的打包
dci文件的结构路径如下:

@enum Dtk::Core::DDciFile::FileType
@var Dtk::Core::DDciFile::FileType Dtk::Core::DDciFile::UnknowFile
@brief 未知文件
@var Dtk::Core::DDciFile::FileType Dtk::Core::DDciFile::File
@brief 文件
@var Dtk::Core::DDciFile::FileType Dtk::Core::DDciFile::Directory
@brief 目录
@var Dtk::Core::DDciFile::FileType Dtk::Core::DDciFile::Symlink
@brief 软链接
@fn bool Dtk::Core::DDciFile::isValid()
@brief 判断读取的dci文件是否有效
@details 当指定的dci文件未成功加载时,此函数会返回false,一般会出现在文件格式错误(不是一个dci格式的文件),或者是dci文件数据被篡改而无法识别的情况
@note 本类中所有涉及文件操作的函数均会首先执行此方法,故如无必要,无需手动确保文件是否有效
@fn QString Dtk::Core::DDciFile::lastErrorString()
@brief 获取上一个报错信息,为人类可读字符串,可以通过此报错信息来获取错误内容,一般情况下是因为文件不存在或者文件名过长(>62个字符)导致。
@fn bool Dtk::Core::DDciFile::writeToFile(const QString &fileName)
@brief 写入文件,在做完对于dci文件的操作之后调用此接口,为保存的作用
@param[in] fileName 文件名
@fn bool Dtk::Core::DDciFile::writeToDevice(QIODevice *device)
@brief 写入到设备,设备指的是qt中的io设备,可以在qt文档中找到相关信息
@param[in] device IO设备
@sa [QIODevice](https://doc.qt.io/qt-6/qiodevice.html)
@fn QByteArray Dtk::Core::DDciFile::toData()
@brief 返回dci文件的原始数据,以QByteArray形式返回
@retval 如果返回为空字符串则说明读取失败
@sa DDciFile::writeFile
@fn static constexpr int Dtk::Core::DDciFile::metadataSizeV1()
@brief MAGIC_SIZE + VERSION_SIZE + FILE_COUNT_SIZE: 4+1+3 = 8
@fn QStringList Dtk::Core::DDciFile::list(const QString &dir, bool onlyFileName = false)
@brief 列出文件列表
@param[in] dir 文件夹地址
@param[in] onlyFileName 是否只显示文件名 默认为false
@fn int Dtk::Core::DDciFile::childrenCount(const QString &dir)
@brief 子文件计数
@fn bool Dtk::Core::DDciFile::exists(const QString &filePath)
@brief 判断文件是否存在
@param[in] filePath DCI图标结构路径
@fn FileType Dtk::Core::DDciFile::type(const QString &filePath)
@brief 判断文件类型
@sa DDciFile::FileType
@param[in] filePath DCI图标结构路径
@fn QByteArray Dtk::Core::DDciFile::dataRef(const QString &filePath)
@brief 获取dci内部文件的数据,以一种引用(软连接)的方式获取,不会产生数据的的复制
@param[in] filePath DCI图标结构路径
@retval 如果返回为空字符串,则说明此文件不存在或者无效
@fn QString Dtk::Core::DDciFile::name(const QString &filePath)
@brief 获取dci内文件的文件名
@param[in] filePath DCI图标结构路径
@retval 如果返回为空字符串,则说明此文件不存在或者无效
@fn QString Dtk::Core::DDciFile::symlinkTarget(const QString &filePath, bool originData = false)
@brief 获取软链目标
@param[in] filePath DCI图标结构路径
@param[in] originData
@retval 如果返回为空字符串,则说明此文件不存在或者无效
@note 链接的目标只能是“不存在的路径”、“文件”、“链接”,不可是目录
@fn bool Dtk::Core::DDciFile::mkdir(const QString &filePath)
@brief 创建目录(注意:此目录指的是在dci文件内部的目录,而不是指的是传统目录)
@param[in] filePath DCI图标结构路径
@return 操作是否成功
@fn bool Dtk::Core::DDciFile::writeFile(const QString &filePath, const QByteArray &data, bool override = false)
@brief 写入文件
@param[in] filePath DCI图标结构路径
@param[in] data 数据内容
@param[in] override 当文件已经存在时,是否覆盖此文件,默认状态下不执行覆盖,会在lasterror中记录"The target file is existed"错误信息。
如果传入为true,则会执行覆盖操作,** 此操作不可逆 **。
@return 操作是否成功
@sa QByteArray DDciFile::toData()
@fn bool Dtk::Core::DDciFile::remove(const QString &filePath)
@brief 移除文件
@param[in] filePath DCI图标结构路径
@return 操作是否成功
@fn bool Dtk::Core::DDciFile::rename(const QString &filePath, const QString &newFilePath, bool override = false)
@brief 重命名文件
@param[in] filePath DCI图标结构路径
@param[in] newFilePath 新文件的路径
@param[in] override 当文件已经存在时,是否覆盖此文件,默认状态下不执行覆盖,会在lasterror中记录"The target file is existed"错误信息。
如果传入为true,则会执行覆盖操作,** 此操作不可逆 **。
@return 操作是否成功
@fn bool Dtk::Core::DDciFile::link(const QString &source, const QString &to)
@brief 链接文件
@param[in] source 文件源
@param[in] to 链接目标
@return 操作是否成功
*/
dtkcore-5.7.12/docs/dci/index.zh_CN.md 0000664 0000000 0000000 00000022734 14762266606 0017410 0 ustar 00root root 0000000 0000000 @page dci dci--dci图标工具类
# DTk dci:dci工具类
关于dtkcore提供的dci工具见:[DCI](group__dci.html#files)
下面内容是关于dci文件的简介,还有一部分使用以及工具将会在以后的文档中提供
## 关于dci图标简介
`DCI` 图标是一种整合性图标格式,应用可以使用该图标完成多种状态的自动变化。例如, `ListView` 控件中高亮的 `Item` 图标自动反白,`Menu` 中图标跟随当前 `Item` 变化等等。
`dtkcore` 中提供了一个 `DDciFile` 的类,实现 `DCI` 文件的逻辑。其只是对数据的打包,不限于图片数据,可以是任何文本和二进制数据。 `dtkcore` 中还提供了用于在文管中解析文件的文件引擎,专门用于通过 `QFile` 和 `QDir` 处理 `dci` 文件。
dtkgui 中提供了一个 `DDciIcon` 类,实现了对 `DCI` 图标的逻辑。区别于 `DDciFile` ,它是 `DDciFile` 的上层封装,即使用 DDciFile 可以将文件进行打包归档的功能,封装了一种图标格式。 `DDciIcon` 中提供的接口,都是针对图标的,并无 `DDciFile` 的数据处理操作,多个 `DDciIcon` 进行数据拷贝和交换时,可以进行数据共享。 `DDciIcon` 可以通过调用 pixmap 函数返回需要显示的图片数据,也可以通过调用 paint 函数直接将内容绘制到目标内部。解析 Dci 图标的过程,这里讲解一下,详细过程可以查看代码理解:
首先需要创建一个 DDciFile 来解析 (*.dci) 文件,无论是本地文本还是二进制数据,都可以通过 `DDciFile` 来解析内部内容。
根据 `DDciIcon` 中规定好的路径格式,来解析出图标中拟定的各种信息,一般情况下的 `DDciIcon` 的路径格式是这样的:

最上层时 `/` 作为根目录( `DCI` 文件都必须使用 `/` 作为根目录)。
第一层子目录( 16、32、512 )作为图标的大小。一般情况下是图标在 @1(1倍缩放比) 时的大小(在目前的使用设计师使用的 dci 图标插件的)。例如上述图标,传入的大小在 0-16时选择 16,传入大小在 16-32 时选择 32,... 以此类推。
第二层目录( `normal.light` )作为该层图标的状态和主题,其中状态分为 `Normal` , `Disabled` , `Hovered` 和 `Pressed` 四种,主题分为 `light` 和 `dark` 两种。四种状态和两种主题可产生 8 种组合,也就是说,每种大小的图标最多有八种不同状态和主题的子图标进行切换。需要注意的是:状态和主题存在缺省模式: `normal` 和 `light` 。如果传入的状态和主题在所属大小的子图标下未找到,则选择缺省模式的状态和主题。也就是说,当图标的 `Normal` 和 `light` 状态未找到任何图标时,该图标是无效的。一般情况下,如果图标不会在不同状态和主题下发生过大的样式修改,只修改内部颜色填充时,可以不添加特殊状态的图标,通过修改调色版解决。(后面提及)
第三层目录(1、2)作为缩放比系数,可以存放多个缩放比系数来适配系统的缩放比。例如上述示例:缩放比系数在1和2之间时,选择 2,大于 2 时,选择 2 ,默认情况下选择 1。目前提供的图标中,为了保证尽量减少图标文件的大小,仅保存缩放比为 3 的文件。在软件层面进行缩放。
第四层(1.png)描述图标图片文件(图层)所携带的信息。这些信息中,包含:图层优先级、外边框数值、调色板格式、颜色调整数值、图层格式。可以通过下述文件表
```
├── 1.7p.3.png.alpha8
├── 2.3.webp
└── 3.7p.3_0_0_-10_0_0_0_0.png.alpha8
│ │ │ │ │ │ ┕━┳━┙┕━┳━┙
│ │ │ │ │ │ rgba format
│ │ │ │ │ │
│ │ │ │ │ └─ lightness (亮度)
│ │ │ │ └─ saturation (饱和度)
│ │ │ └─ hue (色调)
│ │ └─ palette (高亮色3)
│ └─ padding (填充间隔)
└─ prior (图层)
.[padding]..
```
下面进行一一介绍:
* **图层优先级**(`prior`):优先级代表图层的绘制顺序,从 1-n 进行绘制,最底层的图层会被上层图层覆盖。
* **外边框数值**(`padding`):外边框在有阴影效果的图标中充分利用。 `padding` 代表图层外围不被控件大小覆盖的区域。

类似控件的布局方式,这里可以之看 `padding` 部分, `padding` 定义四周所有数据,举个例子,如果子图标的大小是 32 (第一层目录的数值),一倍缩放比下,如果该图层的 `padding` 大小时 5,那么该图层的真实图片大小是:[32 + 5 × 2, 32 + 5 × 2] = [42, 42]。但最终, `padding` 区域的大小并不计算在整个图标大小内(仅针对 QML,dtkwidget 不支持)。为了区别其他数据, `padding` 的数值后面使用 `'p'` 进行结尾。例如上述示例:`'7p'` 。
* **调色板格式** :当存在调色板时,就表示该图标的颜色是通过调色板的颜色进行动态变化的,外部修改调色板颜色后,预览效果会随之发生变化。因此该图标有两种特性:1. 可以转换成 alpha8 格式; 2. 可以不需要其他状态,通过调色板变化即可。当无调色板时,该部分的数值为空。调色板格式分为5种:无效(-1)、前景色(0)、背景色(1)、高亮前景色(2)、高亮色(3)。
* **颜色调整数值** :颜色调整只针对有调色板的图层(调色板格式部分数据不为空)时。一旦存在,必须要将其所有的数据写入,例如上述示例。颜色调整数值使用 '_' 进行分割。
每个部分表示:hu、saturation、lightness、red、green、blue、alpha。
* **图层格式** :图层格式可以使用:"png"、"jpg"、"webp"。如果图层存在调色板格式,就意味着可以优化其大小,转化为 alpha8 格式,使用".alpha8" 作为后缀,进行标识,在软件渲染时进行进行复原。
`DCI` 图标的细节介绍在 应用图标,上面主要介绍 `DCI` 图标的整个结构和在 `QML` 中的使用方式。其主要是设计实现了一种特殊格式的文件(.dci),该种格式通过路径,名称和文件数据,打包到同一个文件内,使不同状态、大小、主题的多个图标图片,整合到同一个文件内,在程序内部自动匹配当前状态,选择合适的图标图片。因此,总的来说, `DCI` 图标是对多个图标图片的打包归档。
本文将介绍 `DCI` 图标在 `dtkwidget` 和 `dtkdeclarative` 中的使用,对于一些 `DCI` 图标相关的高级知识(使用方无需过度关心),如 “DDciIconPalette”、“缩放比的适配”以及“图片的格式”等等。
**请注意:** 当使用 `DciIcon` 时,如果您认为控件在某种状态下需要进行图标变色或更换图标而未出现时,可能是由于**设计提供的图标未指定变色所需要的调色板对象(可以理解为图标出错)** 或 **设计认为该种场景下不需要变色(即固定样式图标)**,请及时与设计沟通。
### 1. 图标状态
大部分控件可以分为 `Normal` 、 `Hovered` 、 `Pressed` 和 `Disabled` 四种状态。这四种状态是每种控件的基础状态。因此将使用这几种状态作为图标的状态分类。
#### 答疑
1. 为什么没有 `Checked` 和 `Inactive` 类似这样的状态?
`Checked` 状态属于复合状态,并不属于基础状态。 `Checked` 状态下,可以有 `Hovered` 、 `Pressed` 、 `Normal` 等等状态,相同地, `Unchecked` 状态也会存在一样的情况。因此, `Checked` 状态并不适合作为 `DCI` 图标的状态。对于需要时,可通过控件的 `checked` 状态属性,切换下不同的图标即可。
`Inactive` 状态作为窗口的状态,在 `DTK` 应用都会通过降低透明度的方式实现,而不是作为图标状态。
2. 为什么需要这些状态?
存在这些状态的原因是,为了让应用和开发者更加无感知的使用图标,而无需关心不同状态下进行图标切换的操作。方便设计师一次提供多种状态的图标到一个图标文件中,进行压缩整合。防止出现图标资源较多,占用较大系统内存,同时能够帮助设计师在控件的不同状态下,不仅仅只局限于修改图标颜色这一种功能,也可以通过不同的图标代替,更适合多样化的样式设计。
3. 图标不显示可能是什么原因?
很可能是 webp 格式的支持问题, 查看一下系统中是否安装 `qt5-image-formats-plugins` ,这个包中有对 webp 格式图片格式的支持。
### 2. 图标大小和缩放比
应用所关心的图标大小是否正常,是否能够适配高缩放比模式等等。 `DCI` 图标中都做到了这些,默认情况下,设计师所提供的图标大小能够满足应用开发的需求,应用只需要主动调用接口指定图标大小即可,例如 `dtkwidget`,中 `DIconButton` 可以使用 `setIconSize` 指定; `QML` 中可以指定 `DciIcon` 控件的 `sourceSize` 或者 `Button` 控件的 `icon.size` 等等。而对于高缩放比的适配, `DTK` 已经全部完成无需应用关心。
@defgroup dci
@brief dtkdci图标工具类, 提供对于dci文件的操作方法
@details 详细内容可见 [DCI图标简介](md_docs_dci_index_zh_CN.html#autotoc_md0)
dtkcore-5.7.12/docs/filesystem/ 0000775 0000000 0000000 00000000000 14762266606 0016374 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/docs/filesystem/dbasefilewatcher.zh_CN.dox 0000664 0000000 0000000 00000005564 14762266606 0023416 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dfilesystem
@file include/filesystem/dbasefilewatcher.h
@class Dtk::Core::DBaseFileWatcher
@brief DBaseFileWatcher 类提供了一系列接口可供监视文件和目录的变动。
@note 建议使用 DFileWatcher 类,该类是 DBaseFileWatcher 的子类,提供了更多的功能。或者使用DFileWatcherManager类,该类提供了对文件和目录的监视功能。
@warning 该类是一个虚类,不应该被直接使用,而应该使用 DFileWatcher 类或者 DFileWatcherManager 类。
@fn QUrl Dtk::Core::DBaseFileWatcher::fileUrl()
@brief 返回文件的统一资源定位符
@sa [QUrl](https://doc.qt.io/qt-5/qurl.html)
@fn bool Dtk::Core::DBaseFileWatcher::startWatcher()
@brief 开始监视文件变动
@return true 成功 false 失败
@sa DBaseFileWatcher::stopWatcher
@fn bool Dtk::Core::DBaseFileWatcher::stopWatcher()
@brief 停止监视文件变动
@return true 成功 false 失败
@sa DBaseFileWatcher::startWatcher()
@fn bool Dtk::Core::DBaseFileWatcher::restartWatcher()
@brief 重启监视文件变动
@return true 成功 false 失败
@sa DBaseFileWatcher::startWatcher()
@fn virtual void Dtk::Core::DBaseFileWatcher::setEnabledSubfileWatcher(const QUrl &subfileUrl, bool enabled = true)
@brief 设置是否对`subfileUrl`目录启用文件监视
@param[in] subfileUrl 设置所针对的 Url
@param[in] enabled 是否启用文件变动监视
@fn static bool Dtk::Core::DBaseFileWatcher::ghostSignal(const QUrl &targetUrl, SignalType1 signal, const QUrl &arg1)
@brief 发送一个信号表示目标目录`targetUrl`得到了一个`signal`信号,包含参数`arg1`
使用方式如下:
@code
DBaseFileWatcher::ghostSignal(QUrl("bookmark:///"), &DBaseFileWatcher::fileDeleted, QUrl("bookmark:///bookmarkFile1"));
@endcode
@return 成功发送返回 true,否则返回 false
@fn static bool Dtk::Core::DBaseFileWatcher::ghostSignal(const QUrl &targetUrl, DBaseFileWatcher::SignalType2 signal, const QUrl &arg1, const QUrl &arg2)
@brief 发送一个信号表示目标目录`targetUrl`得到了一个`signal`信号,包含参数`arg1`和`arg2`
@details 示例用法:
@code
DBaseFileWatcher::ghostSignal(QUrl("bookmark:///"), &DBaseFileWatcher::fileMoved, QUrl("bookmark:///bookmarkFile1"), QUrl("bookmark:///NewNameFile1"));
@endcode
@var Dtk::Core::DBaseFileWatcher::fileDeleted(const QUrl &url)
@brief 文件被删除的信号
@var Dtk::Core::DBaseFileWatcher::fileMoved(const QUrl &fromUrl, const QUrl &toUrl)
@brief 文件被移动的信号
@var Dtk::Core::DBaseFileWatcher::fileAttributeChanged(const QUrl &url)
@brief 文件属性被改变的信号
@var Dtk::Core::DBaseFileWatcher::subfileCreated(const QUrl &url)
@brief 子文件被创建的信号
@var Dtk::Core::DBaseFileWatcher::fileClosed(const QUrl &url)
@brief 文件被关闭的信号
@var Dtk::Core::DBaseFileWatcher::fileModified(const QUrl &url)
@brief 文件被修改的信号
*/
dtkcore-5.7.12/docs/filesystem/dcapfile.zh_CN.dox 0000664 0000000 0000000 00000023767 14762266606 0021676 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dfilesystem
@file include/filesystem/dcapfile.h
@class Dtk::Core::DCapFile
@brief 对于文件操作的安全封装, 提供了带有安全管控的文件读取, 相关漏洞见[CWE_22](https://cwe.mitre.org/data/definitions/22.html)
@fn explicit Dtk::Core::DCapFile(QObject *parent = nullptr)
@brief 默认构造函数, 创建一个文件默认文件对象
@fn Dtk::Core::DCapFile::DCapFile(const QString &name, QObject *parent)
@brief 重载的构造函数, 接受传入一个文件名, 并创建一个文件对象
@note 调用此构造函数相当于调用默认构造函数+`DCapFile::setFileName()`
@fn void Dtk::Core::DCapFile::setFileName(const QString &name)
@brief 传入需要操作的文件名
@fn bool Dtk::Core::DCapFile::exists() const
@brief 文件是否存在
@note 此处的存在指当前由setFileName() 指定的文件或者是在构造时指定的文件是否可读可写
@note 需要在构造时或者手动指定了文件名才可以使用此函数, 否则请调用其重载的函数
@fn static bool Dtk::Core::DCapFile::exists(const QString &fileName)
@brief 文件是否存在
@param[in] fileName 文件名
@note 此处的存在指的是此函数的传入的文件名指向的文件是否可读可写
@fn QString Dtk::Core::DCapFile::readLink() const
@brief 读取软连接, 如果软连接指向的文件不允许读写, 则返回空字符串
@note 此方法在Qt版本>=5.13后**废弃**
@return 返回软连接指向的文件或者目录的绝对路径
@note 需要在构造时或者手动指定了文件名才可以使用此函数, 否则请调用其重载的函数
@sa [readLink](https://doc.qt.io/qt-5/qfile-obsolete.html#readLink-1)
@fn QString Dtk::Core::DCapFile::symLinkTarget() const
@brief 这是一个重载函数
返回符号链接, 或Windows上的快捷方式指向的文件或目录的绝对路径, 如果该对象不是符号链接, 则返回一个空字符串。
@fn bool Dtk::Core::DCapFile::remove()
@brief 如果文件存在则删除文件
@note 此处的存在指当前由setFileName() 指定的文件或者是在构造时指定的文件是否可读可写
@note 需要在构造时或者手动指定了文件名才可以使用此函数, 否则请调用其重载的函数
@note 文件需要在删除前被关闭
@fn static bool Dtk::Core::DCapFile::remove(const QString &fileName)
@brief 如果文件存在则删除文件
@param[in] fileName 文件名
@note 此处的存在指的是此函数的传入的文件名指向的文件是否可读可写
@note 文件需要在删除前被关闭
@sa DCapFile::remove()
@fn bool Dtk::Core::DCapFile::moveToTrash()
@brief 如果文件存在则将文件移动至默认回收站(垃圾桶)
@note 此处的存在指当前由setFileName() 指定的文件或者是在构造时指定的文件是否可读可写
@note 需要在构造时或者手动指定了文件名才可以使用此函数, 否则请调用其重载的函数
@note 此方法仅在Qt版本>=5.15.0后可用
@fn bool Dtk::Core::DCapFile::moveToTrash(const QString &fileName, QString *pathInTrash)
@brief 如果传入文件名对应文件存在则将文件移动至指定回收站(垃圾桶)
@note 此处的存在指的是此函数的传入的文件名指向的文件是否可读可写
@note 此方法仅在Qt版本>=5.15.0后可用
@param[in] fileName 文件名
@param[in] pathInTrash 回收站路径
@fn bool Dtk::Core::DCapFile::rename(const QString &newName)
@brief 如果文件名存在则重命名文件
@param[in] newName 新文件名
@note 需要在构造时或者手动指定了文件名才可以使用此函数, 否则请调用其重载的函数
@fn static bool Dtk::Core::DCapFile::rename(const QString &oldName, const QString &newName)
@brief 如果文件名存在则重命名文件
@param[in] oldName 旧文件名
@param[in] newName 新文件名
@fn bool Dtk::Core::DCapFile::link(const QString &newName)
@brief 创建一个名为newName的链接
@details 该链接指向当前由`setFileName()`指定的文件或者是在构造时指定的文件。链接是什么取决于底层文件系统(无论是Windows上的快捷方式还是Unix上的符号链接)。如果成功, 则返回ture;否则返回false
@note 如果是windows系统的newName参数必须有`.lnk`合法后缀才可用
@param[in] newName 新文件名
@fn static bool Dtk::Core::DCapFile::link(const QString &oldname, const QString &newName)
@brief 该函数是重载`DCapFile::link()`区别是需要手动传入原始文件名
@sa DCapFile::link(const QString &newName)
@fn bool Dtk::Core::DCapFile::copy(const QString &newName)
@brief `setFileName()`指定的文件或者是在构造时指定的文件复制一份, 名为newName
如果成功, 则返回ture;否则返回false
@note 确保文件在复制之前是关闭的
@note 如果复制的文件是一个符号链接(symlink), 它所指的文件被复制, 而不是链接本身。除了权限
会被复制外, 其他的文件元数据都不会被复制。
@note 如果一个名称为 newName 的文件已经存在, `copy()`将会返回true但是并不会覆盖它
@fn static bool Dtk::Core::DCapFile::copy(const QString &fileName, const QString &newName)
@brief 该函数是重载`DCapFile::copy(const QString &newName)`区别是需要手动传入原始文件名
@sa DCapFile::copy(const QString &newName)
@fn bool Dtk::Core::DCapFile::open(OpenMode flags)
@brief 使用OpenMode模式打开文件, 如果成功返回true;否则返回false
@details 模式如下:
NotOpen = 0x0000,
ReadOnly = 0x0001,
WriteOnly = 0x0002,
ReadWrite = ReadOnly | WriteOnly,
Append = 0x0004,
Truncate = 0x0008,
Text = 0x0010,
Unbuffered = 0x0020,
NewOnly = 0x0040,
ExistingOnly = 0x0080
@note 在只写或读写模式下, 如果相关文件不存在, 该函数将在打开文件之前尝试创建一个新文件
@fn bool Dtk::Core::DCapFile::resize(qint64 sz)
@brief 设置文件大小sz(以字节为单位)。如果调整大小成功, 则返回true;否则为false。如果sz大于当前文件, 则新字节将设置为 0;如果sz较小, 则文件将被简单地截断
@note 如果文件不存在, 此函数可能会无效
@fn static bool Dtk::Core::DCapFile::resize(const QString &filename, qint64 sz)
@brief 该函数是重载`DCapFile::resize(qint64 sz)`区别是手动指定文件名
@sa DCapFile::resize(qint64 sz)
*/
/*!
@class Dtk::Core::DCapFile
@brief 对于文件夹操作的封装
@fn Dtk::Core::DCapDir::DCapDir(const DCapDir &)
@brief 拷贝构造函数 构造一个DCapDir对象, 该对象是目录目录的DCapDir对象的副本
@fn Dtk::Core::DCapDir::DCapDir(const QString &path = QString())
@brief 构造指向给定目录路径的DCapDir。如果 path 为空, 则使用程序的工作目录`.`
@fn Dtk::Core::DCapDir::DCapDir(const QString &path,
const QString &nameFilter, SortFlags sort = SortFlags(Name | IgnoreCase),
Filters filter = AllEntries)
@brief 构造具有路径路径的DCapDir对象
@details 该 DCapDir 使用nameFilter按名称筛选其条目, 并使用筛选器 按属性筛选其条目。它还使用排序对名称进行排序。
默认名称筛选器是一个空字符串, 它不排除任何内容;默认筛选器是“所有条目”, 这也意味着不排除任何内容。默认排序为“名称|忽略大小写, 即按名称排序, 不区分大小写。
如果path为空字符串, DCapDir 将使用 “.”(当前目录)
如果nameFilter为空字符串, DCapDir 将使用名称筛选器“*”(所有文件)
@note 路径不需要存在
@fn void Dtk::Core::DCapDir::setPath(const QString &path)
@brief 将目录的路径设置为path。该路径被清除了多余的"."、"... "和多个分隔符。没有检查这个路径的
目录是否真的存在;
路径可以是绝对路径也可以是相对路径, 绝对路径以目录分隔符"/"开始(在Windows下可以选择在前面加一个驱动器号, 例如: C:\)
相对路径以目录名开始, 并指定一个相对于当前目录的路径。一个绝对路径的例子是字符串"/etc/apt", 一个相对路径例子是 "src/1/"
@fn bool Dtk::Core::DCapDir::cd(const QString &dirName)
@brief 将DCapDir的目录更改为dirName。
如果新目录存在, 则返回true;否则返回false
请注意, 如果新目录不存在, 则不执行逻辑`cd()`操作
@fn QStringList Dtk::Core::DCapDir::entryList(Filters filters = NoFilter, SortFlags sort = NoSort) const
@brief 返回目录中所有文件和目录的名称列表
@details 这些名称根据以前使用`setNameFilters()` 和`setFilter()`
设置的名称和属性筛选器排序, 并根据使用`setSorting() 设置的标志进行排序。
可以使用过滤器和排序参数覆盖属性过滤器和排序规范。
如果目录不可读、不存在或与规范不匹配, 则返回空列表。
@fn QString Dtk::Core::DCapDir::entryList(const QStringList &nameFilters, Filters filters = NoFilter,
SortFlags sort = NoSort)
@brief 重载函数, 返回目录中所有文件和目录的名称列表
@sa entryList(Filters filters = NoFilter, SortFlags sort = NoSort)
@fn bool Dtk::Core::DCapDir::mkdir(const QString &dirName) const
@brief 创建文件夹
@fn bool Dtk::Core::DCapDir::rmdir(const QString &dirName) const
@brief 移除文件夹
@fn bool Dtk::Core::DCapDir::mkpath(const QString &dirPath)
@brief 创建目录
@fn bool Dtk::Core::DCapDir::rmpath(const QString &dirPath)
@brief 移除目录
@fn bool Dtk::Core::DCapDir::exists() const
@brief 文件夹是否存在(如果找到同名文件, 此函数将返回 false)
@fn bool Dtk::Core::DCapDir::exists(const QString &name) const
@brief 指定文件夹是否存在(如果找到同名文件, 此函数将返回 false)
@fn bool Dtk::Core::DCapDir::remove(const QString &fileName)
@brief 移除文件夹
@fn bool Dtk::Core::DCapDir::rename(const QString &oldName, const QString &newName)
@brief 重命名文件夹
@param[in] oldName 旧文件夹名
@param[in] newName 新文件夹名
*/
dtkcore-5.7.12/docs/filesystem/dfilesystemwatcher.zh_CN.dox 0000664 0000000 0000000 00000011115 14762266606 0024015 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dfilesystem
@file include/filesystem/dfilesystemwatcher.h
@class DFileSystemWatcher
@brief 监听文件系统变化的类
@details
DFileSystemWatcher监视文件系统对文件的更改和目录,通过观察指定的path列表。
调用addPath()来监视特定的文件或目录。多个path可以使用addPaths()函数添加。现有path可以使用removePath()和removePaths()函数删除。
DFileSystemWatcher检查添加到其中的每个path。具有以下特性的文件添加到DFileSystemWatcher可以使用函数Files()和使用函数directories()创建的目录。
fileChanged()信号在文件被修改时发出,重命名或从磁盘中删除。类似地,directoryChanged()在目录或其内容被修改或移除。
请注意,DFileSystemWatcher只停止监视一次文件,它们被重命名或从磁盘和目录中删除一次,它们已从磁盘中移除。
@note 在运行不支持inotify的Linux内核的系统上,包含被监视路径的文件系统不能被卸载。
默认情况下,Windows CE不支持目录监控,这取决于安装的文件系统驱动程序。
监视文件和目录的行为修改操作会消耗系统资源。这意味着有一个限制进程可以使用的文件和目录的数量同时监控。
@fn DFileSystemWatcher::DFileSystemWatcher(QObject *parent)
@brief 构造函数,构造一个新的文件系统监视器对象。
@fn DFileSystemWatcher::DFileSystemWatcher(const QStringList &paths, QObject *parent = Q_NULLPTR)
@brief 构造函数,构造一个新的文件系统监视器对象,监控指定路径列表。
@param paths 要监听的路径列表
@fn bool DFileSystemWatcher::addPath(const QString &file)
@brief 添加要监听的路径
@details 如果path存在,则将path添加到文件系统监视器。如果path不存在或已经存在,则不添加它由文件系统监视程序监视。
如果path指定了一个目录,则调用directoryChanged()信号将在path被修改或从磁盘中删除时发出。否则,当path被修改、重命名或删除。,就会触发fileChanged()信号
如果监视成功,则返回true。
监视故障的原因通常与系统有关,但是可能包括资源不存在、访问失败或总监视数量限制,如果平台有一个。
@note 可能有一个系统依赖的数量限制可以同时监控的文件和目录。
如果达到了这个限制,path将不会被监控,返回false。
@param[in] file 要监听的路径
@sa DFileSystemWatcher::addPaths()
@sa DFileSystemWatcher::removePath()
@fn QStringList DFileSystemWatcher::addPaths(const QStringList &files)
@brief 添加要监听的路径列表
@details 将path中的每个path添加到文件系统监视程序。path如果不存在,或者已经存在,则不添加由文件系统监视程序监视。
如果path指定了一个目录,则调用directoryChanged()信号将在path被修改或从磁盘中删除时触发。否则,当path被修改、重命名或删除。,就会触发fileChanged()信号
返回值是一个无法被监视的路径列表。
监视故障的原因通常与系统有关,但是可能包括资源不存在、访问失败或总监视数量限制,如果平台有一个。
@note 可能有一个系统依赖的数量限制可以同时监控的文件和目录。
如果达到了这个限制,多余的path就不会达到,它们将被添加到返回的QStringList中。
@param[in] files 要监听的路径列表
@sa DFileSystemWatcher::addPath()
@sa DFileSystemWatcher::removePaths()
@fn bool DFileSystemWatcher::removePath(const QString &file)
@brief 移除监听的路径
@details 从文件系统监视程序中删除指定的path。
如果监视成功删除,则返回true。
监视删除失败的原因通常与系统有关,但可能是因为path已经被删除了。
@sa DFileSystemWatcher::removePaths()
@sa DFileSystemWatcher::addPath()
@fn QStringList DFileSystemWatcher::removePaths(const QStringList &files)
@brief 移除监听的路径列表
@details 从文件系统监视程序中删除指定的path。
返回值是一个无法被监视的路径列表。
监视删除失败的原因通常与系统有关,但可能是因为path已经被删除了。
@sa DFileSystemWatcher::removePath()
@sa DFileSystemWatcher::addPaths()
@fn QStringList DFileSystemWatcher::directories() const
@brief 获取监听的目录列表
@sa DFileSystemWatcher::files()
@fn QStringList DFileSystemWatcher::files() const
@brief 获取监听的文件列表
@sa DFileSystemWatcher::directories()
*/
dtkcore-5.7.12/docs/filesystem/dfilewarcher.zh_CN.dox 0000664 0000000 0000000 00000003262 14762266606 0022552 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dfilesystem
@file include/filesystem/dfilewatcher.h
@class DFileWatcher
@brief DFileWatcher 类提供了对 DBaseFileWatcher 接口的实现,可供监视文件和目录的变动
@fn DFileWatcher::DFileWatcher(const QString &filepath, QObject *parent = 0)
@brief 构造函数
@param filepath 要监视的文件或目录的路径
@param parent 父对象
@fn void DFileWatcher::onFileDeleted(const QString &path, const QString &name)
@brief 当文件被删除时触发的信号
@param[in] path 文件所在的目录路径
@param[in] name 文件名
@fn void DFileWatcher::onFileAttributeChanged(const QString &path, const QString &name)
@brief 当文件属性发生变化时触发的信号
@param[in] path 文件所在的目录路径
@param[in] name 文件名
@fn void DFileWatcher::onFileMoved(const QString &fromPath, const QString &fromName, const QString &toPath, const QString &toName)
@brief 当文件被移动时触发的信号
@param[in] fromPath 文件原来所在的目录路径
@param[in] fromName 文件原来的文件名
@param[in] toPath 文件现在所在的目录路径
@param[in] toName 文件现在的文件名
@fn void DFileWatcher::onFileModified(const QString &path, const QString &name)
@brief 当文件被修改时触发的信号
@param[in] path 文件所在的目录路径
@param[in] name 文件名
@fn void DFileWatcher::onFileCreated(const QString &path, const QString &name)
@brief 当文件被创建时触发的信号
@param[in] path 文件所在的目录路径
@param[in] name 文件名
@fn void DFileWatcher::onFileClosed(const QString &path, const QString &name)
@brief 当文件被关闭时触发的信号
@param[in] path 文件所在的目录路径
*/
dtkcore-5.7.12/docs/filesystem/dfilewatchermanager.zh_CN.dox 0000664 0000000 0000000 00000006701 14762266606 0024110 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dfilesystem
@file include/filesystem/dfilewatchermanager.h
@class DFileWatcherManager
@brief DFileWatcherManager 类可以帮助管理一系列 DFileWatcher 文件监视器,并在文件变动时发送信号通知.
@details
示例代码:
```cpp
#include "dfilewatchermanager"
#include
#include
#include
#include
DCORE_USE_NAMESPACE
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
DFileWatcherManager manager;
QTemporaryFile tmpfile1; // 创建临时文件1
tmpfile1.open();
QFile file1( tmpfile1.fileName());
QTemporaryFile tmpfile2; // 创建临时文件2
tmpfile2.open();
QFile file2( tmpfile2.fileName());
manager.add(tmpfile1.fileName());// 监控临时文件1
manager.add(tmpfile2.fileName());// 监控临时文件2
QObject::connect(&manager, &Dtk::Core::DFileWatcherManager::fileModified, &app, [=](const QString value) {
qDebug() << "文件发生变动:" << value;
}); // 文件发生变动时打印文件路径
QObject::connect(&manager, &Dtk::Core::DFileWatcherManager::fileDeleted, &app, [=](const QString value) {
qDebug() << "文件被删除:" << value;
});
file1.open(QIODevice::WriteOnly|QIODevice::Text);// 修改临时文件1
file1.write("test");
file1.close();
file2.open(QIODevice::WriteOnly|QIODevice::Text);// 修改临时文件2
file2.write("test");
file2.close();
qDebug() << manager.watchedFiles();// 打印所有被监控的文件路径
qDebug() << "---------------------------";
app.processEvents();// 处理事件
manager.removeAll();// 移除所有的监控
qDebug() << manager.watchedFiles();// 打印所有被监控的文件路径
return app.exec();
}
```
上面代码演示了如何使用 DFileWatcherManager 类来监控文件变动和清除文件变动的监控.
具体可以参照源码中的example文件夹中的文件变动监控例子.
@fn DFileWatcher* DFileWatcherManager::add(const QString &filePath)
@brief 为路径`filePath`创建 DFileWatcher 并将其添加到 DFileWatcherManager 中.
@return 被创建并添加到 DFileWatcherManager 的 DFileWatcher
@fn void DFileWatcherManager::remove(const QString &filePath)
@brief 从 DFileWatcherManager 中移除路径`filePath`对应的 DFileWatcher.
@fn void DFileWatcherManager::removeAll()
@brief 从 DFileWatcherManager 中移除所有的 DFileWatcher.
@fn void DFileWatcherManager::watchedFiles()
@brief 获取 DFileWatcherManager 中所有的 DFileWatcher.
@var void DFileWatcherManager::fileDeleted(const QString &filePath)
@brief 当路径`filePath`对应的文件被删除时发送此信号.
@var void DFileWatcherManager::fileAttributeChanged(const QString &filePath)
@brief 当路径`filePath`对应的文件属性发生变化时发送此信号.
@var void DFileWatcherManager::fileMoved(const QString &fromFilePath, const QString &toFilePath)
@brief 当路径`fromFilePath`对应的文件被移动到路径`toFilePath`时发送此信号.
@var void DFileWatcherManager::fileClosed(const QString &filePath)
@brief 当路径`filePath`对应的文件被关闭时发送此信号.
@var void DFileWatcherManager::fileModified(const QString &filePath)
@brief 当路径`filePath`对应的文件被修改时发送此信号.
@var void DFileWatcherManager::subfileCreated(const QString &filePath)
@brief 当路径`filePath`对应的文件夹中有新的子文件被创建时发送此信号.
*/
dtkcore-5.7.12/docs/filesystem/dstandardpaths.zh_CN.dox 0000664 0000000 0000000 00000005121 14762266606 0023113 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dfilesystem
@file include/filesystem/dstandardpaths.h
@class DStandardPaths
@brief DStandardPaths 类描述了一些标准的文件路径,包括XDG文件路径,locate等
@fn static QString DStandardPaths::writableLocation(QStandardPaths::StandardLocation type)
@brief DStandardPaths提供兼容Snap/Dtk标准的路径模式。DStandardPaths实现了Qt的QStandardPaths主要接口。此处返回可写路径
@fn static QStringList DStandardPaths::standardLocations (QStandardPaths::StandardLocation type)
@brief DStandardPaths提供兼容Snap/Dtk标准的路径模式。DStandardPaths实现了Qt的QStandardPaths主要接口。此处返回所有Standardpath
@fn static QString DStandardPaths::locate(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options = QStandardPaths::LocateFile)
@brief 在 type 的标准位置查找名为 fileName 的文件或目录。选项标志允许您指定是否查找文件或目录。默认情况下,此标志设置为 LocateFile。返回找到的第一个文件或目录的绝对路径,否则返回空字符串。
@fn static QStringList DStandardPaths::locateAll(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options = QStandardPaths::LocateFile)
@brief 在类型的标准位置中按名称 fileName 查找所有文件或目录。选项标志允许您指定是否查找文件或目录。默认情况下,此标志设置为 LocateFile。返回找到的所有文件的列表。
@fn static QString DStandardPaths::findExecutable(const QString &executableName, const QStringList &paths = QStringList())
@brief 同QStandardPaths::findExecutable, 查找可执行文件
@fn static void DStandardPaths::setMode(DStandardPaths::Mode mode)
@brief 同QStandardPaths::setTestModeEnabled, 设置是否是测试模式
@fn static QString DStandardPaths::homePath()
@brief 返回家目录
@fn static QString DStandardPaths::homePath(const uint uid)
@brief 用uid返回家目录
@fn static QString DStandardPaths::path(DStandardPaths::XDG type)
@brief 返回对应的xdg目录
@fn static QString DStandardPaths::path(DStandardPaths::DSG type)
@brief 返回对应Dsg目录
@fn static QStringList DStandardPaths::paths(DStandardPaths::DSG type)
@brief 返回所有DSG下所有目录
@fn static QString DStandardPaths::filePath(DStandardPaths::XDG type, QString fileName)
@brief 用xdg和文件名称拼接,返回文件绝对路径
@fn static QString DStandardPaths::filePath(DStandardPaths::DSG type, QString fileName)
@brief 用dsg和文件名称拼接,返回文件绝对路径
*/
dtkcore-5.7.12/docs/filesystem/dtrashmanager.zh_CN.dox 0000664 0000000 0000000 00000001054 14762266606 0022730 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dfilesystem
@file include/filesystem/dtrashmanager.h
@class DTrashManager
@brief dtk垃圾管理器提供管理文件回收站的功能。
@details 非常简单的一个类
@fn ststic DTrashManager *DTrashManager::instance()
@brief 获取DTrashManager的实例
@fn bool DTrashManager::trashIsEmpty() const
@brief 判断回收站是否为空
@fn bool DTrashManager::cleanTrash()
@brief 清空回收站
@fn bool DTrashManager::moveToTrash(const QString &filePath, bool followSymlink = false)
@brief 将文件移动到回收站
*/
dtkcore-5.7.12/docs/filesystem/index.zh_CN.md 0000664 0000000 0000000 00000000300 14762266606 0021016 0 ustar 00root root 0000000 0000000 @page dfilesystem dfilesystem--dtk文件系统操作的封装
# Dlog:dtk日志组件
TODO:添加filesystem组件使用说明
@defgroup dfilesystem
@brief dtk文件系统操作的封装
dtkcore-5.7.12/docs/global/ 0000775 0000000 0000000 00000000000 14762266606 0015450 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/docs/global/dconfig.zh_CN.dox 0000664 0000000 0000000 00000033535 14762266606 0020606 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@file include/global/dconfig.h
@ingroup dglobal
@class Dtk::Core::DConfigBackend dconfig.h
@brief 配置后端的抽象接口。
@details 所有DConfig使用的配置后端都继承此类,用户可以继承此类实现自己的配置后端。
@sa FileBackend
@sa DBusBackend
@sa QSettingBackend
@fn Dtk::Core::DConfigBackend::~DConfigBackend()
@brief DConfigBackend析构函数
@sa FileBackend::~FileBackend()
@sa DBusBackend::~DBusBackend()
@sa QSettingBackend::~QSettingBackend()
@fn bool Dtk::Core::DConfigBackend::isValid() const = 0
@brief 判断此后端是否可用
@sa DConfig::isValid()
@sa FileBackend::isValid()
@sa DBusBackend::isValid()
@sa QSettingBackend::isValid()
@fn bool Dtk::Core::DConfigBackend::load(const QString &) = 0
@brief 初始化后端
@details appId 管理的配置信息key值,默认为应用程序名称。
@sa FileBackend::load()
@sa DBusBackend::load()
@sa QSettingBackend::load()
@fn QStringList Dtk::Core::DConfigBackend::keyList() = 0
@brief 获得所有可用的配置项名称
@sa DConfig::keyList()
@sa FileBackend::keyList()
@sa DBusBackend::keyList()
@sa QSettingBackend::keyList()
@fn QVariant Dtk::Core::DConfigBackend::value(const QString &key, const QVariant &fallback = QVariant()) const = 0
@brief 根据配置项名称获得对应值
@param[in] key 配置项名称
@param[in] fallback 没有获取到配置项值后提供的默认值
@sa DConfig::value()
@sa FileBackend::value()
@sa DBusBackend::value()
@sa QSettingBackend::value()
@fn void Dtk::Core::DConfigBackend::setValue(const QString &key, const QVariant &value) = 0
@brief 根据配置项名称设置其值
@param[in] key 配置项名称
@param[in] value 需要更新的值
@sa DConfig::setValue()
@sa FileBackend::setValue()
@sa DBusBackend::setValue()
@sa QSettingBackend::setValue()
@fn void Dtk::Core::DConfigBackend::reset(const QString &key)
@brief 设置其配置项对应的默认值,此值为经过override机制覆盖后的值,不一定为此配置文件中meta中定义的值。
@param[in] key 配置项名称
@sa DConfig::reset()
@sa FileBackend::reset()
@sa DBusBackend::reset()
@sa QSettingBackend::reset()
@fn QString Dtk::Core::DConfigBackend::name() const = 0
@brief 后端配置的唯一标识
@sa FileBackend::name()
@sa DBusBackend::name()
@sa QSettingBackend::name()
@fn bool Dtk::Core::DConfigBackend::isDefaultValue(const QString &key)
@brief 检测指定配置项名称对应的值是否为默认值。
@param[in] key 配置项名称
@sa DConfig::isDefaultValue()
@sa FileBackend::isDefaultValue()
@sa DBusBackend::isDefaultValue()
@sa QSettingBackend::isDefaultValue()
@class Dtk::Core::QSettingBackend dconfig.h
@brief QSetting后端,继承自DConfigBackend抽象接口,并实现了虚函数。
@sa DConfigBackend
@fn QSettingBackend Dtk::Core::QSettingBackend::QSettingBackend(DConfigPrivate* o)
@brief QSettingBackend构造函数
@class Dtk::Core::DConfigPrivate dconfig.h
@brief DConfig的私有实现
@fn DConfigPrivate Dtk::Core::DConfigPrivate::DConfigPrivate()
@brief DConfigPrivate构造函数
@fn bool Dtk::Core::DConfigPrivate::invalid()
@brief 判断此后端是否可用
@fn DConfigBackend* Dtk::Core::DConfigPrivate::getOrCreateBackend()
@brief 创建一个配置后端
@details 默认使用的配置后端会优先根据环境变量来选择配置中心的D-Bus接口还是文件配置后端接口。若没有配置此环境变量,则根据是否有配置中心提供D-Bus服务来选择配置中心服务还是文件配置后端接口。
@fn DConfigBackend* Dtk::Core::DConfigPrivate::createBackendByEnv()
@brief 创建一个配置后端
@details 尝试根据环境变量来选择配置中心的D-Bus接口还是文件配置后端接口。
@var QString Dtk::Core::DConfigPrivate::appId
@brief 配置文件所属的应用Id,为空时默认为本应用Id。
@var QString Dtk::Core::DConfigPrivate::name
@brief 配置文件名
@var QString Dtk::Core::DConfigPrivate::subpath
@brief 配置文件对应的子目录
@var QScopedPointer Dtk::Core::DConfigPrivate::backend
@brief 配置策略后端
@class Dtk::Core::DConfig dconfig.h
@brief 配置策略提供的接口类
@details
## 概述
此接口规范定义了开发库所提供的关于配置文件读写的相关接口,如果应用程序所使用的开发库实现了此规范,则程序应当优先使用开发库提供的接口。
项目目录结构如下:
```bash
├── CMakeLists.txt
├── config
│ └── example.json
└── main.cpp
```
## CMakeLists.txt
```cmake
cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本
project(dconfig-example VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++
set(CMAKE_CXX_STANDARD 11) # 指定c++标准
set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上
set(CMAKE_AUTOMOC ON) # 支持qt moc
set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # 支持 clangd
if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0
set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录
endif()
find_package(Qt5 REQUIRED COMPONENTS Core) # 寻找Qt5组件Core
find_package(Dtk REQUIRED COMPONENTS Core) # 寻找Dtk组件Core
add_executable(${PROJECT_NAME} # 生成可执行文件
main.cpp
)
target_link_libraries(${PROJECT_NAME} PRIVATE # 添加需要链接的共享库
Qt5::Core
dtkcore
)
# dtk_add_config_meta_files函数,部署一些"meta"的配置。
# 函数定义在dtkcore的cmake目录下
# APPID 应用的ID
# FILES 需要部署的文件。
dtk_add_config_meta_files(
APPID ${PROJECT_NAME}
FILES ./config/example.json
)
```
## example.json
```json
{
"magic": "dsg.config.meta",
"version": "1.0",
"contents": {
"canExit": {
"value": true,
"serial": 0,
"flags": ["global"],
"name": "I am name",
"name[zh_CN]": "我是名字",
"description": "I am description",
"permissions": "readwrite",
"visibility": "private"
},
"key1": {
"value": "125",
"serial": 0,
"flags": ["nooverride"],
"name": "I am name",
"name[zh_CN]": "我是名字",
"description": "I am description",
"permissions": "readwrite",
"visibility": "public"
},
"number": {
"value": 1,
"serial": 0,
"flags": ["global"],
"name": "array value type",
"permissions": "readwrite",
"visibility": "public"
},
"array": {
"value": ["value1", "value2"],
"serial": 0,
"flags": ["global"],
"name": "array",
"permissions": "readwrite",
"visibility": "public"
},
"map": {
"value": {"key1": "value1", "key2": "value2"},
"serial": 0,
"flags": ["global"],
"name": "map",
"permissions": "readwrite",
"visibility": "public"
}
}
}
```
## main.cpp
```cpp
#include
#include
#include
DCORE_USE_NAMESPACE
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
// 构造DConfig,元数据文件名example,与元数据安装目录的/usr/share/dsg/configs/APPID名(可执行文件名)对应目录/example.json,
DConfig config("example");
// 判断是否有效
if (!config.isValid()) {
qWarning() << QString("DConfig无效, name:[%1].").
arg(config.name());
return 0;
}
// 获取所有配置项的key
qDebug() << "所有的所有配置项的key:" << config.keyList();
// 获取指定配置项的值,配置项可以是字符串,数组,map容器,布尔值,整型,详见example.json
qDebug() << "canExit对应的值:" << config.value("canExit").toBool();
QVariantMap map;
for (int i = 0; i < 1; i++) {
QVariantMap nestItem;
for (int j = 0; j < 1; j++) {
nestItem[QString::number(j)] = QString::number(j);
}
map[QString::number(i)] = nestItem;
}
QScopedPointer heapConfig;
heapConfig.reset(new DConfig("example"));
if (!heapConfig->isValid()) {
qWarning() << QString("DConfig无效, name:[%1].").
arg(heapConfig->name());
return 0;
}
// 监听值改变的信号
const bool &oldValue = heapConfig->value("canExit").toBool();
QObject::connect(heapConfig.get(), &DConfig::valueChanged, [oldValue,&heapConfig](const QString &key){
qDebug() << "canExit原来的值:" << oldValue << ", canExit新的值:" << heapConfig->value(key).toBool();
});
// 重置canExit的值
heapConfig->setValue("canExit", !oldValue);
return a.exec();
}
```
## 从源码构建
```bash
mkdir build && cd build
# 修改路径前缀为/usr,GNU标准的默认值为/usr/local
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
make
sudo make install
```
结果如下图

@fn DConfig Dtk::Core::DConfig(const QString &name, const QString &subpath, QObject *parent)
@brief 构造配置策略提供的对象
@param[in] name 配置文件名
@param[in] subpath 配置文件对应的子目录
@param[in] parent 父对象
@fn DConfig Dtk::Core::DConfig(DConfigBackend *backend, const QString &name, const QString &subpath, QObject *parent)
@brief 使用自定义的配置策略后端构造对象
@param[in] backend 调用者继承于DConfigBackend的配置策略后端
@param[in] name 配置文件名
@param[in] subpath 配置文件对应的子目录
@param[in] parent 父对象
@fn static DConfig* Dtk::Core::DConfig::create(const QString &appId, const QString &name, const QString &subpath, QObject *parent)
@brief 构造配置策略提供的对象,指定配置所属的应用Id,管理某一特定应用的配置。
@param[in] appId 配置文件所属的应用Id,为空时默认为本应用Id
@param[in] name 配置文件名
@param[in] subpath 配置文件对应的子目录
@param[in] parent 父对象
@return 构造的配置策略对象,由调用者释放
@fn static DConfig* Dtk::Core::DConfig::create(DConfigBackend *backend, const QString &appId, const QString &name, const QString &subpath, QObject *parent)
@brief 构造配置策略提供的对象,指定配置所属的应用Id。
@param[in] backend 调用者继承于DConfigBackend的配置策略后端
@param[in] appId 配置文件所属的应用Id,为空时默认为本应用Id
@param[in] name 配置文件名
@param[in] subpath 配置文件对应的子目录
@param[in] parent 父对象
@return 构造的配置策略对象,由调用者释放
@fn static DConfig* Dtk::Core::DConfig::createGeneric(const QString &name, const QString &subpath, QObject *parent)
@brief 构造配置策略提供的对象,用来管理与应用无关的配置。
@param[in] name 配置文件名
@param[in] subpath 配置文件对应的子目录
@param[in] parent 父对象
@return 构造的配置策略对象,由调用者释放
@note 如果我们管理针对某一特定应用的配置,应该使用 Dtk::Core::DConfig::create(),或 Dtk::Core::DConfig(),来指定所属应用的appId。
@fn static DConfig* Dtk::Core::DConfig::createGeneric(DConfigBackend *backend, const QString &name, const QString &subpath, QObject *parent)
@sa Dtk::Core::DConfig::createGeneric()
@fn DConfig Dtk::Core::DConfig(DConfigBackend *backend, const QString &appId, const QString &name, const QString &subpath, QObject *parent)
@brief 使用自定义的配置策略后端构造对象
@param[in] backend 调用者继承于DConfigBackend的配置策略后端
@param[in] appId 配置文件所属的应用Id,为空时默认为本应用Id
@param[in] name 配置文件名
@param[in] subpath 配置文件对应的子目录
@param[in] parent 父对象
@note 调用者只构造backend,由DConfig释放。
@fn static void DConfig::setAppId(const QString &appId)
@brief 显示指定应用Id,不采用DSGApplication::id()作为应用Id
@param[in] appId 配置文件所属的应用Id
@note 需要在QCoreApplication构造前设置。
@fn static void DConfig::globalThread()
@brief 一个服务于 DConfig 的公用线程,一般用于 dconfig2cpp 生成的代码,此线程在构造时会自动调用 QThread::start 以满足 dconfig2cpp 的需求。
@return 此线程默认为 running 状态
@note 请不要析构它,它会在应用程序退出时释放
@fn QString Dtk::Core::DConfig::backendName()
@brief 配置策略后端名称
@return 配置策略后端名称
@note 调用者只能用DConfig访问DConfigBackend对象,所以不返回DConfigBackend对象。
@fn QStringList Dtk::Core::DConfig::keyList()
@brief 获得所有可用的配置项名称
@return 配置项名称集合
@fn bool Dtk::Core::DConfig::isValid()
@brief 判断此后端是否可用
@fn bool Dtk::Core::DConfig::isDefaultValue(const QString &key)
@brief 检测指定配置项名称对应的值是否为默认值。
@param[in] key 配置项名称
@fn QVariant Dtk::Core::DConfig::value(const QString &key, const QVariant &fallback)
@brief 根据配置项名称获得对应值
@param[in] key 配置项名称
@param[in] fallback 没有获取到配置项值后提供的默认值
@fn void Dtk::Core::DConfig::setValue(const QString &key, const QVariant &value);
@brief 根据配置项名称设置其值
@param[in] key 配置项名称
@param[in] value 需要更新的值
@fn void Dtk::Core::DConfig::reset(const QString &key)
@brief 设置其配置项对应的默认值,此值为经过override机制覆盖后的值,不一定为此配置文件中meta中定义的值
@param[in] key 配置项名称
@fn QString Dtk::Core::DConfig::name()
@brief 返回配置文件名称
@fn QString Dtk::Core::DConfig::subpath()
@brief 返回配置文件对应的子目录
*/
dtkcore-5.7.12/docs/global/dconfigfile.zh_CN.dox 0000664 0000000 0000000 00000041066 14762266606 0021444 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@file include/global/dconfigfile.h
@ingroup dglobal
@class Dtk::Core::DConfigFile dconfigfile.h
@brief 规范配置文件读写的相关接口的配置文件实现
@details
## 概述
规范配置文件读写的相关接口的配置文件实现
项目目录结构如下:
```bash
├── CMakeLists.txt
├── config
│ └── example.json
└── main.cpp
```
## CMakeLists.txt
```cmake
cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本
project(dconfigfile-example VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++
set(CMAKE_CXX_STANDARD 11) # 指定c++标准
set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上
set(CMAKE_AUTOMOC ON) # 支持qt moc
set(CMAKE_AUTORCC ON) # 支持qt资源文件
set(CMAKE_AUTOUIC ON) # 支持qt ui文件(非必须)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # 支持 clangd
if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0
set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录
endif()
find_package(Qt5 REQUIRED COMPONENTS Core) # 寻找Qt5组件Core
find_package(Dtk REQUIRED COMPONENTS Core) # 寻找Dtk组件Core
add_executable(${PROJECT_NAME} # 生成可执行文件
main.cpp
)
target_link_libraries(${PROJECT_NAME} PRIVATE # 添加需要链接的共享库
Qt5::Core
dtkcore
)
# dtk_add_config_meta_files函数,部署一些"meta"的配置。
# 函数定义在dtkcore的cmake目录下
# APPID 应用的ID
# FILES 需要部署的文件。
dtk_add_config_meta_files(
APPID ${PROJECT_NAME}
FILES ./config/example.json
)
```
## example.json
```json
{
"magic": "dsg.config.meta",
"version": "1.0",
"contents": {
"canExit": {
"value": true,
"serial": 0,
"flags": ["global"],
"name": "I am name",
"name[zh_CN]": "我是名字",
"description": "I am description",
"permissions": "readwrite",
"visibility": "private"
},
"key1": {
"value": "125",
"serial": 0,
"flags": ["nooverride"],
"name": "I am name",
"name[zh_CN]": "我是名字",
"description": "I am description",
"permissions": "readwrite",
"visibility": "public"
},
"number": {
"value": 1,
"serial": 0,
"flags": ["global"],
"name": "array value type",
"permissions": "readwrite",
"visibility": "public"
},
"array": {
"value": ["value1", "value2"],
"serial": 0,
"flags": ["global"],
"name": "array",
"permissions": "readwrite",
"visibility": "public"
},
"map": {
"value": {"key1": "value1", "key2": "value2"},
"serial": 0,
"flags": ["nooverride"],
"name": "map",
"permissions": "readwrite",
"visibility": "public"
},
"publicConfig": {
"value": true,
"serial": 0,
"flags": ["user-public"],
"name": "public configure",
"name[zh_CN]": "我是公开的配置",
"description": "I am public configure",
"permissions": "readwrite",
"visibility": "private"
}
}
}
```
## main.cpp
```cpp
#include
#include
#include
#include
DCORE_USE_NAMESPACE
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
// 构造DConfigFile,元数据文件名example,与元数据安装目录的/usr/share/dsg/configs/APPID名(可执行文件名)对应目录/example.json,
DConfigFile configFile("dconfigfile-example","example");
// 解析配置文件
configFile.load();
// 创建用户缓存
QScopedPointer userCache(configFile.createUserCache(getuid()));
// 解析配置文件
userCache->load();
// 判断是否有效
if (!configFile.isValid()) {
qWarning() << QString("DConfig无效.");
return 0;
}
// meta 返回原型对象, keyList获取所有配置项的key
qDebug() << "所有的所有配置项的key:" << configFile.meta()->keyList();
// 获取指定配置项的值,配置项可以是字符串,数组,map容器,布尔值,整型,详见example.json
qDebug() << "canExit对应的值:" << configFile.value("canExit").toBool();
// 配置项的可见性,其余配置项标记、配置项的权限可查看文档
qDebug() << "配置项的可见性" << configFile.meta()->visibility("canExit");
QVariantMap map;
map.insert("k1","v1");
map.insert("k2","v2");
// 设置map的值
configFile.setValue("map", map, "dconfigfile-example", userCache.get());
configFile.save();
// root用户运行,save的数据会保存到/root/.config/dsg/configs-fake-global/dconfigfile-example/example.json
// map数据对应的flags标记为NoOverride,配置项允许被覆盖,如果flags为global泽忽略用户身份,详见文档。
userCache->save();
return a.exec();
}
```
## 从源码构建
```bash
mkdir build && cd build
# 修改路径前缀为/usr,GNU标准的默认值为/usr/local
cmake .. -DCMAKE_INSTALL_PREFIX=/usr
sudo make install
sudo ./dconfigfile-example
```
结果如下图


@enum Dtk::Core::DConfigFile::Flag
@brief 配置项名称
@var Dtk::Core::DConfigFile::Flag Dtk::Core::DConfigFile::NoOverride
@brief 存在此标记时,将表明则此配置项不可被覆盖(详见下述 override 机制)。反之,不存在此标记时表明此配置项允许被覆盖,对于此类配置项,如若其有界面设置入口,则当此项不可写时,应当隐藏或禁用界面的设置入口.
@var Dtk::Core::DConfigFile::Flag Dtk::Core::DConfigFile::Global
@brief 当读写此类配置时,将忽略用户身份,无论程序使用哪个用户身份执行,读操作都将获取到同样的数据,写操作将对所有用户都生效。但是,如果对应的配置存储目录不存在或无权限写入,则忽略此标志
@var Dtk::Core::DConfigFile::Flag Dtk::Core::DConfigFile::UserPublic
@brief 该类配置项允许被其他用户访问
@enum Dtk::Core::DConfigFile::Permissions
@brief 配置项的权限
@var Dtk::Core::DConfigFile::Permissions Dtk::Core::DConfigFile::ReadOnly
@brief 将配置项覆盖为只读
@var Dtk::Core::DConfigFile::Permissions Dtk::Core::DConfigFile::ReadWrite
@brief 将配置项覆盖为可读可写
@enum Dtk::Core::DConfigFile::Visibility
@brief 配置项的可见性
@var Dtk::Core::DConfigFile::Visibility Dtk::Core::DConfigFile::Private
@brief 仅限程序内部使用,对外不可见。此类配置项完全由程序自己读写,可随意增删改写其含义,无需做兼容性考虑
@var Dtk::Core::DConfigFile::Visibility Dtk::Core::DConfigFile::Public
@brief 外部程序可使用。 此类配置项一旦发布,在兼容性版本的升级中,要保障此配置项向下兼容,简而言之,只允许在程序/库的大版本升级时才允许删除或修改此类配置项,当配置项的 permissions、visibility、flags 任意一个属性被修改则认为此配置项被修改,除此之外修改 value、name、description 属性时则不需要考虑兼容性。
@struct Dtk::Core::DConfigFile::Version
@brief 版本信息
@details
此文件的内容格式的版本。版本号使用两位数字描述,
首位数字不同的描述文件相互之间不兼容,第二位数字不同的描述文件需满足向下兼容。
读取此描述文件的程序要根据版本进行内容分析,当遇到不兼容的版本时,需要立即终止解析,忽略此文件,
并在程序日志中写入警告信息,如 “1.0” 和 “2.0” 版本之间不兼容,
如果解析程序最高只支持 1.0 版本,则遇到 2.0 版本的描述文件时应该终止解析,
但是如果遇到 1.1 版本,则可以继续执行。
写入此描述文件时,遇到不兼容的版本时,需要先清空当前内容再写入,每次写入皆需更新此字段。
@fn static constexpr DConfigFile::Version Dtk::Core::DConfigFile::supportedVersion()
@brief 支持的版本
@return
@fn Dtk::Core::DConfigFile::DConfigFile(const QString &appId, const QString &name, const QString &subpath = QString())
@brief DConfigFile构造函数,构造配置文件管理对象。
@param[in] appId 应用程序唯一标识
@param[in] name 配置文件名
@param[in] subpath 子目录
@fn Dtk::Core::DConfigFile::DConfigFile(const DConfigFile &other);
@brief DConfigFile构造函数,构造配置文件管理对象。
@param[in] appId 应用程序唯一标识
@param[in] name 配置文件名
@param[in] subpath 子目录
@fn bool Dtk::Core::DConfigFile::load(const QString &localPrefix = QString())
@brief 解析配置文件
@param[in] localPrefix 为目录前缀
@return
@fn bool Dtk::Core::DConfigFile::load(QIODevice *meta, const QList &overrides)
@brief 解析配置文件流
@param[in] meta 为原型流
@param[in] overrides 为覆盖机制查找的文件流
@return
@fn bool Dtk::Core::DConfigFile::save(const QString &localPrefix = QString(), QJsonDocument::JsonFormat format = QJsonDocument::Indented, bool sync = false) const
@brief 保存缓存的值到磁盘中
@param[in] format 保存格式
@param[in] sync 是否立即刷新
@return
@fn bool Dtk::Core::DConfigFile::isValid() const
@brief 检测配置文件是否有效
@return
@fn QVariant Dtk::Core::DConfigFile::value(const QString &key, DConfigCache *userCache = nullptr) const
@brief DConfigFile::value
@param[in] key 配置项名称
@param[in] userCache 用户缓存,当key为全局项时, \a userCache 不会被使用
@return
@fn QVariant Dtk::Core::DConfigFile::cacheValue(DConfigCache *userCache, const QString &key) const
@brief DConfigFile::cacheValue 获取指定用户缓存的配置项值,若无此配置项的用户缓存值,返回无效值
@param[in] key 配置项名称
@param[in] userCache 用户缓存,当key为全局配置项时, \a userCache 不会被使用
@return
@fn bool Dtk::Core::DConfigFile::setValue(const QString &key, const QVariant &value, const QString &callerAppid, DConfigCache *userCache = nullptr)
@brief 设置缓存中的值
@param[in] key 配置项名称
@param[in] value 需要设置的值
@param[in] uid 设置时的用户id
@param[in] appid 设置时的应用id
@return 为true时表示重新设置了新值,false表示没有设置
@fn DConfigCache* Dtk::Core::DConfigFile::createUserCache(const uint uid)
@brief 创建用户缓存
@fn DConfigCache* Dtk::Core::DConfigFile::globalCache() const
@brief 返回全局缓存
@return
@fn DConfigMeta* Dtk::Core::DConfigFile::meta()
@brief 返回原型对象
@return
*/
/*!
@class Dtk::Core::DConfigMeta dconfigfile.h
@brief 提供配置文件的原型和覆盖机制的访问接口
@fn virtual DConfigFile::Version Dtk::Core::DConfigMeta::version() const = 0
@brief 返回配置版本信息
@return
@fn virtual void Dtk::Core::DConfigMeta::setVersion(quint16 major, quint16 minor) = 0
@brief 设置配置版本信息
@param[in] major 主板本号
@param[in] minor 次版本号
@fn virtual bool Dtk::Core::DConfigMeta::load(const QString &localPrefix = QString()) = 0
@brief 解析配置文件
@param[in] localPrefix 为目录前缀
@return
@fn virtual bool Dtk::Core::DConfigMeta::load(QIODevice *meta, const QList &overrides) = 0
@brief 解析配置文件流
@param[in] meta 为原型流
@param[in] overrides 为覆盖机制查找的文件流
@return
@fn virtual QStringList Dtk::Core::DConfigMeta::keyList() const = 0
@brief 返回配置内容的所有配置项
@return
@fn virtual DConfigFile::Flags Dtk::Core::DConfigMeta::flags(const QString &key) const = 0
@brief 返回指定配置项的特性
@param[in] key 配置项名称, NoOverride为此配置项不可被覆盖, Global为忽略用户身份
@return
@fn virtual DConfigFile::Permissions Dtk::Core::DConfigMeta::permissions(const QString &key) const = 0
@brief 返回指定配置项的权限
@param[in] key 配置项名称
@return
@fn virtual DConfigFile::Visibility Dtk::Core::DConfigMeta::visibility(const QString &key) const = 0
@brief 返回指定配置项的可见性
@param[in] key 配置项名称
@return
@fn virtual int Dtk::Core::DConfigMeta::serial(const QString &key) const = 0
@brief 返回配置项的单调递增值
@param[in] key 配置项名称
@return -1为无效值,表明没有配置此项
@fn virtual QString Dtk::Core::DConfigMeta::displayName(const QString &key, const QLocale &locale) = 0
@brief 返回指定配置项的显示名
@param[in] key 配置项名称
@param[in] locale 为语言版本
@return
@fn virtual QString Dtk::Core::DConfigMeta::description(const QString &key, const QLocale &locale) = 0
@brief 返回指定配置项的描述信息
@param[in] key 配置项名称
@param[in] locale 为语言版本
@return
@fn virtual QString Dtk::Core::DConfigMeta::metaPath(const QString &localPrefix = QString(), bool *useAppId = nullptr) const = 0
@brief 返回描述文件的路径
@param[in] localPrefix 目录的所有需要查找的覆盖机制目录
@param[in] useAppId 是否不使用通用目录
@return
@fn virtual QStringList Dtk::Core::DConfigMeta::allOverrideDirs(const bool useAppId, const QString &prefix = QString()) const = 0
@brief 获得前缀为 `prefix` 目录的所有需要查找的覆盖机制目录
@param[in] useAppId 是否不使用通用目录
@param[in] prefix 目录的应用或公共库的所有覆盖机制目录
@return
@fn virtual QVariant DConfigMeta::value(const QString &key) const = 0
@brief meta初始值经过覆盖机制覆盖后的原始值
@param[in] key 配置项名称
@return
@fn static QStringList genericMetaDirs(const QString &localPrefix = QString())
@brief 获取应用无关配置存储的目录
@param[in] localPrefix 配置的目录前缀
@return 返回应用无关配置存储的目录列表
@fn static QStringList applicationMetaDirs(const QString &localPrefix, const QString &appId)
@brief 获取应用配置存储的目录
@param[in] localPrefix 配置的目录前缀
@param[in] appId 应用唯一标识
@return 返回存储应用配置的目录列表
*/
/*!
@class Dtk::Core::DConfigCache dconfigfile.h
@brief 提供配置文件的用户和全局运行缓存访问接口
@fn virtual bool Dtk::Core::DConfigCache::load(const QString &localPrefix = QString()) = 0
@brief 解析缓存配置文件
@return
@fn virtual bool Dtk::Core::DConfigCache::load(const QString &localPrefix = QString()) = 0
@brief 解析缓存配置文件
@return
@fn virtual bool Dtk::Core::DConfigCache::save(const QString &localPrefix = QString(), QJsonDocument::JsonFormat format = QJsonDocument::Indented, bool sync = false) = 0
@brief 保存缓存的值到磁盘中
@param[in] localPrefix 为目录前缀
@param[in] format 保存格式
@param[in] sync 是否立即刷新
@return
@fn virtual bool Dtk::Core::DConfigCache::isGlobal() const = 0
@brief 是否是全局缓存
@return
@fn virtual void Dtk::Core::DConfigCache::remove(const QString &key) = 0
@brief 删除缓存中的配置项
@param[in] key 配置项名称
@return
@fn virtual QStringList Dtk::Core::DConfigCache::keyList() const = 0
@brief 返回配置内容的所有配置项
@return
@fn virtual bool Dtk::Core::DConfigCache::setValue(const QString &key, const QVariant &value, const int serial, const uint uid, const QString &callerAppid) = 0
@brief 设置缓存中的值
@param[in] key 配置项名称
@param[in] value 需要设置的值
@param[in] uid 设置时的用户id
@param[in] callerAppid 设置时的应用id
@return 为true时表示重新设置了新值,false表示没有设置。
@fn virtual QVariant Dtk::Core::DConfigCache::value(const QString &key) const = 0
@brief 获取缓存中的值
@param[in] key 配置项名称
@return
@fn virtual int Dtk::Core::DConfigCache::serial(const QString &key) const = 0
@brief 返回配置项的单调递增值
@param[in] key 配置项名称
@return -1为无效值,表明没有配置此项
@fn virtual uint Dtk::Core::DConfigCache::uid() const = 0
@brief 用户标识,为全局缓存时,uid为非用户标识的特定值
@return
@fn virtual void setCachePathPrefix(const QString &prefix) = 0
@brief 指定缓存位置前缀,缓存访问所需的权限及区分不同缓存的位置由调用者考虑,其默认值参考配置策略规范
@param[in] prefix 缓存位置的前缀
*/
dtkcore-5.7.12/docs/global/ddesktopentry.zh_CN.dox 0000664 0000000 0000000 00000041063 14762266606 0022067 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@file include/global/ddesktopentry.h
@ingroup dglobal
@class Dtk::Core::DDesktopEntry ddesktopentry.h
@brief 处理desktop文件的接口
@details
## 概述
DDesktopEntry提供了处理XDG desktop读写的方法的接口,这个Class类似于QSettings。
有关该规范本身的更多详细信息,请参阅:
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
项目目录结构在同一目录下
## CMakeLists.txt
```cmake
cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本
project(example1 VERSION 1.0.0 LANGUAGES CXX) # 指定项目名称, 版本, 语言 cxx就是c++
set(CMAKE_CXX_STANDARD 11) # 指定c++标准
set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上
set(target example1) # 指定目标名称
set(CMAKE_AUTOMOC ON) # support qt moc # 支持qt moc
set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件
set(CMAKE_AUTOUIC ON) # support qt ui file # 支持qt ui文件(非必须)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # support clangd # 支持 clangd
if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0
set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录
endif()
find_package(Qt5 COMPONENTS Core REQUIRED) # 寻找Qt5组件Core
find_package(Dtk COMPONENTS Core REQUIRED) # 寻找Dtk组件Core
add_executable(${target} # 生成可执行文件
main.cpp
)
target_link_libraries(${target} PRIVATE # 添加需要链接的共享库
Qt5::Core
dtkcore
)
```
## main.cpp
```cpp
#include
#include
#include
#include
DCORE_USE_NAMESPACE // 使用Dtk Core命名空间
const QString fileContent = { QStringLiteral(R"desktop(# A. Example Desktop Entry File
[Desktop Entry]
Version=1.0
Type=Application
Name=Foo Viewer
Name[zh_CN]=福查看器
Comment=The best viewer for Foo objects available!
# Next line have an extra " character
Comment[zh_CN]=最棒的 "福 查看器!
TryExec=fooview
Exec=fooview %F
Icon=fooview
MimeType=image/x-foo;
Actions=Gallery;Create;
[Desktop Action Gallery]
Exec=fooview --gallery
Name=Browse Gallery
[Desktop Action Create]
Exec=fooview --create-new
Name=Create a new Foo!
Icon=fooview-new
)desktop") };
int main(int argc, char *argv[])
{
QFile file("example1.desktop");
// 尝试打开文件
if(!file.open(QIODevice::WriteOnly | QIODevice::Text)){
qDebug()<<"文件打开失败";
}
const QString fileName = file.fileName();
QTextStream ts(&file);
ts << fileContent;
file.close();
QFile::exists(fileName);
// 打开一个fileName为example1.desktop的文件
QScopedPointer desktopFile(new DDesktopEntry(fileName));
// 获取desktop中所有组并返回列表,对应"Desktop Entry"、"Desktop Action Gallery"、"Desktop Action Create"三组
QStringList allGroups = desktopFile->allGroups();
qDebug() << QString("Desktop 文件共有%1组").arg(allGroups.count());
// 调用allGroups函数,传入true,保持读取desktop文件时的顺序不变,获取第0组
qDebug() << QString("Desktop 文件第0组为: %1").arg(desktopFile->allGroups(true)[0]);
// 获取key=Name,localeKey=zh_CN的值,即Name[zh_CN]=福查看器
qDebug() << QString("Name[zh_CN]=%1") \
.arg(desktopFile->localizedValue("Name", "zh_CN"));
// 获取key为Nam,,localeKey为empty的值,empty表示没有localeKey,即Name=Foo Viewer
qDebug() << QString("Name=%1") \
.arg(desktopFile->localizedValue("Name", "empty"));
// 获取Desktop Entry组下的所有key,即"Actions", "Comment", "Comment[zh_CN]", "Exec", "Icon", "MimeType", "Name", "Name[zh_CN]", "TryExec", "Type", "Version"
qDebug() << QString("Desktop Entry组下的所有key: ") \
<< desktopFile->keys("Desktop Entry");
// 设置 key 为 Name的值为"Bar Viewer",默认组是"Desktop Entry"
desktopFile->setRawValue("Bar Viewer", "Name");
// 设置 key 为 Name,localeKey为zh_CN的值为霸查看器,默认组是"Desktop Entry"
desktopFile->setLocalizedValue("霸查看器", "zh_CN", "Name");
// 检查 section 中是否包 key 为 Semicolon 的值,包含 key 返回true; 否则返回false,默认组是Desktop Entry
qDebug() << QString("Desktop Entry组是否包key是Semicolon: ") \
<< desktopFile->contains("Semicolon", "Desktop Entry");
// 设置key为Semicolon的值为";grp\\;2;grp3;",默认组是"Desktop Entry"
desktopFile->setRawValue(";grp\\;2;grp3;", "Semicolon");
// 返回给定 section 中与给定 key 关联的字符串的列表。如果destkop不包含为该键的项,则函数返回一个空字符串列表。 默认组是Desktop Entry
qDebug() << QString("Desktop Entry组中Semicolon对应值的字符串列表: ") \
<< desktopFile->stringListValue("Semicolon");
// 再次检查 section 中是否包 key 为 Semicolon 的值,此时为true
qDebug() << QString("Desktop Entry组是否包key是Semicolon: ") \
<< desktopFile->contains("Semicolon", "Desktop Entry");
// 删除desktop中 section 中 key 对应的值,默认组是"Desktop Entry"
desktopFile->removeEntry("Semicolon", "Desktop Entry");
// 再次检查 section 中是否包 key 为 Semicolon 的值,此时为false
qDebug() << QString("Desktop Entry组是否包key是Semicolon: ") \
<< desktopFile->contains("Semicolon", "Desktop Entry");
// 将数据回写到desktop文件。 true表示写成功; 否则返回false
if (desktopFile->save())
{
qDebug() << "文件保存成功";
} else {
qDebug() << "文件保存失败";
}
return 0;
}
```
结果如下图

@enum Dtk::Core::DDesktopEntry::EntryType
@brief 桌面入口文件的类型
@var Dtk::Core::DDesktopEntry::Unknown
@brief 未知的桌面文件类型。可能是无效的
@var Dtk::Core::DDesktopEntry::Application
@brief 该文件描述应用程序
@var Dtk::Core::DDesktopEntry::Link
@brief 该文件描述URL
@var Dtk::Core::DDesktopEntry::Directory
@brief 该文件描述目录设置
@var Dtk::Core::DDesktopEntry::ServiceType
@brief KDE特定类型。规范中提到过, 所以这里也列出了
@var Dtk::Core::DDesktopEntry::Service
@brief KDE特定类型。规范中提到过, 所以这里也列出了
@var Dtk::Core::DDesktopEntry::FSDevice
@brief KDE特定类型。规范中提到过, 所以这里也列出了
@enum Dtk::Core::DDesktopEntry::ValueType
@brief 值的类型
@var Dtk::Core::DDesktopEntry::Unparsed
@brief 未解析的值
@var Dtk::Core::DDesktopEntry::String
@brief 字符串
@var Dtk::Core::DDesktopEntry::Strings
@brief 字符串数组
@var Dtk::Core::DDesktopEntry::Boolean
@brief 布尔值
@var Dtk::Core::DDesktopEntry::Numeric
@brief 数字
@var Dtk::Core::DDesktopEntry::NotExisted
@brief 不存在
@enum Dtk::Core::DDesktopEntry::Status
@brief desktop文件的解析状态
@var Dtk::Core::DDesktopEntry::NoError
@brief 没有错误发生
@var Dtk::Core::DDesktopEntry::AccessError
@brief 发生访问错误(例如, 试图写入只读文件)
@var Dtk::Core::DDesktopEntry::FormatError
@brief 发生格式错误(例如, 加载格式错误的desktop文件)
@fn Dtk::Core::DDesktopEntry::DDesktopEntry(const QString &filePath) noexcept
@brief DDesktopEntry构造函数
@fn bool Dtk::Core::DDesktopEntry::save() const
@brief 将数据回写到desktop文件。
@return true表示写成功; 否则返回false
@fn Status Dtk::Core::DDesktopEntry::status() const
@brief Get data parse status
@return 返回一个状态码, 表示DDesktopEntry遇到的第一个错误, 如果没有错误发生, 则返回QSettings::NoError。请注意, DDesktopEntry会延迟执行某些操作。
@fn QStringList Dtk::Core::DDesktopEntry::keys(const QString §ion = "Desktop Entry") const
@brief 根据 `section` 返回全部键值
@return 返回所有的键值
@fn QStringList Dtk::Core::DDesktopEntry::allGroups(bool sorted = false) const
@brief 获取desktop中所有组的列表。如果 `sorted` 设置为true, 则返回结果将保持读取desktop文件时的顺序不变。
@return 返回所有的组.
@fn bool Dtk::Core::DDesktopEntry::contains(const QString &key, const QString §ion = "Desktop Entry") const
@brief 检查desktop文件是否有给定的 `section` 包含给定的 `key`
@return 如果desktop在 `section` 包含 `key` 返回true; 否则返回false。
@fn QString Dtk::Core::DDesktopEntry::name() const
@brief 返回“Desktop Entry”部分下的“Name”键的本地化字符串值。这等价于调用localizedValue("Name")。
@return 返回“Desktop Entry”部分下的“Name”键的本地化字符串值。
@sa localizedValue(), genericName(), ddeDisplayName()
@fn QString Dtk::Core::DDesktopEntry::genericName() const
@brief 返回"Desktop Entry"部分下的"GenericName"键的本地化字符串值。它等价于调用localizedValue("GenericName")。如果是“GenericName”不存在。则不会回退到“Name”。
@return 返回"Desktop Entry"部分下的"GenericName"键的本地化字符串值。
@sa localizedValue(), name(), ddeDisplayName()
@fn QString Dtk::Core::DDesktopEntry::ddeDisplayName() const
@brief 为DDE应用程序专门显示名称
@details 这将检查“X-Deepin-Vendor”,并将返回本地化的字符串值“GenericName”
"X-Deepin-Vendor"是"deepin",否则它将返回"Name"的本地化字符串值。
@return 返回专门用于DDE应用程序的显示名称
@sa localizedValue(), name(), genericName()
@fn QString Dtk::Core::DDesktopEntry::comment() const
@brief 返回“Desktop Entry”部分下的“Comment”键的本地化字符串值。这等价于调用localizedValue("Comment")。
@return 返回“Desktop Entry”部分下的“Comment”键的本地化字符串值。
@sa localizedValue()
@fn QString Dtk::Core::DDesktopEntry::rawValue(const QString &key, const QString §ion = "Desktop Entry", const QString &defaultValue = QString()) const
@brief 返回 `section` 中与给定 `key` 关联的原始字符串值。如果desktop不包含具有该键的项, 则函数返回一个构造好的 `defaultValue`。
@return 返回 `section` 中与给定 `key` 相关联的原始字符串值。
@sa stringValue() localizedValue() stringListValue()
@fn QString Dtk::Core::DDesktopEntry::stringValue(const QString &key, const QString §ion = "Desktop Entry", const QString &defaultValue = QString()) const
@brief 返回 `section` 与给定 `key` 关联的未转义字符串值。如果desktop不包含键值为0的项, 则函数返回一个构造好的 `defaultValue`。
@return 返回 `section` 中与给定 `key` 相关联的未转义字符串值。
@sa rawValue() localizedValue() stringListValue()
@fn QString Dtk::Core::DDesktopEntry::localizedValue(const QString &key, const QString &localeKey = "default", const QString §ion = "Desktop Entry", const QString& defaultValue = QString()) const
@brief 返回与 `section` 中给定的 `key` 和 `localeKey` 相关联的本地化字符串值。
@details
如果找不到给定的 `localeKey` ,它将回退到"C",如果仍然找不到,将回退 `key` 没有`localeKey`部分。。
如果destkop不包含 `key` 值为0的项,则函数返回一个构造好的 `defaultValue`。
@return 返回 `section` 中与给定的 `key` 和 `localeKey` 关联的本地化字符串值。
@sa rawValue() stringValue() stringListValue()
@fn QString Dtk::Core::DDesktopEntry::localizedValue(const QString &key, const QLocale &locale, const QString §ion = "Desktop Entry", const QString& defaultValue = QString()) const
@brief 返回与给定的 `key` 和 `section` 中的区域设置相关联的本地化字符串值。
@details
如果找不到给定的 `localeKey` ,它将回退到"C",如果仍然找不到,将回退 `key` 没有`localeKey`部分。
如果destkop不包含 `key` 值为0的项,则函数返回一个构造好的 `defaultValue`。
@return 返回 `section`中 与给定的 `key` 和 `locale` 设置相关联的本地化字符串值。
@sa rawValue() stringValue() stringListValue()
@fn QStringList Dtk::Core::DDesktopEntry::stringListValue(const QString &key, const QString §ion = "Desktop Entry") const
@brief 返回给定 `section` 中与给定 `key` 关联的字符串的列表。如果destkop不包含为该键的项,则函数返回一个空字符串列表。
@return 返回给定 `section` 中与给定 `key` 关联的字符串的列表。
@sa rawValue() stringValue() localizedValue()
@fn bool Dtk::Core::DDesktopEntry::setRawValue(const QString &value, const QString &key, const QString& section = "Desktop Entry")
@brief 设置给定 `section` 中与给定 `key` 关联的原始字符串值。
@fn bool Dtk::Core::DDesktopEntry::setStringValue(const QString &value, const QString &key, const QString& section = "Desktop Entry")
@brief 设置给定 `section` 中与给定 `key` 关联的字符串
@fn bool Dtk::Core::DDesktopEntry::setLocalizedValue(const QString &value, const QString& localeKey, const QString &key, const QString& section = "Desktop Entry")
@brief 设置给定的 `key` 和 `section` 中的区域设置相关联的本地化字符串值。
@fn bool Dtk::Core::DDesktopEntry::removeEntry(const QString &key, const QString §ion = "Desktop Entry");
@brief 删除desktop中 `section` 与 `key` 对应的值
@fn static QString& Dtk::Core::DDesktopEntry::escape(QString &str)
@brief 支持转义序列`\s`、`\n`、`\t`、`\r`和`\\`表示值
@details string和localestring类型的值支持转义序列`\s`、`\n`、`\t`、`\r`和`\\`,分别表示ASCII空格、换行符、制表符、回车和反斜杠。
@fn static QString& Dtk::Core::DDesktopEntry::escapeExec(QString &str)
@brief 必须将参数括在双引号之间,并对双引号字符进行转义。
@details
| 原字符 | 转义后 |
|------|---------|
| \` | "`" |
| $ | "$" |
| \ | "\" |
在它前面加上一个额外的反斜杠字符。实现必须在扩展字段代码之前和之前撤销引用,将参数传递给可执行程序。
@note 类型为string的值的通用转义规则规定,反斜杠字符也可以转义为("\\")和这个转义规则应用在引用规则之前。
因此,要明确地表示在desktop文件中,引号参数中的文字反斜杠字符
要求使用四个连续的反斜杠字符("\\\\")。同样,在桌面入口文件中引用参数中的美元符号表示为("\\$")。
@fn static QString& Dtk::Core::DDesktopEntry::unescape(QString &str, bool unescapeSemicolons = false)
@brief 对于类型为string和localestring的值,支持转义序列`\s`、`\n`、`\t`、`\r`和`\\`,分别表示ASCII空格、换行符、制表符、回车符和反斜杠。
@details 有些键可以有多个值。这种情况下,`key` 的值被指定为复数形式:
例如,字符串。多个值应该用分号分隔,`key` 的值可以选择以分号结尾。空字符串必须以分号结尾。
这些值中的分号需要使用`\;`转义。
有关该规范本身的更多详细信息,请参阅:
https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html#value-types
@fn static QString& Dtk::Core::DDesktopEntry::unescapeExec(QString &str)
@brief 必须将参数括在双引号之间,并对双引号字符进行转义,
@details
| 原字符 | 转义后 |
|------|---------|
| \` | "`" |
| $ | "$" |
| \ | "\" |
在它前面加上一个额外的反斜杠字符。实现必须在扩展字段代码之前和之前撤销引用,将参数传递给可执行程序。
保留字符:
| 功能 | 字符 |
|---------------------|---------|
| space | " " |
| tab | |
| newline | |
| double quote | |
| single quote | "'" |
| backslash character | "\" |
| greater-than sign | ">" |
| less-than sign | "<" |
| tilde | "~" |
| vertical bar | \| |
| ampersand | "&" |
| semicolon | ";" |
| dollar sign | "$" |
| asterisk | "*" |
| question mark | "?" |
| hash mark | "#" |
| parenthesis | "(" 和 ")" |
| backtick character | "`" |
@note 类型为string的值的通用转义规则规定
反斜杠字符也可以转义为("\\"),而且转义规则在引号规则之前应用。
因此,要在desktop文件的引号参数中明确表示字面上的反斜杠字符,需要使用四个连续的反斜杠字符(“\\\\”)。
同样,在desktop文件中,引号参数中的美元符号可以明确地表示为("\\$")。
@fn bool Dtk::Core::DDesktopEntry::setStatus(const Status &status)
@brief 设置desktop文件解析状态
*/
dtkcore-5.7.12/docs/global/dlicenseinfo.zh_CN.dox 0000664 0000000 0000000 00000003267 14762266606 0021636 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dglobal
@file include/global/dlicenseinfo.h
@class Dtk::Core::DLicenseInfo::DComponentInfo
@brief dcomponentinfo 是一组用于查询组件所用开源协议信息的类
@fn Dtk::Core::DLicenseInfo::DComponentInfo::DComponentInfo(DObject *parent)
@brief 组件信息类的构造函数
@param[in] parent 组件信息类的父对象
@fn QString Dtk::Core::DLicenseInfo::DComponentInfo::name()
@brief 获取组件的名称
@fn QString Dtk::Core::DLicenseInfo::DComponentInfo::version()
@brief 获取组件的版本号
@fn QString Dtk::Core::DLicenseInfo::DComponentInfo::copyRight()
@brief 获取组件的授权信息
@fn QString Dtk::Core::DLicenseInfo::DComponentInfo::licenseName()
@brief 获取组件的所用开源许可协议名称
@class Dtk::Core::DLicenseInfo
@brief dlicenseinfo是一组用于查询应用所用开源许可协议相关信息的类
@fn Dtk::Core::DLicenseInfo::DLicenseInfo(DObject *parent)
@brief 开源许可协议信息类的构造函数
@param[in] parent 开源许可协议信息类的父对象
@fn bool Dtk::Core::DLicenseInfo::loadContent(const QByteArray &content)
@brief 通过内容content加载协议
@return 0 加载失败
@return 1 加载成功
@fn bool Dtk::Core::DLicenseInfo::loadFile(const QString &file)
@brief 通过文件file加载协议
@return 0 加载失败
@return 1 加载成功
@fn void Dtk::Core::DLicenseInfo::setLicenseSearchPath(const QString &path)
@brief 设置协议内容路径path
@fn QByteArray Dtk::Core::DLicenseInfo::licenseContent(const QString &licenseName)
@brief 获取协议名为licenseName的内容
@fn DLicenseInfo::DComponentInfos Dtk::Core::DLicenseInfo::componentInfos()
@brief 获取组件的相关信息
*/
dtkcore-5.7.12/docs/global/dsysinfo.zh_CN.dox 0000664 0000000 0000000 00000027361 14762266606 0021033 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dglobal
@file include/global/dsysinfo.h
@class Dtk::Core::DSysInfo
@brief dsysinfo 是一组用于查询系统信息的静态类
@details
## 概述
dsysinfo是一组用于查询系统信息的静态类
项目目录结构如下:
```bash
├── CMakeLists.txt
└── main.cpp
```
## CMakeLists.txt
```cmake
cmake_minimum_required(VERSION 3.13) # cmake版本要求
set (VERSION "1.0.0" CACHE STRING "define project version") # 定义项目版本
set(BIN_NAME test) # 定义项目名称
project(test) # 定义项目名称
file(GLOB_RECURSE SRCS "*.h" "*.cpp") # 定义项目源文件
find_package(Qt5 REQUIRED COMPONENTS Core) # 寻找Qt5
find_package(DtkCore REQUIRED) # 寻找DtkCore
add_executable(test
main.cpp # 源文件
)
target_link_libraries(test PRIVATE
${DtkCore_LIBRARIES} # 链接DtkCore
Qt5::Core # 链接Qt5
)
```
## main.cpp
```cpp
#include // 引入DSysInfo
#include // 引入qdebug.h
DCORE_USE_NAMESPACE // 使用dtkcore命名空间
int main(int argc, char **argv) {
qDebug() << DSysInfo::deepinType(); // 打印deepin类型
qDebug() << DSysInfo::ProductType(); // 打印产品类型
return 0;
}
```
@enum Dtk::Core::DSysInfo::ProductType
@brief 产品信息
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::Deepin
@brief 深度操作系统
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::ArchLinux
@brief ArchLinux
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::CentOS
@brief CentOS
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::Debian
@brief Debian
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::Fedora
@brief Fedora
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::LinuxMint
@brief LinuxMint
@var Dtj::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::Manjaro
@brief Manjaro
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::openSUSE
@brief openSUSE
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::SailfishOS
@brief SailfishOS
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::Ubuntu
@brief Ubuntu
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::Uos
@brief UOS
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::Gentoo
@brief Gentoo
@var Dtk::Core::DSysInfo::ProductType Dtk::Core::DSysInfo::NixOS
@brief NixOS
@enum Dtk::Core::DSysInfo::DeepinType
@brief 深度操作系统版本
@var Dtk::Core::DSysInfo::DeepinType Dtk::Core::DSysInfo::UnknownDeepin
@brief 未知版本
@var Dtk::Core::DSysInfo::DeepinType Dtk::Core::DSysInfo::DeepinDesktop
@brief 桌面版
@var Dtk::Core::DSysInfo::DeepinType Dtk::Core::DSysInfo::DeepinProfessional
@brief deepin专业版, 现为uos专业版
@var Dtk::Core::DSysInfo::DeepinType Dtk::Core::DSysInfo::DeepinServer
@brief deepin服务器版本, 现为uos服务器版
@var Dtk::Core::DSysInfo::DeepinType Dtk::Core::DSysInfo::DeepinPersonal
@brief deepin个人版, 现为uos家庭版
@enum Dtk::Core::DSysInfo::LogoType
@brief 系统的logo类型
@var Dtk::Core::DSysInfo::LogoType Dtk::Core::DSysInfo::Normal
@brief 正常
@var Dtk::Core::DSysInfo::LogoType Dtk::Core::DSysInfo::Light
@brief 亮色
@var Dtk::Core::DSysInfo::LogoType Dtk::Core::DSysInfo::Symbolic
@brief 符号
@var Dtk::Core::DSysInfo::LogoType Dtk::Core::DSysInfo::Transparent
@brief 水印
@enum Dtk::Core::DSysInfo::OrgType
@brief 组织类型
@var Dtk::Core::DSysInfo::OrgType Dtk::Core::DSysInfo::Distribution
@brief 当前版本
@var Dtk::Core::DSysInfo::OrgType Dtk::Core::DSysInfo::Distributor
@brief 当前发行版
@var Dtk::Core::DSysInfo::OrgType Dtk::Core::DSysInfo::Manufacturer
@brief 当前发行版或设备的制造商
@enum Dtk::Core::DSysInfo::UosType
@brief UOS版本类型
@var Dtk::Core::DSysInfo::UosType Dtk::Core::DSysInfo::UosTypeUnknown
@brief 未知版本
@var Dtk::Core::DSysInfo::UosType Dtk::Core::DSysInfo::UosDesktop
@brief UOS桌面版
@var Dtk::Core::DSysInfo::UosType Dtk::Core::DSysInfo::UosServer
@brief UOS服务器版
@var Dtk::Core::DSysInfo::UosType Dtk::Core::DSysInfo::UosDevice
@brief UOS设备版
@var Dtk::Core::DSysInfo::UosType Dtk::Core::DSysInfo::UosTypeCount
@brief 记录枚举数量
@enum Dtk::Core::DSysInfo::UosEdition
@brief 详细uos版本
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosEditionUnknown
@brief 未知版本
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosProfessional
@brief UOS专业版
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosHome
@brief UOS家庭版
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosCommunity
@brief 社区版
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosMilitary
@brief *
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosEnterprise
@brief UOS企业版
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosEnterpriseC
@brief UOS行业版
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosEuler
@brief UOS服务器欧拉版
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosMilitaryS
@brief *
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosDeviceEdition
@brief UOS专用设备版
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosEducation
@brief UOS教育版
@var Dtk::Core::DSysInfo::UosEdition Dtk::Core::DSysInfo::UosEditionCount
@brief 记录枚举数量
@enum Dtk::Core::DSysInfo::UosArch
@brief UOS使用的架构
@var Dtk::Core::DSysInfo::UosArch Dtk::Core::DSysInfo::UosArchUnknown
@brief 未知架构
@var Dtk::Core::DSysInfo::UosArch Dtk::Core::DSysInfo::UosAMD64
@brief x86_64
@var Dtk::Core::DSysInfo::UosArch Dtk::Core::DSysInfo::UosARM64
@brief arm64
@var Dtk::Core::DSysInfo::UosArch Dtk::Core::DSysInfo::UosMIPS64
@brief mips64
@var Dtk::Core::DSysInfo::UosArch Dtk::Core::DSysInfo::UosSW64
@brief sw_64
@fn static bool Dtk::Core::DSysInfo::isDeepin() //FIXME: 显示错乱 无法修复
@brief 是否为 deepin 或 uos 系统
@return 0 不是 deepin 或 uos 系统
@return 1 是 deepin 或 uos 系统
@fn static bool Dtk::Core::DSysInfo::isDDE()
@brief 是否使用 dde 桌面环境
@note 此方法仅在 linux 平台下可用
@fn static DeepinType Dtk::Core::DSysInfo::deepinType()
@brief deepin 系统类型
@note 此方法仅在 linux 平台下可用
@fn static QString Dtk::Core::DSysInfo::deepinTypeDisplayName (const QLocale &locale=QLocale::system())
@brief 显示的 deepin 发行版类型名称
@note 此方法仅在 linux 平台下可用
@fn static QString Dtk::Core::DSysInfo::deepinVersion()
@brief deepin 版本
@note 此方法仅在 linux 平台下可用
@fn static QString Dtk::Core::DSysInfo::deepinCopyright()
@brief deepin 开源许可协议
@note 此方法仅在 linux 平台下可用
@fn static UosEdition Dtk::Core::DSysInfo::uosEditionType()
@brief DSysInfo::osEditionType 版本类型 显示版本类型 专业版/个人版/社区版..
@note 根据 osBuild.B && osBuild.D
@note 此方法仅在 linux 平台下可用
@fn static UosArch Dtk::Core::DSysInfo::uosArch()
@brief DSysInfo::osArch 架构信息
@details(使用一个字节的二进制位, 从低位到高位) 【0x8 sw64】【0x4 mips64】【0x2 arm64】【0x1 amd64】
@note 此处架构是从 OsBuild 获取的系统版本的 Arch 信息, 并不是指硬件的 Arch 信息
@note 此方法仅在 linux 平台下可用
@fn static QString uosProductTypeName(const QLocale &locale=QLocale::system())
@brief DSysInfo::osProductTypeName 版本名称
@details ProductType[xx] 项对应的值, 如果找不到对应语言的默认使用 ProductType 的值(Desktop/Server/Device) locale 当前系统语言
@fn static QString Dtk::Core::DSysInfo::uosSystemName(const QLocale &locale=QLocale::system())
@brief SystemName[xx] 项对应的值
@details 如果找不到对应语言的默认使用 SystemName 的值 Uniontech OS locale 当前系统语言
@note 此方法仅在 linux 平台下可用
@fn static QString Dtk::Core::DSysInfo::function uosEditionName(const QLocale &locale=QLocale::system())
@brief 版本名称 EditionName[xx] 项对应的值
@details 如果找不到对应语言的默认使用 EditionName 的值(Professional/Home/Community...) locale 当前系统语言
@note 此方法仅在 linux 平台下可用
@fn static QString Dtk::Core::DSysInfo::spVersion()
@brief 阶段版本名称
@details 小版本号 A-BC-D 中 BC、 A.B.C 中的 B 返回 SP1-SPxx, 如果正式版返回空 X.Y.Z模式下暂不支持返回此版本号
@note minVersion.BC == 00 正式版本, minVersion.BC | minVersion.B == 01-99 SP1….SP99
@note 此方法仅在 linux 平台下可用
@fn static QString Dtk::Core::DSysInfo::udpateVersion()
@brief 更新版本名称 小版本号 A-BC-D 中 D、A.B.C 模式中的 C 返回 update1… update9, 如果正式版返回空 X.Y.Z 模式下暂不支持返回此版本号
@note minVersion.D == 0;正式版本 minVersion.D | minVersion.C == 1-9;update1… update9, updateA...updateZ
@note 此方法仅在 linux 平台下可用
@fn static QString Dtk::Core::DSysInfo::majorVersion()
@brief 主版本号 主版本号 【20】【23】【25】【26】【29】【30】
@note 此方法仅在 linux 平台下可用
@fn static QString Dtk::Core::DSysInfo::minorVersion()
@brief 小版本号 【ABCD】 ·[0-9]{4} 【A.B.C】 或者【X.Y.Z】
@note 此方法仅在 linux 平台下可用
@fn static QString Dtk::Core::DSysInfo::buildVersion()
@brief 小版本号 系统镜像批次号, 按时间顺序(不可回退)从100-999递增
@note 此方法仅在 linux 平台下可用
@fn static QString Dtk::Core::DSysInfo::distributionInfoPath ()
@brief 返回 distribution 文件地址 一般在`/usr/share/deepin/`目录下
@fn static QString Dtk::Core::DSysInfo::distributionInfoSectionName(OrgType type)
@brief 返回 distribution.info 文件中 SectionName 字段的值
@fn static Dtk::Core::DSysInfo::distributionOrgName(OrgType type=Distribution, const QLocale &locale=QLocale::system())
@brief 返回组织名称
@details 使用类型为Distribution来获取当前deepin distribution本身的名称
@fn static QPairDtk::Core::DSysInfo::distributionOrgWebsite(OrgType type=Distribution)
@brief 发行版组织的网站名称和网址。使用 type 作为 Distribution 获取当前 deepin 发行版本身的名称。
@fn static QString Dtk::Core::DSysInfo::distributionOrgLogo(OrgType orgType=Distribution, LogoType type=Normal, const QString &fallback=QString())
@brief 获得的组织logo路径, 如果不存在, 则返回给定的其他路径
@details 使用 type 作为 Distribution 获取当前 deepin 发行版本身的logo。
@fn static QString Dtk::Core::DSysInfo::operatingSystemName()
@brief 操作系统名
@fn static ProductType Dtk::Core::DSysInfo::productType()
@brief 产品类型
@fn static QString Dtk::Core::DSysInfo::productVersion()
@brief 产品版本
@fn static bool Dtk::Core::DSysInfo::isCommunityEdition()
@brief 检查当前版本是否是社区版 开发者可以使用这种方式来检查我们是否需要启用或禁用社区版或企业版的功能。
@details 目前的规则:
专业版、服务器版、个人版(DeepinType)将被视为企业版。
Uos(ProductType)将被视为企业版。
@fn static QString Dtk::Core::DSysInfo::computerName()
@brief 电脑名
@fn static QString Dtk::Core::DSysInfo::cpuModelName()
@brief cpu模式名
@fn static qint64 Dtk::Core::DSysInfo::memoryInstalledSize()
@brief 内存安装大小
@fn static qint64 Dtk::Core::DSysInfo::memoryTotalSize()
@brief 实际内存大小
@fn static qint64 Dtk::Core::DSysInfo::systemDiskSize()
@brief 系统磁盘大小
@fn static QDateTime Dtk::Core::DSysInfo::bootTime ()
@brief 系统启动时间点
@fn static QDateTime Dtk::Core::DSysInfo::shutdownTime ()
@brief 上一次正常关机时间点(重启也会被记录在内)
@fn static qint64 Dtk::Core::DSysInfo::uptime()
@brief 系统启动到现在时长
@note 参见`cat /proc/uptime`命令
@fn static Arch Dtk::Core::DSysInfo::arch
@brief cpu架构信息
@note 此处架构是从gcc编译器获取的
*/
dtkcore-5.7.12/docs/global/index.zh_CN.md 0000664 0000000 0000000 00000002561 14762266606 0020105 0 ustar 00root root 0000000 0000000 @page global global--dtk全局工具组件
# DTk global:dtk全局工具类
## dsysinfo:dtk系统信息工具类
[dsysinfo.h 详细文档](dsysinfo_8h.html)
这里放一个最小化使用dsysinfo的例子:
cmake:
```cmake
cmake_minimum_required(VERSION 3.13) # cmake版本要求
set (VERSION "1.0.0" CACHE STRING "define project version") # 定义项目版本
set(BIN_NAME test) # 定义项目名称
project(test) # 定义项目名称
file(GLOB_RECURSE SRCS "*.h" "*.cpp") # 定义项目源文件
find_package(Qt5 REQUIRED COMPONENTS Core) # 寻找Qt5
find_package(DtkCore REQUIRED) # 寻找DtkCore
add_executable(test
main.cpp # 源文件
)
target_link_libraries(test PRIVATE
${DtkCore_LIBRARIES} # 链接DtkCore
Qt5::Core # 链接Qt5
)
```
cpp:
```cpp
#include // 引入DSysInfo
#include // 引入qdebug.h
DCORE_USE_NAMESPACE // 使用dtkcore命名空间
int main(int argc, char **argv) {
qDebug() << DSysInfo::deepinType(); // 打印deepin类型
qDebug() << DSysInfo::ProductType(); // 打印产品类型
return 0;
}
```
其余的组件使用方法类似,这里就不一一列举了
@defgroup dglobal
@brief dtk设置全局工具组件
@details
dtk全局工具组件,提供了设置全局工具的功能。
包含以下功能:
* dsysinfo:dtk系统信息工具类
* dconfig:dtk配置文件工具类
dtkcore-5.7.12/docs/log/ 0000775 0000000 0000000 00000000000 14762266606 0014771 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/docs/log/AbstractAppender.zh_CN.dox 0000664 0000000 0000000 00000010121 14762266606 0021722 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dlog
@file include/log/AbstractAppender.h
AbstractAppender类是所有可以与Logger一起使用的日志appender的基础接口类。
@class Dtk::Core::AbstractAppender
@brief AbstractAppender为应用消息的线程安全、互斥保护的日志提供了一个通用的实现
@details AbstractAppender为应用消息的线程安全、互斥保护的日志提供了一个通用的实现,例如ConsoleAppender、FileAppender或其他的东西。
AbstractAppender是抽象的,不能被实例化,但是你可以使用它的任何一个子类,或者根据你的选择创建一个自定义的日志appender。
Appenders是逻辑设备,旨在通过调用`Logger::registerAppender()`附加到Logger对象。在每个来自应用程序的日志记录调用中,Logger对象都会依次调用所有在它身上注册的appender的`write()`函数。
你可以子类化AbstractAppender来实现你喜欢的任何类型的日志目标。它可以是外部日志子系统(例如,*nix中的syslog)、XML文件、SQL数据库条目、D-Bus消息或任何你能想到的其他东西。
对于简单的非结构化的纯文本日志(例如,到一个纯文本文件或到控制台输出),请子类化AbstractStringAppender而不是AbstractAppender,这将给你一个更方便的方法来控制日志输出的格式。
@fn AbstractAppender Dtk::Core::AbstractAppender::AbstractAppender()
@brief AbstractAppender构造函数
@fn AbstractAppender Dtk::Core::AbstractAppender::~AbstractAppender()
@brief AbstractAppender析构函数
@fn Logger::LogLevel Dtk::Core::AbstractAppender::detailsLevel()
@brief 返回appender的当前日志级别
@details 返回appender的当前日志级别.日志级别低于当前`detailsLevel()`的日志记录将被appender默认忽略,
并且不会被发送到其append()函数。
它提供了额外的日志灵活性,允许你为不同类型的日志设置不同的记录等级
@note 该函数是线程安全的
@sa setDetailsLevel()
@sa Logger::LogLevel
@return 日志记录等级
@fn void Dtk::Core::AbstractAppender::setDetailsLevel(Logger::LogLevel level)
@brief 设置当前appender的记录级别,默认记录级别为Logger::Debug
@note 该函数是线程安全的
@sa setDetailsLevel()
@sa Logger::LogLevel
@fn void Dtk::Core::AbstractAppender::setDetailsLevel(const QString &level)
@brief 设置当前appender的记录级别,这个函数是为了简化输入而提供的,它的行为与同名函数类似。
@sa AbstractAppender::setDetailsLevel(Logger::LogLevel level)
@sa setDetailsLevel()
@sa Logger::LogLevel
@fn void Dtk::Core::AbstractAppender::write(const QDateTime &time, Logger::LogLevel level, const char *file, int line, const char *func, const QString &category, const QString &msg)
@brief 尝试写入日志,这是由Logger对象调用的函数,用于向appender写入日志信息
@param[in] time 时间戳
@param[in] level 日志记录等级
@param[in] file 目标文件名
@param[in] line 要输出的行数
@param[in] func 输出的函数名称
@param[in] category 日志类别
@param[in] msg 输出信息
@note 该函数是线程安全的
@sa Logger::write()
@sa detailsLevel()
@fn void Dtk::Core::AbstractAppender::AbstractAppender::append(const QDateTime &timeStamp, Logger::LogLevel level, const char *file, int line,
const char *function, const QString &category, const QString &message) = 0
@brief 将日志记录写到logger实例中
@details 每次当用户试图使用`write()`函数向这个AbstractAppender实例写入消息时,都会调用这个函数。`write()`函数作为代理工作,只输出日志级别大于或等于当前`logLevel()`的消息
@note 当你实现一个自定义的appender时,需要重载这个函数。
@note 该函数不需要是线程安全的,因为它不会被Logger对象直接调用。`write()`函数作为代理,保护该函数不被并发调用。
@param[in] timeStamp 时间戳
@param[in] level 日志记录等级
@param[in] file 目标文件名
@param[in] line 要输出的行数
@param[in] function 输出的函数名称
@param[in] category 日志类别
@param[in] message 输出信息
*/
dtkcore-5.7.12/docs/log/AbstractStringAppender.zh_CN.dox 0000664 0000000 0000000 00000013066 14762266606 0023124 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dlog
@file include/log/AbstractStringAppender.h
@class Dtk::Core::AbstractStringAppender
@brief AbstractStringAppender类为处理纯文本格式的Appender提供了一个方便的基础日志
@details AbstractStringAppender是AbstractAppender类的简单扩展,
它提供了一种方便的方式来创建自定义日志应用程序, 该程序使用纯文本格式的日志.
它有`formattedString()`保护类型(不可直接被调用)函数, 可以根据`setFormat()`设置的格式来格式化日志参数。
@note 这个类不能直接实例化, 因为它包含从AbstractAppender类继承的纯虚函数。
@brief 关于自定义日志输出格式的更详细描述, 请参见setFormat()函数的文档
@sa AbstractStringAppender::setFormat()
@fn AbstractStringAppender Dtk::Core::AbstractStringAppender::AbstractStringAppender()
@brief 构建一个新的字符串appender对象
@fn QString Dtk::Core::AbstractStringAppender::format()
@brief 返回当前使用的format字符串
@details 默认记录格式为:`"%{time}{yyyy-MM-ddTHH:mm:ss.zzz} [%{type:-7}] <%{function}> %{message}\n"`
你可以使用setFormat()函数来设置不同的日志记录格式。
@sa AbstractStringAppender::setFormat()
@return 返回当前使用的format字符串
@fn void Dtk::Core::AbstractStringAppender::setFormat(const QString &format)
@brief 设置日志格式, 以便用这个appender向日志目标写入字符串。
@details
对于那些使用过标准sprintf函数的开发者来说, 字符串格式非常常见。
日志输出格式是一个简单的QString, 带有特殊的标记(以%符号开始), 在写日志记录时将被替换成它的内部含义。
控制标记以百分号(%)开始, 后面是{}括号内的命令(该命令描述了将被放入日志记录而不是标记的内容)。
可选的字段宽度参数可以在命令后直接指定(通过括号内的冒号), 有些命令需要一个额外的格式化参数(在第二个{}括号内)
字段宽度参数的工作原理与`QString::arg()`fieldWidth参数几乎相同(并在内部使用它),
例如, "%{type:-7}"将被替换为消息的左边填充的调试级别("Debug")或其他东西。更详细的描述请参考Qt文档。
@details 支持的标记:
| **标记** | **含义** | **备注** |
|:-----------:|:-----------------------------------------------------:|:-------------------------------------------------------------------:|
| %{time} | 时间戳。你可以使用标记后的第二个{}括号来指定你的自定义时间戳格式。默认格式:"HH:mm:ss.zzz" | "%{time}{dd-MM-yyyy, HH:mm}"可能被替换为 "20-9-2022, 21:24", 这取决于当前的日期和时间。 |
| %{type} | 日志级别。可能的日志级别在Logger::LogLevel枚举中显示。 | |
| %{Type} | 大写的日志级别 | |
| %{typeOne} | 一个字母的日志级别 | |
| %{TypeOne} | 一个大写字母的日志级别 | |
| %{File} | 记录日志的文件的完整源文件名(含路径), 使用 `__FILE__`预处理程序宏 | |
| %{file} | 简短的文件名(去除路径后的文件名) | |
| %{line} | 源文件中的行数。使用`__LINE__`预处理程序宏。 | |
| %{Function} | 调用`LOG_*`宏的函数的名称。使用Qt提供的`Q_FUNC_INFO`宏。 | |
| %{function} | 类似于%{Function}, 但使用 stripFunctionName 剥离了函数名。 | |
| %{message} | 日志内容 | |
| %{category} | 日志类别 | |
| %{appname} | 应用程序名称(由`QCoreApplication::applicationName()`函数返回) | |
| %{pid} | 应用程序的pid(由`QCoreApplication::applicationPid()`函数返回) | |
| %{threadid} | 线程ID | |
| %% | 转译为单`%`标记 | |
@fn static QString Dtk::Core::AbstractStringAppender::stripFunctionName(const char *name)
@brief 剥离长函数签名(由Q_FUNC_INFO宏添加)
@details 字符串处理掉了函数的返回类型、参数和模板参数, 这对于提高日志输出的可读性是非常有用的
@param[in] name 函数名称
@return 剥离的函数名称
*/
dtkcore-5.7.12/docs/log/ConsoleAppender.zh_CN.dox 0000664 0000000 0000000 00000002357 14762266606 0021575 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dlog
@file include/log/ConsoleAppender.h
@class Dtk::Core::ConsoleAppender
@brief ConsoleAppender是简单的控制台appender,将日志记录写入`std::cerr`输出流
@details ConsoleAppender使用`[%{type:-7}] <%{function}> %{message}\n`作为默认输出格式。它类似于AbstractStringAppender,但不显示时间
你可以通过使用`QT_MESSAGE_PATTERN`环境变量来修改ConsoleAppender的输出格式,而不用修改你的代码。
变量。如果你需要你的应用程序忽略这个环境变量,你可以调用`ConsoleAppender::ignoreEnvironmentPattern(true)`
@fn ConsoleAppender Dtk::Core::ConsoleAppender::ConsoleAppender()
@brief 构造函数,设置默认的日志格式为`[%{type:-7}] <%{function}> %{message}\n`
@fn virtual QString Dtk::Core::ConsoleAppender::format()
@brief 返回当前默认输出格式,可以调用父类的`setFormat()`来更改日志输出格式
@sa AbstractStringAppender::setFormat()
@fn void Dtk::Core::ConsoleAppender::ignoreEnvironmentPattern(bool ignore)
@brief 设置应用程序忽略环境变量来修改ConsoleAppender的输出格式,使用默认输出格式
@sa [QT_MESSAGE_PATTERN](https://doc.qt.io/qt-5/debug.html#warning-and-debugging-messages)
*/
dtkcore-5.7.12/docs/log/FileAppender.zh_CN.dox 0000664 0000000 0000000 00000001633 14762266606 0021046 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dlog
@file include/log/FileAppender.h
@class Dtk::Core::FileAppender
@brief 简单的文件appender,将日志记录写到纯文本文件中
@fn FileAppender Dtk::Core::FileAppender::FileAppender(const QString &fileName = QString())
@brief 构造函数,指定日志记录文件的文件名。
@fn QString Dtk::Core::FileAppender::fileName() const
@brief 返回由setFileName()设置的名称,或返回FileAppender构造函数传入的fileName
@sa FileAppender::setFileName()
@fn void Dtk::Core::FileAppender::setFileName(const QString &s)
@brief 设置文件的名称。该名称可以没有路径,可以是相对路径,也可以是绝对路径
@sa FileAppender::fileName()
@fn qint64 Dtk::Core::FileAppender::size()
@brief 返回日志文件大小
@fn bool FileAppender::openFile()
@brief 打开日志记录文件
@fn void FileAppender::closeFile()
@brief 关闭日志记录文件
*/
dtkcore-5.7.12/docs/log/Logger.zh_CN.dox 0000664 0000000 0000000 00000022673 14762266606 0017736 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dlog
@file include/log/Logger.h
@class Dtk::Core::Logger Logger.h
@brief 非常简单但相当强大的组件,可用于记录你的应用程序活动。
@enum Dtk::Core::Logger::LogLevel
@brief 日志等级
@var Dtk::Core::Logger::LogLevel Dtk::Core::Logger::Trace
追踪级别,可用于大部分不需要的记录,用于内部代码追踪
@var Dtk::Core::Logger::LogLevel Dtk::Core::Logger::Debug
调试级别,用于软件的调试。
@var Dtk::Core::Logger::LogLevel Dtk::Core::Logger::Info
信息级别,可用于信息记录,这可能不仅对开发者有意义
@var Dtk::Core::Logger::LogLevel Dtk::Core::Logger::Warning
警告,可以用来记录你的应用程序检测到的一些非致命的警告
@var Dtk::Core::Logger::LogLevel Dtk::Core::Logger::Error
错误,可能是一个较大问题,导致你的程序工作出错,但不至于崩溃
@var Dtk::Core::Logger::LogLevel Dtk::Core::Logger::Fatal
致命错误,用于不可恢复的错误,在写入日志记录后立即崩溃应用程序(终止)
@fn Logger Dtk::Core::Logger::Logger()
@brief 构建Logger的实例。
@note 如果你只使用一个全局的logger实例,不需要手动使用这个构造函数,可以考虑使用logger宏来代替访问记录器实例
@fn Logger Dtk::Core::Logger::Logger(const QString &defaultCategory)
@brief 构建Logger的实例并设置Logger的默认类别
@note 如果你只使用一个全局的logger实例,不需要手动使用这个构造函数,
可以考虑使用logger宏来访问logger实例并调用setDefaultCategory方法
@sa Logger::Logger()
@sa Logger::setDefaultCategory()
@fn Logger Dtk::Core::Logger::~Logger()
@brief 析构函数
@note 你可能不需要直接使用这个函数。记录器的全局实例将在你的QCoreApplication执行结束后自动销毁
@fn static Logger* Dtk::Core::Logger::globalInstance()
@brief 返回Logger的全局对象
@note 在大多数情况下,你不应该直接使用这个函数。可以考虑使用 [logger](@ref logger) 宏来代替
@return Logger指针
@fn static QString Dtk::Core::Logger::levelToString(Logger::LogLevel level)
@brief 将LogLevel枚举值转换为其字符串表示
@sa Logger::LogLevel
@fn static LogLevel Dtk::Core::Logger::levelFromString(const QString &str)
@brief 将LogLevel字符串表示转换为枚举值
@note 字符串的比较是不分大小写的。如果提供的日志级别字符串不合法,则返回`Logger::Debug`的枚举值
@sa Logger::LogLevel
@sa Logger::levelToString()
@fn void Dtk::Core::Logger::registerAppender(AbstractAppender *appender)
@brief 注册appender来写入日志记录
在写入日志的调用中(使用其中一个宏或`write()`函数),Logger遍历appender列表,并向每个appender写入日志记录。请查阅AbstractAppender文档以了解appenders的概念。
如果没有appender被添加到Logger中,它就会退回到记录到`std::cerr`流中。
@param[in] appender 要在Logger中注册的Appender
@note Logger对appender拥有所有权,它将在应用程序退出时删除它。因此,appender必须在堆上创建,以防止appender被重复销毁。
@sa Logger::registerCategoryAppender()
@sa Dtk::Core::AbstractAppender
@fn void Dtk::Core::Logger::registerCategoryAppender(const QString &category, AbstractAppender *appender)
@brief 注册appender,将日志记录写到特定的类别中
@details 调用这个方法,你可以将一些appender与命名的类别联系起来。
在调用特定类别的日志写入时(直接调用带有类别参数的`write()`,写入默认类别,或使用特殊的`dCDebug()`、`dCWarning()`等宏),
Logger只将日志信息写入注册的类别appender列表中。
你可以调用`logToGlobalInstance()`将所有类别的日志信息传递给全局的Logger实例Appender(使用`registerAppender()`注册)。
如果没有特定名称的类别应用程序被注册到记录器上,它就会退回到记录到`std::cerr` STL流中,这两种方法都有简单的警告信息。
@param[in] category 类别名称
@param[in] appender 要在Logger中注册的Appender
@note Logger对appender拥有所有权,它将在应用程序退出时删除它。根据这一点,appender必须在堆上创建,以防止appender被重复销毁。
@sa Logger::registerAppender()
@sa Logger::logToGlobalInstance()
@sa Logger::setDefaultCategory()
@fn void Dtk::Core::Logger::logToGlobalInstance(const QString &category, bool logToGlobal = false)
@brief 将一些日志类别与全局日志实例应用者联系起来。
如果logToGlobal设置为 "true",所有到指定类别的Logger的日志消息也将被写入全局日志实例appenders(使用`registerAppender()`注册)
默认情况下,所有到特定类别的消息都只写到特定的类别应用者
(使用 `registerCategoryAppender()` 注册)
@param[in] category 类别名称
@param[in] logToGlobal 是否将日志写入全局日志appenders
@sa Logger::registerAppender()
@sa Logger::globalInstance()
@sa Logger::registerCategoryAppender()
@fn void Dtk::Core::Logger::setDefaultCategory(const QString &category);
QString defaultCategory()
@brief 设置默认的日志类别
所有到这个类别应用的日志信息也将被写入一般的日志实例应用(使用[registerAppender](@ref registerAppender)方法注册),反之亦然
特别是,任何对dDebug()宏的调用都将被视为类别日志
所以你不需要用dCDebug()宏来指定类别名称
要取消默认的类别,传递一个空字符串作为参数
@param[in] category 类别名称
@note "category "格式标记将被设置为所有这些消息的类别名称
@sa Dtk::Core::AbstractStringAppender::setFormat()
@sa Logger::defaultCategory()
@sa Logger::registerCategoryAppender()
@sa Logger::logToGlobalInstance()
@fn QString Dtk::Core::Logger::defaultCategory()
@brief 返回默认的日志类别名称
@sa Logger::setDefaultCategory()
@fn void Dtk::Core::Logger::write(const QDateTime &time, LogLevel level,
const char *file, int line,const char *func,
const char *category, const QString &msg)
@brief 写入日志记录。
将带有所提供参数的日志记录写给所有注册的应用
@param[in] time 时间戳
@param[in] level 日志记录等级
@param[in] file 目标文件名
@param[in] line 要输出的行数
@param[in] func 输出的函数名称
@param[in] category 日志类别
@param[in] msg 输出信息
@note 使用`Logger::Fatal`日志级别记录日志记录将导致调用STL `abort()`函数,
这将中断你的软件的运行并Core dump
@sa Logger::LogLevel
@sa Dtk::Core::AbstractAppender
@fn void Dtk::Core::Logger::write(LogLevel level, const char *file, int line,
const char *func, const char *category, const QString &msg)
@brief 这是为方便而提供的重载函数。它的行为与同名函数类似,此函数无需传入time参数
@note 这个函数使用了`QDateTime::currentDateTime()`用获得的当前时间戳
@sa Logger::write(const QDateTime &time, LogLevel level,
const char *file, int line,const char *func,
const char *category, const QString &msg)
@param[in] level 日志记录等级
@param[in] file 目标文件名
@param[in] line 要输出的行数
@param[in] func 输出的函数名称
@param[in] category 日志类别
@param[in] msg 输出信息
@fn QDebug Dtk::Core::Logger::write(LogLevel level, const char *file,
int line,const char *func, const char *category)
@brief 这是为方便而提供的重载函数。它的行为与同名函数类似,此函数无需传入message参数
@details 这个函数不接受任何日志信息作为参数。它返回的是可以使用流函数写入的`QDebug`对象
例如,你可能想写:
@code
dDebug() << "This is the size" << size << "of the element" << elementName;
@endcode
而不是写为:
@code
dDebug(QString(QLatin1String("This is the size %1x%2 of the element %3")).arg(size.x()).arg(size.y()).arg(elementName));
@endcode
这样会更优雅一些
请考虑阅读Qt参考文档,了解QDebug类的使用语法
@note 这个重载肯定是最好用的一个重载,但是代价是它会比其他的重载更为慢
@sa Logger::write(const QDateTime &time, LogLevel level,
const char *file, int line,const char *func,
const char *category, const QString &msg)
@param[in] level 日志记录等级
@param[in] file 目标文件名
@param[in] line 要输出的行数
@param[in] func 输出的函数名称
@param[in] category 日志类别
@fn void Dtk::Core::Logger:: writeAssert(const char *file, int line,
const char *func, const char *condition)
@brief 写入断言
@details 这个函数使用write()函数来写断言记录
断言记录总是使用`Logger::Fatal`日志级别来写,这将导致程序的中止和核心转储(core dump)的生成(如果支持)
写入appenders的信息与传入参数相同,前缀为 `ASSERT:`
@param[in] file 目标文件名
@param[in] line 要输出的行数
@param[in] func 输出的函数名称
@note 不建议直接调用这个函数,你可以直接调用`LOG_ASSERT`宏,它将为这个函数提供所有需要的信息
@sa Logger::write(const QDateTime &time, LogLevel level,
const char *file, int line,const char *func,
const char *category, const QString &msg)
*/
dtkcore-5.7.12/docs/log/RollingFileAppender.zh_CN.dox 0000664 0000000 0000000 00000006306 14762266606 0022377 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dlog
@file include/log/RollingFileAppender.h
@class Dtk::Core::RollingFileAppender
@brief RollingFileAppender类扩展了FileAppender,使日志文件在按照用户指定的频率进行滚动
@details
该类是基于`Log4Qt.DailyRollingFileAppender`类[Log4Qt](http://log4qt.sourceforge.net/)
并具有相同的日期模式格式
例如,如果fileName设置为`/foo/bar`,DatePattern设置为每日滚动('.yyy-MM-dd'.log'),在2022-05-28的午夜。
日志文件`/foo/bar.log`将被复制到`/foo/bar.2022-05-28.log`,2022-05-29的日志将在`/foo/bar`中继续,直到第二天滚动
logFilesLimit参数用于在滚动期间自动删除目录中最旧的日志文件。
(所以在任何时候,目录中都不会有超过logFilesLimit的最新日志文件存在)
@enum Dtk::Core::RollingFileAppender::DatePattern
@brief 日志频率
@var Dtk::Core::RollingFileAppender::DatePattern Dtk::Core::RollingFileAppender::MinutelyRollover
@brief 每分钟的日期模式字符串是`.yyyy-MM-dd-hh-mm`
@var Dtk::Core::RollingFileAppender::DatePattern Dtk::Core::RollingFileAppender::HourlyRollover
@brief 每小时的日期模式字符串是 `.yyyy-MM-dd-hh`
@var Dtk::Core::RollingFileAppender::DatePattern Dtk::Core::RollingFileAppender::HalfDailyRollover
@brief 每半天的日期模式字符串是`.yyyy-MM-dd-a`
@var Dtk::Core::RollingFileAppender::DatePattern Dtk::Core::RollingFileAppender::DailyRollover
@brief 每天的日期模式字符串是`.yyyy-MM-dd`
@var Dtk::Core::RollingFileAppender::DatePattern Dtk::Core::RollingFileAppender::WeeklyRollover
@brief 每周的日期模式字符串是`.'yyyy-ww`
@var Dtk::Core::RollingFileAppender::DatePattern Dtk::Core::RollingFileAppender::MonthlyRollover
@brief 每月的日期模式字符串是`.yyyy-MM`
@fn RollingFileAppender Dtk::Core::RollingFileAppender::RollingFileAppender()
@brief 构造函数,默认限制日志文件个数是0,默认日志文件大小是1024*1024*20=20m
@fn DatePattern Dtk::Core::RollingFileAppender::datePattern()
@brief 返回当前的滚动更新频率
@sa RollingFileAppender::DatePattern
@fn void Dtk::Core::RollingFileAppender::setDatePattern(DatePattern datePattern)
@brief 设置日志滚动频率
@sa RollingFileAppender::DatePattern
@fn void Dtk::Core::RollingFileAppender::setDatePattern(const QString &datePattern)
@brief 此重载是为了方便使用,可以传入一个滚动频率字符串
@sa RollingFileAppender::DatePattern
@sa RollingFileAppender::setDatePattern(DatePattern datePattern)
@fn QString Dtk::Core::RollingFileAppender::datePatternString()
@brief 以字符串形式,返回当前滚动频率
@fn void Dtk::Core::RollingFileAppender::setLogFilesLimit(int limit)
@brief 设置日志文件数量上限,最旧的文件会被滚动覆盖
@fn int Dtk::Core::RollingFileAppender::logFilesLimit()
@brief 返回设置的日志文件数量上限
@sa RollingFileAppender::setLogFilesLimit()
@fn int Dtk::Core::RollingFileAppender::setLogSizeLimit(int qint64)
@brief 设置日志文件单个文件大小上限
@fn qint64 Dtk::Core::RollingFileAppender::logSizeLimit()
@brief 返回设置的日志文件单个文件大小上限
@sa RollingFileAppender::setLogSizeLimit(int qint64)
*/
dtkcore-5.7.12/docs/log/dlogmanager.zh_CN.dox 0000664 0000000 0000000 00000004637 14762266606 0020777 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@ingroup dlog
@file include/log/LogManager.h
@class Dtk::Core::DLogManager
@brief DLogManager是dtk日志管理类,提供对日志的基础设置
@details 使用此类可以很方便的为自己的dtk程序加上日志,一般情况下应用如果需要写入日志只需要调用此类
调用相应的注册方法设置存储路径相关信息即可
@fn static void Dtk::Core::DLogManager::registerConsoleAppender()
@brief 注册默认的控制台记录器
@fn static void Dtk::Core::DLogManager::registerFileAppender()
@brief 注册默认的文件记录器,默认的文件记录器类型为RollingFileAppender.
@note 输出日志默认文件位置为`~/.cache//.log`如果获取 $HOME 环境变量失败将不写日志.
如果在创建程序的时候没有指定这两个name,如果未设置organizationName,则是 `~/.cache//.log`
如果applicationName没有设置, 会fallback到进程二进制文件名
@sa DLogManager::setlogFilePath()
@fn static void Dtk::Core::DLogManager::registerJournaldAppender()
@brief 注册默认的journald记录器
@note 此方法只在linux下有效
@detials 默认输出文件位置为`/var/log/journal/.journal`,前提是此目录存在且有写权限,
如果目录不存在,systemd将不会自动创建此目录,并将日志写入到`/run/log/journal/.journal`中,此目录不支持持久化存储,
将在下次重启后丢失。
@note 查看日志可用`journalctl`命令,查看详细信息可用`journalctl -o verbose`命令,也可以使用deepin 日志查看器查看
@fn static QString Dtk::Core::DLogManager::getlogFilePath()
@brief 获取当前的日志存储路径,包括文件名
@fn static void Dtk::Core::DLogManager::setlogFilePath(const QString &logFilePath)
@brief 设置log文件路径。如果文件存在且不是log文件类型(比如文件夹)会导致设置无效并输出一条警告。
@note 注意,此文件路径为包括具体文件名的绝对路径。需要此文件不存在或者存在且为有效类型(xxx.log),一般情况下无需手动指定路径。
@fn static void Dtk::Core::DLogManager::setLogFormat(const QString &format)
@brief 设置日志的格式,如果没有设置格式
@details 默认的格式为:`"%{time}{yyyy-MM-dd, HH:mm:ss.zzz} [%{type:-7}] [%{file:-20} %{function:-35} %{line}] %{message}\n"`
@sa Dtk::Core::AbstractStringAppender::format()
*/
dtkcore-5.7.12/docs/log/index.zh_CN.md 0000664 0000000 0000000 00000011042 14762266606 0017420 0 ustar 00root root 0000000 0000000 @page DLog dlog--DTK日志组件
# Dlog:DTK日志组件
## 简介
DTK日志组件,提供了日志的输出、日志级别的设置、日志文件的设置等功能。为了简化日志的使用,我们提供了两种使用方式,一种是使用宏,另一种是使用类。
但是更为建议使用宏的方式进行使用。因为使用宏可以输出更多的信息,比如文件名、函数名、行号等。
## 使用
### 宏
DTK日志组件提供了一系列的宏,用于输出日志。这些宏的定义在dloggerdefs.h中
如果需要使用宏,则需要在你的代码中包含`DLog`文件。
@note DTK更推荐使用CPP标准引入头文件的方式,即使用`#include `的方式引入头文件,而不是使用`#include "xxxxx.h"`的方式引入头文件。
示例代码如下:
```cpp
#include
#include
DCORE_USE_NAMESPACE
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
#ifdef Q_OS_LINUX
DLogManager::registerJournalAppender();
#endif
DLogManager::registerConsoleAppender();
dDebug() << "this is a debug message";
return app.exec();
}
```
上述代码中,我们使用了dDebug()宏,用于输出一条debug级别的日志。在输出日志时,我们可以使用`<<`运算符,将多个变量输出到日志中。
注意,registerJournalAppender()仅在Linux平台下有效,因为journal仅在Linux平台下有效。而registerConsoleAppender()则是在所有平台下都有效。
### 类
使用类的方式需要先创建一个logger对象,然后使用logger对象的方法来输出日志,具体请参见logger文档
## 注意事项
### 日志级别
DTK使用的日志级别与Qt的日志级别一致,分别为:Trace、Debug、Info、Warning、Error、Fatal。其中Trace是最低级别,Fatal是最高级别。
与之不同的是journal的日志级别和DTK的日志级别不一致,journal的日志级别分别为:emergency、alert、critical、error、warning、notice、info、debug。
这是因为journal的日志级别是从syslog中继承过来的,而syslog的日志级别是从BSD的syslog中继承过来的。而DTK的日志级别是从Qt的日志级别中继承过来的。
下表是DTK日志级别和journal日志级别的对应关系
| DTK值 | 序号 | 含义 | syslog值 | syslog序号 |
|---------|----|-------------------------------------|-------------|----------|
| dTrace | 0 | 追踪级别,可用于大部分不需要的记录,用于内部代码追踪 | 无 | |
| dDebug | 1 | 调试级别,用于软件的调试。 | LOG_DEBUG | 7 |
| dInfo | 2 | 信息级别,可用于信息记录,这可能不仅对开发者有意义 | LOG_INFO | 6 |
| dWarning | 3 | 警告,可以用来记录你的应用程序检测到的一些非致命的警告 | LOG_WARNING | 4 |
| dError | 4 | 错误,可能是一个较大问题,导致你的程序工作出错,但不至于崩溃 | LOG_ERR | 3 |
| dFatal | 5 | 致命错误,用于不可恢复的错误,在写入日志记录后立即崩溃应用程序(终止) | LOG_EMERG | 0 |
| | | | LOG_ALERT | 1 |
| | | | LOG_CRIT | 2 |
| | | | LOG_NOTICE | 6 |
### 日志文件
如果你选择使用journal作为日志输出,那么你需要在系统中安装systemd(一般的linux发行版都会自带systemd)。并且需要确保`/var/log/journal/`
目录的存在,否则journal会将日志写入到`/run/log/journal/`目录中。
如果你选择使用控制台作为日志输出,那么不会生成日志文件。
如果你选择使用文件作为日志输出,那么你需要确保你的日志文件所在的目录存在,否则会导致日志文件无法创建。
### 日志格式
如果你选择使用journal作为日志输出,且使用宏的方式进行日志输出,那么日志的格式为:
`[时间] [进程ID] [线程ID] [日志级别] [文件名:行号] [函数名] [日志内容]`,你仅需要关注日志内容即可。其他的信息都是journal自动添加的。
@defgroup dlog
@brief DTK日志组件
@details
DTK日志组件,提供了日志的输出、日志级别的设置、日志文件的设置等功能。
对于DTK日志组件,我们提供了两种使用方式,一种是使用宏,另一种是使用类。
但是更为建议使用宏的方式进行使用
dtkcore-5.7.12/docs/settings/ 0000775 0000000 0000000 00000000000 14762266606 0016050 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/docs/settings/backend/ 0000775 0000000 0000000 00000000000 14762266606 0017437 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/docs/settings/backend/dsettingsdconfigbackend.zh_CN.dox 0000664 0000000 0000000 00000002132 14762266606 0026017 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@file include/settings/backend/dsettingsdconfigbackend.h
@ingroup dsettings
@class Dtk::Core::DSettingsDConfigBackend dsettingsdconfigbackend.h
@brief 配置存储到DConfig
@fn Dtk::Core::DSettingsDConfigBackend::DSettingsDConfigBackend(const QString &name, const QString &subpath = QString(), QObject *parent = nullptr)
@brief DSettingsDConfigBackend构造函数,使用DConfig为配置文件名,保存数据到配置文件。
@param[in] name 配置文件名
@param[in] subpath 配置文件名的子目录
@param[in] parent 父对象
@fn virtual QStringList Dtk::Core::DSettingsDConfigBackend::keys() const
@brief 返回Dconfig的全部键值
@return
@fn virtual QVariant Dtk::Core::DSettingsDConfigBackend::getOption(const QString &key) const
@brief 从DConfig获取键值
@param[in] key
@return
@fn virtual void QVariant Dtk::Core::DSettingsDConfigBackend::doSetOption(const QString &key, const QVariant &value)
@brief 给DConfig设置键值
@param[in] key
@param[in] value
@fn virtual void Dtk::Core::DSettingsDConfigBackend::doSync()
@brief 触发DSettings将选项值保存到DConfig
*/ dtkcore-5.7.12/docs/settings/backend/gsettingsbackend.zh_CN.dox 0000664 0000000 0000000 00000001744 14762266606 0024500 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@file include/settings/backend/gsettingsbackend.h
@ingroup dsettings
@class Dtk::Core::GSettingsBackend gsettingsbackend.h
@brief DSettings的存储后端使用gsettings
@details 你可以从libdtkcore-bin中找到此工具, 使用/usr/lib/x86_64-linux-gnu/libdtk-/DCore/bin/dtk-settings -h 获取帮助
@fn Dtk::Core::GSettingsBackend::GSettingsBackend(DSettings *settings, QObject *parent = nullptr)
@brief GSettingsBackend构造函数
@fn virtual QStringList Dtk::Core::GSettingsBackend::keys() const
@brief gsettings的全部键值
@return 返回gsettings的全部键值
@fn virtual QVariant Dtk::Core::GSettingsBackend::getOption(const QString &key) const
@brief 根据`key`获取值
@return 返回键对应的值
@fn virtual void Dtk::Core::GSettingsBackend::doSetOption(const QString &key, const QVariant &value)
@brief 设置`key`对应的值
@fn virtual void Dtk::Core::GSettingsBackend::doSync()
@brief 触发DSettings将选项同步到存储
*/ dtkcore-5.7.12/docs/settings/backend/qsettingbackend.zh_CN.dox 0000664 0000000 0000000 00000002034 14762266606 0024320 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@file include/settings/backend/qsettingbackend.h
@ingroup dsettings
@class Dtk::Core::QSettingBackend qsettingbackend.h
@brief 存储DSettings到QSettings
@fn Dtk::Core::QSettingBackend::QSettingBackend(const QString &filepath, QObject *parent = 0)
@brief QSettingBackend构造函数,使用QSettings::NativeFormat将数据保存到指定路径。
@param[in] filepath 存储数据的路径
@param[in] parent 父对象
@fn virtual QStringList Dtk::Core::QSettingBackend::keys() const
@brief QSettings的全部键值
@return 返回QSettings的全部键值
@fn virtual QVariant Dtk::Core::QSettingBackend::getOption(const QString &key) const
@brief 根据`key`获取值
@param[in] key 配置项名称
@return 返回键对应的值
@fn virtual void Dtk::Core::QSettingBackend::doSetOption(const QString &key, const QVariant &value)
@brief 设置`key`对应的值
@param[in] key 配置项名称
@param[in] value 需要设置的值
@fn virtual void Dtk::Core::QSettingBackend::doSync()
@brief 触发DSettings选项值保存到QSettings
*/ dtkcore-5.7.12/docs/settings/dsettings.zh_CN.dox 0000664 0000000 0000000 00000017036 14762266606 0021577 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@file include/settings/dsettings.h
@ingroup dsettings
@class Dtk::Core::DSettingsBackend dsettings.h
@brief DSettingsBackend是一个配置存储类的接口
@details 简单的例子:
@code
{
"groups": [{
"key": "base",
"name": "Basic settings",
"groups": [{
"key": "open_action",
"name": "Open Action",
"options": [{
"key": "alway_open_on_new",
"type": "checkbox",
"text": "Always Open On New Windows",
"default": true
},
{
"key": "open_file_action",
"name": "Open File:",
"type": "combobox",
"default": ""
}
]
},
{
"key": "new_tab_windows",
"name": "New Tab & Window",
"options": [{
"key": "new_window_path",
"name": "New Window Open:",
"type": "combobox",
"default": ""
},
{
"key": "new_tab_path",
"name": "New Tab Open:",
"type": "combobox",
"default": ""
}
]
}
]
}]
}
@endcode
读取/设置其值的示例如下:
@code
// 初始化一个存储后端
QTemporaryFile tmpFile;
tmpFile.open();
auto backend = new Dtk::Core::QSettingBackend(tmpFile.fileName());
// 从json中初始化配置
auto settings = Dtk::Core::DSettings::fromJsonFile(":/resources/data/dfm-settings.json");
settings->setBackend(backend);
// 读取配置
auto opt = settings->option("base.new_tab_windows.new_window_path");
qDebug() << opt->value();
// 修改配置
opt->setValue("Test")
qDebug() << opt->value();
@endcode
@sa Dtk::Core::DSettingsOption
@sa Dtk::Core::DSettingsGroup
@sa Dtk::Core::DSettingsBackend
@sa Dtk::Widget::DSettingsWidgetFactory
@sa Dtk::Widget::DSettingsDialog
@fn Dtk::Core::DSettingsBackend::DSettingsBackend(QObject *parent = Q_NULLPTR)
@brief DSettingsBackend构造函数
@fn virtual QStringList DSettingsBackend::keys() const = 0;
@brief 返回全部键值
@fn virtual QVariant DSettingsBackend::getOption(const QString &key) const = 0;
@brief 获取 `key` 对应的值
@fn virtual void DSettingsBackend::doSync() = 0;
@brief 开始进行同步
@fn virtual void DSettingsBackend::doSetOption(const QString &key, const QVariant &value) = 0;
@brief 设置`key`对应的值,并使用存储后端进行存储。
@fn void DSettingsBackend::optionChanged(const QString &key, const QVariant &value);
@brief DSettingsOption的值发生变化时发出的信号。
@details `key` 发生改变的 option 键,`value`对应键的值。
@fn void DSettingsBackend::sync();
@brief 私有信号,请勿使用。
@fn void DSettingsBackend::setOption(const QString &key, const QVariant &value);
@brief 私有信号,请勿使用。
@class Dtk::Core::DSettings dsettings.h
@brief DSettings是设计上为Dtk的应用程序提供统一的配置存储以及界面生成工具的基础库。
@details DSetting使用json作为应用配置程序的描述文件。简单来说,应用查询的配置分为组/键值二个基础层级,
对于一个标准的Dtk配置控件,一般只包含组/子组/键值三个层级,对于超过三个层级的键值,可以通过
DSettings的API接口进行读取和写入,但是不能在标准的DSettingsDialogs上显示出来。
一个简单的配置文件如下:
@code
{
"groups": [{
"key": "base",
"name": "Basic settings",
"groups": [{
"key": "open_action",
"name": "Open Action",
"options": [{
"key": "alway_open_on_new",
"type": "checkbox",
"text": "Always Open On New Windows",
"default": true
},
{
"key": "open_file_action",
"name": "Open File:",
"type": "combobox",
"default": ""
}
]
},
{
"key": "new_tab_windows",
"name": "New Tab & Window",
"options": [{
"key": "new_window_path",
"name": "New Window Open:",
"type": "combobox",
"default": ""
},
{
"key": "new_tab_path",
"name": "New Tab Open:",
"type": "combobox",
"default": ""
}
]
}
]
}]
}
@endcode
该组中包含一个base的root组,两个子组: open_action/new_tab_windows,每个子组有包含若干选项。
对于"New Window Open:"这个配置,其完整的访问id为base.new_tab_windows.new_window_path。
读取/设置其值的示例如下:
@code
// 初始化一个存储后端
QTemporaryFile tmpFile;
tmpFile.open();
auto backend = new Dtk::Core::QSettingBackend(tmpFile.fileName());
// 从json中初始化配置
auto settings = Dtk::Core::DSettings::fromJsonFile(":/resources/data/dfm-settings.json");
settings->setBackend(backend);
// 读取配置
auto opt = settings->option("base.new_tab_windows.new_window_path");
qDebug() << opt->value();
// 修改配置
opt->setValue("Test")
qDebug() << opt->value();
@endcode
@sa Dtk::Core::DSettingsOption
@sa Dtk::Core::DSettingsGroup
@sa Dtk::Core::DSettingsBackend
@sa Dtk::Widget::DSettingsWidgetFactory
@sa Dtk::Widget::DSettingsDialog
@fn Dtk::Core::DSettings::DSettings(QObject *parent = Q_NULLPTR)
@brief DSettings构造函数
@fn void Dtk::Core::DSettings::setBackend(DSettingsBackend *backend = nullptr)
@brief 设置存储后端
@fn static QPointer Dtk::Core::DSettings::fromJson(const QByteArray &json)
@brief 从 json 中获取 DSettings,返回的数据使用之后需要自己手动释放。
@fn static QPointer Dtk::Core::DSettings::fromJsonFile(const QString &filepath)
@brief 从 json 文件中获取 DSetting。
@fn QJsonObject Dtk::Core::DSettings::meta() const
@brief 返回JSON对象
@fn QStringList Dtk::Core::DSettings::keys() const
@brief 返回全部键值
@fn QList > Dtk::Core::DSettings::options() const
@brief 返回全部 `key` 的值
@fn QPointer Dtk::Core::DSettings::option(const QString &key) const
@brief 获取 `key` 对应的值
@fn QVariant Dtk::Core::DSettings::value(const QString &key) const
@brief 获取 `key` 对应的值
@fn QStringList Dtk::Core::DSettings::groupKeys() const
@brief 返回子组全部键值
@fn QList > Dtk::Core::DSettings::groups() const
@brief 返回子组全部 `key` 的值
@fn QPointer Dtk::Core::DSettings::group(const QString &key) const
@brief DSettings::group将递归找到子组
@return
@fn QVariant Dtk::Core::DSettings::getOption(const QString &key) const
@brief 获取 `key` 对应的值
@fn void Dtk::Core::DSettings::sync()
@brief 开始进行同步
@fn void Dtk::Core::DSettings::setOption(const QString &key, const QVariant &value)
@brief 设置键值
@fn void Dtk::Core::DSettings::reset()
@brief 重置键值
*/
dtkcore-5.7.12/docs/settings/dsettingsgroup.zh_CN.dox 0000664 0000000 0000000 00000005011 14762266606 0022642 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@file include/settings/dsettingsgroup.h
@ingroup dsettings
@class Dtk::Core::DSettingsGroup dsettingsgroup.h
@brief 一组DSettings选项的集合,也可以包含子组。
@fn Dtk::Core::DSettingsGroup::DSettingsGroup(QObject *parent = Q_NULLPTR)
@brief DSettingsGroup构造函数
@fn QPointer Dtk::Core::DSettingsGroup::parentGroup() const
@brief 获取当前组的父组
@return
@fn void Dtk::Core::DSettingsGroup::setParentGroup(QPointer< DSettingsGroup > parentGroup)
@brief 设置当前组的父组为 `parentGroup`
@fn QString Dtk::Core::DSettingsGroup::key() const
@brief 返回这个组的键,会包含全部的父组的键
@return 返回这个组的键,会包含全部的父组的键
@fn QString Dtk::Core::DSettingsGroup::name() const
@brief 返回这个组名称,它可能被翻译。
@return 返回这个组名称
@fn bool Dtk::Core::DSettingsGroup::isHidden() const
@brief 检查这个选项组是否会在界面上显示
@return true 表示则这个选项组会显示出来
@fn QPointer Dtk::Core::DSettingsGroup::childGroup(const QString &groupKey) const
@brief 返回给定键在选项组中对应的子组。`groupKey`子组的键
@return 返回子组的指针
@fn QPointer Dtk::Core::DSettingsGroup::option(const QString &key) const
@brief 根据键值获取选项。`key`选项的完整键
@return 返回对应键值选项指针
@fn QList > Dtk::Core::DSettingsGroup::childGroups() const
@brief 列出组下面所有的直接子组。
@return 返回所有子组指针列表
@fn QList > Dtk::Core::DSettingsGroup::childOptions() const
@brief 列出组下面所有的直接选项。
@return 返回所有子选项指针列表
@fn QList > Dtk::Core::DSettingsGroup::options() const
@brief 列出组下面所有的选项。
@return 返回所有选项指针列表
@fn QPointer Dtk::Core::DSettingsGroup::fromJson(const QString &prefixKey, const QJsonObject &group)
@brief 将json对象转化为DSettingsGroup。`prefixKey` 组键值前缀 `group` 待反序列化的json对象
@return 返回解析json后的组指针
@sa QPointer Dtk::Core::DSettingsOption
@fn void Dtk::Core::DSettingsGroup::parseJson(const QString &prefixKey, const QJsonObject &group)
@brief 将json对象转化为DSettingsGroup。`prefixKey` 组键值前缀 `group` 待反序列化的json对象
@sa QPointer Dtk::Core::DSettingsGroup::fromJson(const QString &prefixKey, const QJsonObject &json)
*/
dtkcore-5.7.12/docs/settings/dsettingsoption.zh_CN.dox 0000664 0000000 0000000 00000006600 14762266606 0023023 0 ustar 00root root 0000000 0000000 /*!
@~chinese
@file include/settings/dsettingsoption.h
@ingroup dsettings
@class Dtk::Core::DSettingsOption dsettingsoption.h
@brief DSettingsOption是DSettings的基本单元,用于存放一对键-值数据。
@fn Dtk::Core::DSettingsOption::DSettingsOption(QObject *parent = Q_NULLPTR)
@brief DSettingsOption构造函数
@fn QPointer Dtk::Core::DSettingsOption::parentGroup() const
@brief 当前选项的直接上级组
@return 返回当前选项的直接上级组
@fn void Dtk::Core::DSettingsOption::setParentGroup(QPointer parentGroup)
@brief 修改当前选项的上级组
@param[in] parentGroup 上级组
@fn QString Dtk::Core::DSettingsOption::key() const
@brief 当前选项的键值
@return 返回当前选项的键值
@fn QString Dtk::Core::DSettingsOption::name() const
@brief 当前选项的名称
@return 返回当前选项的名称
@fn bool Dtk::Core::DSettingsOption::canReset() const
@brief 选项是否可以重置,如果可以重置,在调用reset方法后,选项的值会变成初始值。
@return 如果可以重置则为true
@fn QVariant Dtk::Core::DSettingsOption::defaultValue() const
@brief 选项的默认值
@return 返回选项的默认值
@fn QVariant Dtk::Core::DSettingsOption::value() const
@brief 选项的当前值
@return 返回选项的当前值
@fn QVariant Dtk::Core::DSettingsOption::data(const QString &dataType) const
@param[in] dataType 数据类型
@brief 选项的附件data,用于未选项设置一些额外的辅助属性。
@return 数据类型对应的数据.
@sa QObject::property
@sa Dtk::Core::DSettingsOption::setData
@fn QString Dtk::Core::DSettingsOption::viewType() const
@brief 选项的控件类型
@return 返回选项的控件类型
@sa Dtk::Widget::DSettingsWidgetFactory
@fn bool Dtk::Core::DSettingsOption::isHidden() const
@brief 检查选项是否会在界面上显示
@return 如果显示则返回true,否则返回false。
@fn static QPointer Dtk::Core::DSettingsOption::fromJson(const QString &prefixKey, const QJsonObject &json)
@brief 从json对象中反序列化出一个选项对象
@param[in] prefixKey 选项的前缀
@param[in] json 待反序列化的json对象
@return 返回解析完成后的 `option` 数据
@fn void Dtk::Core::DSettingsOption::setValue(QVariant value)
@brief 设置选项的当前值.
@param[in] value 选项的当前值
@fn void Dtk::Core::DSettingsOption::setData(const QString &dataType, QVariant value)
@brief 为选项添加自定义属性
@param[in] dataType 选项的扎属性数据id,对每个选项必须唯一
@param[in] value 选项id对应的值
@sa Dtk::Core::DSettingsOption::data
@fn void Dtk::Core::DSettingsOption::parseJson(const QString &prefixKey, const QJsonObject &option)
@brief 从json对象中反序列化,并设置自身的值。
@param[in] prefixKey 选项的前缀
@param[in] option 待反序列化的json对象
@sa QPointer Dtk::Core::DSettingsOption::fromJson(const QString &prefixKey, const QJsonObject &json)
@fn void Dtk::Core::DSettingsOption::valueChanged(QVariant value)
@brief 选项的数据变化时发出改信息
@param[in] value 发生改变的数据
@fn void Dtk::Core::DSettingsOption::dataChanged(const QString &dataType, QVariant value);
@brief 选项的附件的额外数据变化时发出改信息,可以看作这个值的属性发生变化。
@param[in] dataType 改变的数据类型
@param[in] value 发生改变的数据
*/ dtkcore-5.7.12/docs/settings/index.zh_CN.md 0000664 0000000 0000000 00000010224 14762266606 0020500 0 ustar 00root root 0000000 0000000 @page dsettings dsettings--dtk设置工具组件
# DSettings
## DSettings:dtk设置组件
[dsettings.h 详细文档](dsettings_8h.html)
项目目录结构如下:
```bash
├── CMakeLists.txt
├── data
│ └── settings.json
├── data.qrc
└── main.cpp
```
CMakeLists.txt:
```cmake
cmake_minimum_required(VERSION 3.1.0) # 指定cmake最低版本
project(dsetting-example VERSION 1.0.0 LANGUAGES CXX)# 指定项目名称, 版本, 语言 cxx就是c++
set(CMAKE_CXX_STANDARD 11) # 指定c++标准
set(CMAKE_CXX_STANDARD_REQUIRED ON) # 指定c++标准要求,至少为11以上
set(CMAKE_AUTORCC ON) # support qt resource file # 支持qt资源文件
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # 支持 clangd
if (CMAKE_VERSION VERSION_LESS "3.7.0") # 如果cmake版本小于3.7.0
set(CMAKE_INCLUDE_CURRENT_DIR ON) # 设置包含当前目录
endif()
find_package(DtkCore REQUIRED) # 寻找Dtk组件Core
add_executable(${PROJECT_NAME} # 生成可执行文件
main.cpp
data.qrc
)
target_link_libraries(${PROJECT_NAME} PRIVATE # 添加需要链接的共享库
Dtk::Core
)
```
settings.json:
```json
{
"groups": [{
"key": "base",
"name": "Basic settings",
"groups": [{
"key": "open_action",
"name": "Open Action",
"options": [{
"key": "alway_open_on_new",
"type": "checkbox",
"text": "Always Open On New Windows",
"default": true
},
{
"key": "open_file_action",
"name": "Open File:",
"type": "combobox",
"default": ""
}
]
},
{
"key": "new_tab_windows",
"name": "New Tab & Window",
"options": [{
"key": "new_window_path",
"name": "New Window Open:",
"type": "combobox",
"default": ""
},
{
"key": "new_tab_path",
"name": "New Tab Open:",
"type": "combobox",
"default": ""
}
]
}
]
}]
}
```
data.qrc
```xml
data/settings.json
```
main.cpp
```cpp
#include
#include
#include
#include
#include
#include
#include
DCORE_USE_NAMESPACE
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
// 初始化一个存储后端
QTemporaryFile tmpFile;
tmpFile.open();
QPointer backend = new QSettingBackend(tmpFile.fileName());
// 从json中初始化配置
QPointer settings = DSettings::fromJsonFile(":/data/settings.json");
settings->setBackend(backend);
// 读取配置
// 该组中包含一个base的root组,两个子组: open_action/new_tab_windows,每个子组有包含若干选项。
// 对于"New Window Open:"这个配置,其完整的访问id为base.new_tab_windows.new_window_path。
QPointer opt = settings->option("base.new_tab_windows.new_window_path");
qDebug() << opt->value();
// 修改配置
opt->setValue("Test");
qDebug() << opt->value();
// 获取所有keys
QStringList keys = settings->keys();
qDebug() << keys;
// base.open_action对应的组
QPointer group = settings->group("base.open_action");
qDebug() << group->key();
return a.exec();
}
```
编译运行:
```bash
cmake -Bbuild
cmake --build build
./build/dsetting-example
```
运行结果如下图:

@defgroup dsettings
@brief dtk设置组件
dtkcore-5.7.12/docs/src/ 0000775 0000000 0000000 00000000000 14762266606 0014777 5 ustar 00root root 0000000 0000000 dtkcore-5.7.12/docs/src/dciicon-tree.png 0000664 0000000 0000000 00000162661 14762266606 0020066 0 ustar 00root root 0000000 0000000 PNG
IHDR ~ pHYs + IDATx}wݶyQiԭ"٪e[݉ޜM}&qzsz}ْ&MOljK*7[{n| 2[$p 9 *ĕ!52΅Ih利Pm
f"2czSVΒa.XטM QŖ^ek2᰿