Коммит 5cfee191 создал по автору Зарубин Виталий Викторович's avatar Зарубин Виталий Викторович
Просмотр файлов

Merge branch 'base-docs' into 'master'

владельцы 44efa7cc 390f501c
image: rust:latest
before_script:
- apt update
- apt install -y jq curl
- cargo install mdbook mdbook-environment
pages:
stage: deploy
script:
......
## KMP Docs
# Документация Аврора Multiplatform
Documentation about the Aurora KMP project.
Используйте свой код повторно теперь и на ОС Аврора, так же как и на Android, iOS, в веб-приложениях, на настольных компьютерах и сервере.
### Run
Документация доступна по ссылке:
```shell
mdbook serve
```
### Build
```shell
mdbook build
```
<a href="http://demo-docs.keygenqt.com/">
<img width="170px" src="data/doc-button.svg" alt="Link"/>
</a>
[book]
title = "KMP Aurora Book"
title = "Aurora Multiplatform"
authors = ["Vitaliy Zarubin"]
language = "ru"
src = "src"
[output.html]
git-repository-url = "https://github.com/keygenqt/mdbook-environment"
[build]
build-dir = "book"
create-missing = false
[preprocessor.environment]
# Variables
ENV_MDBOOK_VERSION1 = "0.0.1"
ENV_MDBOOK_VERSION2 = "$(curl -s 'https://api.github.com/repos/rust-lang/mdBook/tags' | jq -r '.[0].name' | sed 's/v//')"
[output.html]
default-theme = "light"
preferred-dark-theme = "coal"
additional-css = ["src/assets/css/styles.css"]
smart-punctuation = true
mathjax-support = true
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="156.47728mm"
height="40.259552mm"
viewBox="0 0 156.47728 40.259552"
version="1.1"
id="svg1"
xml:space="preserve"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><defs
id="defs1" /><g
id="layer1"
style="display:inline"
transform="translate(-63.92013,-79.784792)"><path
id="rect2"
style="display:inline;fill:#406acc;fill-opacity:1;stroke:none;stroke-width:0.127411;stroke-linecap:square;stroke-linejoin:bevel;stroke-dasharray:none;paint-order:stroke fill markers"
d="M 179.87894,79.784794 H 69.696521 c -3.20006,0 -5.776392,2.576332 -5.776392,5.776392 v 28.706774 c 0,3.20006 2.576332,5.77639 5.776392,5.77639 H 179.87894 Z" /><path
id="path2"
style="display:inline;fill:#3051a2;fill-opacity:1;stroke:none;stroke-width:2.327;stroke-linecap:square;stroke-linejoin:bevel;stroke-dasharray:none;paint-order:stroke fill markers"
d="m 179.87894,79.784794 v 40.259556 h 34.74207 c 3.20006,0 5.77639,-2.57633 5.77639,-5.77639 V 85.561186 c 0,-3.20006 -2.57633,-5.776392 -5.77639,-5.776392 z" /><path
style="font-weight:bold;font-size:13.0528px;font-family:'PT Sans Caption';-inkscape-font-specification:'PT Sans Caption Bold';text-align:center;text-anchor:middle;fill:#ffffff;stroke-width:2.327;stroke-linecap:square;stroke-linejoin:bevel;paint-order:stroke fill markers"
d="M 83.896389,104.7702 H 82.525845 L 82.317,103.15166 h -6.395872 l -0.208844,1.61854 h -1.370545 v -3.31541 h 1.057277 q 0.104423,-0.14358 0.32632,-0.62653 0.221898,-0.48295 0.443796,-1.383598 0.221897,-0.900643 0.378531,-2.232029 0.169686,-1.344438 0.143581,-3.197936 h 5.952076 v 7.440093 h 1.253069 z m -3.184883,-3.31541 V 95.711561 H 78.49253 q -0.07832,2.245082 -0.404637,3.68089 -0.313267,1.435809 -0.639587,2.062339 z m 3.73308,-1.722967 q 0,-1.696864 0.900644,-2.662771 0.900643,-0.965907 2.571401,-0.965907 0.874538,0 1.527178,0.274109 0.65264,0.274109 1.083382,0.770115 0.430743,0.482954 0.639588,1.148646 0.221897,0.65264 0.221897,1.435808 0,0.835377 -0.23495,1.514127 -0.234951,0.66569 -0.678746,1.13559 -0.443795,0.4699 -1.096435,0.71791 -0.639587,0.248 -1.461914,0.248 -0.88759,0 -1.54023,-0.27411 -0.65264,-0.27411 -1.083383,-0.75706 -0.430742,-0.49601 -0.639587,-1.14865 -0.208845,-0.66569 -0.208845,-1.435807 z m 1.879604,0 q 0,0.430747 0.09137,0.809277 0.09137,0.37853 0.274109,0.66569 0.195792,0.27411 0.496006,0.4438 0.300215,0.16968 0.730957,0.16968 1.592442,0 1.592442,-2.088447 0,-0.456848 -0.09137,-0.835379 -0.07832,-0.391584 -0.274109,-0.665693 -0.182739,-0.287161 -0.496006,-0.443795 -0.300214,-0.156633 -0.730957,-0.156633 -0.744009,0 -1.174752,0.496006 -0.417689,0.496006 -0.417689,1.605494 z m 9.019475,0.574327 h -0.639588 v 2.84551 h -1.827392 v -6.852723 h 1.827392 v 2.962986 l 0.587376,-0.248004 1.749076,-2.714982 h 1.970972 q -0.456848,0.626534 -0.900643,1.266122 -0.430742,0.626534 -0.874537,1.253068 l -0.861485,0.574324 0.913696,0.56127 q 0.496006,0.809269 1.005065,1.605499 0.50906,0.78316 1.005066,1.59244 h -2.114554 z m 7.192075,-0.20885 0.28716,1.09644 h 0.13053 l 0.248,-1.09644 1.1617,-3.798363 h 1.86655 l -2.27119,6.200083 q -0.28716,0.77011 -0.54822,1.38359 -0.248,0.61349 -0.54821,1.04423 -0.30022,0.43074 -0.67875,0.65264 -0.36548,0.23495 -0.87454,0.23495 -0.33937,0 -0.65264,-0.0653 -0.30021,-0.0522 -0.52211,-0.16968 l 0.37853,-1.4097 q 0.1958,0.0653 0.40464,0.0653 0.18274,0 0.35243,-0.0392 0.16968,-0.0392 0.31326,-0.15663 0.14358,-0.10442 0.26106,-0.31327 0.13053,-0.19579 0.2219,-0.53516 l -3.132676,-6.891883 h 2.205926 z m 11.01654,0.013 0.13053,-1.488015 h -0.20885 l -0.61348,1.174752 v -0.01305 l -1.3836,2.127603 h -0.63958 l -1.52718,-2.127603 v 0.01305 l -0.61348,-1.174752 h -0.18274 l 0.19579,1.474965 v 3.05436 h -1.61855 v -6.852723 h 1.91877 l 1.70991,2.558349 v -0.01305 l 0.45685,0.874538 h 0.14358 l 0.45685,-0.900644 v 0.01305 l 1.59244,-2.532243 h 1.91876 v 6.852723 h -1.73602 z m 9.47632,2.41477 q -0.44379,0.33938 -1.21391,0.58738 -0.75706,0.23495 -1.6316,0.23495 -1.76212,0 -2.58445,-0.96591 -0.82233,-0.96591 -0.82233,-2.649717 0,-1.788233 0.92675,-2.701929 0.92675,-0.926749 2.61056,-0.926749 0.54822,0 1.08338,0.143581 0.53517,0.130528 0.95286,0.456848 0.41769,0.313267 0.66569,0.861485 0.26106,0.535164 0.26106,1.331385 0,0.274109 -0.0392,0.600429 -0.0261,0.32632 -0.10442,0.678747 h -4.56848 q 0.0653,0.88759 0.50906,1.31833 0.45684,0.41769 1.47496,0.41769 0.61348,0 1.09644,-0.16969 0.496,-0.18273 0.75706,-0.36547 z m -2.74108,-4.986167 q -0.80928,0 -1.20086,0.443795 -0.39158,0.430743 -0.45685,1.109488 h 2.94993 q 0.0522,-0.717904 -0.26105,-1.135593 -0.31327,-0.41769 -1.03117,-0.41769 z m 9.05864,2.962987 h -2.59751 v 2.64972 h -1.82739 v -6.852723 h 1.82739 v 2.545296 h 2.59751 v -2.545296 h 1.82739 v 6.852723 h -1.82739 z m 9.03253,-2.584456 h -2.12761 v 5.234176 h -1.90571 v -5.234176 h -2.12761 v -1.618547 h 6.16093 z m 0.97894,-1.148646 q 0.58738,-0.261056 1.43581,-0.430743 0.86149,-0.169686 1.77518,-0.169686 0.71791,0 1.20086,0.169686 0.49601,0.169687 0.78317,0.496007 0.28716,0.313267 0.40464,0.770115 0.13052,0.443795 0.13052,0.992013 0,0.665693 -0.0522,1.318333 -0.0522,0.652637 -0.0522,1.383597 0,0.49601 0.0653,0.96591 0.0653,0.4699 0.20884,0.90064 h -1.48802 l -0.30021,-1.01812 h -0.15664 q -0.33937,0.45685 -0.86148,0.78317 -0.52211,0.32632 -1.34444,0.32632 -0.49601,0 -0.9137,-0.14358 -0.40463,-0.14358 -0.70485,-0.40464 -0.28716,-0.27411 -0.45685,-0.63959 -0.15663,-0.36547 -0.15663,-0.79622 0,-1.1617 0.77012,-1.749071 0.78316,-0.600429 2.36255,-0.600429 0.36548,0 0.73096,0.06526 0.36548,0.05221 0.50906,0.07832 0.0392,-0.274109 0.0392,-0.469901 0,-0.496007 -0.24801,-0.730957 -0.248,-0.23495 -0.92674,-0.23495 -0.62654,0 -1.22697,0.156633 -0.58737,0.143581 -1.04422,0.365479 z m 2.38867,5.025332 q 0.61348,0 0.97896,-0.28717 0.36548,-0.28716 0.53516,-0.60042 v -0.78317 q -0.0653,-0.0261 -0.20884,-0.0522 -0.13053,-0.0261 -0.30022,-0.0522 -0.15663,-0.02611 -0.32632,-0.03916 -0.15663,-0.01305 -0.28716,-0.01305 -0.70485,0 -1.04422,0.26106 -0.33938,0.248 -0.33938,0.62653 0,0.46991 0.26106,0.70486 0.27411,0.23495 0.73096,0.23495 z m 12.45235,2.91077 h -1.29223 l -0.2219,-1.55328 h -5.70407 v -6.852723 h 1.82739 v 5.234173 h 2.46698 v -5.234173 h 1.82739 v 5.234173 h 1.09644 z m 5.74321,-4.6468 0.0783,-1.161696 -0.82233,1.148646 -2.70193,3.10657 h -1.09644 v -6.852723 h 1.8274 v 3.224042 l -0.0653,0.939801 h 0.15664 q 0.15663,-0.2219 0.31326,-0.469901 0.16969,-0.248003 0.32632,-0.4699 l 2.71499,-3.224042 h 1.09643 v 6.852723 h -1.82739 z m 7.6881,0.75707 -1.03117,0.16968 -1.42275,2.16677 h -2.23203 l 1.47496,-2.1015 0.77012,-0.31327 q -0.50906,-0.0522 -0.84843,-0.26106 -0.33938,-0.20884 -0.54822,-0.509056 -0.20885,-0.313267 -0.30022,-0.678746 -0.0783,-0.378531 -0.0783,-0.770115 0,-1.240016 0.88759,-1.827392 0.90064,-0.587376 2.76719,-0.587376 0.66569,0 1.29223,0.06526 0.62653,0.06526 1.09643,0.143581 v 6.839674 h -1.82739 z m 0,-1.148651 v -1.892656 q -0.16968,-0.06526 -0.39158,-0.104422 -0.2219,-0.03916 -0.43074,-0.03916 -0.73096,0 -1.10949,0.261056 -0.37853,0.248003 -0.37853,0.79622 0,0.535165 0.41769,0.770116 0.43074,0.23495 1.27917,0.23495 z"
id="text9"
aria-label="Документация" /><g
id="g3"
transform="matrix(1.0571616,0,0,1.0571616,187.45223,87.228633)"
style="fill:#ffffff;fill-opacity:1;stroke:none"><path
fill="currentColor"
fill-rule="evenodd"
d="M 14,22 H 10 C 6.229,22 4.343,22 3.172,20.828 2.001,19.656 2,17.771 2,14 V 10 C 2,6.229 2,4.343 3.172,3.172 4.344,2.001 6.239,2 10.03,2 c 0.606,0 1.091,0 1.5,0.017 q -0.02,0.12 -0.02,0.244 L 11.5,5.095 c 0,1.097 0,2.067 0.105,2.848 0.114,0.847 0.375,1.694 1.067,2.386 0.69,0.69 1.538,0.952 2.385,1.066 0.781,0.105 1.751,0.105 2.848,0.105 h 4.052 C 22,12.034 22,12.69 22,13.563 V 14 c 0,3.771 0,5.657 -1.172,6.828 C 19.656,21.999 17.771,22 14,22 M 5.25,14.5 A 0.75,0.75 0 0 1 6,13.75 h 8 a 0.75,0.75 0 0 1 0,1.5 H 6 A 0.75,0.75 0 0 1 5.25,14.5 m 0,3.5 A 0.75,0.75 0 0 1 6,17.25 h 5.5 a 0.75,0.75 0 0 1 0,1.5 H 6 A 0.75,0.75 0 0 1 5.25,18"
clip-rule="evenodd"
id="path1"
style="fill:#ffffff;fill-opacity:1;stroke:none" /><path
fill="currentColor"
d="M 19.352,7.617 15.392,4.054 C 14.265,3.039 13.702,2.531 13.009,2.266 L 13,5 c 0,2.357 0,3.536 0.732,4.268 C 14.464,10 15.643,10 18,10 h 3.58 C 21.218,9.296 20.568,8.712 19.352,7.617"
id="path2-2"
style="fill:#ffffff;fill-opacity:1;stroke:none" /></g></g></svg>
# Summary
- [Chapter 1](./chapter_1.md)
- [Chapter 1](./chapter_2.md)
- [Главная](./index.html)
- [Аврора Multiplatform](./docs/main.md)
# Kotlin Multiplatform
- [QtBindings](./docs/kotlin/qt_bindings/main.md)
- [Начало работы](./docs/kotlin/qt_bindings/start.md)
- [Hello, world!](./docs/kotlin/qt_bindings/demo.md)
- [Примеры](./docs/kotlin/qt_bindings/examples.md)
/** Item 1 **/
.block1 {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
min-height: 545px;
padding-top: 40px;
padding-bottom: 40px;
}
.block1 .block:first-child {
padding-right: 40px;
}
.block1 .block .title {
font-size: 60px;
margin-bottom: 35px;
font-weight: bold;
}
.block1 .block .subtitle {
font-size: 20px;
margin-bottom: 35px;
color: #474749;
}
.block1 .block .text {
margin-bottom: 35px;
}
.block1 .block img.preview {
width: 400px;
}
.Btn.BtnBlack {
border: none;
background-color: #19191C;
padding: 9px 32px 12px 32px;
font-size: 22px;
border-radius: 25px;
}
.Btn.BtnBlack:hover {
text-decoration: none;
background-color: #474749;
}
@media (max-width: 1000px) {
.block1 {
text-align: center;
flex-direction: column-reverse;
}
.block1 .block .title br {
display: none;
}
.block1 .block:first-child {
padding: 0;
}
.block1 .block img.preview {
width: 200px;
margin-bottom: 40px;
}
}
@media (max-width: 500px) {
.block1 .block .title {
font-size: 38px;
}
.block1 .block .subtitle {
font-size: 16px;
}
}
.Footer .block {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.Footer .title {
font-size: 14px;
}
.Header .block {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.Header .title {
font-size: 18px;
color: white;
display: inline-block;
}
.Header .title:hover {
text-decoration: none;
}
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');
html,
body {
font-family: 'Open Sans', sans-serif;
margin: 0;
padding: 0;
height: 100%;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.PageIndex {
min-height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: stretch;
}
.PageIndex .Header {
background-color: #19191C;
color: white;
box-sizing: border-box;
}
.PageIndex .Body {
box-sizing: border-box;
}
.PageIndex .Footer {
background-color: #19191C;
color: white;
box-sizing: border-box;
}
.Content {
max-width: 1200px;
margin: 0 auto;
padding: 30px;
}
.Btn {
border: 1px solid white;
color: white;
border-radius: 16px;
padding: 6px 18px;
transition: background-color 100ms linear;
display: inline-block;
}
.Btn:hover {
text-decoration: none;
background-color: #ffffff1f;
}
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');
html,
body {
font-family: 'Open Sans', sans-serif;
}
html.light {
--sidebar-active: #6c2ec9;
--sidebar-nonactive: #ededed;
--sidebar-nonactive-focus: #e3e3e3;
--links: #b93078;
}
html.ayu {
--sidebar-active: #e39c42;
--sidebar-nonactive: #5c6773;
--sidebar-nonactive-focus: #4c5763;
}
html.coal {
--sidebar-nonactive: #505254;
--sidebar-nonactive-focus: #464749;
}
html.navy {
--sidebar-nonactive: #505274;
--sidebar-nonactive-focus: #444661;
}
html.rust {
--sidebar-active: #d38c55;
--sidebar-nonactive: #505254;
--sidebar-nonactive-focus: #47494b;
}
.chapter li a {
font-weight: bold;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.preview {
border-radius: 10px;
}
.table-wrapper table {
width: 100%;
text-align: left;
}
.chapter li.part-title{
font-size: 16px;
}
.chapter li a {
font-weight: normal;
}
.publication {
margin: 0 !important;
padding: 0 !important;
list-style-type: none !important;
font-size: 0;
}
.publication li {
display: inline-block;
padding: 0 !important;
margin: 0 !important;
width: 30%;
vertical-align: top;
line-height: normal;
}
.publication li {
margin-right: 2% !important;
}
.publication li .title {
font-size: 16px;
padding: 10px 0 30px 0;
font-weight: bold;
}
.publication li img {
border-radius: 10px;
}
.chapter .chapter-item a {
background-color: var(--sidebar-nonactive);
display: block;
padding: 5px 8px;
padding-top: 4px;
border-radius: 6px;
width: 100%;
}
.chapter .chapter-item a:hover:not(.active) {
background-color: var(--sidebar-nonactive-focus);
color: var(--sidebar-fg);
}
.chapter .chapter-item a.active {
background-color: var(--sidebar-active);
color: white;
}
/* Hide Index */
.chapter strong,
.chapter > .chapter-item:first-child {
display: none;
}
.chapter > .chapter-item:nth-child(2) {
margin-top: -13px;
}
# Chapter 1
Just set environment: {{ENV_MDBOOK_VERSION1}}.
Set environment with execute command: {{ ENV_MDBOOK_VERSION2 }}.
# Hello, Qt world!
Здесь будет описан процесс как создать приложение с походом Qt/Qml + QtBindings для ОС Аврора.
```rust
// This is a comment, and is ignored by the compiler.
// You can test this code by clicking the "Run" button over there ->
// or if you prefer to use your keyboard, you can use the "Ctrl + Enter"
// shortcut.
// This code is editable, feel free to hack it!
// You can always return to the original code by clicking the "Reset" button ->
// This is the main function.
fn main() {
// Statements here are executed when the compiled binary is called.
// Print text to the console.
println!("Hello World!");
}
```
# Примеры Qt приложений.
Для демонстрации данного подхода, реализация бизнес логики с использование QtBindings и Linux таргета, были разработаны и портированны следующие приложения:
| Приложения | Платформы | Ссылка |
| -------------- | ------------------ | --------------- |
| StudentBox | ОС Аврора, Android | [GitLab](@todo) |
# QtBindings - Qt/Qml
В ОС Аврора, как и iOS, не имеет поддержки Java и Kotlin Multiplatform доступен для этих систем через нативные таргеты.
Для ОС Аврора это `linuxX64` & `linuxArm64`.
При использовании этих таргетов можно получить нативную библиотеку -
статическую или динамическую которую можно использовать в приложении, в нашем случае это Qt.
> Для ОС Аврора Qt - основной фреймворк для разработки приложений.
Но в таком походе есть существенная проблема - без дополнительной работы и написания оберток с ней работать очень затруднительно:
- Сложность 1
- Сложность 2
- Сложность 3
**QtBindings** - решает эту проблему, он создаст необходимы обертки для удобной работы с библиотекой KMP для Qt.
Использовав QtBindings мы получаем:
- Удобство 1
- Удобство 2
- Удобство 3
И вообще, QtBindings лучший!
# Начало работы
Для начала работы с использованием QtBindings вам потребуется:
- [Подключить плагин](#Подключить-плагин)
- [Подключить target](#Подключить-target)
- [Добавить annotation](#Добавить-annotation)
- ...
### Подключить плагин
```kotlin
plugins {
alias(libs.plugins.qt.bindings)
}
qtBindings {
libName = "mylib"
}
```
### Подключить target
```kotlin
linuxX64("qt") {
binaries {
staticLib {
baseName = "mylib"
}
}
}
```
### Добавить annotation
```kotlin
@QtExport
class PlatformData {
private val platform: Platform = getPlatform()
fun title(): String {
return "StudentBox (${platform.name})"
}
}
```
# Аврора Multiplatform
<p>
<img class="preview" src="../assets/images/image1.png"/>
</p>
Проект Аврора Multiplatform - это поддержка инфраструктуры Kotlin Multiplatform для разработки приложений под ОС Аврора.
### Kotlin Multiplatform
Основной фреймворк разработки приложение для ОС Аврора - Qt.
Был разработан плагин `QtBindings` для облегчения использования нативных целей `linuxX64` & `linuxArm64`
для реализации приложений ОС Аврора с использованием KMP.
[Подробнее](./kotlin/qt_bindings/main.md)
<style>
/** Hide preview to home page **/
.previous {
display: none;
}
.menu-title {
font-size: 0;
}
</style>
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать