diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..4269d47c09fece0728393f7a0e3489702d53c0bc
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,482 @@
+
+## 1.2.9 (2019-06-11)
+
+
+#### Bug Fixes
+
+* should call showNormal() to raise window ([39d9bc12](https://github.com/linuxdeepin/deepin-editor/commit/39d9bc1248803b93cfe6f23cdf51490eb9bb156c))
+* do not overwrite the cursorFlashTime of QGuiApplication ([ed5700d5](https://github.com/linuxdeepin/deepin-editor/commit/ed5700d5410f87f09e89c97c8340967145931fcc))
+* crash if DDE file select dialog is not available to use ([4db075d0](https://github.com/linuxdeepin/deepin-editor/commit/4db075d0cb347f1092045ccb6015f11fdff4f6d2))
+
+
+
+
+## 1.2.8 (2019-05-23)
+
+
+#### Bug Fixes
+
+* no longer designate clang++ as compiler ([36022f04](https://github.com/linuxdeepin/deepin-editor/commit/36022f046dd44f4f681019636ecd216d111da284))
+
+#### Features
+
+* set default open dir as QStandardPaths::DocumentsLocation ([69ed1ded](https://github.com/linuxdeepin/deepin-editor/commit/69ed1dedf6dda48162efb09dddf18cf87d3a68a0))
+
+
+
+
+## 1.2.7.3 (2019-04-19)
+
+
+#### Bug Fixes
+
+* activate window when opening files ([437e8d72](https://github.com/linuxdeepin/deepin-editor/commit/437e8d72470343a9249a6b41312cc0bebd836abb))
+
+
+
+
+## 1.2.7.2 (2019-04-10)
+
+
+
+
+
+## 1.2.7.1 (2019-04-08)
+
+
+#### Features
+
+* display word count from status bar (#37) ([af90d45f](https://github.com/linuxdeepin/deepin-editor/commit/af90d45ff61bffd9bad4f52a2a625b1dc034a532))
+
+#### Bug Fixes
+
+* reduce minimum window size (#38) ([9e514d19](https://github.com/linuxdeepin/deepin-editor/commit/9e514d1950e682ff27f63c1f9045f92a49fcf936))
+
+
+
+
+## 1.2.7 (2019-03-27)
+
+
+
+
+
+## 1.2.6.3 (2019-01-25)
+
+
+
+
+
+## 1.2.6.2 (2019-01-15)
+
+
+#### Bug Fixes
+
+* chinese garbled ([75f76e68](https://github.com/linuxdeepin/deepin-editor/commit/75f76e68ced88d58a9ade66b974c835ea5cf3001))
+
+
+
+
+## 1.2.6.1 (2019-01-10)
+
+
+#### Bug Fixes
+
+* disconnect when object got destroyed ([7fe6c1ef](https://github.com/linuxdeepin/deepin-editor/commit/7fe6c1efb56ce6294b3c5728eb9e1e8d0f4589c2))
+
+
+
+
+## 1.2.6 (2019-01-03)
+
+
+#### Features
+
+* support x-wine-extension-ini ([a71e1415](https://github.com/linuxdeepin/deepin-editor/commit/a71e141553ab4308eb13fdb0cc7fe9e90d1096d7))
+* **textedit:** optimized touch screen. ([b0bed762](https://github.com/linuxdeepin/deepin-editor/commit/b0bed7621d6676d95d80063ddf2259c79e449991))
+
+#### Bug Fixes
+
+* open current file. ([b3fec2c8](https://github.com/linuxdeepin/deepin-editor/commit/b3fec2c8154618753df9b2517bc58e08280acfd1))
+* do not accept rich text. ([5bbdea90](https://github.com/linuxdeepin/deepin-editor/commit/5bbdea905e5f7d418b60ad27178bffa0ab4b01ab))
+* **themepanel:** optimize the selected effect. ([e4e04f20](https://github.com/linuxdeepin/deepin-editor/commit/e4e04f20408445dabde9aee2012cdf75937c7e19))
+
+
+
+
+## 1.2.5 (2018-12-21)
+
+
+#### Bug Fixes
+
+* support m3u8 file open ([2af2d49c](https://github.com/linuxdeepin/deepin-editor/commit/2af2d49c2ad279313db00d412d674d8e24e03fee))
+* dedit args. ([db75ba6b](https://github.com/linuxdeepin/deepin-editor/commit/db75ba6b5824fa962d32d6a3cd18d17d42623e74))
+* save as file name format. ([e2a07a4c](https://github.com/linuxdeepin/deepin-editor/commit/e2a07a4cf73a509fac68bc2dafc70b31a6befe5f))
+
+#### Features
+
+* support for application/x-mpegURL. ([a31ab8d0](https://github.com/linuxdeepin/deepin-editor/commit/a31ab8d03eb98dac58f1873dc4555ef1a1caa1d3))
+* support for devanagari. ([865b2921](https://github.com/linuxdeepin/deepin-editor/commit/865b2921b804cbbd20e1400b5906500ce580aeaa))
+* add dedit ([c282e683](https://github.com/linuxdeepin/deepin-editor/commit/c282e683b19f87c886ed75033688e7382540618c))
+
+
+
+
+## 1.2.4 (2018-12-18)
+
+
+#### Features
+
+* **tabbar:** change read-only attribute. ([df24648c](https://github.com/linuxdeepin/deepin-editor/commit/df24648c0ddaf3a0370a20605cbf84f7ff4adaba))
+
+#### Bug Fixes
+
+* save as crash. ([b7b50838](https://github.com/linuxdeepin/deepin-editor/commit/b7b508389b8f7431ba959d6dd831198a4a5b37e7))
+
+
+
+
+## 1.2.3 (2018-12-14)
+
+
+#### Bug Fixes
+
+* reconnect save as signal ([68e7dd0a](https://github.com/linuxdeepin/deepin-editor/commit/68e7dd0a1b9edf3c80ed0e059dc0490d52ccfe41))
+
+
+
+
+## 1.2.2 (2018-12-14)
+
+
+#### Bug Fixes
+
+* hide toast after refresh. ([c2b07f4f](https://github.com/linuxdeepin/deepin-editor/commit/c2b07f4f09bf50154ce33d930aa668309bf70d6a))
+* save as file will be lost. ([b54f1c5f](https://github.com/linuxdeepin/deepin-editor/commit/b54f1c5fa994ad3bd1fbbf65e047c36a1b9cdcb2))
+* draft file does not check reload. ([95e74191](https://github.com/linuxdeepin/deepin-editor/commit/95e7419176f2728f8d7780382b3aaa743528437e))
+
+#### Features
+
+* monitor file removed. ([27c6b2ea](https://github.com/linuxdeepin/deepin-editor/commit/27c6b2ea9cfc8aec4cb905c584df56d8c502d346))
+* support touch gesture. ([4160be0d](https://github.com/linuxdeepin/deepin-editor/commit/4160be0d46f4c2ce0a318d75fdb3e5632ff9ab00))
+
+
+
+
+## 1.2.1 (2018-12-11)
+
+
+
+
+
+## 1.2.0 (2018-12-11)
+
+
+#### Features
+
+* monitor file modification. ([9dbde37d](https://github.com/linuxdeepin/deepin-editor/commit/9dbde37d7b8605401ad6c535e09c9e67e2a7abf6))
+* **settings_dialog:** support for preview fonts. ([f49315ca](https://github.com/linuxdeepin/deepin-editor/commit/f49315ca991bde6547c16f5c6cf221721f8f45aa))
+
+#### Bug Fixes
+
+* check reload crash. ([4eb94e7b](https://github.com/linuxdeepin/deepin-editor/commit/4eb94e7b605175dc69dc233f6894c03625dd4bb1))
+* open duplicates. ([04ca82d2](https://github.com/linuxdeepin/deepin-editor/commit/04ca82d21f27290844cbde7431ea855c08b826f8))
+* **toast:** adjust position when resize. ([4523ea74](https://github.com/linuxdeepin/deepin-editor/commit/4523ea7476690a238c17c0788d474d3652b6af6a))
+
+
+
+
+## 1.10 (2018-12-07)
+
+
+#### Bug Fixes
+
+* drop down menu position ([5f458836](https://github.com/linuxdeepin/deepin-editor/commit/5f4588369b0f8368782ec4fed90b0c643ddcefa3))
+* find matches highlight. ([807cf9dd](https://github.com/linuxdeepin/deepin-editor/commit/807cf9ddbca7b40272f651e9827f92f547cba20a))
+* cannot find the end bracket to not need to highlight. ([716b1cc1](https://github.com/linuxdeepin/deepin-editor/commit/716b1cc1a4c1f39344425b84139b0b800e765853))
+* settings dialog to restore default theme. ([89ef418b](https://github.com/linuxdeepin/deepin-editor/commit/89ef418b9e3b3551e4b7d2517d3735f32e22786f))
+* switch theme update extension selection. ([b6b652d8](https://github.com/linuxdeepin/deepin-editor/commit/b6b652d8f1863ecc4c09eee349000ef9059ca334))
+* update theme panel geometry ([29c4563c](https://github.com/linuxdeepin/deepin-editor/commit/29c4563c1e4c9b73bd5e428d375f76f70b5f161c))
+* optimize find keyword color. ([adcae0e3](https://github.com/linuxdeepin/deepin-editor/commit/adcae0e31d631650cb77e0f46caa8ec4358d8fe7))
+* draft modify codec. ([182cb4ef](https://github.com/linuxdeepin/deepin-editor/commit/182cb4efb7281a3c8f92f2ef178783562032be20))
+* optimize bottom bar text color. ([53e7453c](https://github.com/linuxdeepin/deepin-editor/commit/53e7453cfd85c760d7ed875ad7a54f9c7342de8b))
+* encode bobox adaptive width. ([1eecb09b](https://github.com/linuxdeepin/deepin-editor/commit/1eecb09b41181ab1b742a2101c00806084197d41))
+* word wrap to line wrap. ([5f591a12](https://github.com/linuxdeepin/deepin-editor/commit/5f591a126cd90ad5348f906a1ae4a808051cd886))
+* draft document save file name is incorrect. ([c2c1592d](https://github.com/linuxdeepin/deepin-editor/commit/c2c1592d7605b1fda2f2f437cfc8b4140ae6a530))
+* highlight brackets will modify the document status. ([7aeec31b](https://github.com/linuxdeepin/deepin-editor/commit/7aeec31b77234e6bb5a0483ca809d7a8216f4c05))
+* support for custom highlight bracket color. ([78d6528b](https://github.com/linuxdeepin/deepin-editor/commit/78d6528bfc98eca295237e44a13cb56c483da09d))
+* highlight current line and highlight bracket conflicts. ([5db54adb](https://github.com/linuxdeepin/deepin-editor/commit/5db54adb6acc182ae20634b4b679c3bc698b4306))
+* restore the value of the scrollbar when refresh. ([d453f875](https://github.com/linuxdeepin/deepin-editor/commit/d453f87513984749c41cebaf107bc9a46f81cd37))
+* open crash ([5df794c7](https://github.com/linuxdeepin/deepin-editor/commit/5df794c76479dce5edaeb86fbc38b5fbcabe6db8))
+* desktop file encoding detection error. ([57ad5195](https://github.com/linuxdeepin/deepin-editor/commit/57ad5195cac518ebb4e76a2a365787ef6016d3ba))
+* theme panel y offset value. ([1c5f6b9f](https://github.com/linuxdeepin/deepin-editor/commit/1c5f6b9fa0c785ce9eac6102bed3141dd47ae44f))
+* optimize theme panel popup. ([ce01f2fa](https://github.com/linuxdeepin/deepin-editor/commit/ce01f2faf667496c4ed2196fc4b370a01aeab2c9))
+* cursor is incorrect. ([a8ffa9f6](https://github.com/linuxdeepin/deepin-editor/commit/a8ffa9f6a92e2cf771a9a1cdf2f9ecbed12183df))
+* exit file dialog causes window to close. ([74f01aaf](https://github.com/linuxdeepin/deepin-editor/commit/74f01aafe039a506195d7ae35c08d3ab280176db))
+* modify open and save logic. ([f3984dde](https://github.com/linuxdeepin/deepin-editor/commit/f3984dde7fcb1156f98eb8347ba2e6a5489b3211))
+* use universal coding probe. ([0eec6314](https://github.com/linuxdeepin/deepin-editor/commit/0eec63143994894b2c049c4887fb283b489930c8))
+* **encoding:** support russian in cyrllic. ([85f5b870](https://github.com/linuxdeepin/deepin-editor/commit/85f5b870fd5e560e95df916efd5b2e5d8910442a))
+* **tabbar:** draft document modified status. ([6f2054e1](https://github.com/linuxdeepin/deepin-editor/commit/6f2054e1d018fa4f7d69009baa1ebdf4204c8abe))
+
+#### Features
+
+* add highlight menu to bottombar. ([19a0fbe2](https://github.com/linuxdeepin/deepin-editor/commit/19a0fbe21c3dd967bb97f5b6e2b458eb1fd6adca))
+* add cursor mode to the bottom bar. ([2135d2e0](https://github.com/linuxdeepin/deepin-editor/commit/2135d2e0f727de7c6025e5726f4746ee525bfc35))
+* add drop down menu widget. ([13e8600e](https://github.com/linuxdeepin/deepin-editor/commit/13e8600ec23df0085263568508d6308f9a3f48d5))
+* add bottom bar. ([c9931de1](https://github.com/linuxdeepin/deepin-editor/commit/c9931de15ba5e63eeadb17f9459b75462af224c5))
+* add highlight brackets. ([bd138944](https://github.com/linuxdeepin/deepin-editor/commit/bd138944596a0f4ddd0882459f918ff6172248a2))
+* add refresh function. ([44a8f882](https://github.com/linuxdeepin/deepin-editor/commit/44a8f882f877bb5fd1686f8c5ea165495f86e838))
+* add find and replace options to the main menu. ([e418e977](https://github.com/linuxdeepin/deepin-editor/commit/e418e977be502eb83b2e80cd9a2e36e88d207a49))
+* open new file will not create a new tab in a new blank document in draft. ([272c10e6](https://github.com/linuxdeepin/deepin-editor/commit/272c10e6499a92b33ba8e89d1db8bfdc7b22e893))
+* add word wrap setting options. ([b6b871ad](https://github.com/linuxdeepin/deepin-editor/commit/b6b871adef2b7c0fcc3766fca7ae35e667934de0))
+* **bottombar:** support encoding selections. ([341e7c37](https://github.com/linuxdeepin/deepin-editor/commit/341e7c378350a725d554e9883838c4e8db9f81b7))
+* **tabbar:** add file read-only info. ([1ad8e437](https://github.com/linuxdeepin/deepin-editor/commit/1ad8e43727aedafecb2c1aa480ffdcee43836845))
+
+
+
+
+## 1.1.3 (2018-11-23)
+
+
+#### Bug Fixes
+
+* update ts config. ([408b97e2](https://github.com/linuxdeepin/deepin-editor/commit/408b97e240e0131fd75178a6f5fa2b708ec46c02))
+
+#### Features
+
+* support overwrite mode. ([bc57fd98](https://github.com/linuxdeepin/deepin-editor/commit/bc57fd98307cc8af61189006d2086b402c466ad5))
+* support the recent file spec. ([122722b8](https://github.com/linuxdeepin/deepin-editor/commit/122722b8e86e54c5beec49cc91f26c2cae6f5bde))
+* **desktop:** add generic name. ([d29ccc06](https://github.com/linuxdeepin/deepin-editor/commit/d29ccc06988393467a8dba82c0978493f40ad12d))
+* **tabbar:** add document modification status. ([8fbdf34c](https://github.com/linuxdeepin/deepin-editor/commit/8fbdf34ce4c9988271129786d13dfe910b839166))
+
+
+
+
+## 1.1.2 (2018-11-13)
+
+
+#### Bug Fixes
+
+* drag and drop crash under loongson. ([0dc5d62c](https://github.com/linuxdeepin/deepin-editor/commit/0dc5d62c300e102cf62d397e7163d8223b6a21af))
+* icon is incorrect ([f395cacc](https://github.com/linuxdeepin/deepin-editor/commit/f395caccf146e47ae38bf368e7cb9ae1429f8c35))
+
+#### Features
+
+* add two mime types. ([14d1860e](https://github.com/linuxdeepin/deepin-editor/commit/14d1860e05db1052738f6bf1d41bf77f983be7ba))
+
+
+
+
+## 1.1.1 (2018-10-26)
+
+
+#### Features
+
+* update mime type. ([b0e5c0a5](https://github.com/linuxdeepin/deepin-editor/commit/b0e5c0a55d64363fc234fd7f25fb466419b60adf))
+* **theme_panel:** modify the animation easing curve. ([f81a04e3](https://github.com/linuxdeepin/deepin-editor/commit/f81a04e355f1ca47d649786975c0cc27628d9f3d))
+
+#### Bug Fixes
+
+* right menu under arch crashes. ([f08c9e26](https://github.com/linuxdeepin/deepin-editor/commit/f08c9e26a3fe538e3ad896974a55086919b2ed06))
+* drag and drop the window is not activated. ([a199cec2](https://github.com/linuxdeepin/deepin-editor/commit/a199cec2f4207a11fb57cda9bbfcf94e783e6a47))
+* a typo ([ea615971](https://github.com/linuxdeepin/deepin-editor/commit/ea615971c279e6d075f9671ddd18422ffea594a5))
+
+
+
+
+## 1.1 (2018-10-11)
+
+
+#### Bug Fixes
+
+* fix: input text can be read-only mode. ([fe4e93f](https://github.com/linuxdeepin/deepin-editor/commit/7e690af0fbda19735e4790e40adfe381f382aa57))
+
+
+
+
+## 1.0 (2018-10-10)
+
+
+#### Bug Fixes
+
+* multi-screen new window position is incorrect. ([f34ef80c](https://github.com/linuxdeepin/deepin-editor/commit/f34ef80c0842d331fad95cba6dd58eada2a0e379))
+* cannot preview shortcuts in read-only mode ([507edc2e](https://github.com/linuxdeepin/deepin-editor/commit/507edc2ed09063100fd01379a527b552ab1e81b6))
+* optimize close tabs func. ([e1e573b0](https://github.com/linuxdeepin/deepin-editor/commit/e1e573b08921c06cf2cfef0f3fd3debf317f6736))
+* no translation files included ([a6231c42](https://github.com/linuxdeepin/deepin-editor/commit/a6231c4210ea99fa7b0b17c5dcf161242271b02b))
+* tab drag out only disconnect the window siganl. ([da27ede7](https://github.com/linuxdeepin/deepin-editor/commit/da27ede799af5f05ec34be11b69debad8badc158))
+* drag tab to anther window signal is incorrect. ([08c5b927](https://github.com/linuxdeepin/deepin-editor/commit/08c5b92764a92a6949fddd1036e12f4e1cd3599b))
+* no highlight current line ([a3391be5](https://github.com/linuxdeepin/deepin-editor/commit/a3391be5be423701c2abd7d4b1ac265aae34d33c))
+* use fixed byte detection encoding. ([a0dd1cb5](https://github.com/linuxdeepin/deepin-editor/commit/a0dd1cb51fc48ee03a7bc61b03b6c86f7a1b0181))
+* ensure that the file is written to disk ([a036a13b](https://github.com/linuxdeepin/deepin-editor/commit/a036a13b77a47b5175272037b22c07059b6100e8))
+* line number padding. ([ed30c88b](https://github.com/linuxdeepin/deepin-editor/commit/ed30c88b0cd8b8e2ed30772b0db0da16a50d216a))
+* read-only mode cannot drag text. ([a3e4398b](https://github.com/linuxdeepin/deepin-editor/commit/a3e4398b60628db9db2e03177fa5c83ea10a1082))
+* **menu:**
+ * change the highlight order ([1e90cbcc](https://github.com/linuxdeepin/deepin-editor/commit/1e90cbcc9a52df537fcf0fdf2c1677bde4d436f9))
+ * set minimum width ([47a0b06d](https://github.com/linuxdeepin/deepin-editor/commit/47a0b06d76289e7a06d591b8b46a3301db3b48d1))
+
+#### Features
+
+* add abbreviated name. ([3250f36c](https://github.com/linuxdeepin/deepin-editor/commit/3250f36c6bc2980599a58565008436e24628cd22))
+* close tabs prompted to save the file. ([e54bdc99](https://github.com/linuxdeepin/deepin-editor/commit/e54bdc99de05210a16bcc0b002999d2469e42b65))
+* optimize file loading speed. ([286db0fc](https://github.com/linuxdeepin/deepin-editor/commit/286db0fc8092dcd6098ed8dc27430e2339c3fb41))
+* use cmake ([a56c06fb](https://github.com/linuxdeepin/deepin-editor/commit/a56c06fb04bf8d48d0aa28cd49b407641a0b2470))
+* add highlight right option ([501f7795](https://github.com/linuxdeepin/deepin-editor/commit/501f77958ccc62050dc1c756b9272355e5191f61))
+* **tabbar:** add right menu. ([053ec629](https://github.com/linuxdeepin/deepin-editor/commit/053ec62953415ebc912712abd7dd4e69e10d8b69))
+
+
+
+
+## 0.5 (2018-09-21)
+
+
+#### Bug Fixes
+
+* don't blank the cursor when selecting text ([8cf929f9](https://github.com/linuxdeepin/deepin-editor/commit/8cf929f9854bc4cf7e82c10a6c1b2e8898847c5a))
+* no permissions to read file without create new tab. ([bc4039e2](https://github.com/linuxdeepin/deepin-editor/commit/bc4039e2ddd522a7dcd5dd1bca74436a3b18ba77))
+* open invalid prompt ([7c81857e](https://github.com/linuxdeepin/deepin-editor/commit/7c81857eee11e6cdc8addc21ca881f31520477c4))
+* kill backward & forward word. ([47a566bb](https://github.com/linuxdeepin/deepin-editor/commit/47a566bba4af04f2dde610649ea096acf3f30f71))
+* can't replace all empty ([9b83f153](https://github.com/linuxdeepin/deepin-editor/commit/9b83f153bc607460a747c64365cae0b8fe833526))
+* no history filepath saved when closing other tabs. ([adff4cf5](https://github.com/linuxdeepin/deepin-editor/commit/adff4cf5138b0863c00cf5197dbb318e4efc26dd))
+* sort shortcuts ([6487ccf5](https://github.com/linuxdeepin/deepin-editor/commit/6487ccf52214423e55f3d4d4d0a3599beaeed288))
+* open again will create a new window ([7ed3ce95](https://github.com/linuxdeepin/deepin-editor/commit/7ed3ce95db97599fee198c93ee184c37618a75d3))
+* toggle find & replace bar focus ([e8370db4](https://github.com/linuxdeepin/deepin-editor/commit/e8370db401649bd9f9669dbefc611b94e102790e))
+* cannot be replaced after undo ([6fcab391](https://github.com/linuxdeepin/deepin-editor/commit/6fcab391ec2da47a4356ca396ad748f4776a43f6))
+* shortcut viewer translation. ([0d408be2](https://github.com/linuxdeepin/deepin-editor/commit/0d408be276587b75cbf57598e40291c6f358069e))
+* window size. ([15a3c805](https://github.com/linuxdeepin/deepin-editor/commit/15a3c805f581282f39a7567187cbce9d101d09ad))
+* goto next & previous word. ([b3440462](https://github.com/linuxdeepin/deepin-editor/commit/b3440462922997593847dc583465424d6344bc5c))
+* add tab space minimum value ([35ef2b9b](https://github.com/linuxdeepin/deepin-editor/commit/35ef2b9bcb4732c5b4653172ca0815935bcc3bda))
+* can be infinitely replaced next ([e249dc39](https://github.com/linuxdeepin/deepin-editor/commit/e249dc39538ab53c3d479c306974b1b43987e369))
+* replace text is empty. ([d6872e1f](https://github.com/linuxdeepin/deepin-editor/commit/d6872e1fd200d6fb14f238dcf62d91765693c43b))
+* do not restore tab when restoring pos ([d86ec9f0](https://github.com/linuxdeepin/deepin-editor/commit/d86ec9f0eb6b0203608020e963f61d3c52976095))
+* save prompt error ([5992d3ae](https://github.com/linuxdeepin/deepin-editor/commit/5992d3ae028197f78832c9ebccd763444f72f518))
+* new tab does not scroll the latest index. ([1aee05af](https://github.com/linuxdeepin/deepin-editor/commit/1aee05af722f1313ca966722b6d6d484186bcc4e))
+* printer output format ([5c37338f](https://github.com/linuxdeepin/deepin-editor/commit/5c37338f01620a2735785d349e067f9637629bb1))
+* new blank document cannot be saved. ([b5902cfe](https://github.com/linuxdeepin/deepin-editor/commit/b5902cfe607265273211c7cc65b743359d843ca9))
+* don't display horizontal scrollbar. ([328e221b](https://github.com/linuxdeepin/deepin-editor/commit/328e221bb05ad94fa6bc9313975df3670c446659))
+* blank document close without prompting to save. ([48578887](https://github.com/linuxdeepin/deepin-editor/commit/4857888738bfd50c96695fdffa13281c5e15d028))
+* font debug prompt. ([98f6eb40](https://github.com/linuxdeepin/deepin-editor/commit/98f6eb406ec85b75d3a69a44850a0ad66455e1e8))
+* draft file default save directory. ([aac54afc](https://github.com/linuxdeepin/deepin-editor/commit/aac54afcb1e5616672ea047b4c38a96d0ced422e))
+* scroll line incorrect. ([e5f832ce](https://github.com/linuxdeepin/deepin-editor/commit/e5f832cec1c8cef3d16db839aaddb94f462389d8))
+* file not finish loadding cannot be saved. ([2e75eabc](https://github.com/linuxdeepin/deepin-editor/commit/2e75eabc5743e17434815f0e5f1f24b87ffecf1e))
+* does not support highlight do not reload. ([e5bf3942](https://github.com/linuxdeepin/deepin-editor/commit/e5bf39422744c0b8b5a289e0896e7f98b6843339))
+* response esc keymap. ([55b9611a](https://github.com/linuxdeepin/deepin-editor/commit/55b9611a1e966d8dce366508ad012d747cc6f151))
+* save the file priority. ([382c58a0](https://github.com/linuxdeepin/deepin-editor/commit/382c58a0910dab5287dff8c93ee95a4ffbf0ab18))
+* popup the theme panel slow. ([719f1c29](https://github.com/linuxdeepin/deepin-editor/commit/719f1c295a3676fcb702c32bab4abf4ef0b96367))
+* don't show the toast when saving. ([5c3eb6af](https://github.com/linuxdeepin/deepin-editor/commit/5c3eb6af46c1d820439f2999b894e8a6a8be6f49))
+* best encoding it has guessed ([cda92ee7](https://github.com/linuxdeepin/deepin-editor/commit/cda92ee71e03e7e15c127f93015a66ef3b834965))
+* first theme panel popuped up, correct item is not selected. ([0323074c](https://github.com/linuxdeepin/deepin-editor/commit/0323074c33d695d4964112c157f30315c5520616))
+* save root file garbled. ([720b7ec7](https://github.com/linuxdeepin/deepin-editor/commit/720b7ec73a419e0a19aebd4f7222dede7b502a41))
+* determine whether writable. ([dac3c01c](https://github.com/linuxdeepin/deepin-editor/commit/dac3c01c58408c7aa763b670d2e0799e1db8f95c))
+* right click selection color. ([28f91304](https://github.com/linuxdeepin/deepin-editor/commit/28f91304c0f81a1f7ccb6128b5258171ef3669a9))
+* save as correct encoding. ([3693b410](https://github.com/linuxdeepin/deepin-editor/commit/3693b410f37c3083d07c2bb09a8764e695e12360))
+* save set encoding. ([3355588e](https://github.com/linuxdeepin/deepin-editor/commit/3355588eece2c2a88b1a9fabb286a070948341e0))
+* best encoding it has guessed so far. ([52aa370a](https://github.com/linuxdeepin/deepin-editor/commit/52aa370a7c5571fb910c696ad1a8801a093a163e))
+* drag move event crash ([9db195cd](https://github.com/linuxdeepin/deepin-editor/commit/9db195cd4a9b37132c37e2c3e4f6f5706ae6c21d))
+* save root file logic. ([e17002ea](https://github.com/linuxdeepin/deepin-editor/commit/e17002ea20daa014d6f336a679b04e40e526ed29))
+* pro file installs script ([cf6e0b7a](https://github.com/linuxdeepin/deepin-editor/commit/cf6e0b7afdca248de86cb9995b6bb76b081b0cdb))
+* save root file crash ([e1a6b660](https://github.com/linuxdeepin/deepin-editor/commit/e1a6b66060dee283a0d306c3e0b836e213629adb))
+* prompt to save the draft document. ([3232017b](https://github.com/linuxdeepin/deepin-editor/commit/3232017ba94783b2460e80cefbc1bafb0fdf23db))
+* restore cursor ([0c8123c9](https://github.com/linuxdeepin/deepin-editor/commit/0c8123c94c5e41c18d4928b29153b5932f45804e))
+* switch theme to scroll to the next line. ([abde4fac](https://github.com/linuxdeepin/deepin-editor/commit/abde4fac67410a28b12c7c462c3ae6b490f01279))
+* some themes do not highlight. ([15fd8fbd](https://github.com/linuxdeepin/deepin-editor/commit/15fd8fbde04fb81fa13f3f0d46ae20efefc153ad))
+* remove loadding cursor ([c96e9642](https://github.com/linuxdeepin/deepin-editor/commit/c96e9642f5f4eb991463aa2c349cff4c39bd8c9a))
+* move document thread ([862499bf](https://github.com/linuxdeepin/deepin-editor/commit/862499bf997a8bef3999d21c29be33621b60b42a))
+* do not create new QTextDocument. ([c143fd34](https://github.com/linuxdeepin/deepin-editor/commit/c143fd34d33a3a73ba65b967ab526bb8d11593ea))
+* open blank files of last session may cause window flash ([480caa69](https://github.com/linuxdeepin/deepin-editor/commit/480caa6918c982cafb87086ff4a8479d1015c217))
+* open blank files of last session may cause window flash. ([08d04190](https://github.com/linuxdeepin/deepin-editor/commit/08d041906cac46a2589d2b552d2b708d59ba74bb))
+* clear blank files that have no content. ([956b9e06](https://github.com/linuxdeepin/deepin-editor/commit/956b9e066260983cccc74d1db6a7b9a14fbeaa40))
+* if close the tab, delete the blank file. ([67f0ab17](https://github.com/linuxdeepin/deepin-editor/commit/67f0ab179203531d2f6c7d44a4cdd063288e3374))
+* findbar press ESC is invalid ([d900a205](https://github.com/linuxdeepin/deepin-editor/commit/d900a205968aaa2284100ac618229368cbfb5d4e))
+* texteditor does not have focus after switching tabs ([c2dc270e](https://github.com/linuxdeepin/deepin-editor/commit/c2dc270e9a0570f5d5c868f001792fe6db198c12))
+* use build version ([30fb5769](https://github.com/linuxdeepin/deepin-editor/commit/30fb5769fc19f2216f296629fe880af435b20738))
+* tab drag leave not close is incorrect. ([1b49bcef](https://github.com/linuxdeepin/deepin-editor/commit/1b49bcef26a46a51567e238351125b2a97696c78))
+* connection repeat slot functions. ([1c2b4ade](https://github.com/linuxdeepin/deepin-editor/commit/1c2b4ade3ac668bf87b169523fd074268e19c29f))
+* drag a window does not close properly when ([7a9c8bdc](https://github.com/linuxdeepin/deepin-editor/commit/7a9c8bdc7bd96906328669bea8490fdb45f3ffaf))
+* cursor stops being redrawn when QPlainTextEdit::dropEvent() overrided... ([fea5a7e7](https://github.com/linuxdeepin/deepin-editor/commit/fea5a7e7898146dd3385af64db8b36b8e353a769))
+* drag and drop tab index is incorrect ([04916d14](https://github.com/linuxdeepin/deepin-editor/commit/04916d14e7bbea469790d00ed37d2038af70cba9))
+* set window minimum size. ([a1d3b21b](https://github.com/linuxdeepin/deepin-editor/commit/a1d3b21b0a9218120ddf293ca3ca443a0c9602fe))
+* close event ([eafc9523](https://github.com/linuxdeepin/deepin-editor/commit/eafc95236a7ad5c3e401be7c5af65d66b45bf934))
+* no need to adjust scrollbar margins if reach last line ([4c56f4f1](https://github.com/linuxdeepin/deepin-editor/commit/4c56f4f1dc6860b6b3a8a3cdc4613121f9b6b1f0))
+* not release memory when close tab. ([52f0ea3f](https://github.com/linuxdeepin/deepin-editor/commit/52f0ea3f2fc835fae7cb84ac5e26c273cec28019))
+* tabbar stylesheet ([4aeea8a0](https://github.com/linuxdeepin/deepin-editor/commit/4aeea8a04feea2980ddf959730e4ad4dbe1088e3))
+* all window switching theme. ([46818c99](https://github.com/linuxdeepin/deepin-editor/commit/46818c995444ee18bd71101df52906f90635edc2))
+* theme setting background invalid. ([5a856d34](https://github.com/linuxdeepin/deepin-editor/commit/5a856d34580785e6f0a49ddc71d8ea872427eadc))
+* remove english completer menu. ([54e30108](https://github.com/linuxdeepin/deepin-editor/commit/54e3010819214b76a41dcf38890fb2476dde4046))
+* copying to clipboard text is incorrect. ([28a73ada](https://github.com/linuxdeepin/deepin-editor/commit/28a73adaa098fc95743ae21f2ecac5bbbb4d79a2))
+* window flashing. ([c55c5e42](https://github.com/linuxdeepin/deepin-editor/commit/c55c5e42713cc26a4699d79c18ed31105cdd17e0))
+* do not generate BOM. ([fec6fa62](https://github.com/linuxdeepin/deepin-editor/commit/fec6fa6224d252a3b1df43c2ba10741b97ca34e8))
+* read-only mode moving cursor crashes. ([5042c39e](https://github.com/linuxdeepin/deepin-editor/commit/5042c39ef5a9ccaa2c71d3604b131a23b3e2a838))
+* save the correct encoding ([a9e92874](https://github.com/linuxdeepin/deepin-editor/commit/a9e92874e4e25e1ea99362fa42bb27ff1b1f5901))
+* crash when drag tab on high qt version ([1cecc879](https://github.com/linuxdeepin/deepin-editor/commit/1cecc879b238b1a2fd1e8092a1d79537a5dc6fa3))
+* **SettingsDialog:**
+ * no update tab space number. ([d44b100b](https://github.com/linuxdeepin/deepin-editor/commit/d44b100b9eb9c4269a06fc916876de53898196af))
+ * font is empty after recovery. ([2683caea](https://github.com/linuxdeepin/deepin-editor/commit/2683caeac5611b43a1a9cfe0bfe7850ace6ac0e9))
+* **config:** desktop translation ([15b4f878](https://github.com/linuxdeepin/deepin-editor/commit/15b4f87857fd6c87e30f21f2fc6cdc10625aa5e9))
+* **find:** makes find match only complete words. ([c2de5c36](https://github.com/linuxdeepin/deepin-editor/commit/c2de5c364b84a8f6648c4e789e1c742475814014))
+* **find_bar:** text display is incomplete, increase height. ([f282ab24](https://github.com/linuxdeepin/deepin-editor/commit/f282ab249196a9ac19d1a224077aa2f9d8f5deac))
+* **read_only_mode:** empty text moving cursor crashes. ([f60be78e](https://github.com/linuxdeepin/deepin-editor/commit/f60be78e47e11680156bcc2bc6fb515c229e2955))
+* **tabbar:**
+ * close tab without reminder. ([c846f6e9](https://github.com/linuxdeepin/deepin-editor/commit/c846f6e974c97af4d57e903f2677516ece4d0013))
+ * handleTabDroped() type conversion error. ([a1796f93](https://github.com/linuxdeepin/deepin-editor/commit/a1796f93adf45982ab70c53e0b0fb4ac370ce9fc))
+ * dnd background error ([8934d1e9](https://github.com/linuxdeepin/deepin-editor/commit/8934d1e965ffba5134c1c20291ab9d310edebe3a))
+ * did not call closeFile() after dragging out. ([33687534](https://github.com/linuxdeepin/deepin-editor/commit/336875340ed0f05c627e40f650ab01c061c865cd))
+* **texteditor:** some colors is incorrect. ([ba094484](https://github.com/linuxdeepin/deepin-editor/commit/ba094484a7c06bc0a3a3b38171f48e087ac9f785))
+* **toast:** possible memory leak ([4b01a349](https://github.com/linuxdeepin/deepin-editor/commit/4b01a349bd1d2dfc7e8297b68b3b5d2726d770fb))
+
+#### Features
+
+* optimize emacs mode. ([dbc5d021](https://github.com/linuxdeepin/deepin-editor/commit/dbc5d0210eb55bb8923e28e262507ffcbcb82808))
+* sort theme list by lightness. ([8e15694c](https://github.com/linuxdeepin/deepin-editor/commit/8e15694cd0a97bd9cc4204846010132e917be4be))
+* add atom dark theme. ([f523c1aa](https://github.com/linuxdeepin/deepin-editor/commit/f523c1aa11f122b335b7ce4a1fdbec73c5dde75a))
+* support Ctrl + wheel to adjust font size. ([7873a610](https://github.com/linuxdeepin/deepin-editor/commit/7873a610cc974b4829de32a6967d45fd341b7e65))
+* delayed loadding highlight. ([4b0b87ea](https://github.com/linuxdeepin/deepin-editor/commit/4b0b87eac4f896766cdca32751016beb3d9b1b88))
+* close window prompt to save all files. ([b3b8cd9f](https://github.com/linuxdeepin/deepin-editor/commit/b3b8cd9f35c6469241971f7d548fd1b394c3c224))
+* support open srt files. ([9f33d6e8](https://github.com/linuxdeepin/deepin-editor/commit/9f33d6e82d6d1e0b37c7d8a5dd3906ee27481d25))
+* remove document margin. ([adb8ca94](https://github.com/linuxdeepin/deepin-editor/commit/adb8ca94f2db0cceec823ff9d60f981f14528db3))
+* intelligent judge whether to support comments. ([ead6f1d8](https://github.com/linuxdeepin/deepin-editor/commit/ead6f1d8cd7fab011faf0ae0ba3105542a896f3b))
+* support open bak files. ([54c6259c](https://github.com/linuxdeepin/deepin-editor/commit/54c6259cb50db2d1fd5725bb8bd62090ec09cb0b))
+* optimize theme panel selection effect. ([7b4cf4b6](https://github.com/linuxdeepin/deepin-editor/commit/7b4cf4b67ea72b4a9e75b8083e5073dc1bb31c02))
+* add solarized dark theme. ([22781ac6](https://github.com/linuxdeepin/deepin-editor/commit/22781ac60d503ba699e9d8661e5f055cd2d392a8))
+* prompt whether to save as when saving fails. ([b19cd092](https://github.com/linuxdeepin/deepin-editor/commit/b19cd092d63337be601dac986575a04b51dce6dc))
+* optimize load file ([adb356a5](https://github.com/linuxdeepin/deepin-editor/commit/adb356a521747329fe5b673e9093f7b5d69e5b26))
+* tabbar release changes window position. ([992f5415](https://github.com/linuxdeepin/deepin-editor/commit/992f5415158a8f3d2c7b7a89a10e8c9e62a7864e))
+* support multi-thraded read fiels. ([d4de7431](https://github.com/linuxdeepin/deepin-editor/commit/d4de743195567e7ee1b3211d92432645edc8bdc3))
+* change cursor when saving ([456230bc](https://github.com/linuxdeepin/deepin-editor/commit/456230bc42dd0f9f4c96ff3320f7e6dc882f5b7e))
+* add load mouse style. ([9ea1f8d7](https://github.com/linuxdeepin/deepin-editor/commit/9ea1f8d70e5682d7bbdb840fdcbeeab1c6112207))
+* add solarized-light theme ([3341f0fa](https://github.com/linuxdeepin/deepin-editor/commit/3341f0fa5b2c6ab15fddefa9d03590a2c358cd36))
+* can change the titlebar background color. ([37002495](https://github.com/linuxdeepin/deepin-editor/commit/37002495f56fbe21ee481a1c95754434f5459831))
+* optimize modification state. ([003db509](https://github.com/linuxdeepin/deepin-editor/commit/003db509fc12d519237b1c0afad022bc07ca7889))
+* align the top of the line numbers. ([4b0e41aa](https://github.com/linuxdeepin/deepin-editor/commit/4b0e41aadb235cd0f5314c2ec631ce5ee389033f))
+* support drag and drop the web url text. ([dc8413ab](https://github.com/linuxdeepin/deepin-editor/commit/dc8413ab10aaed5e0272b1d3472725801d4705a4))
+* save the file dialog history directory. ([1f28e873](https://github.com/linuxdeepin/deepin-editor/commit/1f28e873379a647239c30124e2da3cbd3e75e0b0))
+* update MimeType of desktop file ([0712e2fc](https://github.com/linuxdeepin/deepin-editor/commit/0712e2fcecf3e48526e02e1e12d41e0eff3540fd))
+* optimize startup speed. ([d7006a9c](https://github.com/linuxdeepin/deepin-editor/commit/d7006a9cece07800e0918d14863394516c756838))
+* select current directory when saving ([c370010f](https://github.com/linuxdeepin/deepin-editor/commit/c370010fde4e276d154effe96232cc6a966cae01))
+* supports drag files to window ([1af5c0f6](https://github.com/linuxdeepin/deepin-editor/commit/1af5c0f62b2347411508d44b918b8abfcdd7f424))
+* support open the desktop & yml files. ([1f6d3ae8](https://github.com/linuxdeepin/deepin-editor/commit/1f6d3ae8ace858ceb750c89f278f5785ac0f0d02))
+* save the correct newline. ([29e93136](https://github.com/linuxdeepin/deepin-editor/commit/29e93136aaf6633650e88f85ebefbca0383a4df6))
+* **IndentText:** optimize cursor blink. ([0175b85a](https://github.com/linuxdeepin/deepin-editor/commit/0175b85aaa771dcdc13a01e0ecf797f5b9f0704f))
+* **TextEdit:** auto adjust scrollbar margins. ([92559757](https://github.com/linuxdeepin/deepin-editor/commit/92559757731578a54abc8b4fad077d28d806e539))
+* **ThemeView:** auto adjust scrollbar margins. ([8e817ec4](https://github.com/linuxdeepin/deepin-editor/commit/8e817ec40627c8325f432ab8465bd4a9d3c3a621))
+* **findbar:** select all text when get focus. ([4a36520c](https://github.com/linuxdeepin/deepin-editor/commit/4a36520cb6c6a991dff8d6e8ed3464ae70814298))
+* **printDialog:** set output file name ([8d7d077d](https://github.com/linuxdeepin/deepin-editor/commit/8d7d077d9a1cda0ed95406b1cd86d73c159a1007))
+* **save:** correct toast content ([0c938f1f](https://github.com/linuxdeepin/deepin-editor/commit/0c938f1f3b849c2357dcc0db9fa568e3540dc388))
+* **search:** case insensitive. ([0a549e93](https://github.com/linuxdeepin/deepin-editor/commit/0a549e935565b767c882cac9df10cb311bd0658d))
+* **tabbar:** support background gradient. ([279dffa1](https://github.com/linuxdeepin/deepin-editor/commit/279dffa1199883bf9d4e3fae99884fdf49bee566))
+
+
+
+### 0.0.5 (2018-05-23)
+- Tag for archlinux.
+
+### 0.0.4 (2018-05-17)
+- Tag for archlinux.
+
+### 0.0.3 (2018-05-14)
+- Fixed many bugs since 0.0.2
+
+### 0.0.2 (2018-05-10)
+- First release for arch.
+
+### 0.0.1 (2018-01-22)
+- Init tag
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..78af98f48899b81f5ae42697d0b6a69bfd6ab089
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,32 @@
+cmake_minimum_required(VERSION 3.7)
+
+set(VERSION "6.0.0" CACHE STRING "Application version")
+
+project(deepin-editor
+ VERSION ${VERSION}
+ DESCRIPTION "Text editor for DDE"
+ HOMEPAGE_URL "https://github.com/linuxdeepin/deepin-editor"
+ LANGUAGES CXX C
+)
+
+#set(CMAKE_VERBOSE_MAKEFILE ON)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+
+if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "sw_64")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mieee")
+endif ()
+
+# 设置软件版本
+include_directories(${PROJECT_BINARY_DIR})
+configure_file(${PROJECT_SOURCE_DIR}/src/environments.h.in ${PROJECT_BINARY_DIR}/environments.h @ONLY)
+
+add_subdirectory(src)
+
+if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ add_subdirectory(tests)
+endif()
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000000000000000000000000000000000000..94a9ed024d3859793618152ea559a168bbcbb5e2
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,674 @@
+ GNU 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.
+
+ 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
+.
diff --git a/LICENSES/CC-BY-4.0.txt b/LICENSES/CC-BY-4.0.txt
new file mode 100644
index 0000000000000000000000000000000000000000..13ca539f377dc705af32b8d2ce89262298ea2f06
--- /dev/null
+++ b/LICENSES/CC-BY-4.0.txt
@@ -0,0 +1,156 @@
+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.
diff --git a/LICENSES/CC0-1.0.txt b/LICENSES/CC0-1.0.txt
new file mode 100644
index 0000000000000000000000000000000000000000..0e259d42c996742e9e3cba14c677129b2c1b6311
--- /dev/null
+++ b/LICENSES/CC0-1.0.txt
@@ -0,0 +1,121 @@
+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.
diff --git a/LICENSES/GPL-2.0-or-later.txt b/LICENSES/GPL-2.0-or-later.txt
new file mode 100644
index 0000000000000000000000000000000000000000..17cb286430a4d8094e473d06bd7f50f40438ddba
--- /dev/null
+++ b/LICENSES/GPL-2.0-or-later.txt
@@ -0,0 +1,117 @@
+GNU GENERAL PUBLIC LICENSE
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 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.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) 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 this service 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 make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. 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.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+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 Program or any portion of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, 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 Program, 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 Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+ a) 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; or,
+
+ b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, 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 executable. However, as a special exception, the source code 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.
+
+If distribution of executable or 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 counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program 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.
+
+5. 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 Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program 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 to this License.
+
+7. 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 Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program 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 Program.
+
+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.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program 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.
+
+9. The Free Software Foundation may publish revised and/or new versions of the 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 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 Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, 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
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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.
+
+12. 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 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.
+
+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 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.
+
+ one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author
+
+ 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 2 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, 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.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author Gnomovision 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, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice
diff --git a/LICENSES/GPL-3.0-or-later.txt b/LICENSES/GPL-3.0-or-later.txt
new file mode 100644
index 0000000000000000000000000000000000000000..d41c0bd98feb776ef7d81efbc1b5447e0284a187
--- /dev/null
+++ b/LICENSES/GPL-3.0-or-later.txt
@@ -0,0 +1,232 @@
+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 .
diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt
new file mode 100644
index 0000000000000000000000000000000000000000..2071b23b0e08594ea6bc99ac71129ef992abf498
--- /dev/null
+++ b/LICENSES/MIT.txt
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..14943bd47632dea11df0ed2cebd7233001f8bbdb
--- /dev/null
+++ b/README.md
@@ -0,0 +1,87 @@
+# Deepin Editor
+
+Deepin Editor is a desktop text editor that supports common text editing features.
+
+## Dependencies
+
+_The **master** branch is current development branch, build dependencies may changes without update README.md, refer to `./debian/control` for a working build depends list_
+
+* libqt5widgets5
+* libdtkcore-dev
+* libdtkwidget-dev
+* qt5-default
+* libpolkit-qt5-1-dev
+* libkf5syntaxhighlighting-dev
+* libkf5codecs-dev
+* qttools5-dev-tools
+* qtbase5-private-dev
+* libxcb-util0-dev
+* libdtkwm-dev
+* libxtst-dev
+
+## Installation
+
+1. Make sure you have installed all dependencies.
+
+_Package name may be different between distros, if deepin-editor is available from your distro, check the packaging script delivered from your distro is a better idea._
+
+Assume you are using [Deepin](https://distrowatch.com/table.php?distribution=deepin) or other debian-based distro which got deepin-editor delivered:
+
+``` shell
+$ sudo apt-get build-dep deepin-edtor
+```
+
+2. Build editor daemon
+
+```
+sudo cp com.deepin.editor.policy /usr/share/polkit-1/actions
+sudo cp com.deepin.editor.conf /usr/share/dbus-1/system.d/
+sudo cp com.deepin.editor.daemon.service /usr/share/dbus-1/system-services
+
+cd ./daemon
+mkdir build
+cd build
+qmake ..
+make
+sudo ./deepin-editor-daemon
+```
+
+3. Build editor
+
+```
+cd deepin-editor
+mkdir build
+cd build
+cmake ..
+make
+./deepin-editor
+```
+
+4. Install editor:
+
+```
+$ sudo make install
+```
+
+## Config file
+
+configure save at: ~/.config/deepin/deepin-editor/config.conf
+
+## Getting help
+
+Any usage issues can ask for help via
+
+* [Gitter](https://gitter.im/orgs/linuxdeepin/rooms)
+* [IRC channel](https://webchat.freenode.net/?channels=deepin)
+* [Forum](https://bbs.deepin.org)
+* [WiKi](http://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 Editor is licensed under [GPL-3.0-or-later](LICENSE.txt).
diff --git a/README.zh_CN.md b/README.zh_CN.md
new file mode 100644
index 0000000000000000000000000000000000000000..0fb778dcf473fe42d0c085f30a5275e47c8d9668
--- /dev/null
+++ b/README.zh_CN.md
@@ -0,0 +1,88 @@
+# Deepin Editor
+
+文本编辑器是一个简单的文本编辑工具。您可以用它书写简单的文本文档,也可以使用它的高级特性,让它成为一个代码编辑工具,支持代码语法高亮。
+
+## 依赖
+
+_**master**分支是当前开发分支,编译依赖可能在未更新README.md文件的情况下变更,请参考./debian/control文件获取有效的编译依赖列表_
+
+* libqt5widgets5
+* libdtkcore-dev
+* libdtkwidget-dev
+* qt5-default
+* libpolkit-qt5-1-dev
+* libkf5syntaxhighlighting-dev
+* libkf5codecs-dev
+* qttools5-dev-tools
+* qtbase5-private-dev
+* libxcb-util0-dev
+* libdtkwm-dev
+* libxtst-dev
+
+## 安装
+
+1. 确保已安装所有依赖库.
+
+
+_不同发行版的软件包名称可能不同,如果您的发行版提供了deepin-editor,请检查发行版提供的打包脚本。_
+
+如果你使用的是 [Deepin](https://distrowatch.com/table.php?distribution=deepin) 或者其它提供了deepin-editor的发行版:
+
+``` shell
+$ sudo apt-get build-dep deepin-edtor
+```
+
+2. 构建 editor daemon
+
+```
+sudo cp com.deepin.editor.policy /usr/share/polkit-1/actions
+sudo cp com.deepin.editor.conf /usr/share/dbus-1/system.d/
+sudo cp com.deepin.editor.daemon.service /usr/share/dbus-1/system-services
+
+cd ./daemon
+mkdir build
+cd build
+qmake ..
+make
+sudo ./deepin-editor-daemon
+```
+
+3. 构建 editor
+
+```
+cd deepin-editor
+mkdir build
+cd build
+cmake ..
+make
+./deepin-editor
+```
+
+4. 安装 editor:
+
+```
+$ sudo make install
+```
+
+## 配置文件
+
+配置文件位于: ~/.config/deepin/deepin-editor/config.conf
+
+## 帮助
+
+任何使用问题都可以通过以下方式寻求帮助:
+
+* [Gitter](https://gitter.im/orgs/linuxdeepin/rooms)
+* [IRC channel](https://webchat.freenode.net/?channels=deepin)
+* [Forum](https://bbs.deepin.org)
+* [WiKi](http://wiki.deepin.org/)
+
+## 贡献指南
+
+我们鼓励您报告问题并做出更改
+
+* [开发者代码贡献指南](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers)
+
+## 开源许可证
+
+Deepin Editor 在 [GPL-3.0-or-later](LICENSE.txt) 下发布
diff --git a/com.deepin.editor.conf b/com.deepin.editor.conf
new file mode 100644
index 0000000000000000000000000000000000000000..42f098f0a05c008b0d1958b658e0431cd0842b45
--- /dev/null
+++ b/com.deepin.editor.conf
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/com.deepin.editor.daemon.service b/com.deepin.editor.daemon.service
new file mode 100644
index 0000000000000000000000000000000000000000..3112e6d82829530f8c805ba05622ce7640df0789
--- /dev/null
+++ b/com.deepin.editor.daemon.service
@@ -0,0 +1,4 @@
+[D-BUS Service]
+User=root
+Name=com.deepin.editor.daemon
+Exec=/usr/bin/deepin-editor-daemon
\ No newline at end of file
diff --git a/com.deepin.editor.policy b/com.deepin.editor.policy
new file mode 100644
index 0000000000000000000000000000000000000000..0240563c99f499f77b4b78469ef36455f6f93269
--- /dev/null
+++ b/com.deepin.editor.policy
@@ -0,0 +1,14 @@
+
+
+
+
+ Save file with administrator privilege
+ Save file with administrator privilege
+
+ no
+ auth_admin
+
+
+
diff --git a/daemon/deepin-editor-daemon.pro b/daemon/deepin-editor-daemon.pro
new file mode 100644
index 0000000000000000000000000000000000000000..3f560f73e5a4060ce86267a7a8f14fdadb274c08
--- /dev/null
+++ b/daemon/deepin-editor-daemon.pro
@@ -0,0 +1,32 @@
+######################################################################
+# Automatically generated by qmake (3.0) ?? 2? 4 17:49:37 2017
+######################################################################
+
+TEMPLATE = app
+TARGET = deepin-editor-daemon
+
+CONFIG += link_pkgconfig
+CONFIG += c++11
+PKGCONFIG += dtkwidget polkit-qt5-1
+
+# Input
+HEADERS += src/dbusadaptor.h \
+ src/dbus.h \
+ src/utils.h \
+ src/policykithelper.h
+
+SOURCES += src/dbusadaptor.cpp \
+ src/dbus.cpp \
+ src/utils.cpp \
+ src/main.cpp \
+ src/policykithelper.cpp
+
+QT += core
+QT += dbus
+
+QMAKE_CXXFLAGS += -g
+
+isEmpty(BINDIR):BINDIR=/usr/bin
+target.path = $$INSTROOT$$BINDIR
+
+INSTALLS += target
diff --git a/daemon/src/dbus.cpp b/daemon/src/dbus.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6f8a670c24697b9466a3055603c75e0cb6a59f8d
--- /dev/null
+++ b/daemon/src/dbus.cpp
@@ -0,0 +1,50 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "policykithelper.h"
+#include "dbus.h"
+#include "utils.h"
+
+#include
+#include
+#include
+#include
+
+DBus::DBus(QObject *parent) : QObject(parent)
+{
+}
+
+bool DBus::saveFile(const QByteArray &path, const QByteArray &text, const QByteArray &encoding)
+{
+ const QString filepath = QString::fromUtf8(path);
+
+ if (PolicyKitHelper::instance()->checkAuthorization("com.deepin.editor.saveFile", getpid())) {
+ // Create file if filepath is not exists.
+ if (!Utils::fileExists(filepath)) {
+ QString directory = QFileInfo(filepath).dir().absolutePath();
+
+ QDir().mkpath(directory);
+ if (QFile(filepath).open(QIODevice::ReadWrite)) {
+ qDebug() << QString("File %1 not exists, create one.").arg(filepath);
+ }
+ }
+
+ // Save content to file.
+ QFile file(filepath);
+ if(!file.open(QIODevice::WriteOnly | QIODevice::Text)){
+ qDebug() << "Can't write file: " << filepath;
+
+ return false;
+ }
+
+ QTextStream out(&file);
+ out.setCodec(encoding);
+ out << text;
+ file.close();
+
+ return true;
+ } else{
+ return false;
+ }
+}
diff --git a/daemon/src/dbus.h b/daemon/src/dbus.h
new file mode 100644
index 0000000000000000000000000000000000000000..2dc8423eec6e1b7b9560edbd343743e43642665a
--- /dev/null
+++ b/daemon/src/dbus.h
@@ -0,0 +1,23 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef DBUS_H
+#define DBUS_H
+
+#include
+
+class DBus : public QObject
+{
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface","com.deepin.editor.daemon")
+
+public:
+ DBus(QObject* parent = nullptr);
+
+public Q_SLOTS:
+ bool saveFile(const QByteArray &path, const QByteArray &text, const QByteArray &encoding);
+};
+
+
+#endif //DBUS_H
diff --git a/daemon/src/dbusadaptor.cpp b/daemon/src/dbusadaptor.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..1fa0d0c021e1927eeadca29923d45e747fce895c
--- /dev/null
+++ b/daemon/src/dbusadaptor.cpp
@@ -0,0 +1,47 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp com.deepin.editor.daemon -a dbusadaptor
+ *
+ * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#include "dbusadaptor.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+/*
+ * Implementation of adaptor class DaemonAdaptor
+ */
+DbusAdaptor::DbusAdaptor(QObject *parent) : QDBusAbstractAdaptor(parent)
+{
+ // constructor
+ setAutoRelaySignals(true);
+}
+
+DbusAdaptor::~DbusAdaptor()
+{
+ // destructor
+}
+
+bool DbusAdaptor::saveFile(const QByteArray &filepath, const QByteArray &text, const QByteArray &encoding)
+{
+ // handle method call com.deepin.editor.daemon.saveFile.
+
+ bool returnResult;
+ QMetaObject::invokeMethod(parent(), "saveFile", Q_RETURN_ARG(bool, returnResult),
+ Q_ARG(QByteArray, filepath),
+ Q_ARG(QByteArray, text),
+ Q_ARG(QByteArray, encoding));
+
+ return returnResult;
+}
diff --git a/daemon/src/dbusadaptor.h b/daemon/src/dbusadaptor.h
new file mode 100644
index 0000000000000000000000000000000000000000..b5b899625c4afad4830bd68830deef323f06df7b
--- /dev/null
+++ b/daemon/src/dbusadaptor.h
@@ -0,0 +1,55 @@
+/*
+ * This file was generated by qdbusxml2cpp version 0.8
+ * Command line was: qdbusxml2cpp com.deepin.editor.daemon -a dbusadaptor
+ *
+ * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ *
+ * This is an auto-generated file.
+ * This file may have been hand-edited. Look for HAND-EDIT comments
+ * before re-generating it.
+ */
+
+#ifndef DBUSADAPTOR_H
+#define DBUSADAPTOR_H
+
+#include
+#include
+
+QT_BEGIN_NAMESPACE
+class QByteArray;
+template class QList;
+template class QMap;
+class QString;
+class QStringList;
+class QVariant;
+QT_END_NAMESPACE
+
+/*
+ * Adaptor class for interface com.deepin.editor.daemon
+ */
+class DbusAdaptor: public QDBusAbstractAdaptor {
+ Q_OBJECT
+ Q_CLASSINFO("D-Bus Interface", "com.deepin.editor.daemon")
+ Q_CLASSINFO("D-Bus Introspection", ""
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ "")
+public:
+ DbusAdaptor(QObject *parent);
+ virtual ~DbusAdaptor();
+
+public: // PROPERTIES
+
+public Q_SLOTS: // METHODS
+ bool saveFile(const QByteArray &filepath, const QByteArray &text, const QByteArray &encoding);
+
+Q_SIGNALS: // SIGNALS
+};
+
+#endif
diff --git a/daemon/src/main.cpp b/daemon/src/main.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..42d0677dc64e1c2372d1bb34b94dc5d150c5080c
--- /dev/null
+++ b/daemon/src/main.cpp
@@ -0,0 +1,32 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "dbus.h"
+#include "dbusadaptor.h"
+
+#include
+#include
+
+int main(int argc, char **argv)
+{
+ QCoreApplication app(argc, argv);
+
+ DBus *dbus1 = new DBus;
+ new DbusAdaptor(dbus1);
+
+ QDBusConnection connection = QDBusConnection::systemBus();
+ if (connection.isConnected()) {
+ qDebug() << "Build deepin-editor daemon success.";
+ }
+
+ if(!connection.registerService("com.deepin.editor.daemon") ||
+ !connection.registerObject("/", dbus1)){
+ qDebug() << connection.lastError();
+
+ app.exit(1);
+ return 1;
+ }
+
+ return app.exec();
+}
diff --git a/daemon/src/policykithelper.cpp b/daemon/src/policykithelper.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..b9c482656ce58a1a6b32e25904b10d48afac5e17
--- /dev/null
+++ b/daemon/src/policykithelper.cpp
@@ -0,0 +1,27 @@
+// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "policykithelper.h"
+
+bool PolicyKitHelper::checkAuthorization(const QString& actionId, qint64 applicationPid)
+{
+ Authority::Result result;
+
+ result = Authority::instance()->checkAuthorizationSync(
+ actionId,
+ UnixProcessSubject(applicationPid),
+ Authority::AllowUserInteraction);
+
+ return result == Authority::Yes;
+}
+
+PolicyKitHelper::PolicyKitHelper()
+{
+
+}
+
+PolicyKitHelper::~PolicyKitHelper()
+{
+
+}
diff --git a/daemon/src/policykithelper.h b/daemon/src/policykithelper.h
new file mode 100644
index 0000000000000000000000000000000000000000..aa6479f9a65768b748eeedcd2696f091889da89a
--- /dev/null
+++ b/daemon/src/policykithelper.h
@@ -0,0 +1,29 @@
+// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef POLICYKITHELPER_H
+#define POLICYKITHELPER_H
+
+#include
+
+using namespace PolkitQt1;
+
+class PolicyKitHelper {
+public:
+ inline static PolicyKitHelper* instance(){
+ static PolicyKitHelper instance;
+ return &instance;
+ }
+
+ bool checkAuthorization(const QString& actionId, qint64 applicationPid);
+
+private:
+ PolicyKitHelper();
+ ~PolicyKitHelper();
+
+ Q_DISABLE_COPY(PolicyKitHelper)
+};
+
+
+#endif //POLICYKITHELPER_H
diff --git a/daemon/src/utils.cpp b/daemon/src/utils.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..13ff7fec56cc9ea03163ce4583ddbee6bec27031
--- /dev/null
+++ b/daemon/src/utils.cpp
@@ -0,0 +1,22 @@
+// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "utils.h"
+
+#include
+#include
+
+bool Utils::fileExists(QString path) {
+ QFileInfo check_file(path);
+
+ // check if file exists and if yes: Is it really a file and no directory?
+ return check_file.exists() && check_file.isFile();
+}
+
+bool Utils::fileIsWritable(QString path)
+{
+ QFileDevice::Permissions permissions = QFile(path).permissions();
+
+ return permissions & QFileDevice::WriteUser;
+}
diff --git a/daemon/src/utils.h b/daemon/src/utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..17504ec040b8ad09a703a2842a17b9454c9ff4d4
--- /dev/null
+++ b/daemon/src/utils.h
@@ -0,0 +1,14 @@
+// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include
+
+class Utils : public QObject
+{
+ Q_OBJECT
+
+public:
+ static bool fileExists(QString path);
+ static bool fileIsWritable(QString path);
+};
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000000000000000000000000000000000000..0843f15e8de2245fe4457361eb6ac882d83176af
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,75 @@
+deepin-editor (6.0.6) unstable; urgency=medium
+
+ * fix: 修复使用特殊字体时,序号显示不全(Bug: 188417)(Influence: 序号显示)
+ * fix: 修复加载完小文件时,行号显示不全问题(Influence: 行号显示)
+ * fix: 修复GB18030部分编码转换错误问题(Influence: 编码转换)
+ * fix: 修复源编码为UTF-8时编码转换空白的问题(Influence: 编码转换)
+ * feat: 适配GB18030-2022规范兼容2005标准(Bug: 193311)(Influence: 编码转换 GB18030显示 另存)
+ * fix: 更新翻译显示(Bug: 110761)
+
+ -- Deepin Packages Builder Thu, 13 Apr 2023 13:51:25 +0800
+
+deepin-editor (6.0.5) unstable; urgency=medium
+
+ * Fix application palette change bug.
+
+ -- Deepin Packages Builder Thu, 16 Mar 2023 09:42:02 +0800
+
+deepin-editor (6.0.4) unstable; urgency=medium
+
+ * Update version to distinguish pro/community.
+ * Fix cursor position error when editing multi-byte encoding text.
+
+ -- Deepin Packages Builder Fri, 10 Mar 2023 10:19:21 +0800
+
+deepin-editor (6.0.3) unstable; urgency=medium
+
+ * Improve GB18030 text encoding recognition rate.
+ * Fix print large document bug.
+
+ -- Deepin Packages Builder Tue, 07 Mar 2023 10:43:27 +0800
+
+deepin-editor (6.0.2) unstable; urgency=medium
+
+ * Improve text search and highlight color.
+
+ -- renbin Thu, 16 Feb 2023 14:42:04 +0800
+
+deepin-editor (6.0.1) unstable; urgency=medium
+
+ * Improve convert text encoding.
+ * Adaptor V23 DDE DBus interface.
+ * Fix debian rules error.
+
+ -- renbin Tue, 14 Feb 2023 15:04:06 +0800
+
+deepin-editor (6.0.0) unstable; urgency=low
+
+ * New version 6.0.0
+ * Sync v23 source code from gerrit.
+
+ -- renbin Wed, 11 Jan 2023 14:04:01 +0000
+
+deepin-editor (5.10.13) unstable; urgency=low
+
+ [ Hu Feng Fri, 19 Feb 2021 15:32:28 +0800 ]
+ * debian/control
+ + Add Hu Feng to the uploaders list.
+ + Delete libdtkwm-dev in Build-Depends.
+ + Delete libxcb-util0-dev in Build-Depends.
+ + Delete libxcb1-dev in Build-Depends.
+ + Delete libxext-dev in Build-Depends.
+ + Delete libxtst-dev in Build-Depends.
+ + Add libdframeworkdbus-dev to Build-Depends.
+ + Add libgmock-dev to Build-Depends.
+ + Add libgtest-dev to Build-Depends.
+ + Add deepin-desktop-base to Depends in deepin-editor package.
+ + Add dde-qt5integration to Depends in deepin-editor package.
+
+ [ Clay Stan ]
+ * debian/copyright: Update license information.
+
+ [ Ma Aiguo ]
+ * Initial package (Closes: #897571)
+
+ -- Ma Aiguo Wed, 02 Jun 2021 16:53:34 +0800
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000000000000000000000000000000000000..4c003294bfd8a08d77ebbc484d1fbe4022e28acc
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,41 @@
+Source: deepin-editor
+Section: editors
+Priority: optional
+Maintainer: Debian Deepin Packaging Team
+Uploaders: Ma Aiguo ,
+Build-Depends:
+ cmake,
+ debhelper-compat (= 12),
+ pkg-config,
+ libqt5widgets5,
+ libdtkcore-dev,
+ libdtkwidget-dev,
+ libpolkit-qt5-1-dev,
+ libkf5syntaxhighlighting-dev,
+ libkf5codecs-dev,
+ qttools5-dev-tools,
+ qtbase5-private-dev,
+ libdframeworkdbus-dev,
+ libgtest-dev,
+ libgmock-dev,
+ libchardet-dev,
+ libuchardet-dev (>= 0.0.6),
+ libicu-dev
+Rules-Requires-Root: no
+Standards-Version: 4.5.1
+Homepage: https://github.com/linuxdeepin/deepin-editor
+
+Package: deepin-editor
+Architecture: any
+Depends:
+ dde-qt5integration,
+ ${shlibs:Depends},
+ ${misc:Depends},
+ libdtkwidget5 (>= 5.4.11),
+ libuchardet0 (>= 0.0.6),
+ libchardet1
+Description: Text editor for DDE (Deepin Desktop Environment)
+ Advanced text editor based on dtk.
+ .
+ This package is part of DDE (Deepin Desktop Environment).
+Recommends: uos-reporter, deepin-event-log
\ No newline at end of file
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000000000000000000000000000000000000..4f92c6b442d7193676fac1319e3f96fe4e74a12f
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,135 @@
+Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: deepin-editor
+Source: https://github.com/linuxdeepin/deepin-editor
+Upstream-Contact: https://github.com/linuxdeepin/deepin-editor/issues
+
+# ci
+Files: .github/*
+Copyright: UnionTech Software Technology Co., Ltd.
+License: CC0-1.0
+
+# gitignore
+Files: .gitignore
+Copyright: None
+License: CC0-1.0
+
+# .gitmodules
+Files: .gitmodules
+Copyright: None
+License: CC0-1.0
+
+# xml toml json conf yaml sh ini h.in
+Files: *.toml *.json *conf *.yaml *.sh *.ini *.h.in
+Copyright: UnionTech Software Technology Co., Ltd.
+License: CC0-1.0
+
+# debian
+Files: debian/*
+Copyright: UnionTech Software Technology Co., Ltd.
+License: CC0-1.0
+
+# rpm
+Files: rpm/*
+Copyright: UnionTech Software Technology Co., Ltd.
+License: CC0-1.0
+
+# Project file
+Files: *.pro *.prf *.pri *.qrc *CMakeLists.txt .tx/*
+Copyright: UnionTech Software Technology Co., Ltd.
+License: CC0-1.0
+
+# config files
+Files: com.deepin.editor.daemon.service com.deepin.editor.policy deepin-editor.desktop
+Copyright: UnionTech Software Technology Co., Ltd.
+License: CC0-1.0
+
+# README
+Files: README.md README.zh_CN.md CHANGELOG.md
+Copyright: UnionTech Software Technology Co., Ltd.
+License: CC-BY-4.0
+
+# assets
+Files: src/assets/* src/images/* src/themes/* src/qss/* tests/src/themes/*
+Copyright: UnionTech Software Technology Co., Ltd.
+License: CC-BY-4.0
+
+# translations
+Files: translations/*
+Copyright: UnionTech Software Technology Co., Ltd.
+License: GPL-3.0-or-later
+
+# src
+Files: src/* daemon/src/* tests/src/*
+Copyright: UnionTech Software Technology Co., Ltd.
+License: GPL-3.0-or-later
+
+# encoding
+Files: src/common/encoding.*
+Copyright: 2014-2020 Pedram Pourang (aka Tsu Jan)
+License: GPL-2.0-or-later
+
+# cpp-stub
+Files: tests/src/stub.h
+Copyright: 2019 coolxv
+License: MIT
+
+
+License: GPL-3.0-or-later
+ This package 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 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 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
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
+License:GPL-2.0-or-later
+ 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 2 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 package; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ Boston, MA 02110-1301 USA
+ .
+ On Debian systems, the full text of the GNU General Public
+ License version 2 can be found in the file
+ `/usr/share/common-licenses/GPL-2'.
+
+License: MIT
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the
+ "Software"), to deal in the Software without restriction, including
+ without limitation the rights to use, copy, modify, merge, publish,
+ distribute, sub license, and/or sell copies of the Software, and to
+ permit persons to whom the Software is furnished to do so, subject to
+ the following conditions:
+ .
+ The above copyright notice and this permission notice (including the
+ next paragraph) shall be included in all copies or substantial portions
+ of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/debian/deepin-editor.1 b/debian/deepin-editor.1
new file mode 100644
index 0000000000000000000000000000000000000000..502ce5afa7bb311a8c048c9634152bf42f7abd1d
--- /dev/null
+++ b/debian/deepin-editor.1
@@ -0,0 +1,28 @@
+.\" This file is processed to generate manpages in the
+.\" build diretory.
+.TH deepin-editor 1 "2020-11-17" "Deepin"
+.SH NAME
+deepin-editor \- the Text editor from UOS
+.SH SYNOPSIS
+.B deepin-editor
+[\fIPATH\fR]
+.SH DESCRIPTION
+Text editor for DDE (Deepin Desktop Environment).
+.PP
+This program does not accept any command line options.
+If the \fIPATH\fR is specified, open that file with .
+If the \fIPATH\fR is omitted, open deepin-editor and show nothing.
+If deepin-editor has been launched, open the Text with deepin-editor.
+Otherwise, launch deepin-editor and open the Text with it.
+.SH SEE ALSO
+https://www.deepin.org/en/original/deepin-editor/
+.SH AUTHOR
+.PP
+.B deepin-editor
+is written by Deepin Technology Co., Ltd.
+.PP
+This manual page was written by
+.MT tuqinggang@\:uniontech.com
+Tu Qinggang
+.ME
+for the Debian Project (but may be used by others).
diff --git a/debian/manpages b/debian/manpages
new file mode 100644
index 0000000000000000000000000000000000000000..84fa7c6e97526a01ffa8512fb141d7cb8a12bb6a
--- /dev/null
+++ b/debian/manpages
@@ -0,0 +1 @@
+debian/deepin-editor.1
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000000000000000000000000000000000000..865c6aa489923e19c5a3b12f9e64156d0ad509d2
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,21 @@
+#!/usr/bin/make -f
+
+export QT_SELECT=5
+include /usr/share/dpkg/default.mk
+
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+VERSION = $(DEB_VERSION_UPSTREAM)
+PACK_VER = $(shell echo $(VERSION) | awk -F'[+_~-]' '{print $$1}')
+
+# Uncomment this to turn on verbose mode.
+export DH_VERBOSE=1
+
+%:
+ dh $@
+
+override_dh_auto_configure:
+ dh_auto_configure -- \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DCMAKE_SAFETYTEST_ARG="CMAKE_SAFETYTEST_ARG_OFF" \
+ -DVERSION=$(PACK_VER)
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000000000000000000000000000000000000..163aaf8d82b6c54f23c45f32895dbdfdcc27b047
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/upstream/metadata b/debian/upstream/metadata
new file mode 100644
index 0000000000000000000000000000000000000000..8f8d54867e953975e85927d9bcf15e7808f0473e
--- /dev/null
+++ b/debian/upstream/metadata
@@ -0,0 +1,4 @@
+Bug-Database: https://github.com/linuxdeepin/deepin-editor/issues
+Bug-Submit: https://github.com/linuxdeepin/deepin-editor/issues/new
+Repository: https://github.com/linuxdeepin/deepin-editor.git
+Repository-Browse: https://github.com/linuxdeepin/deepin-editor
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000000000000000000000000000000000000..791832b69a1eda7fdcf5d8856994ea5903afb00b
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,8 @@
+# Compulsory line, this is a version 4 file
+version=4
+
+# GitHub hosted projects
+opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%deepin-editor-$1.tar.gz%" \
+ https://github.com/linuxdeepin/deepin-editor/tags \
+ (?:.*?/)?v?(\d[\d.]*)\.tar\.gz debian uupdate
+
diff --git a/deepin-editor-6.0.6.tar.gz b/deepin-editor-6.0.6.tar.gz
deleted file mode 100644
index 4e03d61bacca7953fe1568a250b9daa4633d21a5..0000000000000000000000000000000000000000
Binary files a/deepin-editor-6.0.6.tar.gz and /dev/null differ
diff --git a/deepin-editor.desktop b/deepin-editor.desktop
new file mode 100644
index 0000000000000000000000000000000000000000..5398cdd9333c02cb5df2a4ab2a2ef1c20f8c9303
--- /dev/null
+++ b/deepin-editor.desktop
@@ -0,0 +1,109 @@
+[Desktop Entry]
+Categories=Utility;TextEditor;
+Comment=Simple and easy to use text editor
+Exec=deepin-editor %F
+Icon=deepin-editor
+Name=Text Editor
+GenericName=Text Editor
+StartupNotify=false
+Type=Application
+X-Deepin-AppID=deepin-editor
+X-MultipleArgs=false
+X-Deepin-CreatedBy=com.deepin.dde.daemon.Launcher
+X-Deepin-Vendor=deepin
+# Translations:
+# Do not manually modify!
+Comment[ar]=محرر النصوص بسيط وسهل الاستخدام
+Comment[bo]=སྟབས་བདེ་ལ་སྤྱོད་བདེ་བའི་ཡིག་ཆ་རྩོམ་སྒྲིག་ཆས།
+Comment[br]=An aozer testennoù simpl hag aes d'ober gantañ
+Comment[ca]=Editor de text simple i fàcil d'usar
+Comment[cs]=Jednoduchý a snadno se používající textový editor
+Comment[da]=Simpel og letanvendelig teksteditor
+Comment[de]=Einfacher, leicht zu bedienender Texteditor
+Comment[es]=Editor de texto simple y fácil de usar
+Comment[et]=Lihtne ja kergesti kasutatav tekstiredaktor
+Comment[fi]=Yksinkertainen ja helppokäyttöinen tekstieditori
+Comment[fr]=Éditeur de texte simple et facile à utiliser
+Comment[gl_ES]=Editor de texto sinxelo e fácil de usar
+Comment[hr]=Jednostavan i lagan za korištenje uređivač teksta
+Comment[hu]=Letisztult és könnyen használható szövegszerkesztő
+Comment[it]=Editor di testo semplice e facile da usare. Localizzazione italiana a cura di Massimo A. Carofano.
+Comment[ko]=단순하고 사용하기 쉬운 텍스트 편집기
+Comment[lt]=Paprastas ir lengvas naudoti tekstų redaktorius
+Comment[ms]=Penyunting teks yang ringkas dan mudah digunakan
+Comment[nl]=Eenvoudig te gebruiken tekstbewerker
+Comment[pl]=Prosty i łatwy w użyciu edytor tekstu
+Comment[pt]=Editor de texto simples e fácil de usar
+Comment[pt_BR]=Um editor de texto simples e fácil de usar
+Comment[ru]=Простой и удобный текстовый редактор
+Comment[sq]=Përpunues tekstesh i thjeshtë dhe i kollajtë për t’u përdorur
+Comment[sr]=Уењђивач текста који је једноставан за употребу
+Comment[tr]=Basit ve kullanımı kolay metin düzenleyici
+Comment[ug]=ئاددىي، قوللىنىشچان تېكىست تەھرىرلىگۈچ
+Comment[uk]=Простий і доступний текстовий редактор
+Comment[zh_CN]=简单好用的文本编辑器
+Comment[zh_HK]=簡單好用的文本編輯器
+Comment[zh_TW]=簡單好用的文字編輯器
+GenericName[ar]=محرر النصوص
+GenericName[bo]=ཡིག་ཆ་རྩོམ་སྒྲུག་ཆས།
+GenericName[br]=Aozer testennoù
+GenericName[ca]=Editor de text
+GenericName[cs]=Textový editor
+GenericName[da]=Teksteditor
+GenericName[de]=Text Editor
+GenericName[es]=Editor de texto
+GenericName[et]=Tekstiredaktor
+GenericName[fi]=Tekstieditori
+GenericName[fr]=Éditeur de texte
+GenericName[gl_ES]=Editor de texto
+GenericName[hr]=Uređivač teksta
+GenericName[hu]=Szövegszerkesztő
+GenericName[it]=Editor di Testo
+GenericName[ko]=텍스트 편집기
+GenericName[lt]=Tekstų redaktorius
+GenericName[ms]=Penyunting Teks
+GenericName[nl]=Tekstbewerker
+GenericName[pl]=Edytor tekstu
+GenericName[pt]=Editor de texto
+GenericName[pt_BR]=Editor de Textos
+GenericName[ru]=Текстовый редактор
+GenericName[sq]=Përpunues Tekstesh
+GenericName[sr]=Уређивач Текста
+GenericName[tr]=Metin Düzenleyici
+GenericName[ug]=تېكىست تەھرىرلىگۈچ
+GenericName[uk]=Текстовий редактор
+GenericName[zh_CN]=文本编辑器
+GenericName[zh_HK]=文本編輯器
+GenericName[zh_TW]=文字編輯器
+MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-patch;text/x-adasrc;text/x-chdr;text/x-csrc;text/css;application/x-desktop;text/x-patch;text/x-fortran;text/html;text/x-java;text/x-tex;text/x-makefile;text/x-objcsrc;text/x-pascal;application/x-perl;application/x-perl;application/x-php;text/vnd.wap.wml;text/x-python;application/x-ruby;text/sgml;application/xml;model/vrml;image/svg+xml;application/json;
+Name[ar]=محرر نصوص ديبين
+Name[bo]=གཏིང་ཟབ་ཡིག་ཆ་རྩོམ་སྒྲིག་ཆས།
+Name[br]=Aozer testennoù Deepin
+Name[ca]=Editor de text del Deepin
+Name[cs]=Deepin textový editor
+Name[da]=Deepin teksteditor
+Name[de]=Deepin Text Editor
+Name[es]=Editor de texto
+Name[et]=Deepin tekstiredaktor
+Name[fi]=Deepin tekstieditori
+Name[fr]=Éditeur de texte Deepin
+Name[gl_ES]=Editor de texto Deepin
+Name[hr]=Deepin uređivač teksta
+Name[hu]=Deepin® Szövegszerkesztő
+Name[it]=Editor di Testo di Deepin
+Name[ko]=Deepin 텍스트 편집기
+Name[lt]=Deepin tekstų redaktorius
+Name[ms]=Penyunting Teks Deepin
+Name[nl]=Deepin Tekstbewerker
+Name[pl]=Edytor Tekstu Deepin
+Name[pt]=Editor de texto Deepin
+Name[pt_BR]=deepin Editor de Textos
+Name[ru]=Текстовый Редактор Deepin
+Name[sq]=Përpunues Tekstesh Deepin
+Name[sr]=Дипин Уређивач Текста
+Name[tr]=Deepin Metin Düzenleyici
+Name[ug]=Deepin تېكىست تەھرىرلىگۈچ
+Name[uk]=Текстовий редактор Deepin
+Name[zh_CN]=文本编辑器
+Name[zh_HK]=Deepin 文本編輯器
+Name[zh_TW]=Deepin 文字編輯器
diff --git a/install.pri b/install.pri
new file mode 100644
index 0000000000000000000000000000000000000000..3688d4d8e9d72bea99953c0865423c25fa31ca94
--- /dev/null
+++ b/install.pri
@@ -0,0 +1,32 @@
+isEmpty(PREFIX){
+ PREFIX = /usr
+}
+
+# Automating generation .qm files from .ts files
+CONFIG(release, debug|release) {
+ !system($$PWD/translate_generation.sh): error("Failed to generate translation")
+}
+
+target.path = $${PREFIX}/bin/
+
+desktop_files.path = $${PREFIX}/share/applications/
+desktop_files.files = $$PWD/*.desktop
+
+services.path = $${PREFIX}/share/dbus-1/system-services
+services.files = $$PWD/*.service
+
+policy.path = $${PREFIX}/share/polkit-1/actions/
+policy.files = $${PWD}/*.policy
+
+config.path = $${PREFIX}/share/dbus-1/system.d/
+config.files = $${PWD}/*.conf
+
+dman.path = $${PREFIX}/share/dman/
+dman.files = $$PWD/dman/*
+
+translations.path = $${PREFIX}/share/$${TARGET}/translations
+translations.files = $$PWD/translations/*.qm
+
+INSTALLS += target translations desktop_files services dman config policy
+
+
diff --git a/linglong.yaml b/linglong.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..6cc535433765dad83f3bead345c9fa07e226065c
--- /dev/null
+++ b/linglong.yaml
@@ -0,0 +1,47 @@
+package:
+ id: org.deepin.editor
+ name: "deepin-editor"
+ version: 5.10.13
+ kind: app
+ description: |
+ editor for deepin os.
+
+runtime:
+ id: org.deepin.Runtime
+ version: 23.0.0
+
+depends:
+ - id: "dde-qt-dbus-factory"
+ version: 5.5.12
+ type: runtime
+ - id: libchardet
+ version: 1.0.4
+ type: runtime
+ - id: kcodecs
+ version: 5.54.0
+ type: runtime
+ - id: "ksyntax-highlighting"
+ version: 5.54.0
+ type: runtime
+ - id: googletest
+ version: 1.8.1
+ - id: xcb-util
+ type: runtime
+variables:
+ extra_args: |
+ -DVERSION=${VERSION}
+source:
+ kind: local
+
+
+build:
+ kind: manual
+ manual:
+ configure: |
+ mkdir build
+ cd build
+ cmake -DCMAKE_INSTALL_PREFIX=${PREFIX} ${extra_args} ..
+ make -j6
+ #make test -j6
+ #test 用例包含从/usr/share读取内容,会导致失败
+ make -j install
diff --git a/misc/configs/org.deepin.editor.json b/misc/configs/org.deepin.editor.json
new file mode 100644
index 0000000000000000000000000000000000000000..5eb700c608c11c064361562232040c2a94c94e31
--- /dev/null
+++ b/misc/configs/org.deepin.editor.json
@@ -0,0 +1,17 @@
+{
+ "magic":"dsg.config.meta",
+ "version":"1.0",
+ "contents":{
+ "disableImproveGB18030":{
+ "value":false,
+ "serial":0,
+ "flags":[],
+ "name":"屏蔽提高GB18030编码识别率",
+ "name[zh_CN]":"屏蔽提高GB18030编码识别率",
+ "description[zh_CN]":"屏蔽提高中文环境下GB18030编码的识别率的策略,默认不屏蔽",
+ "description":"Block the strategy to improve the recognition rate of GB18030 encoding in the Chinese environment, the default is not blocked",
+ "permissions":"readwrite",
+ "visibility":"private"
+ }
+ }
+}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..39102571705327df7abe0cd00b344ec0aaffc227
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,112 @@
+if (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+ # generate qm files
+ execute_process(COMMAND bash "${CMAKE_SOURCE_DIR}/translate_generation.sh" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+endif ()
+
+# Sources files
+file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/*.h" "encodes/*.h" "common/*.h" "controls/*.h" "editor/*.h" "thememodule/*.h" "widgets/*.h")
+file(GLOB SRCS "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp" "encodes/*.cpp" "common/*.cpp" "controls/*.cpp" "editor/*.cpp" "thememodule/*.cpp" "widgets/*.cpp")
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR})
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/encodes)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/common)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/controls)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/editor)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/thememodule)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/widgets)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/lib/include)
+
+# Find the library
+find_package(PkgConfig REQUIRED)
+find_package(Qt5Widgets REQUIRED)
+find_package(Qt5DBus REQUIRED)
+find_package(Qt5Concurrent REQUIRED)
+find_package(Qt5PrintSupport REQUIRED)
+find_package(Qt5Gui REQUIRED)
+find_package(DtkWidget REQUIRED)
+find_package(DtkCore REQUIRED)
+find_package(KF5SyntaxHighlighting)
+find_package(KF5Codecs)
+find_package(DFrameworkdbus REQUIRED)
+find_package(Qt5Xml REQUIRED)
+find_package(Qt5Svg REQUIRED)
+find_package(ICU COMPONENTS i18n uc REQUIRED)
+include_directories(${Qt5Gui_PRIVATE_INCLUDE_DIRS})
+
+pkg_check_modules(chardet REQUIRED chardet)
+include_directories(${chardet_INCLUDE_DIRS})
+link_directories(${chardet_LIBRARY_DIRS})
+
+# Tell CMake to create the executable
+add_executable(deepin-editor ${SRCS} deepin-editor.qrc)
+target_link_libraries(deepin-editor
+ ${DtkWidget_LIBRARIES}
+ ${DtkCore_LIBRARIES}
+ ${Qt5Widgets_LIBRARIES}
+ ${Qt5DBus_LIBRARIES}
+ ${Qt5PrintSupport_LIBRARIES}
+ ${Qt5Concurrent_LIBRARIES}
+ ${DFrameworkdbus_LIBRARIES}
+ ${Qt5Xml_LIBRARIES}
+ ${Qt5Svg_LIBRARIES}
+ ${chardet_LIBRARY_DIRS}
+ KF5::Codecs
+ KF5::SyntaxHighlighting
+ ICU::i18n
+ ICU::uc
+ -lm
+ uchardet
+ chardet
+)
+
+if(DEFINED ENV{PREFIX})
+ set(CMAKE_INSTALL_PREFIX $ENV{PREFIX})
+else()
+ set(CMAKE_INSTALL_PREFIX /usr)
+endif()
+add_definitions(-DLINGLONG_PREFIX=\"${CMAKE_INSTALL_PREFIX}/\")
+
+# Install qm files
+file(GLOB QM_FILES "${CMAKE_SOURCE_DIR}/translations/*.qm")
+install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-editor/translations/)
+install(FILES ${APP_ICONPATH} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps/)
+install(FILES ${CMAKE_SOURCE_DIR}/src/images/deepin-editor.svg DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps/)
+
+#代码覆盖率开关
+if(CMAKE_COVERAGE_ARG STREQUAL "CMAKE_COVERAGE_ARG_ON")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -fprofile-arcs -ftest-coverage")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -fprofile-arcs -ftest-coverage")
+endif()
+
+# Install help manual
+#if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "loongarch64")
+# install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/assets/loongarch64/deepin-editor DESTINATION /usr/share/deepin-manual/manual-assets/application/)
+if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "sw_64")
+ if(DEFINED ENV{PREFIX})
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/assets/loongarch64/deepin-editor DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-manual/manual-assets/application/)
+ else()
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/assets/loongarch64/deepin-editor DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-manual/manual-assets/application/)
+ endif()
+else()
+ if(DEFINED ENV{PREFIX})
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/assets/deepin-editor DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-manual/manual-assets/application/)
+ else()
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/assets/deepin-editor DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-manual/manual-assets/application/)
+ endif()
+endif()
+
+install(TARGETS deepin-editor DESTINATION bin/)
+install(FILES ${CMAKE_SOURCE_DIR}/deepin-editor.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications/)
+install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/themes DESTINATION ${CMAKE_INSTALL_PREFIX}/share/deepin-editor/)
+
+# 安装 DConfig 配置文件,1040及以下的默认DTK环境不支持DConfig
+set(DCONFIG_APPID org.deepin.editor)
+file(GLOB DCONFIG_FILES "${CMAKE_SOURCE_DIR}/misc/configs/*.json")
+if(DEFINED DSG_DATA_DIR)
+ dconfig_meta_files(APPID ${DCONFIG_APPID} FILES ${DCONFIG_FILES})
+ message("-- DConfig is supported by DTK")
+else()
+ install(FILES ${DCONFIG_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dsg/configs/${DCONFIG_APPID})
+ message("-- DConfig is not supported by DTK")
+endif()
diff --git a/src/assets/deepin-editor/editor/common/+.svg b/src/assets/deepin-editor/editor/common/+.svg
new file mode 100755
index 0000000000000000000000000000000000000000..886d90a83e33497d134bdb3dcc864a5c2df53f20
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/+.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/-.svg b/src/assets/deepin-editor/editor/common/-.svg
new file mode 100755
index 0000000000000000000000000000000000000000..594bc2ea751b91367ea2f591570a8dd11665af0d
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/-.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/0.svg b/src/assets/deepin-editor/editor/common/0.svg
new file mode 100755
index 0000000000000000000000000000000000000000..aa142654920e12798821847ee94c8befaaf646bc
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/0.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/A.svg b/src/assets/deepin-editor/editor/common/A.svg
new file mode 100755
index 0000000000000000000000000000000000000000..909d1da3e635a9773456570aa8e60dde4594b21c
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/A.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/Alt.svg b/src/assets/deepin-editor/editor/common/Alt.svg
new file mode 100755
index 0000000000000000000000000000000000000000..5903a36f213ff9139f202fd40d321eeccc49775c
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/Alt.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/C.svg b/src/assets/deepin-editor/editor/common/C.svg
new file mode 100755
index 0000000000000000000000000000000000000000..c1540bf04cc6cbcbc2fa3a932986b24f5277a97a
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/C.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/Ctrl.svg b/src/assets/deepin-editor/editor/common/Ctrl.svg
new file mode 100755
index 0000000000000000000000000000000000000000..a2bb6738b2825beac7f2239a80b084919d82a780
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/Ctrl.svg
@@ -0,0 +1,16 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/Enter.svg b/src/assets/deepin-editor/editor/common/Enter.svg
new file mode 100755
index 0000000000000000000000000000000000000000..1994b268ad19ddbc1bca8156aaea6fdb2734e9bf
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/Enter.svg
@@ -0,0 +1,17 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/Esc.svg b/src/assets/deepin-editor/editor/common/Esc.svg
new file mode 100755
index 0000000000000000000000000000000000000000..ad8e4937c4a44195ae96a61aaef035250262b3d7
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/Esc.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/F.svg b/src/assets/deepin-editor/editor/common/F.svg
new file mode 100755
index 0000000000000000000000000000000000000000..781b440c8e5893a922ca485c468fe39a007d5b5b
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/F.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/F2.svg b/src/assets/deepin-editor/editor/common/F2.svg
new file mode 100755
index 0000000000000000000000000000000000000000..051adae452a5fd25d55b6df9ec3d34fb99589788
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/F2.svg
@@ -0,0 +1,14 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/G.svg b/src/assets/deepin-editor/editor/common/G.svg
new file mode 100755
index 0000000000000000000000000000000000000000..b57ed109bda0d42386f01c481e160fc0cd2f9083
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/G.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/H.svg b/src/assets/deepin-editor/editor/common/H.svg
new file mode 100755
index 0000000000000000000000000000000000000000..9542c98f0ce653729556a204e2a93a7c9f10f951
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/H.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/L.svg b/src/assets/deepin-editor/editor/common/L.svg
new file mode 100755
index 0000000000000000000000000000000000000000..bb0619d791ff2629b925023301668a356b6be906
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/L.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/N.svg b/src/assets/deepin-editor/editor/common/N.svg
new file mode 100755
index 0000000000000000000000000000000000000000..b7033ae0f1c987ed23028f806a287b47aa8d3383
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/N.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/O.svg b/src/assets/deepin-editor/editor/common/O.svg
new file mode 100755
index 0000000000000000000000000000000000000000..db272edec6ee99dbc68e8dc03d70ee82d41f6b5d
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/O.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/P.svg b/src/assets/deepin-editor/editor/common/P.svg
new file mode 100755
index 0000000000000000000000000000000000000000..8b549241262a344de3ff84b7b27f7998fc1c1fd3
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/P.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/QM.svg b/src/assets/deepin-editor/editor/common/QM.svg
new file mode 100755
index 0000000000000000000000000000000000000000..8b2af9aa6298185307895e429aaf6b4fffe6c57f
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/QM.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/S.svg b/src/assets/deepin-editor/editor/common/S.svg
new file mode 100755
index 0000000000000000000000000000000000000000..8272a7858f352ed776a1a62eb4f74ebdf2bf82bd
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/S.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/Shift.svg b/src/assets/deepin-editor/editor/common/Shift.svg
new file mode 100755
index 0000000000000000000000000000000000000000..cdc7ce5f0034473065cbd73a45c316e180d3b2c0
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/Shift.svg
@@ -0,0 +1,18 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/T.svg b/src/assets/deepin-editor/editor/common/T.svg
new file mode 100755
index 0000000000000000000000000000000000000000..9bc555095472c66c1e811da3899418644a2e79b5
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/T.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/U.svg b/src/assets/deepin-editor/editor/common/U.svg
new file mode 100755
index 0000000000000000000000000000000000000000..c6c24af89cb8dd344c3bad3243f5a440c344032b
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/U.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/W.svg b/src/assets/deepin-editor/editor/common/W.svg
new file mode 100755
index 0000000000000000000000000000000000000000..cb22b6f4a4ac4b7c6ddf42366ba6e222b33bc9ec
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/W.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/Z.svg b/src/assets/deepin-editor/editor/common/Z.svg
new file mode 100755
index 0000000000000000000000000000000000000000..574de2344bd49e866aa3eeb1f71e6a036191fd36
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/Z.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/attention.svg b/src/assets/deepin-editor/editor/common/attention.svg
new file mode 100755
index 0000000000000000000000000000000000000000..23149c05873259cd39721b8ee9c3ab7db86d64c5
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/attention.svg
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/bookmark_normal_light.svg b/src/assets/deepin-editor/editor/common/bookmark_normal_light.svg
new file mode 100755
index 0000000000000000000000000000000000000000..6076d18b77121724a2860fd23b7a703718bdf927
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/bookmark_normal_light.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/bookmarkbig_checked_light.svg b/src/assets/deepin-editor/editor/common/bookmarkbig_checked_light.svg
new file mode 100755
index 0000000000000000000000000000000000000000..d00210a172c209246dd1a23ed78e9c4fbba82508
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/bookmarkbig_checked_light.svg
@@ -0,0 +1,24 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/close_icon.svg b/src/assets/deepin-editor/editor/common/close_icon.svg
new file mode 100755
index 0000000000000000000000000000000000000000..9047265ccb0b8c83821e9059d80a56054121b02a
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/close_icon.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/deepin-editor.svg b/src/assets/deepin-editor/editor/common/deepin-editor.svg
new file mode 100755
index 0000000000000000000000000000000000000000..a8e6fb96946f0b97e35383bf77a1f457e93aef4e
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/deepin-editor.svg
@@ -0,0 +1,23 @@
+
diff --git a/src/assets/deepin-editor/editor/common/deepin_editor.svg b/src/assets/deepin-editor/editor/common/deepin_editor.svg
new file mode 100755
index 0000000000000000000000000000000000000000..ffb562a44c5c648709f9fa5e3cb1baf677e7200b
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/deepin_editor.svg
@@ -0,0 +1,23 @@
+
diff --git a/src/assets/deepin-editor/editor/common/deepin_launcher.svg b/src/assets/deepin-editor/editor/common/deepin_launcher.svg
new file mode 100755
index 0000000000000000000000000000000000000000..5793b3846b7fe6a5758379591215b16c7f9e1b52
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/deepin_launcher.svg
@@ -0,0 +1,43 @@
+
diff --git a/src/assets/deepin-editor/editor/common/icon_menu.svg b/src/assets/deepin-editor/editor/common/icon_menu.svg
new file mode 100755
index 0000000000000000000000000000000000000000..35dd6eacc54a933dc9ebc3f3010edfa7363fecc0
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/icon_menu.svg
@@ -0,0 +1,84 @@
+
+
diff --git a/src/assets/deepin-editor/editor/common/next.svg b/src/assets/deepin-editor/editor/common/next.svg
new file mode 100755
index 0000000000000000000000000000000000000000..ba61fc3e5f99464e7dec7b166beb64d40641b0cf
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/next.svg
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/next_down.svg b/src/assets/deepin-editor/editor/common/next_down.svg
new file mode 100755
index 0000000000000000000000000000000000000000..95baac3db611107248dc47f19ecf596aca8059aa
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/next_down.svg
@@ -0,0 +1,15 @@
+
+
+
+
diff --git a/src/assets/deepin-editor/editor/common/notes.svg b/src/assets/deepin-editor/editor/common/notes.svg
new file mode 100755
index 0000000000000000000000000000000000000000..e9a3aa60a51404c9390bfbea8d8ff09edc0e2e32
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/notes.svg
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/common/plus_icon.svg b/src/assets/deepin-editor/editor/common/plus_icon.svg
new file mode 100755
index 0000000000000000000000000000000000000000..6b69c7bc64ec9640a82bd3aac6a85939760d84df
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/plus_icon.svg
@@ -0,0 +1,10 @@
+
+
+
+
diff --git a/src/assets/deepin-editor/editor/common/tips.svg b/src/assets/deepin-editor/editor/common/tips.svg
new file mode 100755
index 0000000000000000000000000000000000000000..011c05f4b8f296867cd408a339230323fcbb28dd
--- /dev/null
+++ b/src/assets/deepin-editor/editor/common/tips.svg
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/en_US/editor.md b/src/assets/deepin-editor/editor/en_US/editor.md
new file mode 100644
index 0000000000000000000000000000000000000000..a35fe6917118cc9052064104aab454bb1f8ef210
--- /dev/null
+++ b/src/assets/deepin-editor/editor/en_US/editor.md
@@ -0,0 +1,299 @@
+# Text Editor|deepin-editor|
+
+## Overview
+
+Text Editor is a simple text editing tool. You can use it to write a simple text document, or make it a code editing tool with its advanced features which support code syntax highlighting.
+
+
+
+## Guide
+
+### Run Text Editor
+
+1. Click the Launcher icon  in the Dock to enter the Launcher interface.
+2. Locate Text Editor by scrolling the mouse wheel or searching "text editor" in the Launcher interface and click it to run.
+3. In Launcher, right-click Text Editor and you can:
+
+ - Click **Send to desktop** to create a desktop shortcut.
+ - Click **Send to dock** to fix it in the Dock.
+ - Click **Add to startup** to add it to startup and it will automatically run when system boots.
+
+### Exit Text Editor
+
+- On the Text Editor interface, click  to exit.
+- On the Text Editor interface, click  > **Exit** to exit.
+- Right-click  in the Dock and select **Close All** to exit.
+
+### View Shortcuts
+
+On the Text Editor Interface, press **Ctrl + Shift + ?** to view all the shortcuts. You can also check shortcuts in Settings. Proficiency in shortcuts will greatly improve your efficiency.
+
+
+
+## Basic Operations
+
+### Manage Tabs
+
+- Create New Tabs/Windows
+ - Click or > **New tab** on the title bar or press **Ctrl + T** to create a new tab.
+ - Click > **New window** or press **Ctrl + N** to create a new window.
+
+- Adjust Tabs/Windows
+ - Drag the tab in the same window to reorder tabs.
+ - Scroll the mouse wheel on the title of a tab to reorder tabs in the same window.
+ - Move the tab out of the window to create a new window or move the tab from one window to another.
+
+- Close Tabs /Windows
+
+ The window will be closed as well when there is only one tab in the window.
+
+ - Press **Ctrl + W** to close the file on the file interface.
+ - Move the cursor to the file title, and click the  icon there or the mouse middle button to close the file.
+ - Right-click the file title and select **Close tab** or **Close other tabs** or **More options** to close the tabs.
+
+>  Notes: If you make changes to the file but does not save it, you will be prompted by Text Editor to save before closing the file.
+
+### Open Files
+
+You can open one or multiple text files at one time in the following ways, and the selected file will open in the new tab:
+
+- Drag the file directly to the Text Editor interface or the Text Editor icon.
+- Right-click the file and select **Open with** > **Text Editor**. After selecting Text Editor as the default application for text files in Control Center, you can double-click the file to open it directly.
+- On the Text Editor interface, click > **Open file**, or use the shortcuts **Ctrl + O** to open the file in File Manager.
+
+### Save Files
+
+- Press **Ctrl + S** or click > **Save** to save the current document.
+- Press **Ctrl + Shift + S** or click > **Save as** to save the file as a new one.
+
+### Print Files
+
+To print a file in Text Editor, you should connect and set up the printer first.
+
+1. Click > **Print**, or press **Ctrl + P** to open the print preview interface.
+2. On the preview interface, preview the document,select a printer and set the printing page.
+3. Click the **Advanced** option on the preview interface to select parameters including paper size and layout.
+4. Click **Print** to start printing.
+
+
+
+
+
+## Edit Texts
+
+### Move Cursor
+
+In addition to the arrow keys and mouse clicks, you can also use the following shortcuts to move the cursor quickly:
+
+| Function | Shortcuts |
+| --------------- | ------------ |
+| Save cursor position | Ctrl + Shift + > |
+| Reset cursor position (Jump to cursor last saving position) | Ctrl + Shift + < |
+| Forward one word (Jump forward over one word) | Ctrl + Right |
+| Backward one word (Jump backward over one word) | Ctrl + Left |
+| Move to end of line | End |
+| Move to start of line | Home |
+| Move to end of text | Ctrl + End |
+| Move to start of text | Ctrl + Home |
+| Move to line indentation | Ctrl + M |
+| Forward over a pair (Jump forward after the right parenthesis) | Alt + P |
+| Backward over a pair (Jump backward before the left parenthesis) | Alt + N |
+
+### Change Cases
+
+It helps you change the case of selected text. You can change it to lowercase, uppercase, or capitalize the initial.
+
+1. Select the text.
+2. Right-click and select **Change Case**.
+3. Choose **Upper Case**, **Lower Case**, or **Capitalize**. The changes will take effect immediately.
+
+You can also use **Alt** + **U / L / C** to quickly switch the cases.
+
+
+
+### Highlight Texts
+Text Editor supports highlighting different kinds of texts.
+
+Click the triangle symbol at the far right corner of the status bar at the bottom, and select the type of text you want to highlight. The corresponding contents in the text will be highlighted automatically.
+
+
+
+### Delete Texts
+
+In addition to deleting characters one by one, you can quickly delete characters by using the following shortcuts:
+
+| Function | Shortcuts |
+| --------------- | ------------ |
+| Delete to end of line | Ctrl + K |
+| Delete current line | Ctrl + Shift + K |
+| Delete one word backward | Alt + Shift + N |
+| Delete one word forward | Alt + Shift + M |
+
+### Undo
+
+If you make an incorrect operation, press **Ctrl + Z** to undo it, or right-click to select **Undo**.
+
+### Find Texts
+
+1. Click  and select **Find**, or press **Ctrl** + **F** to open the "Find" box below.
+2. Input the text you want to find.
+3. Click **Previous** /**Next** to find each match, or press the **Enter** key to find the next match.
+4. Press the **Esc** key or click the close icon to close the dialog box.
+
+> Tips: Select the text and conduct search. The text selected will be automatically displayed in the **Find** box.
+
+### Replace Texts
+1. Click , and select **Replace**, or press **Ctrl + H** to open the **Replace** box below.
+2. Input the text to be replaced and the new text.
+3. Click **Replace** to replace the matches one by one and click **Replace Rest** and **Replace All** to replace the rest or all the matches at once. Click **Skip** to skip the current matching text.
+4. Press **Esc** or click the close icon to close the dialog box.
+
+### Go to Line
+Use Go to Line to jump to the specific line directly.
+Right-click and select **Go to Line**, or press **Ctrl + G** and then input the line number to go to that line.
+
+### Edit Line
+
+Use the shortcuts below to edit lines easily:
+
+| Function | Shortcuts |
+| ------------ | ------------ |
+| New line above (Insert one line above) | Ctrl + Enter |
+| New line below (Insert one line below) | Ctrl + Shift + Enter |
+| Duplicate line | Ctrl + Shift + D |
+| Swap line up (Swap the current line with above line) | Ctrl + Shift + Up |
+| Swap line down (Swap the current line with below line) | Ctrl + Shift + Down |
+| Scroll up one line | Super + Shift + Up |
+| Scroll down one line | Super + Shift + Down |
+| Mark | Alt + H |
+| Unmark | Alt + Shift + H |
+| Copy line | Super + C |
+| Cut line | Super + X |
+| Merge lines | Ctrl + J |
+
+### Enable/Disable Read-only Mode
+
+1. Open the document with Text Editor and right-click to select **Turn on Read-only Mode**.
+
+
+
+
+2. Right-click to select **Turn off Read-only Mode** under the read-only mode.
+
+
+
+
+### Use Column Mode
+
+Press and hold the **Alt** key on the keyboard, drag the mouse to select multiple lines, and edit the identical contents in multiple lines of codes efficiently by using the column mode function.
+
+
+
+### Color Mark
+
+Select the text to be marked in Text Editor, right-click to select **Color Mark** and select the corresponding options in the drop-down list as needed.
+
+
+
+
+- Select **Mark** to mark a certain line or a paragraph of texts. You can choose from 8 colors displayed through icons.
+ - Place the cursor at any line and you can mark the current line.
+ - Select a paragraph of texts and you can mark the selected texts.
+- Select **Mark All** to mark all the contents in Text Editor, or mark all the matching contents of selected texts in Text Editor. You can choose from 8 colors displayed through icons.
+ - Place the cursor at any line and you can mark all contents.
+ - Select any content and you can mark the same content in the whole document.
+- Select **Clear Last Mark** to cancel the last mark operation.
+- Select **Clear All Marks** to cancel all the current marks.
+
+
+### Manage Bookmarks
+
+Check **Show bookmarks icon** in **Settings** and you can add a bookmark for any line on the Text Editor interface. The icon  shows up when you move the cursor to any line in the left column, and the icon  will appear after a bookmark is successfully added.
+
+- Add bookmarks
+
+ + Click  to add a bookmark for the line.
+ + Right-click  and select **Add bookmark** to add a bookmark for the line.
+ + Place the cursor on any line and press **Ctrl + F2** to add a bookmark for the line.
+
+- Delete bookmarks
+
+ + Click the colored bookmark icon  to delete the bookmark of the line directly.
+ + Right-click the colored bookmark icon  to select **Remove Bookmark** to delete the bookmark in the line.
+ + Right-click a bookmark to select **Remove All Bookmarks** to delete all the bookmarks in the text.
+ >Notes: The bookmark icon appears only when cursor is hovered over to the left of the line number in the left column; when it's moved beyond the left bookmark column, the bookmark icon will disappear. The bookmark icon will always be displayed after being added.
+
+
+### Manage Comments
+
+You can add comments to any text with a code type suffix, such as cpp and java, among others.
+
+- Add comments
+ - Select the text needed and right-click to select **Add Comment**.
+ - Select the text needed and press **Alt + A** to add comments.
+
+- Cancel comments
+ - Select the text with comments, and right-click to select **Remove Comment**.
+- Select the text with comments, and press **Alt + Z** to cancel comments.
+
+
+> Notes: This supports comments in different languages. Please refer to actual conditions for detailed information. For example, comment symbol for C, C# and Java is // and comment symbol for Python is #.
+
+## Main Menu
+
+On the main menu, you can Create New Windows, Create New Files, [Find Texts](#Find Texts), [Replace Texts](#Replace Texts), [Save Files](#Save Files), switch window themes, view help manual, and get more information about Text Editor.
+
+### Settings
+
+You can set the basic information, shortcuts and advanced information in settings.
+
+#### Basic Settings
+
+Click > **Settings** and you can perform the following in the Settings window:
+
+- Select the Font and Font Size.
+- Check or uncheck **Word wrap**.
+- Check **Code folding flag** and  or  are displayed in the edit area. Right-click to select **Fold/Unfold Current Level** or **Fold/Unfold All** to perform the corresponding operations.
+- Check **Show line numbers** to display the line number in the edit area.
+- Check **Highlight current line** to highlight the current line.
+- Check **Show bookmarks icon** to display the bookmarks in the text.
+- Check **Show whitespaces and tabs** to display all the white spaces and tabs. You can also input or delete white spaces and tabs manually.
+
+> Tips: You can also use **Ctrl + “+”/ “-”** to adjust the font size, and press **Ctrl + 0** to restore default font size.
+
+#### Shortcuts Settings
+1. Click > **Settings** to view the current shortcut in the **Shortcuts** option.
+2. Select a keymap in **Shortcuts** and view the shortcuts.
+3. You can click and customize new shortcuts.
+
+> Notes: You can choose a proper keymap to fit your habits, including standard keymap, Emacs keymap, or customize it as you like.
+
+#### Advanced Settings
+
+1. Click > **Settings**.
+2. In the **Advanced** option, you can set:
+ - Window size: Normal, Maximum, or Full screen;
+ - Tab width: The indentation width when pressing Tab.
+
+
+### Theme
+
+The window theme provides three theme types, namely Light Theme, Dark Theme and System Theme.
+
+1. On the Text Editor interface, click .
+2. Click **Theme** to select one theme.
+
+### Help
+
+1. On the Text Editor interface, click .
+2. Select **Help** to view the manual of Text Editor.
+
+### About
+
+1. On the Text Editor interface, click .
+2. Select **About** to view the version and introduction of Text Editor.
+
+### Exit
+
+1. On the Text Editor interface, click .
+2. Click **Exit** to exit Text Editor.
diff --git a/src/assets/deepin-editor/editor/en_US/fig/advanced-preview.png b/src/assets/deepin-editor/editor/en_US/fig/advanced-preview.png
new file mode 100644
index 0000000000000000000000000000000000000000..b12ff1347c2ff1fc6d17805d44cc215b9b234d81
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/advanced-preview.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/changecase.png b/src/assets/deepin-editor/editor/en_US/fig/changecase.png
new file mode 100644
index 0000000000000000000000000000000000000000..0f94f0f94b70e3a1e65bba684599dffda3985870
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/changecase.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/colormark.png b/src/assets/deepin-editor/editor/en_US/fig/colormark.png
new file mode 100644
index 0000000000000000000000000000000000000000..ed393530f486cfd88c0e53881cbc6e1862edb8fb
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/colormark.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/column mode.png b/src/assets/deepin-editor/editor/en_US/fig/column mode.png
new file mode 100644
index 0000000000000000000000000000000000000000..bc478448411363235bb3294c199cafe260b817ac
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/column mode.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/d_changecase.png b/src/assets/deepin-editor/editor/en_US/fig/d_changecase.png
new file mode 100644
index 0000000000000000000000000000000000000000..53176e9378f77cac57e98266633c28c3bb5ebc90
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/d_changecase.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/d_colormark.png b/src/assets/deepin-editor/editor/en_US/fig/d_colormark.png
new file mode 100644
index 0000000000000000000000000000000000000000..ee19302f254db85d79cd7a1dbf3920533ee83875
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/d_colormark.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/d_readonly.png b/src/assets/deepin-editor/editor/en_US/fig/d_readonly.png
new file mode 100644
index 0000000000000000000000000000000000000000..13c25165f661754080ac0b8fbace48e935ed1138
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/d_readonly.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/d_turnoffreadonly.png b/src/assets/deepin-editor/editor/en_US/fig/d_turnoffreadonly.png
new file mode 100644
index 0000000000000000000000000000000000000000..12a65856d37692ad03e203507ed05ada144afd21
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/d_turnoffreadonly.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/highlight.png b/src/assets/deepin-editor/editor/en_US/fig/highlight.png
new file mode 100644
index 0000000000000000000000000000000000000000..0b561fa4cf89da7627d88279df78209384d1538e
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/highlight.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/hotkey.png b/src/assets/deepin-editor/editor/en_US/fig/hotkey.png
new file mode 100644
index 0000000000000000000000000000000000000000..d046a1d3d405db2050d1a3dec831906c6c50f2f1
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/hotkey.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/mark.png b/src/assets/deepin-editor/editor/en_US/fig/mark.png
new file mode 100644
index 0000000000000000000000000000000000000000..2d49df34f09e43372b9478381969d3d19102555b
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/mark.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/overview.png b/src/assets/deepin-editor/editor/en_US/fig/overview.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce8e1b6c31ae66c186b22a30e67e98809495d5c9
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/overview.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/overviewx2.jpg b/src/assets/deepin-editor/editor/en_US/fig/overviewx2.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..626835806e1f4751970f9de1f083246c28b655c0
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/overviewx2.jpg differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/pagesetup.png b/src/assets/deepin-editor/editor/en_US/fig/pagesetup.png
new file mode 100644
index 0000000000000000000000000000000000000000..af37bba809612860509fddb4cb33aa4ad5075e79
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/pagesetup.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/preview.png b/src/assets/deepin-editor/editor/en_US/fig/preview.png
new file mode 100644
index 0000000000000000000000000000000000000000..88ad6e0b5735bbd793a89aac5dfc4162c1f16f7a
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/preview.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/printer.png b/src/assets/deepin-editor/editor/en_US/fig/printer.png
new file mode 100644
index 0000000000000000000000000000000000000000..e7e386de11866008179399223b542ab1952be2bb
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/printer.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/read_only.png b/src/assets/deepin-editor/editor/en_US/fig/read_only.png
new file mode 100644
index 0000000000000000000000000000000000000000..6a67a2375e880e366cdd397fb79c81a86d6c5469
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/read_only.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/read_only_02.png b/src/assets/deepin-editor/editor/en_US/fig/read_only_02.png
new file mode 100644
index 0000000000000000000000000000000000000000..8dac668ec8614d9c8a6b954eab16c830e37b168a
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/read_only_02.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/reading.png b/src/assets/deepin-editor/editor/en_US/fig/reading.png
new file mode 100644
index 0000000000000000000000000000000000000000..0089c2cf21bb0247ffbea65eead4b7798d9819cc
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/reading.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/shortcuts.jpg b/src/assets/deepin-editor/editor/en_US/fig/shortcuts.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a109071e5aec5af0e6f8dcb18ec923c0812b07ce
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/shortcuts.jpg differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/shortcutsx2.jpg b/src/assets/deepin-editor/editor/en_US/fig/shortcutsx2.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..d595feed21482567d3dc5383ef39452c58574c85
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/shortcutsx2.jpg differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/texttospeech.png b/src/assets/deepin-editor/editor/en_US/fig/texttospeech.png
new file mode 100644
index 0000000000000000000000000000000000000000..41c37956862e9948f322891fc630f1643b7e950e
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/texttospeech.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/translate.png b/src/assets/deepin-editor/editor/en_US/fig/translate.png
new file mode 100644
index 0000000000000000000000000000000000000000..7c2999b7c5378109de08573a245be9a3f69db7b4
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/translate.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/fig/translation.png b/src/assets/deepin-editor/editor/en_US/fig/translation.png
new file mode 100644
index 0000000000000000000000000000000000000000..6b401d0b3033a8eb4c1a34269751f711bf783ca0
Binary files /dev/null and b/src/assets/deepin-editor/editor/en_US/fig/translation.png differ
diff --git a/src/assets/deepin-editor/editor/en_US/p_editor.md b/src/assets/deepin-editor/editor/en_US/p_editor.md
new file mode 100644
index 0000000000000000000000000000000000000000..477b41ff72fe9b88c2f305dcc75a2499b697e315
--- /dev/null
+++ b/src/assets/deepin-editor/editor/en_US/p_editor.md
@@ -0,0 +1,310 @@
+# Text Editor|deepin-editor|
+
+## Overview
+
+Text Editor is a simple text editing tool. You can use it to write a simple text document, or make it a code editing tool with its advanced features which support code syntax highlighting.
+
+
+
+## Guide
+
+### Run Text Editor
+
+1. Click the Launcher icon  in the Dock to enter the Launcher interface.
+2. Locate Text Editor  by scrolling the mouse wheel or searching "text editor" in the Launcher interface, and click it to run.
+3. In Launcher, right-click Text Editor to:
+ - Click **Send to desktop** to create a desktop shortcut.
+ - Click **Send to dock** to fix it in the Dock.
+ - Click **Add to startup** to add the application to startup, and it will automatically run when the system starts up.
+
+### Exit Text Editor
+
+- On the Text Editor interface, click  to exit.
+- On the Text Editor interface, click > **Exit** to exit.
+- Right-click  in the Dock, and select **Close All** to exit.
+
+### View Shortcuts
+
+On the Text Editor Interface, press **Ctrl** + **Shift** + **?** to view all the shortcuts. You can also check shortcuts in the Settings. Proficiency in shortcuts will greatly improve your efficiency.
+
+
+
+## Basic Operations
+
+### Manage Tabs
+
+- Create New Tabs/Windows
+ - Click or > **New tab** on the title bar or press **Ctrl + T** to create a new tab.
+ - Click > **New window** or press **Ctrl + N** to create a new window.
+
+- Adjust Tabs/Windows
+ - Drag the tab in the same window to reorder tabs.
+ - Scroll the mouse wheel on the title of a tab to reorder tabs in the same window.
+ - Move the tab out of the window to create a new window or move the tab from one window to another.
+
+- Close Tabs /Windows
+
+ The window will be closed as well when there is only one tab in the window.
+
+ - Press **Ctrl + W** to close the file on the file interface.
+ - Move the cursor to the file title, and click the  icon there or the mouse middle button to close the file.
+ - Right-click the file title and select **Close tab** or **Close other tabs** or **More options** to close the tabs.
+
+>  Notes: If you make changes to the file but does not save it, you will be prompted by Text Editor to save before closing the file.
+
+### Open Files
+
+You can open one or multiple text files at one time in the following ways, and the selected file will open in the new tab:
+
+- Drag the file directly to the Text Editor interface or the Text Editor icon.
+- Right-click the file and select **Open with** > **Text Editor**. After selecting Text Editor as the default application for text files in Control Center, you can double-click the file to open it directly.
+- On the Text Editor interface, click > **Open file**, or use the shortcuts **Ctrl + O** to open the file in File Manager.
+
+### Save Files
+
+- Press **Ctrl + S** or click > **Save** to save the current document.
+- Press **Ctrl + Shift + S** or click > **Save as** to save the file as a new one.
+
+### Print Files
+
+To print a file in the Text Editor interface, you should connect and set up the printer first.
+
+1. Click > **Print**, or press **Ctrl + P** to open the print preview interface.
+2. On the preview interface, preview the document, select a printer, and set the printing page.
+3. Click the **Advanced** option on the preview interface to select parameters including paper size and layout.
+4. Click **Print** to start printing at the printer selected.
+
+
+
+
+
+## Edit Texts
+
+### Move Cursor
+
+In addition to the arrow keys and mouse clicks, you can also use the following shortcuts to move the cursor quickly:
+
+| Function | Shortcuts |
+| --------------- | ------------ |
+| Save cursor position | Ctrl + Shift + > |
+| Reset cursor position (Jump to cursor last saving position) | Ctrl + Shift + < |
+| Forward one word (Jump forward over one word) | Ctrl + Right |
+| Backward one word (Jump backward over one word) | Ctrl + Left |
+| Move to end of line | End |
+| Move to start of line | Home |
+| Move to end of text | Ctrl + End |
+| Move to start of text | Ctrl + Home |
+| Move to line indentation | Ctrl + M |
+| Forward over a pair (Jump forward after the right parenthesis) | Alt + P |
+| Backward over a pair (Jump backward before the left parenthesis) | Alt + N |
+
+### Change Cases
+
+It helps you change the case of selected text. You can change it to lowercase, uppercase, or capitalize the initial.
+
+1. Select the text.
+2. Right-click and select **Change Case**.
+3. Choose **Upper Case**, **Lower Case**, or **Capitalize**. The changes will take effect immediately.
+
+You can also use **Alt** + **U/L/C** to quickly switch the cases.
+
+
+
+### Highlight Texts
+Text Editor supports highlighting different kinds of texts.
+
+Click the triangle symbol at the far right corner of the status bar at the bottom, and select the type of text you want to highlight. The corresponding contents in the text will be highlighted automatically.
+
+
+
+### Delete Texts
+
+In addition to deleting characters one by one, you can quickly delete characters by using the following shortcuts:
+
+| Function | Shortcuts |
+| --------------- | ------------ |
+| Delete to end of line | Ctrl + K |
+| Delete current line | Ctrl + Shift + K |
+| Delete one word backward | Alt + Shift + N |
+| Delete one word forward | Alt + Shift + M |
+
+### Undo
+
+If you make an incorrect operation, press **Ctrl + Z** to undo it, or right-click and select **Undo**.
+
+### Find Texts
+
+1. Click  > **Find**, or press **Ctrl + F** to open the **Find** box in the bottom of the Text Editor interface.
+2. Input the text you want to find.
+3. Click **Previous**/**Next** to find each match, or press the **Enter** key to find the next match.
+4. Press the **Esc** key or click the close icon to close the dialog box.
+
+> Tips: Select the text and conduct search. The text selected will be automatically displayed in the **Find** box.
+
+### Replace Texts
+1. Click  > **Replace**, or press **Ctrl + H** to open the **Replace** box in the bottom of the Text Editor interface.
+2. Input the text to be replaced and the new text.
+3. Click **Replace** to replace the matches one by one, and click **Replace Rest** and **Replace All** to replace the rest or all the matches at once. Click **Skip** to skip the current matching text.
+4. Press **Esc** or click the close icon to close the dialog box.
+
+### Go to Line
+Use Go to Line to jump to the specific line directly.
+
+Right-click and select **Go to Line**; or press **Ctrl + G**, and then input the line number to go to that line.
+
+### Edit Line
+
+Use the shortcuts below to edit lines easily:
+
+| Function | Shortcuts |
+| ------------ | ------------ |
+| New line above (Insert one line above) | Ctrl + Enter |
+| New line below (Insert one line below) | Ctrl + Shift + Enter |
+| Duplicate line | Ctrl + Shift + D |
+| Swap line up (Swap the current line with above line) | Ctrl + Shift + Up |
+| Swap line down (Swap the current line with below line) | Ctrl + Shift + Down |
+| Scroll up one line | Super + Shift + Up |
+| Scroll down one line | Super + Shift + Down |
+| Mark | Alt + H |
+| Unmark | Alt + Shift + H |
+| Copy line | Super + C |
+| Cut line | Super + X |
+| Merge lines | Ctrl + J |
+
+### Enable/Disable Read-only Mode
+
+1. Open the document with Text Editor, right-click on the Text Editor interface, and select **Turn on Read-Only mode**.
+
+
+
+
+2. Right-click on the Text Editor interface, and select **Turn off Read-Only mode** under the read-only mode.
+
+
+
+### Text to Speech
+
+You can perform the following operations after enabling the Text to Speech and Speech to Text features in the Control Center.
+
+1. Right-click and select **Speech to Text**. The input voices through microphone will be converted to texts and can be edited in the document.
+2. Select a paragraph of texts. Right-click it and select **Text to Speech**. The texts selected will be broadcast.
+
+>  Notes: The **Text to Speech** option in the right-click menu is grayed out and cannot be activated when no text is selected.
+
+
+
+### Translate
+
+1. Enable **Translation** in **Control Center** > **Assistive Tools** and set the corresponding language pairs according to your needs.
+2. Select the texts to be translated in Text Editor. Right-click and select **Translate**, and the texts selected will be translated into the target language.
+
+
+
+### Use Column Mode
+
+Press and hold the **Alt** key on the keyboard, drag the mouse to select multiple lines, and edit the identical contents in multiple lines of codes efficiently by using the column mode function.
+
+
+
+### Color Mark
+
+Select the text to be marked in Text Editor, right-click to select **Color Mark**, and select the corresponding options in the drop-down list as needed.
+
+
+
+
+- Select **Mark** to mark a certain line or a paragraph of texts. You can choose from 8 colors displayed through icons.
+ - Place the cursor at any line and you can mark the current line.
+ - Select a paragraph of texts and you can mark the selected texts.
+- Select **Mark All** to mark all the contents in Text Editor, or mark all the matching contents of selected texts in Text Editor. You can choose from 8 colors displayed through icons.
+ - Place the cursor at any line and you can mark all contents.
+ - Select any content and you can mark the same content in the whole document.
+- Select **Clear Last Mark** to cancel the last mark operation.
+- Select **Clear All Marks** to cancel all the current marks.
+
+### Manage Bookmarks
+
+Check **Show bookmarks icon** in **Settings** and you can add a bookmark for any current line on the Text Editor interface. The icon  shows up when you move the cursor to any line in the left column, and the icon  will appear after a bookmark is successfully added.
+
+- Add bookmarks
+ + Click  to add a bookmark for the line.
+ + Right-click  and select **Add bookmark** to add a bookmark for the line.
+ + Place the cursor on any line, and press **Ctrl + F2** to add a bookmark for the line.
+
+- Delete bookmarks
+ + Click the colored bookmark icon  to delete the bookmark of the line directly.
+ + Right-click the colored bookmark icon  , and select **Remove Bookmark** to delete the bookmark in the line.
+ + Right-click a bookmark, and select **Remove All Bookmarks** to delete all the bookmarks in the text.
+ > Notes: The bookmark icon appears only when cursor is hovered over to the left of the line number in the left column; when it's moved beyond the left bookmark column, the bookmark icon will disappear. The bookmark icon will always be displayed after being added.
+
+### Manage Comments
+
+You can add comments to any text with a code type suffix, such as cpp and java, among others.
+
+- Add comments
+ - Select the text needed, and right-click to select **Add Comment**.
+ - Select the text needed, and press **Alt + A** to add comments.
+
+- Cancel comments
+ - Select the text with comments, and right-click to select **Remove Comment**.
+ - Select the text with comments, and press **Alt + Z** to cancel comments.
+
+>  Notes: This supports comments in different languages. Please refer to actual conditions for detailed information. For example, comment symbol for C, C# and Java is //, and comment symbol for Python is #.
+
+## Main Menu
+
+On the main menu, you can Create New Windows, Create New Files, [Find Texts](#Find Texts), [Replace Texts](#Replace Texts), [Save Files](#Save Files), switch window themes, view help manual, and get more information about Text Editor.
+
+### Settings
+
+You can set the basic information, shortcuts, and advanced information in settings.
+
+#### Basic Settings
+
+Click > **Settings** and you can perform the following in the **Basic** option:
+
+- Select the Font and Font Size.
+- Check or uncheck **Word wrap**.
+- Check **Code folding flag** and  or  are displayed in the edit area. Right-click and select **Fold/Unfold Current Level** or **Fold/Unfold All** to perform the corresponding operations.
+- Check **Show line numbers** to display the line number in the edit area.
+- Check **Highlight current line** to highlight the current line.
+- Check **Show bookmarks icon** to display the bookmarks in the text.
+- Check **Show whitespaces and tabs** to display all the white spaces and tabs. You can also input or delete white spaces and tabs manually.
+
+>  Tips: You can also use **Ctrl + “+”/ “-”** to adjust the font size, and press **Ctrl + 0** to restore to default font size.
+
+#### Shortcuts Settings
+1. Click > **Settings** to view the current shortcut in the **Shortcuts** option.
+2. Select a keymap in **Shortcuts** and view the shortcuts.
+3. You can click and customize new shortcuts.
+
+>  Notes: You can choose a proper keymap to fit your habits, including standard keymap, Emacs keymap, or customize it as you like.
+
+#### Advanced Settings
+
+1. Click > **Settings**.
+2. In the **Advanced** option, you can set:
+ - Window size: Normal, Maximum, or Fullscreen;
+ - Tab width: The width of a tab character.
+
+### Theme
+
+The window theme provides three theme types, namely Light Theme, Dark Theme, and System Theme.
+
+1. On the Text Editor interface, click .
+2. Click **Theme** to select one theme.
+
+### Help
+
+1. On the Text Editor interface, click .
+2. Select **Help** to view the manual of Text Editor.
+
+### About
+
+1. On the Text Editor interface, click .
+2. Select **About** to view the version and introduction of Text Editor.
+
+### Exit
+
+1. On the Text Editor interface, click .
+2. Click **Exit** to exit Text Editor.
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/zh_CN/editor.md b/src/assets/deepin-editor/editor/zh_CN/editor.md
new file mode 100755
index 0000000000000000000000000000000000000000..507a1c3e4ad00bc116f70adc07b2631313ed802c
--- /dev/null
+++ b/src/assets/deepin-editor/editor/zh_CN/editor.md
@@ -0,0 +1,322 @@
+# 文本编辑器|deepin-editor|
+
+## 概述
+
+文本编辑器是一个简单的文本编辑工具。您可以用它书写简单的文本文档,也可以使用它的高级特性,让它成为一个代码编辑工具,支持代码语法高亮。
+
+
+
+## 使用入门
+
+### 运行文本编辑器
+
+1. 单击任务栏上的启动器图标 ,进入启动器界面。
+2. 上下滚动鼠标滚轮浏览或通过搜索,找到文本编辑器图标 ,单击运行。
+3. 右键单击,您可以:
+
+ - 单击 **发送到桌面**,在桌面创建快捷方式。
+ - 单击 **发送到任务栏**,将应用程序固定到任务栏。
+ - 单击 **开机自动启动**,将应用程序添加到开机启动项,在电脑开机时自动运行该应用。
+
+### 退出文本编辑器
+
+- 在文本编辑器界面,单击 ,退出文本编辑器。
+- 在文本编辑器界面,单击主菜单  > **退出** ,退出文本编辑器。
+- 在任务栏右键单击 ,选择 **关闭所有** ,退出文本编辑器。
+
+
+### 查看快捷键
+
+在文本编辑器界面,使用快捷键 **Ctrl + Shift + ?** 打开快捷键预览界面,您也可以在设置界面查看快捷键。熟练地使用快捷键,将大大提升您的操作效率。
+
+
+
+## 基本操作
+
+### 管理标签页
+
+- 新建标签页/窗口
+
+ - 单击标签页上的按钮  或  > **新标签页** 或使用快捷键 **Ctrl + T** 创建一个新的标签页。
+ - 单击 > **新窗口** 或使用快捷键 **Ctrl + N** 创建一个新的窗口。
+
+- 调整标签页/窗口
+
+ - 拖拽同一窗口内的标签页重新排序。
+ - 滚动鼠标切换同一窗口内的标签页。
+ - 移出标签页创建一个新的窗口,或者从一个窗口移到另外一个窗口中。
+
+- 关闭标签页/窗口
+
+ 当窗口中仅有一个标签页时,关闭标签页的同时也会关闭窗口。
+ - 使用快捷键 **Ctrl + W** 关闭当前标签页。
+ - 单击标签页上的按钮  或者单击鼠标中键,关闭当前标签页。
+ - 右键单击标签页,选择 **关闭标签页** 、**关闭其他标签页** 或 **更多关闭方式** 来关闭标签页。
+
+ > 说明:如果您的文件发生了变化而没有保存,文本编辑器会在关闭前提示您保存更改。
+
+
+
+### 打开文件
+
+
+您可以采用以下方式打开一个或同时打开多个文本文件,选中的文件将会在新标签页打开:
+
+- 直接拖动文件到文本编辑器界面或其图标上。
+- 右键单击文件,选择 **打开方式** > **文本编辑器**。选择文本编辑器为默认打开程序后,可直接双击打开。
+- 在文本编辑器界面,单击  > **打开文件** 或使用快捷键 **Ctrl + O**,在弹出的窗口中选择文件。
+
+
+
+### 保存文件
+- 单击  > **保存** 或使用快捷键 **Ctrl + S**,保存当前文件。
+- 单击  > **另存为** 或使用快捷键 **Ctrl + Shift + S**,另存当前文件。
+
+
+
+### 打印文件
+
+在文本编辑器中使用打印,需要您连接并配置好打印机。
+
+1. 单击  > **打印** 或使用快捷键 **Ctrl + P** 打开打印预览。
+2. 在打印预览界面,您可以预览文件,选择打印机并设置打印页面。
+3. 在打印预览界面,单击 **高级设置**,可配置纸张大小、打印方式等相关参数。
+4. 单击 **打印** 即可将文件发送到打印机打印。
+
+
+
+
+
+
+
+## 编辑文本
+
+### 移动光标
+
+除了使用方向键和鼠标点击移动光标,您还可以使用以下快捷键迅速移动光标:
+
+| 功能 | 快捷键 |
+| --------------- | ------------ |
+| 保存光标位置 | Ctrl + Shift + > |
+| 重置光标位置(跳转到上次光标保存的位置) | Ctrl + Shift + < |
+| 右移一个词 (光标向右跳过一个词) | Ctrl + 右方向键 |
+| 左移一个词 (光标向左跳过一个词) | Ctrl + 左方向键 |
+| 移动到行尾 | End |
+| 移动到行头 | Home |
+| 移动到文本结尾 | Ctrl + End |
+| 移动到文本开头 | Ctrl + Home |
+| 移动到行缩进 | Ctrl + M |
+| 向右匹配 (光标移动到右括号的后面) | Alt + P |
+| 向左匹配(光标移动到左括号的前面) | Alt + N |
+
+### 切换大小写
+
+切换大小写功能可以将选中的文本全部改为大写字母、小写字母或者让首字母大写。
+
+1. 选中待更改的文本内容。
+2. 单击右键,选择 **切换大小写**。
+3. 选择 **大写**/**小写**/**首字母大写** 选项,更改会立即生效。
+
+您也可以使用快捷键 **Alt + U/ L/ C** 迅速切换大小写。
+
+
+
+### 高亮文本
+
+文本编辑器支持高亮不同类型的文本。
+单击底部状态栏最右侧的三角符号, 选择某种文本类型。若文本中有相应内容则会自动高亮。
+
+
+
+### 删除文本
+除了向左或向右逐个删除字符外,您还可以使用以下快捷键迅速删除字符:
+
+| 功能 | 快捷键 |
+| --------------- | ------------ |
+| 删除到行尾 | Ctrl + K |
+| 删除当前行 | Ctrl + Shift + K |
+| 向左删除一个词 | Alt + Shift + N |
+| 向右删除一个词 | Alt + Shift + M |
+
+### 撤销操作
+
+如果在编辑文本时发生误操作,可以使用快捷键 **Ctrl + Z** 撤销操作,或者在右键菜单中选择 **撤销**。
+
+### 查找文本
+
+1. 单击  > **查找** 或使用快捷键 **Ctrl + F**,打开查找窗口。
+2. 在查找窗口中,输入要搜索的文本。
+3. 单击 **下一个**、**上一个** 逐个查找,或使用 **Enter** 键查找下一个匹配项。
+4. 按下 **Esc** 键或单击关闭按钮,关闭查找窗口。
+
+> 窍门:选中一段文本后再进行查找,则这段文本会自动出现在查找窗口中。
+
+### 替换文本
+1. 单击  > **替换** 或使用快捷键 **Ctrl + H** ,打开替换窗口。
+2. 在替换窗口中,输入要替换的文本以及新文本。
+3. 单击 **替换** 逐个替换;单击 **剩余替换**、**全部替换** 一次性替换剩余的或所有的匹配文本;单击 **跳过** 不替换当前匹配的文本。
+4. 按下 **Esc** 键或单击关闭按钮,关闭搜索窗口。
+
+### 跳到行
+使用该功能可以迅速跳转到任一行。
+在右键菜单中选择 **跳到行** 或者使用快捷键 **Ctrl + G** ,输入行号即可跳转到相应行。
+
+### 编辑行
+
+您可以使用以下快捷键迅速编辑行:
+
+| 功能 | 快捷键 |
+| ------------ | ------------ |
+| 向上插入一行(在上方插入一行) | Ctrl + Enter |
+| 向下插入一行(在下方插入一行) | Ctrl + Shift + Enter |
+| 复制并粘贴当前行 | Ctrl + Shift + D |
+| 上移一行(与上一行交换位置) | Ctrl + Shift + Up |
+| 下移一行(与下一行交换位置) | Ctrl + Shift + Down |
+| 向上滚动一行 | Super + Shift + Up |
+| 向下滚动一行 | Super + Shift + Down |
+| 设置标记 | Alt + H |
+| 取消标记 | Alt + Shift + H |
+| 复制行 | Super + C |
+| 剪切行 | Super + X |
+| 合并行 | Ctrl + J |
+
+### 开启/关闭只读模式
+
+1. 使用文本编辑器打开文档,单击右键,选择 **开启只读模式**。
+2. 在只读模式下,单击右键,选择 **关闭只读模式**。
+
+
+
+
+
+
+### 列编辑
+
+在文本编辑器界面,按住 **Alt** 键不放,鼠标左键单击多列启动列编辑模式,为多行代码同时编辑相同的内容,提高工作效率。
+
+
+
+
+
+### 颜色标记
+
+在文本编辑器界面,单击鼠标右键选择 **颜色标记**,在其下拉列表中进行选择。
+
+
+
+ - **添加标记**:对某一行或某一段文本内容添加颜色标记;有8种颜色按钮可供选择。
+ + 将光标定在某一行,标记当前所在的行。
+ + 选中一段文本内容后,标记选中的文本内容。
+ - **标记所有**:将文本内容全部标记或对已选中的文本内容,在全文中标记匹配项;有8种颜色按钮可供选择。
+ + 将光标定在任意一行,将文本内容全部标记。
+ + 选中一段文本内容,在全文中标记匹配项。
+
+ - **清除上次标记**:清除上次标记操作。
+ - **清除所有标记**:清除当前所有标记。
+
+
+
+### 书签管理
+
+在文本编辑器设置界面,勾选 **显示书签图标** 后,您可以为任意一行的文本内容添加书签。将鼠标指针移至左侧栏任意行号前面会显示图标 ,添加成功后该行的书签图标会变为蓝色填充的图标 。
+
+- 添加书签
+
+ + 鼠标左键单击 ,为该行添加书签。
+ + 鼠标右键单击 ,选择 **添加书签**,为该行添加一个书签。
+ + 将光标定在文本中任意一行,使用快捷键 **Ctrl + F2** 为该行添加一个书签。
+
+
+- 删除书签
+
+ + 鼠标左键单击已填充颜色的书签图标,直接删除该行书签。
+ + 鼠标右键单击已填充颜色的书签图标,选择 **清除书签**,删除该行书签。
+ + 鼠标右键单击书签图标,选择 **清除所有书签**,删除该文本的全部书签。
+
+ >说明:鼠标移到左侧行号前面才会显示书签图标,移出书签区域,书签图标消失。添加书签后,该图标一直显示。
+
+
+
+### 注释管理
+
+在文本编辑器界面,您可以对扩展名为.cpp 、.java 、.py等代码类型的文件进行添加注释的操作。
+
+- 添加注释
+ + 选中一段文本内容,单击右键并选择 **添加注释**。
+ + 选中一段文本内容,使用快捷键 **Alt + A** 添加注释。
+
+- 取消注释
+ + 选中一段已添加注释的文本内容,单击右键并选择 **取消注释**。
+ + 选中一段已添加注释的文本内容,使用快捷键 **Alt + Z** 取消注释。
+
+ >说明:支持不同代码语言的注释,具体以实际为主。例如C,C#,Java注释符号为 //,Python 注释符号为 #。
+
+
+
+## 主菜单
+
+在主菜单中,您可以新建窗口、新建标签页、[查找文本](#查找文本)、[替换文本](#替换文本)、保存文件、切换窗口主题、查看帮助手册,了解文本编辑器的更多信息。
+
+### 设置
+
+您可以对基础信息、快捷键和高级信息进行设置。
+
+#### 基础设置
+
+1. 单击 > **设置**。
+2. 在基础设置选项,您可以选择:
+ - 设置字体样式和字号大小。
+ - 勾选 **自动换行**,在编辑区自动换行。
+ - 勾选 **代码折叠标志**,在左侧栏显示按钮或者 ,右键单击按钮选择折叠/展开当前层次或所有层次。
+ - 勾选 **显示行号**,在左侧栏显示行号。
+ - 勾选 **当前行高亮**,光标所在的行高亮显示。
+ - 勾选 **显示书签图标**,在左侧栏显示书签图标。
+ - 勾选 **显示空白制符/制表符**,显示文本中的空白字符和制表符,您也可以手动输入或删除空白字符和制表符。
+
+ > 窍门:您还可以使用 **Ctrl + “+”/ “-”** 来调节文本编辑器的默认字号。使用 **Ctrl + 0** 恢复默认字号。
+
+
+
+#### 快捷键设置
+
+1. 单击  > **设置**,在 **快捷键** 选项查看当前快捷键。
+2. 选择一种快捷键映射。
+3. 您可以单击并重新输入快捷键,自定义快捷键。
+
+ > 说明: 快捷键映射允许您选择某一种键盘快捷键。您可以使用标准快捷键,Emacs快捷键,或自定义快捷键,以符合您的使用习惯。
+
+
+#### 高级设置
+
+1. 单击  > **设置**。
+2. 在 **高级设置** 选项,您可以设置:
+ - 窗口状态:正常窗口,最大化或全屏。
+ - Tab字符宽度:Tab缩进所占用的空间大小。
+
+
+
+### 主题
+
+窗口主题包含浅色主题、深色主题和系统主题。
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **主题**,选择一个主题颜色。
+
+### 帮助
+
+查看帮助手册,进一步了解和使用文本编辑器。
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **帮助**。
+3. 查看文本编辑器的帮助手册。
+
+### 关于
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **关于**。
+3. 查看文本编辑器的版本和介绍。
+
+### 退出
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **退出**。
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/close.png b/src/assets/deepin-editor/editor/zh_CN/fig/close.png
new file mode 100755
index 0000000000000000000000000000000000000000..eb5704b81bca1efccd06786eb2a324c63b3edcf0
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/close.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/colortag.png b/src/assets/deepin-editor/editor/zh_CN/fig/colortag.png
new file mode 100755
index 0000000000000000000000000000000000000000..5b64f60d1096bbfc488196af98b4c546e64ff20d
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/colortag.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/column_mode.png b/src/assets/deepin-editor/editor/zh_CN/fig/column_mode.png
new file mode 100755
index 0000000000000000000000000000000000000000..52ec0e407f09e3db763f9c17b0c39a52e9ca54fd
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/column_mode.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/d_colortag.png b/src/assets/deepin-editor/editor/zh_CN/fig/d_colortag.png
new file mode 100755
index 0000000000000000000000000000000000000000..f7021f8e32c0237bd8cf2500545428ef5573ecd1
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/d_colortag.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/d_column_mode.png b/src/assets/deepin-editor/editor/zh_CN/fig/d_column_mode.png
new file mode 100755
index 0000000000000000000000000000000000000000..76ee58b8e34c2ffc15d3a034d0399bbb401f8a80
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/d_column_mode.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/d_read_only.png b/src/assets/deepin-editor/editor/zh_CN/fig/d_read_only.png
new file mode 100755
index 0000000000000000000000000000000000000000..384de02df149c88f91608b2787589a89b7dcbeb6
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/d_read_only.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/d_read_only02.png b/src/assets/deepin-editor/editor/zh_CN/fig/d_read_only02.png
new file mode 100755
index 0000000000000000000000000000000000000000..f3200d80ae77470ca94e77561727ac1e1119e106
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/d_read_only02.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/d_toggle_case.png b/src/assets/deepin-editor/editor/zh_CN/fig/d_toggle_case.png
new file mode 100755
index 0000000000000000000000000000000000000000..05733d417f05b52435eb62310f6b7f635439e66b
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/d_toggle_case.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/editer.psd b/src/assets/deepin-editor/editor/zh_CN/fig/editer.psd
new file mode 100755
index 0000000000000000000000000000000000000000..d68083edaf82a349425c63540ac895a3dfa4bb5b
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/editer.psd differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/highlight.png b/src/assets/deepin-editor/editor/zh_CN/fig/highlight.png
new file mode 100755
index 0000000000000000000000000000000000000000..955ff0130d4ade9801a58c4821aab115a0b64b77
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/highlight.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/hotkey.png b/src/assets/deepin-editor/editor/zh_CN/fig/hotkey.png
new file mode 100755
index 0000000000000000000000000000000000000000..37e87eebeddeb9c6628793abbe1ef9cc4067f260
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/hotkey.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/listen.png b/src/assets/deepin-editor/editor/zh_CN/fig/listen.png
new file mode 100755
index 0000000000000000000000000000000000000000..d397f90eaad0909f49535c74cb5cb58d949b2f2b
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/listen.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/overview.png b/src/assets/deepin-editor/editor/zh_CN/fig/overview.png
new file mode 100755
index 0000000000000000000000000000000000000000..56e6ef348cb76f88f29dae3c3cbaa93e706260fd
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/overview.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/printer.png b/src/assets/deepin-editor/editor/zh_CN/fig/printer.png
new file mode 100644
index 0000000000000000000000000000000000000000..e2f66f6cde42daa99f466bdfea82e06927ef1f47
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/printer.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/printer_setting.png b/src/assets/deepin-editor/editor/zh_CN/fig/printer_setting.png
new file mode 100644
index 0000000000000000000000000000000000000000..984eee2f24f282dfb78878bddab5ca3afb72ce21
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/printer_setting.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/read_only.png b/src/assets/deepin-editor/editor/zh_CN/fig/read_only.png
new file mode 100755
index 0000000000000000000000000000000000000000..9d26b1e1e316a68c0abee8e3ad751078bfb0a427
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/read_only.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/read_only_02.png b/src/assets/deepin-editor/editor/zh_CN/fig/read_only_02.png
new file mode 100755
index 0000000000000000000000000000000000000000..960b5a350fa3ab4dcf7917aa37101d8045b5c843
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/read_only_02.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/reading.png b/src/assets/deepin-editor/editor/zh_CN/fig/reading.png
new file mode 100755
index 0000000000000000000000000000000000000000..7dbbeed5c8c7cb8933856dcdec4ec92e36b09ed1
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/reading.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/text_translation.png b/src/assets/deepin-editor/editor/zh_CN/fig/text_translation.png
new file mode 100755
index 0000000000000000000000000000000000000000..890ecd017a37cc38886ab90c129cbd834137ffa1
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/text_translation.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/fig/togglecase.png b/src/assets/deepin-editor/editor/zh_CN/fig/togglecase.png
new file mode 100755
index 0000000000000000000000000000000000000000..63ac808ab35ececc3d630fda919d7a7b1609d896
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_CN/fig/togglecase.png differ
diff --git a/src/assets/deepin-editor/editor/zh_CN/p_editor.md b/src/assets/deepin-editor/editor/zh_CN/p_editor.md
new file mode 100755
index 0000000000000000000000000000000000000000..ba0119d7ff8de9bf8cdc400beb9c59234bb1f257
--- /dev/null
+++ b/src/assets/deepin-editor/editor/zh_CN/p_editor.md
@@ -0,0 +1,330 @@
+# 文本编辑器|deepin-editor|
+
+## 概述
+
+文本编辑器是一个简单的文本编辑工具。您可以用它书写简单的文本文档,也可以使用它的高级特性,让它成为一个代码编辑工具,支持代码语法高亮。
+
+
+
+## 使用入门
+
+### 运行文本编辑器
+
+1. 单击任务栏上的启动器图标 ,进入启动器界面。
+2. 上下滚动鼠标滚轮浏览或通过搜索,找到文本编辑器图标 ,单击运行。
+3. 右键单击 ,您可以:
+
+ - 单击 **发送到桌面**,在桌面创建快捷方式。
+ - 单击 **发送到任务栏**,将应用程序固定到任务栏。
+ - 单击 **开机自动启动**,将应用程序添加到开机启动项,在电脑开机时自动运行该应用。
+
+### 退出文本编辑器
+
+- 在文本编辑器界面,单击 ,退出文本编辑器。
+- 在文本编辑器界面,单击主菜单  > **退出** ,退出文本编辑器。
+- 在任务栏右键单击 ,选择 **关闭所有** ,退出文本编辑器。
+
+
+### 查看快捷键
+
+在文本编辑器界面,使用快捷键 **Ctrl + Shift + ?** 打开快捷键预览界面,您也可以在设置界面查看快捷键。熟练地使用快捷键,将大大提升您的操作效率。
+
+
+
+## 基本操作
+
+### 管理标签页
+
+- 新建标签页/窗口
+
+ - 单击标签页上的  或  > **新标签页** 或使用快捷键 **Ctrl + T** 创建一个新的标签页。
+ - 单击 > **新窗口** 或使用快捷键 **Ctrl + N** 创建一个新的窗口。
+
+- 调整标签页/窗口
+
+ - 拖拽同一窗口内的标签页重新排序。
+ - 滚动鼠标切换同一窗口内的标签页。
+ - 移出标签页创建一个新的窗口,或者从一个窗口移到另外一个窗口中。
+
+- 关闭标签页/窗口
+
+ 当窗口中仅有一个标签页时,关闭标签页的同时也会关闭窗口。
+ - 使用 **Ctrl + W** 组合键关闭当前标签页。
+ - 单击标签页上的按钮  或者单击鼠标中键,关闭当前标签页。
+ - 右键单击标签页,选择 **关闭标签页** 、**关闭其他标签页** 或 **更多关闭方式** 来关闭标签页。
+
+ > 说明:如果您的文件发生了变化而没有保存,文本编辑器会在关闭前提示您保存更改。
+
+### 打开文件
+
+您可以采用以下方式打开一个或同时打开多个文本文件,选中的文件将会在新标签页打开:
+
+- 直接拖动文件到文本编辑器界面或其图标上。
+- 右键单击文件,选择 **打开方式** > **文本编辑器**。选择文本编辑器为默认打开程序后,可以直接双击打开。
+- 在文本编辑器界面,单击  > **打开文件** 或使用快捷键 **Ctrl + O**,在弹出的窗口中选择文件打开。
+
+### 保存文件
+- 单击  > **保存** 或使用快捷键 **Ctrl + S**,保存当前文件。
+- 单击  > **另存为** 或使用快捷键 **Ctrl + Shift + S**,另存当前文件。
+
+
+### 打印文件
+
+在文本编辑器中使用打印,需要提前连接并配置好打印机。
+
+1. 单击  > **打印**,也可以使用快捷键 **Ctrl + P** 打开打印预览。
+2. 在打印预览界面,您可以预览文件,选择打印机并设置打印页面。
+3. 在打印预览界面,单击 **高级设置**,可配置纸张大小、打印方式等相关参数。
+4. 单击 **打印** 即可将文件发送到打印机打印。
+
+
+
+
+
+
+
+## 编辑文本
+
+### 移动光标
+
+除了使用方向键和鼠标点击移动光标,您还可以使用以下快捷键迅速移动光标:
+
+| 功能 | 快捷键 |
+| --------------- | ------------ |
+| 保存光标位置 | Ctrl + Shift + > |
+| 重置光标位置(跳转到上次光标保存的位置) | Ctrl + Shift + < |
+| 右移一个词 (光标向右跳过一个词) | Ctrl + 右方向键 |
+| 左移一个词 (光标向左跳过一个词) | Ctrl + 左方向键 |
+| 移动到行尾 | End |
+| 移动到行头 | Home |
+| 移动到文本结尾 | Ctrl + End |
+| 移动到文本开头 | Ctrl + Home |
+| 移动到行缩进 | Ctrl + M |
+| 向右匹配 (光标移动到右括号的后面) | Alt + P |
+| 向左匹配(光标移动到左括号的前面) | Alt + N |
+
+### 切换大小写
+
+切换大小写功能可以将选中的文本全部改为大写字母、小写字母或者让首字母大写。
+
+1. 选中待更改的文本内容。
+2. 单击右键,选择 **切换大小写**。
+3. 选择 **大写**/**小写**/**首字母大写** 选项,更改会立即生效。
+
+您也可以使用快捷键 **Alt + U/ L/ C** 迅速切换大小写。
+
+
+
+### 高亮文本
+
+文本编辑器支持高亮不同类型的文本。
+单击底部状态栏最右侧的三角符号, 选择某种文本类型。若文本中有相应内容则会自动高亮。
+
+
+
+### 删除文本
+除了向左或向右逐个删除字符外,您还可以使用以下快捷键迅速删除字符:
+
+| 功能 | 快捷键 |
+| --------------- | ------------ |
+| 删除到行尾 | Ctrl + K |
+| 删除当前行 | Ctrl + Shift + K |
+| 向左删除一个词 | Alt + Shift + N |
+| 向右删除一个词 | Alt + Shift + M |
+
+### 撤销操作
+
+如果在编辑文本时发生误操作,可以使用快捷键 **Ctrl + Z** 撤销操作,或者在右键菜单中选择 **撤销**。
+
+### 查找文本
+
+1. 单击  > **查找** 或使用快捷键 **Ctrl + F** ,打开查找窗口。
+2. 在查找窗口中,输入要搜索的文本。
+3. 单击 **下一个**、**上一个** 逐个查找,或使用 **Enter** 键查找下一个匹配项。
+4. 按下 **Esc** 键或单击关闭按钮,关闭查找窗口。
+
+> 窍门:选中一段文本后再进行查找,则这段文本会自动出现在查找窗口中。
+
+### 替换文本
+1. 单击  > **替换** 或使用快捷键 **Ctrl + H** ,打开替换窗口。
+2. 在替换窗口中,输入要替换的文本以及新文本。
+3. 单击 **替换** 逐个替换,单击 **剩余替换**、**全部替换** 一次性替换剩余的或所有的匹配文本;单击 **跳过** 不替换当前匹配的文本。
+4. 按下 **Esc** 键或单击关闭按钮,关闭搜索窗口。
+
+### 跳到行
+使用该功能可以迅速跳转到任一行。
+在右键菜单中选择 **跳到行** 或者使用快捷键 **Ctrl + G** ,输入行号即可跳转到相应行。
+
+### 编辑行
+
+您可以使用以下快捷键迅速编辑行:
+
+| 功能 | 快捷键 |
+| ------------ | ------------ |
+| 向上插入一行(在上方插入一行) | Ctrl + Enter |
+| 向下插入一行(在下方插入一行) | Ctrl + Shift + Enter |
+| 复制并粘贴当前行 | Ctrl + Shift + D |
+| 上移一行(与上一行交换位置) | Ctrl + Shift + Up |
+| 下移一行(与下一行交换位置) | Ctrl + Shift + Down |
+| 向上滚动一行 | Super + Shift + Up |
+| 向下滚动一行 | Super + Shift + Down |
+| 设置标记 | Alt + H |
+| 取消标记 | Alt + Shift + H |
+| 复制行 | Super + C |
+| 剪切行 | Super + X |
+| 合并行 | Ctrl + J |
+
+### 开启/关闭只读模式
+
+1. 使用文本编辑器打开文档,单击右键,选择 **开启只读模式**。
+2. 在只读模式下,单击右键,选择 **关闭只读模式**。
+
+
+
+
+
+### 语音朗读
+
+在“控制中心”>“辅助功能”中开启语音朗读、语音听写功能后,可以执行如下操作。
+
+1. 单击右键,选择 **语音听写**,通过麦克风语音输入后,转译文字将被编辑在文档中。
+2. 选择一段文字后,单击右键,选择 **语音朗读**,语音播报选中的文字。
+
+ > 说明:当未选择文字时,右键菜单中 **语音朗读** 不可激活,处置灰状态。
+
+
+
+### 文本翻译
+
+在“控制中心”>“辅助功能”中开启文本翻译并选择语言后,可以执行以下操作。
+
+1. 在文本编辑器界面选择一段文本后,单击右键,选择 **文本翻译**,可将该段文本内容翻译成目标语言。
+
+
+
+### 列编辑
+
+在文本编辑器界面,按住键盘上的 **Alt** 键不放,鼠标左键单击多列启动列编辑模式,为多行代码同时编辑相同的内容,提高工作效率。
+
+
+
+
+
+### 颜色标记
+
+在文本编辑器界面,单击鼠标右键选择 **颜色标记**,在其下拉列表中进行选择。
+
+
+
+ - **添加标记**:对某一行或某一段文本内容添加颜色标记;有8种颜色按钮可供选择。
+ + 将光标定在某一行,标记当前所在的行。
+ + 选中一段文本内容后,标记选中的文本内容。
+ - **标记所有**:将文本内容全部标记或对已选中的文本内容,在全文中标记匹配项;有8种颜色按钮可供选择。
+ + 将光标定在任意一行,将文本内容全部标记。
+ + 选中一段文本内容,在全文中标记匹配项。
+
+ - **清除上次标记**:清除上次标记操作。
+ - **清除所有标记**:清除当前所有标记。
+
+### 书签管理
+
+在文本编辑器设置界面,勾选 **显示书签图标** 后,您可以为任意一行的文本内容添加书签。将鼠标指针移至左侧栏任意行号前面会显示图标 ,添加成功后该行的书签图标会变为蓝色填充的图标 。
+
+- 添加书签
+
+ + 鼠标左键单击 ,为该行添加书签。
+ + 鼠标右键单击 ,选择 **添加书签**,为该行添加一个书签。
+ + 将光标定在文本中任意一行,使用快捷键 **Ctrl + F2** 为该行添加一个书签。
+
+- 删除书签
+
+ + 鼠标左键单击已填充颜色的书签图标,直接删除该行书签。
+ + 鼠标右键单击已填充颜色的书签图标,选择 **清除书签**,删除该行书签。
+ + 鼠标右键单击书签图标,选择 **清除所有书签**,删除该文本的全部书签。
+
+ >说明:鼠标移到左侧行号前面才会显示书签图标,移出书签区域,书签图标消失。添加书签后,该图标一直显示。
+
+
+
+### 注释管理
+
+在文本编辑器界面,您可以对扩展名为.cpp 、.java 、.py等代码类型的文件进行添加注释的操作。
+
+- 添加注释
+ + 选中一段文本内容,单击右键并选择 **添加注释**。
+ + 选中一段文本内容,使用组合键 **Alt + A** 添加注释。
+
+- 取消注释
+ + 选中一段已添加注释的文本内容,单击右键并选择 **取消注释**。
+ + 选中一段已添加注释的文本内容,使用快捷键 **Alt + Z** 取消注释。
+
+ >说明:支持不同代码语言的注释,具体以实际为主。例如C,C#,Java注释符号为 //,Python 注释符号为 #。
+
+
+
+## 主菜单
+
+在主菜单中,您可以新建窗口、新建标签页、[查找文本](#查找文本)、[替换文本](#替换文本)、保存文件、切换窗口主题、查看帮助手册、进一步了解文本编辑器的更多信息。
+
+### 设置
+
+您可以对基础信息、快捷键和高级信息进行设置。
+
+#### 基础设置
+
+1. 单击 > **设置**。
+2. 在基础设置选项,您可以选择:
+ - 设置字体样式和字号大小。
+ - 勾选 **自动换行**,在编辑区自动换行。
+ - 勾选 **代码折叠标志**,在左侧栏显示按钮  或者 ,右键单击按钮选择折叠/展开当前层次或所有层次。
+ - 勾选 **显示行号**,在左侧栏显示行号。
+ - 勾选 **当前行高亮**,光标所在的行高亮显示。
+ - 勾选 **显示书签图标**,在左侧栏显示书签图标。
+ - 勾选 **显示空白制符/制表符**,显示文本中的空白字符和制表符,您也可以手动输入或删除空白字符和制表符。
+
+ > 窍门:在文本编辑器中,使用 **Ctrl + “+”/ “-”** 调节字号,使用 **Ctrl + 0** 恢复默认字号。
+
+
+
+#### 快捷键设置
+
+1. 单击  > **设置**,在 **快捷键** 选项查看当前快捷键。
+2. 选择一种快捷键映射。
+3. 您可以单击快捷键编辑区域,自定义快捷键。
+
+ > 说明: 快捷键映射允许您选择某一种键盘快捷键。可以使用标准快捷键,Emacs快捷键,或自定义快捷键,以符合您的使用习惯。
+
+
+#### 高级设置
+
+1. 单击  >**设置**。
+2. 在 **高级设置** 选项,您可以设置:
+ - 窗口状态:正常窗口,最大化或全屏。
+ - Tab字符宽度:Tab缩进所占用的空间大小。
+
+
+### 主题
+
+窗口主题包含浅色主题、深色主题和系统主题。
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **主题**,选择一个主题颜色。
+
+### 帮助
+
+查看帮助手册,进一步了解和使用文本编辑器。
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **帮助**。
+3. 查看文本编辑器的帮助手册。
+
+### 关于
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **关于**。
+3. 查看文本编辑器的版本和介绍。
+
+### 退出
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **退出**。
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/zh_HK/editor.md b/src/assets/deepin-editor/editor/zh_HK/editor.md
new file mode 100755
index 0000000000000000000000000000000000000000..983546b6967ae7beaf416bbe2060f56d321eb47a
--- /dev/null
+++ b/src/assets/deepin-editor/editor/zh_HK/editor.md
@@ -0,0 +1,310 @@
+# 文本編輯器|deepin-editor|
+
+## 概述
+
+文本編輯器是一個簡單的文本編輯工具。您可以用它書寫簡單的文本文檔,也可以使用它的高級特性,讓它成為一個代碼編輯工具,支持代碼語法高亮。
+
+
+
+## 使用入門
+
+### 運行文本編輯器
+
+1. 單擊任務欄上的啟動器圖標 ,進入啟動器界面。
+2. 上下滾動鼠標滾輪瀏覽或通過搜索,找到文本編輯器圖標,單擊運行。
+3. 右鍵單擊,您可以:
+
+ - 單擊 **傳送到桌面**,在桌面創建快捷方式。
+ - 單擊 **傳送到任務欄**,將應用程序固定到任務欄。
+ - 單擊 **加至開機啟動**,將應用程序添加到開機啟動項,在電腦開機時自動運行該應用。
+
+### 關閉文本編輯器
+
+- 在文本編輯器界面,單擊 ,關閉文本編輯器。
+- 在文本編輯器界面,單擊主菜單  > **退出** ,關閉文本編輯器。
+- 在任務欄右鍵單擊 ,選擇 **關閉所有** ,關閉文本編輯器。
+
+
+### 查看快捷鍵
+
+在文本編輯器界面,使用快捷鍵 **Ctrl + Shift + ?** 打開快捷鍵預覽界面,您也可以在設置界面查看快捷鍵。熟練地使用快捷鍵,將大大提升您的操作效率。
+
+
+
+## 基本操作
+
+### 管理標籤頁
+
+- 新建標籤頁/窗口
+
+ - 單擊標籤頁上的  或  > **新標籤頁** 或使用快捷鍵 **Ctrl + T** 創建一個新的標籤頁。
+ - 單擊 > **新窗口** 或使用快捷鍵 **Ctrl + N** 創建一個新的窗口。
+
+- 調整標籤頁/窗口
+
+ - 拖拽同一窗口內的標籤頁重新排序。
+ - 滾動鼠標切換同一窗口內的標籤頁。
+ - 移出標籤頁創建一個新的窗口,或者從一個窗口移到另外一個窗口中。
+
+- 關閉標籤頁/窗口
+
+ 當窗口中僅有一個標籤頁時,關閉標籤頁的同時也會關閉窗口。
+ - 使用快捷鍵 **Ctrl + W** 關閉當前標籤頁。
+ - 單擊標籤頁上的按鈕  或者單擊鼠標中鍵,關閉當前標籤頁。
+ - 右鍵單擊標籤頁,選擇 **關閉標籤頁** 、**關閉其他標籤頁** 或 **更多關閉方式** 來關閉標籤頁。
+
+ > 說明:如果您的文件發生了變化而沒有保存,文本編輯器會在關閉前提示您保存更改。
+
+
+### 打開文件
+
+您可以採用以下方式打開一個或同時打開多個文本文件,選中的文件將會在新標籤頁中打開:
+
+- 直接拖動文件到文本編輯器界面或其圖標上。
+- 右鍵單擊文件,選擇 **打開方式** > **文本編輯器**。選擇文本編輯器為默認打開程序後,可直接雙擊打開。
+- 在文本編輯器界面,單擊  > **打開文件** 或使用快捷鍵 **Ctrl + O**,在彈出的窗口中選擇文件打開。
+
+
+### 保存文件
+- 單擊  > **保存** 或使用快捷鍵 **Ctrl + S**,保存當前文件。
+- 單擊  > **另存為** 或使用快捷鍵 **Ctrl + Shift + S**,另存當前文件。
+
+
+### 打印文件
+
+在文本編輯器中使用打印,需要您連接並配置好打印機。
+
+1. 單擊  > **打印**,也可以使用快捷鍵 **Ctrl + P** 打開打印預覽。
+2. 在打印預覽界面,您可以預覽文件,選擇打印機並設置打印頁面。
+3. 在打印預覽界面,單擊 **高級設置**,可配置紙張大小、打印方式等相關參數。
+4. 單擊 **打印** 即可將文件發送到打印機打印。
+
+
+
+## 編輯文本
+
+### 移動光標
+
+除了使用方向鍵和鼠標單擊移動光標,您還可以使用以下快捷鍵迅速移動光標:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 保存光標位置 | Ctrl + Shift + > |
+| 重置光標位置(跳轉到上次光標保存的位置) | Ctrl + Shift + < |
+| 右移一個詞 (光標向右跳過一個詞) | Ctrl + 右方向鍵 |
+| 左移一個詞 (光標向左跳過一個詞) | Ctrl + 左方向鍵 |
+| 移動到行尾 | End |
+| 移動到行頭 | Home |
+| 移動到文本結尾 | Ctrl + End |
+| 移動到文本開頭 | Ctrl + Home |
+| 移動到行縮進 | Ctrl + M |
+| 向右匹配 (光標移動到右括號的後面) | Alt + P |
+| 向左匹配(光標移動到左括號的前面) | Alt + N |
+
+### 切換大小寫
+
+切換大小寫功能可以將選中的文本全部改為大寫字母、小寫字母或者讓首字母大寫。
+
+1. 選中待更改的文本內容。
+2. 單擊右鍵,選擇 **切換大小寫**。
+3. 選擇 **大寫**/**小寫**/**首字母大寫** 選項,更改會立即生效。
+
+您也可以使用快捷鍵 **Alt + U/ L/ C** 迅速切換大小寫。
+
+
+
+### 高亮文本
+
+文本編輯器支持高亮不同類型的文本。
+單擊底部狀態欄最右側的三角符號, 選擇某種文本類型。若文本中有相應內容則會自動高亮。
+
+
+
+### 刪除文本
+除了向左或向右逐個刪除字符外,您還可以使用以下快捷鍵迅速刪除字符:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 刪除到行尾 | Ctrl + K |
+| 刪除當前行 | Ctrl + Shift + K |
+| 向左刪除一個詞 | Alt + Shift + N |
+| 向右刪除一個詞 | Alt + Shift + M |
+
+### 撤銷操作
+
+如果在編輯文本時發生誤操作, 可以使用快捷鍵 **Ctrl + Z** 撤銷操作, 或者在右鍵菜單中選擇 **撤銷**。
+
+### 查找文本
+
+1. 單擊  > **查找** 或使用快捷鍵 **Ctrl + F** 打開查找窗口。
+2. 在查找窗口中,輸入要搜索的文本。
+3. 單擊 **下一個**、**上一個** 逐個查找,或使用 **Enter** 鍵查找下一個匹配項。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉查找窗口。
+
+> 竅門:選中一段文本後再進行搜索,則這段文本會自動出現在查找窗口中。
+
+### 替換文本
+1. 單擊  > **替換** 或使用快捷鍵 **Ctrl + H** 打開替換窗口。
+2. 在替換窗口中,輸入要替換的文本以及新文本。
+3. 單擊 **替換** 逐個替換,單擊 **剩餘替換**、**全部替換** 一次性替換剩餘的或所有的匹配文本。單擊 **跳過** 不替換當前匹配的文本。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉搜索窗口。
+
+### 跳到行
+使用該功能可以迅速跳轉到任一行。
+在右鍵菜單中選擇 **跳到行** 或者使用快捷鍵 **Ctrl + G** ,輸入行號即可跳轉到相應行。
+
+### 編輯行
+
+您可以使用以下快捷鍵迅速編輯行:
+
+| 功能 | 快捷鍵 |
+| ------------ | ------------ |
+| 向上插入一行(在上方插入一行) | Ctrl + Enter |
+| 向下插入一行(在下方插入一行) | Ctrl + Shift + Enter |
+| 複製並黏貼當前行 | Ctrl + Shift + D |
+| 上移一行(與上一行交換位置) | Ctrl + Shift + Up |
+| 下移一行(與下一行交換位置) | Ctrl + Shift + Down |
+| 向上滾動一行 | Super + Shift + Up |
+| 向下滾動一行 | Super + Shift + Down |
+| 設置標記 | Alt + H |
+| 取消標記 | Alt + Shift + H |
+| 複製行 | Super + C |
+| 剪切行 | Super + X |
+| 合併行 | Ctrl + J |
+
+### 開啟/關閉只讀模式
+
+1. 使用文本編輯器打開文檔,單擊右鍵,選擇 **開啟只讀模式**。
+2. 在只讀模式下,單擊右鍵,選擇 **關閉只讀模式**。
+
+
+
+
+
+
+
+### 列編輯
+
+在文本編輯器界面,按住鍵盤上的 **Alt** 鍵不放,鼠標左鍵單擊多列啟動列編輯模式,為多行代碼同時編輯相同的內容,提高工作效率。
+
+
+
+### 顏色標記
+
+在文本編輯器界面,單擊鼠標右鍵選擇 **顏色標記**,在其下拉列表中進行選擇。
+
+
+
+ - **設置標記**:對某一行或某一段文本內容添加顏色標記;有8種顏色按鈕可供選擇。
+ + 將光標定在某一行,標記當前所在的行。
+ + 選中一段文本內容後,標記選中的文本內容。
+ - **標記所有**:將文本內容全部標記或對已選中的文本內容,在全文中標記匹配項;有8種顏色按鈕可供選擇。
+ + 將光標定在任意一行,將文本內容全部標記。
+ + 選中一段文本內容,在全文中標記匹配項。
+ - **清除上次標記**:清除上次標記操作。
+ - **清除所有標記**:清除當前所有標記。
+
+
+
+
+### 書籤管理
+
+在文本編輯器設置界面,勾選 **顯示書籤圖標** 後,您可以為任意一行的文本內容添加一個書籤。將鼠標指針移至左側欄任意行號前面會顯示圖標 ,添加成功後該行的書籤圖標會變為藍色填充的圖標 。
+
+- 添加書籤
+
+ + 鼠標左鍵單擊 ,為該行添加書籤。
+ + 鼠標右鍵單擊,選擇 **添加書籤**,為該行添加一個書籤。
+ + 將光標定在文本中任意一行,使用快捷鍵 **Ctrl + F2** 為該行添加一個書籤。
+
+- 刪除書籤
+
+ + 鼠標左鍵單擊已填充顏色的書籤圖標,直接刪除該行書籤。
+ + 鼠標右鍵單擊已填充顏色的書籤圖標,選擇 **清除書籤**,刪除該行書籤。
+ + 鼠標右鍵單擊書籤圖標,選擇 **清除所有書籤**,刪除該文本的全部書籤。
+
+ >說明:鼠標移到左側行號前面才會顯示書籤圖標,移出書籤區域,書籤圖標消失。添加書籤後,該圖標一直顯示。
+
+
+
+### 注釋管理
+
+在文本編輯器界面,您可對擴展名為.cpp 、.java 、.py等代碼類型的文件進行添加注釋的操作。
+- 添加注釋
+ + 選中一段文本內容,在右鍵菜單中選擇 **添加注釋**。
+ + 選中一段文本內容,使用快捷鍵 **Alt + A** 添加注釋。
+
+- 取消注釋
+ + 選中一段已添加注釋的文本內容,在右鍵菜單中選擇 **取消注釋**。
+ + 選中一段已添加注釋的文本內容,使用快捷鍵 **Alt + Z** 取消注釋。
+
+ >說明:支持不同代碼語言的注釋,具體以實際為主。例如C,C#,Java注釋符號為 //,Python 注釋符號為 #。
+
+
+
+## 主菜單
+
+在主菜單中,您可以新建窗口、新建標籤頁、[查找文本](#查找文本)、[替換文本](#替換文本)、保存文件、切換窗口主題、查看幫助手冊,了解文本編輯器的更多訊息。
+
+### 設置
+
+您可以對基礎訊息、快捷鍵和高級訊息進行設置。
+
+#### 基礎設置
+
+1. 單擊> **設置**。
+2. 在基礎設置選項,您可以選擇:
+ - 設置字體樣式和字號大小。
+ - 勾選 **自動換行**,在編輯區自動換行。
+ - 勾選 **顯示代碼摺疊標誌**,在左側欄顯示或者按鈕,右鍵單擊按鈕選擇摺疊/展開當前層次或所有層次。
+ - 勾選 **顯示行號**,在左側欄顯示行號。
+ - 勾選 **當前行高亮**,光標所在的行高亮顯示。
+ - 勾選 **顯示書籤圖標**,在左側欄顯示書籤圖標。
+ - 勾選 **顯示空白制符/製表符**,顯示文本中的空白字符和製表符,您也可手動輸入或刪除空白字符和製表符。
+
+ > 竅門:您還可以使用 **Ctrl + 「+」/ 「-」** 來調節文本編輯器的默認字號。使用 **Ctrl + 0** 恢復默認字號。
+
+
+#### 快捷鍵設置
+
+1. 單擊> **設置**,在 **快捷鍵** 選項查看當前快捷鍵。
+2. 選擇一種快捷鍵映射。
+3. 單擊快捷鍵編輯框 ,可以自定義快捷鍵。
+
+ > 說明: 快捷鍵映射允許您選擇某一種鍵盤快捷鍵。您可以使用標準快捷鍵,Emacs快捷鍵,或自定義快捷鍵,以符合您的使用習慣。
+
+
+#### 高級設置
+
+1. 單擊>**設置**。
+2. 在 **高級設置** 選項,您可以設置:
+ - 窗口狀態:正常窗口,最大化或全螢幕。
+ - Tab字符寬度:Tab縮進所佔用的空間大小。
+
+
+
+### 主題
+
+窗口主題包含淺色主題、深色主題和系統主題。
+
+1. 在文本編輯器界面,單擊。
+2. 單擊 **主題**,選擇一個主題顏色。
+
+### 幫助
+
+查看幫助手冊,進一步了解和使用文本編輯器。
+
+1. 在文本編輯器界面,單擊 。
+2. 單擊 **幫助**。
+3. 查看文本編輯器的幫助手冊。
+
+### 關於
+
+1. 在文本編輯器界面,單擊 。
+2. 單擊 **關於**。
+3. 查看文本編輯器的版本和介紹。
+
+### 退出
+
+1. 在文本編輯器界面,單擊 。
+2. 單擊 **退出**。
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/close.png b/src/assets/deepin-editor/editor/zh_HK/fig/close.png
new file mode 100755
index 0000000000000000000000000000000000000000..eb5704b81bca1efccd06786eb2a324c63b3edcf0
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/close.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/color_tag.png b/src/assets/deepin-editor/editor/zh_HK/fig/color_tag.png
new file mode 100755
index 0000000000000000000000000000000000000000..aa8b20067d4b65afa7cdb4f0ca21c1628240bfec
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/color_tag.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/column_mode.png b/src/assets/deepin-editor/editor/zh_HK/fig/column_mode.png
new file mode 100755
index 0000000000000000000000000000000000000000..8d55fc7aa995f012faabb4139da55a9f3771a2c3
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/column_mode.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/d_color_tag.png b/src/assets/deepin-editor/editor/zh_HK/fig/d_color_tag.png
new file mode 100755
index 0000000000000000000000000000000000000000..24a393283d28e2805018c16203220ba1afb82b9c
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/d_color_tag.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/d_read_only.png b/src/assets/deepin-editor/editor/zh_HK/fig/d_read_only.png
new file mode 100755
index 0000000000000000000000000000000000000000..e5cdf3ab18903e84ce507aa386934cbdcf7ddca8
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/d_read_only.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/d_read_only02.png b/src/assets/deepin-editor/editor/zh_HK/fig/d_read_only02.png
new file mode 100755
index 0000000000000000000000000000000000000000..c140b8083c385c43e57b059136137824704d77f4
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/d_read_only02.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/d_toggle_case.png b/src/assets/deepin-editor/editor/zh_HK/fig/d_toggle_case.png
new file mode 100755
index 0000000000000000000000000000000000000000..bbe4afb482256cdcd5e5b761127506c57bab6b3b
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/d_toggle_case.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/highlight.png b/src/assets/deepin-editor/editor/zh_HK/fig/highlight.png
new file mode 100755
index 0000000000000000000000000000000000000000..9ec23d428c003591fd448c0be2ce2d5c89e72089
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/highlight.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/hotkey.png b/src/assets/deepin-editor/editor/zh_HK/fig/hotkey.png
new file mode 100755
index 0000000000000000000000000000000000000000..84c50b0cf0b2cf8007c6e7c671fa8455292f84a6
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/hotkey.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/listen.png b/src/assets/deepin-editor/editor/zh_HK/fig/listen.png
new file mode 100755
index 0000000000000000000000000000000000000000..d397f90eaad0909f49535c74cb5cb58d949b2f2b
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/listen.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/overview.png b/src/assets/deepin-editor/editor/zh_HK/fig/overview.png
new file mode 100755
index 0000000000000000000000000000000000000000..b20ade6435cee3855c8c36ad28f241c8ec71ceb0
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/overview.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/read_only.png b/src/assets/deepin-editor/editor/zh_HK/fig/read_only.png
new file mode 100755
index 0000000000000000000000000000000000000000..e9ecb117bce231c927a54769d8446bc9f3a56092
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/read_only.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/read_only02.png b/src/assets/deepin-editor/editor/zh_HK/fig/read_only02.png
new file mode 100755
index 0000000000000000000000000000000000000000..fe3fdee35c4d37144555001b17a2c51f14019afb
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/read_only02.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/reading.png b/src/assets/deepin-editor/editor/zh_HK/fig/reading.png
new file mode 100755
index 0000000000000000000000000000000000000000..12ae8421d68a9b4c19d2600e111a879e3f7cbfdb
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/reading.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/toggle_case.png b/src/assets/deepin-editor/editor/zh_HK/fig/toggle_case.png
new file mode 100755
index 0000000000000000000000000000000000000000..e7d395f2710ebf8247a5f9d6561c4415dd2f29e5
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/toggle_case.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/fig/translation.png b/src/assets/deepin-editor/editor/zh_HK/fig/translation.png
new file mode 100755
index 0000000000000000000000000000000000000000..b522e244afa264a01d52ccd08852cc6ca0ef826c
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_HK/fig/translation.png differ
diff --git a/src/assets/deepin-editor/editor/zh_HK/p_editor.md b/src/assets/deepin-editor/editor/zh_HK/p_editor.md
new file mode 100755
index 0000000000000000000000000000000000000000..52c628392068da1747658f6cb395ef2cf9cf2303
--- /dev/null
+++ b/src/assets/deepin-editor/editor/zh_HK/p_editor.md
@@ -0,0 +1,330 @@
+# 文本編輯器|deepin-editor|
+
+## 概述
+
+文本編輯器是一個簡單的文本編輯工具。您可以用它書寫簡單的文本文檔,也可以使用它的高級特性,讓它成為一個代碼編輯工具,支持代碼語法高亮。
+
+
+
+## 使用入門
+
+### 運行文本編輯器
+
+1. 單擊任務欄上的啟動器圖標 ,進入啟動器界面。
+2. 上下滾動鼠標滾輪瀏覽或通過搜索,找到文本編輯器圖標 ,單擊運行。
+3. 右鍵單擊 ,您可以:
+
+ - 單擊 **傳送到桌面**,在桌面創建快捷方式。
+ - 單擊 **傳送到任務欄**,將應用程序固定到任務欄。
+ - 單擊 **加至開機啟動**,將應用程序添加到開機啟動項,在電腦開機時自動運行該應用。
+
+### 關閉文本編輯器
+
+- 在文本編輯器界面,單擊 ,關閉文本編輯器。
+- 在文本編輯器界面,單擊主菜單  > **退出** ,關閉文本編輯器。
+- 在任務欄右鍵單擊 ,選擇 **關閉所有** ,關閉文本編輯器。
+
+
+### 查看快捷鍵
+
+在文本編輯器界面,使用快捷鍵 **Ctrl + Shift + ?** 打開快捷鍵預覽界面,您也可以在設置界面查看快捷鍵。熟練地使用快捷鍵,將大大提升您的操作效率。
+
+
+
+## 基本操作
+
+### 管理標籤頁
+
+- 新建標籤頁/窗口
+
+ - 單擊標籤頁上的按鈕  或  > **新標籤頁** 或使用快捷鍵 **Ctrl + T** 創建一個新的標籤頁。
+ - 單擊  > **新窗口** 或使用快捷鍵 **Ctrl + N** 創建一個新的窗口。
+
+- 調整標籤頁/窗口
+
+ - 拖拽同一窗口內的標籤頁重新排序。
+ - 滾動鼠標切換同一窗口內的標籤頁。
+ - 移出標籤頁創建一個新的窗口,或者從一個窗口移到另外一個窗口中。
+
+- 關閉標籤頁/窗口
+
+ 當窗口中僅有一個標籤頁時,關閉標籤頁的同時也會關閉窗口。
+ - 使用快捷鍵 **Ctrl + W** 關閉當前標籤頁。
+ - 單擊標籤頁上的  按鈕或者單擊鼠標中鍵,關閉當前標籤頁。
+ - 右鍵單擊標籤頁,選擇 **關閉標籤頁** 、**關閉其他標籤頁** 或 **更多關閉方式** 來關閉標籤頁。
+
+ > 說明:如果您的文件發生了變化而沒有保存,文本編輯器會在關閉前提示您保存更改。
+
+
+### 打開文件
+
+您可以採用以下方式打開一個或同時打開多個文本文件,選中的文件將會在新標籤頁中打開:
+
+- 直接拖動文件到文本編輯器界面或其圖標上。
+- 右鍵單擊文件,選擇 **打開方式** > **文本編輯器**。選擇文本編輯器為默認打開程序後,可直接雙擊打開。
+- 在文本編輯器界面,單擊  > **打開文件** 或使用快捷鍵 **Ctrl + O**,在彈出的窗口中選擇文件打開。
+
+
+### 保存文件
+- 單擊  > **保存** 或使用快捷鍵 **Ctrl + S**,保存當前文件。
+- 單擊  > **另存為** 或使用快捷鍵 **Ctrl + Shift + S**,另存當前文件。
+
+
+
+### 打印文件
+
+在文本編輯器中使用打印,需要您連接並配置好打印機。
+
+1. 單擊  > **打印**,也可以使用快捷鍵 **Ctrl + P** 打開打印預覽。
+2. 在打印預覽界面,您可以預覽文件,選擇打印機並設置打印頁面。
+3. 在打印預覽界面,單擊 **高級設置**,可配置紙張大小、打印方式等相關參數。
+4. 單擊 **打印** 即可將文件發送到打印機打印。
+
+
+
+## 編輯文本
+
+### 移動光標
+
+除了使用方向鍵和鼠標單擊移動光標,您還可以使用以下快捷鍵迅速移動光標:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 保存光標位置 | Ctrl + Shift + > |
+| 重置光標位置(跳轉到上次光標保存的位置) | Ctrl + Shift + < |
+| 右移一個詞 (光標向右跳過一個詞) | Ctrl + 右方向鍵 |
+| 左移一個詞 (光標向左跳過一個詞) | Ctrl + 左方向鍵 |
+| 移動到行尾 | End |
+| 移動到行頭 | Home |
+| 移動到文本結尾 | Ctrl + End |
+| 移動到文本開頭 | Ctrl + Home |
+| 移動到行縮進 | Ctrl + M |
+| 向右匹配 (光標移動到右括號的後面) | Alt + P |
+| 向左匹配(光標移動到左括號的前面) | Alt + N |
+
+### 切換大小寫
+
+切換大小寫功能可以將選中的文本全部改為大寫字母、小寫字母或者讓首字母大寫。
+
+1. 選中待更改的文本內容。
+2. 單擊右鍵,選擇 **切換大小寫**。
+3. 選擇 **大寫**/**小寫**/**首字母大寫** 選項,更改會立即生效。
+
+您也可以使用快捷鍵 **Alt + U/ L/ C** 迅速切換大小寫。
+
+
+
+### 高亮文本
+
+文本編輯器支持高亮不同類型的文本。
+單擊底部狀態欄最右側的三角符號, 選擇某種文本類型。若文本中有相應內容則會自動高亮。
+
+
+
+### 刪除文本
+除了向左或向右逐個刪除字符外,您還可以使用以下快捷鍵迅速刪除字符:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 刪除到行尾 | Ctrl + K |
+| 刪除當前行 | Ctrl + Shift + K |
+| 向左刪除一個詞 | Alt + Shift + N |
+| 向右刪除一個詞 | Alt + Shift + M |
+
+### 撤銷操作
+
+如果在編輯文本時發生誤操作,可以使用快捷鍵 **Ctrl + Z** 撤銷操作,或者在右鍵菜單中選擇 **撤銷**。
+
+### 查找文本
+
+1. 單擊  > **查找** 或使用快捷鍵 **Ctrl + F** 打開查找窗口。
+2. 在查找窗口中,輸入要搜索的文本。
+3. 單擊 **下一個**、**上一個** 逐個查找,或使用 **Enter** 鍵查找下一個匹配項。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉查找窗口。
+
+> 竅門:選中一段文本後再進行搜索,則這段文本會自動出現在查找窗口中。
+
+### 替換文本
+1. 單擊  > **替換** 或使用快捷鍵 **Ctrl + H** 打開替換窗口。
+2. 在替換窗口中,輸入要替換的文本以及新文本。
+3. 單擊 **替換** 逐個替換,單擊 **剩餘替換**、**全部替換** 一次性替換剩餘的或所有的匹配文本。單擊 **跳過** 不替換當前匹配的文本。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉搜索窗口。
+
+### 跳到行
+使用該功能可以迅速跳轉到任一行。
+在右鍵菜單中選擇 **跳到行** 或者使用快捷鍵 **Ctrl + G** ,輸入行號即可跳轉到相應行。
+
+### 編輯行
+
+您可以使用以下快捷鍵迅速編輯行:
+
+| 功能 | 快捷鍵 |
+| ------------ | ------------ |
+| 向上插入一行(在上方插入一行) | Ctrl + Enter |
+| 向下插入一行(在下方插入一行) | Ctrl + Shift + Enter |
+| 複製並黏貼當前行 | Ctrl + Shift + D |
+| 上移一行(與上一行交換位置) | Ctrl + Shift + Up |
+| 下移一行(與下一行交換位置) | Ctrl + Shift + Down |
+| 向上滾動一行 | Super + Shift + Up |
+| 向下滾動一行 | Super + Shift + Down |
+| 設置標記 | Alt + H |
+| 取消標記 | Alt + Shift + H |
+| 複製行 | Super + C |
+| 剪切行 | Super + X |
+| 合併行 | Ctrl + J |
+
+### 開啟/關閉只讀模式
+
+1. 使用文本編輯器打開文檔,單擊右鍵,選擇 **開啟只讀模式**。
+2. 在只讀模式下,單擊右鍵,選擇 **關閉只讀模式**。
+
+
+
+
+
+### 語音朗讀
+
+在 **控制中心 > 輔助功能** 中開啟語音朗讀、語音聽寫功能後,可以執行如下操作。
+
+1. 單擊右鍵,選擇 **語音聽寫**,通過麥克風語音輸入後,轉譯文字將被編輯在文檔中
+2. 選擇一段文字後,單擊右鍵,選擇 **語音朗讀**,語音播報選中的文字。
+
+ > 說明:當未選擇文字時,右鍵菜單中 **語音朗讀** 不可啟動,處置灰狀態。
+
+
+
+
+### 文本翻譯
+
+在 **控制中心 > 輔助功能** 中開啟文本翻譯並選擇語言後,可以執行以下操作。
+
+1. 在文本編輯器界面選擇一段文本後,單擊右鍵,選擇 **文本翻譯**,可將該段文本內容翻譯成目標語言。
+
+
+
+
+
+### 列編輯
+
+在文本編輯器界面,按住鍵盤上的 **Alt** 鍵不放,鼠標左鍵單擊多列啟動列編輯模式,為多行代碼同時編輯相同的內容,提高工作效率。
+
+
+
+### 顏色標記
+
+在文本編輯器界面,單擊鼠標右鍵選擇 **顏色標記**,在其下拉列表中進行選擇。
+
+
+
+ - **設置標記**:對某一行或某一段文本內容添加顏色標記;有8種顏色按鈕可供選擇。
+ + 將光標定在某一行,標記當前所在的行。
+ + 選中一段文本內容後,標記選中的文本內容。
+ - **標記所有**:將文本內容全部標記或對已選中的文本內容,在全文中標記匹配項;有8種顏色按鈕可供選擇。
+ + 將光標定在任意一行,將文本內容全部標記。
+ + 選中一段文本內容,在全文中標記匹配項。
+ - **清除上次標記**:清除上次標記操作。
+ - **清除所有標記**:清除當前所有標記。
+
+
+
+### 書籤管理
+
+在文本編輯器設置界面,勾選 **顯示書籤圖標** 後,您可以為任意一行的文本內容添加一個書籤。將鼠標指針移至左側欄任意行號前面會顯示圖標 ,添加成功後該行的書籤圖標會變為藍色填充的圖標 。
+
+- 添加書籤
+
+ + 鼠標左鍵單擊 ,為該行添加書籤。
+ + 鼠標右鍵單擊 ,選擇 **添加書籤**,為該行添加一個書籤。
+ + 將光標定在文本中任意一行,使用快捷鍵 **Ctrl + F2** 為該行添加一個書籤。
+
+- 刪除書籤
+
+ + 鼠標左鍵單擊已填充顏色的書籤圖標,直接刪除該行書籤。
+ + 鼠標右鍵單擊已填充顏色的書籤圖標,選擇 **清除書籤**,刪除該行書籤。
+ + 鼠標右鍵單擊書籤圖標,選擇 **清除所有書籤**,刪除該文本的全部書籤。
+
+ >說明:鼠標移到左側行號前面才會顯示書籤圖標,移出書籤區域,書籤圖標消失。添加書籤後,該圖標一直顯示。
+
+
+
+### 注釋管理
+
+在文本編輯器界面,您可對擴展名為.cpp 、.java 、.py等代碼類型的文件進行添加注釋的操作。
+- 添加注釋
+ + 選中一段文本內容,在右鍵菜單中選擇 **添加注釋**。
+ + 選中一段文本內容,使用快捷鍵 **Alt + A** 添加注釋。
+
+- 取消注釋
+ + 選中一段已添加注釋的文本內容,在右鍵菜單中選擇 **取消注釋**。
+ + 選中一段已添加注釋的文本內容,使用快捷鍵 **Alt + Z** 取消注釋。
+
+ >說明:支持不同代碼語言的注釋,具體以實際為主。例如C,C#,Java注釋符號為 //,Python 注釋符號為 #。
+
+
+
+## 主菜單
+
+在主菜單中,您可以新建窗口、新建標籤頁、[查找文本](#查找文本)、[替換文本](#替換文本)、保存文件、切換窗口主題、查看幫助手冊,了解文本編輯器的更多訊息。
+### 設置
+
+您可以對基礎訊息、快捷鍵和高級訊息進行設置。
+
+#### 基礎設置
+
+1. 單擊 > **設置**。
+2. 在基礎設置選項,您可以選擇:
+ - 設置字體樣式和字號大小。
+ - 勾選 **自動換行**,在編輯區自動換行。
+ - 勾選 **顯示代碼摺疊標誌**,在左側欄顯示 或者按鈕,右鍵單擊按鈕選擇摺疊/展開當前層次或所有層次。
+ - 勾選 **顯示行號**,在左側欄顯示行號。
+ - 勾選 **當前行高亮**,光標所在的行高亮顯示。
+ - 勾選 **顯示書籤圖標**,在左側欄顯示書籤圖標。
+ - 勾選 **顯示空白制符/製表符**,顯示文本中的空白字符和製表符,您也可手動輸入或刪除空白字符和製表符。
+
+ > 竅門:您還可以使用 **Ctrl + 「+」/ 「-」** 來調節文本編輯器的默認字號。使用 **Ctrl + 0** 恢復默認字號。
+
+
+
+#### 快捷鍵設置
+
+1. 單擊> **設置**,在 **快捷鍵** 選項查看當前快捷鍵。
+2. 選擇一種快捷鍵映射。
+3. 單擊快捷鍵編輯框 ,可以自定義快捷鍵。
+
+ > 說明: 快捷鍵映射允許您選擇某一種鍵盤快捷鍵。您可以使用標準快捷鍵,Emacs快捷鍵,或自定義快捷鍵,以符合您的使用習慣。
+
+
+#### 高級設置
+
+1. 單擊  >**設置**。
+2. 在 **高級設置** 選項,您可以設置:
+ - 窗口狀態:正常窗口,最大化或全螢幕。
+ - Tab字符寬度:Tab縮進所佔用的空間大小。
+
+
+
+### 主題
+
+窗口主題包含淺色主題、深色主題和系統主題。
+
+1. 在文本編輯器界面,單擊 。
+2. 單擊 **主題**,選擇一個主題顏色。
+
+### 幫助
+
+查看幫助手冊,進一步了解和使用文本編輯器。
+
+1. 在文本編輯器界面,單擊 。
+2. 單擊 **幫助**。
+3. 查看文本編輯器的幫助手冊。
+
+### 關於
+
+1. 在文本編輯器界面,單擊 。
+2. 單擊 **關於**。
+3. 查看文本編輯器的版本和介紹。
+
+### 退出
+
+1. 在文本編輯器界面,單擊 。
+2. 單擊 **退出**。
\ No newline at end of file
diff --git a/src/assets/deepin-editor/editor/zh_TW/editor.md b/src/assets/deepin-editor/editor/zh_TW/editor.md
new file mode 100644
index 0000000000000000000000000000000000000000..cfa889ae5107711a3401071c8ee26f40ca7079d5
--- /dev/null
+++ b/src/assets/deepin-editor/editor/zh_TW/editor.md
@@ -0,0 +1,307 @@
+# 文字編輯器|deepin-editor|
+
+## 概述
+
+文字編輯器是一個簡單的文字編輯工具。您可以用它書寫簡單的文字檔案,也可以使用它的進階特性,讓它成為一個程式碼編輯工具,支援程式碼語法突顯。
+
+
+
+## 使用入門
+
+### 執行文字編輯器
+
+1. 單擊任務欄上的啟動器圖示 ,進入啟動器介面。
+2. 上下滾動滑鼠滾輪瀏覽或透過搜尋,找到文字編輯器圖示,單擊執行。
+3. 右鍵單擊,您可以:
+
+ - 單擊 **建立桌面捷徑**,在桌面建立捷徑。
+ - 單擊 **釘選到Dock**,將應用程式固定到Dock。
+ - 單擊 **開機啟動**,將應用程式添加到開機啟動項,在電腦開機時自動執行該應用。
+
+### 關閉文字編輯器
+
+- 在文字編輯器介面,單擊 ,關閉文字編輯器。
+- 在文字編輯器介面,單擊主選單 > **退出**, 關閉文字編輯器。
+- 在Dock上右鍵單擊 ,選擇 **全部關閉**, 關閉文字編輯器。
+
+
+### 查看快捷鍵
+
+在文字編輯器介面,使用快捷鍵 **Ctrl + Shift + ?** 打開快捷鍵預覽介面。您也可以在設定介面查看快捷鍵。熟練地使用快捷鍵,將大大提升您的操作效率。
+
+
+
+## 基本操作
+
+### 管理標籤頁
+
+- 建立標籤頁/視窗
+
+ - 單擊標籤頁上的  或  > **建立新標籤頁** 或使用快捷鍵 **Ctrl + T** 建立一個新的標籤頁。
+ - 單擊 > **建立新視窗** 或使用快捷鍵 **Ctrl + N** 建立一個新的視窗。
+
+- 調整標籤頁/視窗
+
+ - 拖曳同一視窗內的標籤頁重新排序。
+ - 滾動滑鼠切換同一視窗內的標籤頁。
+ - 移出標籤頁建立一個新的視窗,或者從一個視窗移到另外一個視窗中。
+
+- 關閉標籤頁/視窗
+
+ 當視窗中僅有一個標籤頁時,關閉標籤頁的同時也會關閉視窗。
+
+ - 使用 快捷鍵**Ctrl + W** 關閉目前標籤頁。
+ - 單擊標籤頁上的  按鈕或者單擊滑鼠中鍵,關閉目前標籤頁。
+ - 右鍵單擊標籤頁,選擇 **關閉標籤頁** 、**關閉其他標籤頁** 或 **更多關閉方式** 來關閉標籤頁。
+
+ > 說明:如果您的檔案發生了變化而沒有儲存,文字編輯器會在關閉前提示您儲存更改。
+
+### 開啟檔案
+
+您可採用以下方式開啟一個或同時開啟多個文字檔案,選中的檔案將會在新標籤頁開啟:
+
+- 直接拖動檔案到文字編輯器介面或其圖示上。
+- 右鍵單擊檔案,選擇 **用其他程式開啟** > **文字編輯器**。選擇文字編輯器為預設開啟程式後,可直接雙擊檔案開啟。
+- 在文字編輯器介面,單擊 > **開啟檔案** 或使用快捷鍵 **Ctrl + O**,在彈出的視窗中選擇檔案。
+
+### 儲存檔案
+- 單擊 > **儲存** 或使用快捷鍵 **Ctrl + S** ,儲存目前檔案。
+- 單擊 > **另存新檔** 或使用快捷鍵 **Ctrl + Shift + S**, 另存目前檔案。
+
+
+### 列印檔案
+
+在文字編輯器中使用列印,需要您連接並配置好印表機。
+
+1. 單擊  > **列印** 或使用快捷鍵 **Ctrl + P** 打開列印預覽。
+2. 在列印預覽介面,您可以預覽檔案,選擇印表機並設定列印頁面。
+3. 在列印預覽介面,單擊 **進階設定**,可配置紙張大小、列印方式等相關參數。
+4. 單擊 **列印** 即可將檔案發送到印表機列印。
+
+
+
+
+
+## 編輯文字
+
+### 移動游標
+
+除了使用方向鍵和滑鼠單擊移動游標,您還可以使用以下快捷鍵迅速移動游標:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 儲存游標位置 | Ctrl + Shift + > |
+| 重設游標位置(跳轉到上次游標儲存的位置) | Ctrl + Shift + < |
+| 後一個字詞 (游標向右跳過一個字詞) | Ctrl + 右方向鍵 |
+| 前一個字詞 (游標向左跳過一個字詞) | Ctrl + 左方向鍵 |
+| 移動到行結尾 | End |
+| 移動到行開頭 | Home |
+| 移動到文字結尾 | Ctrl + End |
+| 移動到文字開頭 | Ctrl + Home |
+| 移到行縮排區塊 | Ctrl + M |
+| 往後一對 (游標移動到右括號的後面) | Alt + P |
+| 往前一對(游標移動到左括號的前面) | Alt + N |
+
+### 切換大小寫
+
+切換大小寫功能可以將選中文字全部改為大寫字母、小寫字母或者首字母大寫。
+
+1. 選中待更改的文字內容。
+2. 單擊右鍵,選擇 **變更大小寫**。
+3. 選擇 **大寫**/**小寫**/**首字母大寫** 選項。文字格式的更改會立即生效。
+
+您也可以使用快捷鍵 **Alt + U/L/C** 迅速切換大小寫。
+
+
+
+### 突顯文字
+
+文字編輯器支援突顯不同類型的文字。單擊底部狀態欄最右側的三角符號, 選擇某種文字類型。若文字中有相應內容則會自動突顯。
+
+
+
+### 刪除文字
+除了向左或向右逐個刪除字元外,您還可以使用以下快捷鍵迅速刪除字元:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 刪除至行結尾所有字元 | Ctrl + K |
+| 刪除目前整行 | Ctrl + Shift + K |
+| 刪除前一個字詞 | Alt + Shift + N |
+| 刪除後一個字詞 | Alt + Shift + M |
+
+### 復原操作
+
+如果在文字編輯時發生誤操作,您可以使用快捷鍵 **Ctrl + Z** 撤銷操作, 或者在右鍵選單中選擇 **復原**。
+
+### 尋找文字
+
+1. 單擊 > **尋找** 或使用快捷鍵 **Ctrl + F** ,打開尋找視窗。
+2. 在尋找視窗中,輸入要搜尋的文字。
+3. 單擊 **上一個**、**下一個** 逐個尋找,或使用 **Enter** 鍵尋找下一個匹配項。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉尋找視窗。
+
+> 竅門:選中一段文字,再選擇尋找,則這段文字會自動出現在尋找視窗中。
+
+### 取代文字
+1. 單擊 > **取代** 或使用快捷鍵 **Ctrl + H**,打開取代視窗。
+2. 在取代為視窗中,輸入要取代的文字以及新文字。
+3. 單擊 **取代** 逐個取代,單擊 **取代剩餘部份**、**全部取代** 一次性取代剩餘的或所有的匹配文字。單擊 **跳過** 不取代目前匹配的文字。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉取代視窗。
+
+### 前往該行
+使用該功能可以迅速前往到任一行。在右鍵選單中選擇 **前往該行** 或者使用快捷键 **Ctrl + G**,輸入行號即可前往到相應行。
+
+### 編輯行
+
+您可以使用以下快捷鍵迅速編輯行:
+
+| 功能 | 快捷鍵 |
+| ------------ | ------------ |
+| 於上方換行(在上方插入一行) | Ctrl + Enter |
+| 於下方換行(在下方插入一行) | Ctrl + Shift + Enter |
+| 複製一行 | Ctrl + Shift + D |
+| 切到上一行(與上一行交換位置) | Ctrl + Shift + Up |
+| 切到下一行(與下一行交換位置) | Ctrl + Shift + Down |
+| 捲到上一行 | Super + Shift + Up |
+| 捲到下一行 | Super + Shift + Down |
+| 標記 | Alt + H |
+| 取消標記 | Alt + Shift + H |
+| 複製一行 | Super + C |
+| 剪下一行 | Super + X |
+| 合併一行 | Ctrl + J |
+
+### 開啟/關閉唯讀模式
+
+1. 使用文字編輯器打開檔案,單擊右鍵,選擇 **開啟唯讀模式**。
+2. 在唯讀模式下,單擊右鍵,選擇 **關閉唯讀模式**。
+
+
+
+
+
+
+### 列编辑
+在文字編輯器介面,按住鍵盤上的 **Alt** 鍵不放,滑鼠左鍵單擊多列啟動列編輯模式,為多行程式碼同時編輯相同的內容,提高工作效率。
+
+
+
+### 顏色標記
+
+在文字編輯器介面,單擊滑鼠右鍵選擇 **顏色標記**,在其下拉選單中進行選擇。
+
+
+
+ - **標記**:對某一行或某一段文字內容添加顏色標記;有8種顏色按鈕可供選擇。
+ + 將游標定在某一行,標記目前所在的行。
+ + 選中一段文字內容後,標記選中的文字內容。
+ - **標記所有**:將文字內容全部標記或對已選中的文字內容,在全文中標記匹配項;有8種顏色按鈕可供選擇。
+ + 將游標定在任意一行,將文字內容全部標記。
+ + 選中一段文字內容,在全文中標記匹配項。
+ - **清除上次標記**:清除上次標記操作。
+ - **清除所有標記**:清除目前所有標記。
+
+
+
+### 書籤管理
+
+在文字編輯器設定介面,勾選 **顯示書籤圖標** 後,您可以為任意一行的文字內容添加書籤,將滑鼠遊標移至左側欄任意一行處會顯示 ,添加成功後該行的書籤圖示會變為藍色填充的圖示 。
+
+- 添加書籤
+
+ + 滑鼠左鍵單擊 ,為該行添加書籤。
+ + 滑鼠右鍵單擊 ,選擇 **添加書籤**,為該行添加書籤。
+ + 將游標定在文字中任意一行,使用快捷鍵 **Ctrl + F2** 為該行添加書籤。
+
+- 刪除書籤
+
+ + 滑鼠左鍵單擊已填充顏色的書籤圖示,直接刪除該行書籤。
+ + 滑鼠右鍵單擊已填充顏色的書籤圖示,選擇 **清除書籤**,刪除該行書籤。
+ + 滑鼠右鍵單擊書籤圖示,選擇 **清除所有書籤**,刪除該文字的全部書籤。
+
+ >說明:滑鼠移到左側行號前面才會顯示書籤圖示,移出書籤區域,書籤圖示消失。添加書籤後,該圖示一直顯示。
+
+
+
+### 注釋管理
+
+在文字編輯器介面,您可以對副檔名為cpp 、java 、py等程式碼類型的檔案進行添加注釋的操作。
+
+- 添加注釋
+ + 選中一段文字內容,單擊右鍵並選擇 **添加注釋**。
+ + 選中一段文字內容,使用快捷鍵 **Alt + A** 添加注釋。
+
+- 取消注釋
+ + 選中一段已添加注釋的文字內容,單擊右鍵並選擇 **取消注釋**。
+ + 選中一段已添加注釋的文字內容,使用快捷鍵 **Alt + Z** 取消注釋。
+
+ >說明:支援不同程式碼語言的注釋,具體以實際為主。例如C,C#,Java注釋符號為 //,Python 注釋符號為 #。
+
+
+
+## 主選單
+
+在主選單中,您可以 建立新視窗、建立新標籤頁、[尋找文字](#尋找文字)、[取代文字](#取代文字)、儲存檔案、切換視窗主題、查看說明手冊,了解文字編輯器的更多訊息。
+
+### 設定
+您可以對基本訊息、快捷鍵和進階訊息進行設定。
+
+#### 基本設定
+
+1. 單擊 > **設定**。
+2. 在基本設定選項,您可以選擇:
+ - 設定字體樣式,選擇字體和字體大小。
+ - 勾選 **文字換行**,在編輯區自動換行。
+ - 勾選 **顯示代碼摺疊標誌**,在左側欄顯示或者按鈕,右鍵單擊按鈕選擇摺疊/展開目前層次或所有層次。
+ - 勾選 **顯示行號**,在左側欄顯示行號。
+ - 勾選**當前行高亮**,游標所在的行突顯顯示。
+ - 勾選 **顯示書籤圖示**,在左側欄顯示書籤圖示。
+ - 勾選 **顯示空白制符/制表符**,顯示文字中的空白字符和制表符,您也可以手動輸入或刪除空白字符和制表符。
+ > 竅門:您還可以使用 **Ctrl + 「+」/ 「-」** 來調節文字編輯器的預設字號。使用 **Ctrl + 0** 復原預設字號。
+
+
+
+#### 快捷鍵設定
+
+1. 單擊 > **設定**,在 **快捷鍵** 選項查看目前快捷鍵。
+2. 選擇一種按鍵映射。
+3. 單擊並重新輸入快捷鍵,可以自訂快捷鍵。
+
+ > 說明: 按鍵映射允許您選擇某一種鍵盤快捷鍵。您可以使用標準快捷鍵、Emacs快捷鍵、或自訂快捷鍵,以符合您的使用習慣。
+
+
+#### 進階設定
+
+1. 單擊 > **設定**。
+2. 在 **進階設定** 選項,您可以設定:
+ - 視窗大小:一般、最大或全螢幕。
+ - Tab寬度:Tab縮排所占用的空間大小。
+
+
+
+### 主題
+
+視窗主題包含亮色主題、暗色主題和系統主題。
+
+1. 在文字編輯器介面,單擊。
+2. 單擊 **主題**,選擇一個主題顏色。
+
+### 說明
+
+查看說明手冊,進一步了解和使用文字編輯器。
+
+1. 在文字編輯器介面,單擊 。
+2. 單擊 **說明**。
+3. 查看文字編輯器的說明手冊。
+
+### 關於
+
+1. 在文字編輯器介面,單擊 。
+2. 單擊 **關於**。
+3. 查看文字編輯器的版本和介紹。
+
+### 退出
+
+1. 在文字編輯器介面,單擊 。
+2. 單擊 **退出**。
+
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/advanced_setting.png b/src/assets/deepin-editor/editor/zh_TW/fig/advanced_setting.png
new file mode 100644
index 0000000000000000000000000000000000000000..7ecf14a7f1162b7c2ad15102f66f03ed97d62263
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/advanced_setting.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/close.png b/src/assets/deepin-editor/editor/zh_TW/fig/close.png
new file mode 100644
index 0000000000000000000000000000000000000000..eb5704b81bca1efccd06786eb2a324c63b3edcf0
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/close.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/color_tag.png b/src/assets/deepin-editor/editor/zh_TW/fig/color_tag.png
new file mode 100644
index 0000000000000000000000000000000000000000..31ebc41567d152199195fbc33b07d52a60b55df5
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/color_tag.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/column mode.png b/src/assets/deepin-editor/editor/zh_TW/fig/column mode.png
new file mode 100644
index 0000000000000000000000000000000000000000..efeb5f854f7f16c90b298e3473dd4a9724c4a1cd
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/column mode.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/d_color_tag.png b/src/assets/deepin-editor/editor/zh_TW/fig/d_color_tag.png
new file mode 100644
index 0000000000000000000000000000000000000000..a5923c736852e1e1e59160a5b733a6d579c0c247
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/d_color_tag.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/d_read-only_02.png b/src/assets/deepin-editor/editor/zh_TW/fig/d_read-only_02.png
new file mode 100644
index 0000000000000000000000000000000000000000..db0fa12522ccc61290002dae7a524cd5a0727d19
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/d_read-only_02.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/d_read_only.png b/src/assets/deepin-editor/editor/zh_TW/fig/d_read_only.png
new file mode 100644
index 0000000000000000000000000000000000000000..af2fcf4fa489ca5e4b178973601efe48467c4f95
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/d_read_only.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/d_read_only_02.png b/src/assets/deepin-editor/editor/zh_TW/fig/d_read_only_02.png
new file mode 100644
index 0000000000000000000000000000000000000000..022dba9fb5956aef8851d907e6270673c3736413
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/d_read_only_02.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/d_toggle_case.png b/src/assets/deepin-editor/editor/zh_TW/fig/d_toggle_case.png
new file mode 100644
index 0000000000000000000000000000000000000000..be9bdc902c80095e57d5c4dc0b50eb94a6bd8159
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/d_toggle_case.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/editer.psd b/src/assets/deepin-editor/editor/zh_TW/fig/editer.psd
new file mode 100644
index 0000000000000000000000000000000000000000..d68083edaf82a349425c63540ac895a3dfa4bb5b
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/editer.psd differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/highlight.png b/src/assets/deepin-editor/editor/zh_TW/fig/highlight.png
new file mode 100644
index 0000000000000000000000000000000000000000..f16308bd678e8650e3701ed9a994a8e7202c9072
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/highlight.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/hotkey.png b/src/assets/deepin-editor/editor/zh_TW/fig/hotkey.png
new file mode 100644
index 0000000000000000000000000000000000000000..e3225d97e31be3827dc2b4bb222b097e61493c94
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/hotkey.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/listen.png b/src/assets/deepin-editor/editor/zh_TW/fig/listen.png
new file mode 100644
index 0000000000000000000000000000000000000000..d397f90eaad0909f49535c74cb5cb58d949b2f2b
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/listen.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/overview.png b/src/assets/deepin-editor/editor/zh_TW/fig/overview.png
new file mode 100644
index 0000000000000000000000000000000000000000..764cf82fcfce532c908bb8f38df53f6013bdab41
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/overview.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/print_setting.png b/src/assets/deepin-editor/editor/zh_TW/fig/print_setting.png
new file mode 100644
index 0000000000000000000000000000000000000000..9d08dc8e9097beb003a7f5b9d5d13cb2e54c103a
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/print_setting.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/read_only.png b/src/assets/deepin-editor/editor/zh_TW/fig/read_only.png
new file mode 100644
index 0000000000000000000000000000000000000000..96658be2ad45d728b8780d9ec4658b72bd56dd86
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/read_only.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/read_only_02.png b/src/assets/deepin-editor/editor/zh_TW/fig/read_only_02.png
new file mode 100644
index 0000000000000000000000000000000000000000..a5f735b475e7c695f9c56c426a82616eb25c0525
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/read_only_02.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/reading.png b/src/assets/deepin-editor/editor/zh_TW/fig/reading.png
new file mode 100644
index 0000000000000000000000000000000000000000..7fe6846cd99c737fe62a3b29e48e76576f170b4e
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/reading.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/text translation.png b/src/assets/deepin-editor/editor/zh_TW/fig/text translation.png
new file mode 100644
index 0000000000000000000000000000000000000000..f76230034be4aecffeed0ee1c6129efd60590c47
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/text translation.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/fig/toggle_case.png b/src/assets/deepin-editor/editor/zh_TW/fig/toggle_case.png
new file mode 100644
index 0000000000000000000000000000000000000000..32351990a6966c71870ccfadedfcca381f573b75
Binary files /dev/null and b/src/assets/deepin-editor/editor/zh_TW/fig/toggle_case.png differ
diff --git a/src/assets/deepin-editor/editor/zh_TW/p_editor.md b/src/assets/deepin-editor/editor/zh_TW/p_editor.md
new file mode 100644
index 0000000000000000000000000000000000000000..615b5138145d800070a47c25dfec04933cf82d9f
--- /dev/null
+++ b/src/assets/deepin-editor/editor/zh_TW/p_editor.md
@@ -0,0 +1,326 @@
+# 文字編輯器|deepin-editor|
+
+## 概述
+
+文字編輯器是一個簡單的文字編輯工具。您可以用它書寫簡單的文字檔案,也可以使用它的進階特性,讓它成為一個程式碼編輯工具,支援程式碼語法突顯。
+
+
+
+## 使用入門
+
+### 執行文字編輯器
+
+1. 單擊任務欄上的啟動器圖示 ,進入啟動器介面。
+2. 上下滾動滑鼠滾輪瀏覽或透過搜尋,找到文字編輯器圖示 并打開。
+3. 在啟動器中,右鍵單擊,您可以:
+
+ - 單擊 **建立桌面捷徑**,在桌面建立捷徑。
+ - 單擊 **釘選到Dock**,將應用程式固定到Dock。
+ - 單擊 **開機啟動**,將應用程式添加到開機啟動項,在電腦開機時自動執行該應用。
+
+### 關閉文字編輯器
+
+- 在文字編輯器介面,單擊 ,關閉文字編輯器。
+- 在文字編輯器介面,單擊主選單 > **退出**, 關閉文字編輯器。
+- 在Dock上右鍵單擊 ,選擇 **全部關閉**, 關閉文字編輯器。
+
+
+### 查看快捷鍵
+
+在文字編輯器介面上,使用快捷鍵 **Ctrl + Shift + ?** 打開快捷鍵預覽介面。您也可以在設定介面查看快捷鍵。熟練地使用快捷鍵,將大大提升您的操作效率。
+
+
+
+## 基本操作
+
+### 管理標籤頁
+
+- 建立標籤頁/視窗
+
+ - 單擊標籤頁上的  或  > **建立新標籤頁** 或使用組合鍵 **Ctrl + T** 建立一個新的標籤頁。
+ - 單擊 > **建立新視窗** 或使用組合鍵 **Ctrl + N** 建立一個新的視窗。
+
+- 調整標籤頁/視窗
+
+ - 拖曳同一視窗內的標籤頁重新排序。
+ - 滾動滑鼠切換同一視窗內的標籤頁。
+ - 移出標籤頁建立一個新的視窗,或者從一個視窗移到另外一個視窗中。
+
+- 關閉標籤頁/視窗
+
+ 當視窗中僅有一個標籤頁時,關閉標籤頁的同時也會關閉視窗。
+
+ - 使用快捷鍵 **Ctrl + W** 關閉目前標籤頁。
+ - 單擊標籤頁上的  按鈕或者單擊滑鼠中鍵,關閉目前標籤頁。
+ - 右鍵單擊標籤頁,選擇 **關閉標籤頁** 、**關閉其他標籤頁** 或 **更多關閉方式** 關閉標籤頁。
+
+ > 說明:如果您的檔案發生了變化而沒有儲存,文字編輯器會在關閉前提示您儲存更改。
+
+### 開啟檔案
+
+您可採用以下方式開啟一個或同時開啟多個文字檔案,選中的檔案將會在新標籤頁開啟:
+
+- 直接拖動檔案到文字編輯器介面或其圖示上。
+- 右鍵單擊檔案,選擇 **用其他程式開啟** > **文字編輯器**。選擇文字編輯器為預設開啟程式後,可直接雙擊檔案開啟。
+- 在文字編輯器介面,單擊 > **開啟檔案** 或使用快捷鍵 **Ctrl + O**,在彈出的視窗中選擇檔案。
+
+### 儲存檔案
+- 單擊 > **儲存**或使用快捷鍵 **Ctrl + S**,儲存目前檔案。
+- 單擊 > **另存新檔** 或 使用快捷鍵**Ctrl + Shift + S**, 另存目前檔案。
+
+
+### 列印檔案
+
+在文字編輯器中使用列印,需要您連接並配置好印表機。
+
+1. 單擊  > **列印**,也可以使用快捷鍵 **Ctrl + P** 打開列印預覽。
+2. 在列印預覽介面,您可以預覽檔案,選擇印表機並設定列印頁面。
+3. 在列印預覽介面,單擊 **進階設定**,可配置紙張大小、列印方式等相關參數。
+4. 單擊 **列印** 即可將檔案發送到印表機列印。
+
+
+
+
+
+## 編輯文字
+
+### 移動游標
+
+除使用方向鍵和滑鼠單擊移動游標,您還可以使用以下快捷鍵迅速移動游標:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 儲存游標位置 | Ctrl + Shift + > |
+| 重設游標位置(跳轉到上次游標儲存的位置) | Ctrl + Shift + < |
+| 後一個字詞 (游標向右跳過一個字詞) | Ctrl + 右方向鍵 |
+| 前一個字詞 (游標向左跳過一個字詞) | Ctrl + 左方向鍵 |
+| 移動到行結尾 | End |
+| 移動到行開頭 | Home |
+| 移動到文字結尾 | Ctrl + End |
+| 移動到文字開頭 | Ctrl + Home |
+| 移到行縮排區塊 | Ctrl + M |
+| 往後一對 (游標移動到右括號的後面) | Alt + P |
+| 往前一對(游標移動到左括號的前面) | Alt + N |
+
+### 切換大小寫
+
+切換大小寫功能可以將選中文字全部改為大寫字母、小寫字母或者首字母大寫。
+
+1. 選中待更改的文字內容。
+2. 單擊右鍵,選擇 **變更大小寫**。
+3. 選擇 **大寫**/**小寫**/**首字母大寫** 選項。文字格式的更改會立即生效。
+
+您也可以使用快捷鍵 **Alt + U/L/C** 迅速切換大小寫。
+
+
+
+### 突顯文字
+
+文字編輯器支援突顯不同類型的文字。單擊底部狀態欄最右側的三角符號, 選擇某種文字類型。若文字中有相應內容則會自動突顯。
+
+
+
+### 刪除文字
+除了向左或向右逐個刪除字元外,您還可以使用以下快捷鍵迅速刪除字元:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 刪除至行結尾所有字元 | Ctrl + K |
+| 刪除目前整行 | Ctrl + Shift + K |
+| 刪除前一個字詞 | Alt + Shift + N |
+| 刪除後一個字詞 | Alt + Shift + M |
+
+### 復原操作
+
+如果在文字編輯時發生誤操作,您可以使用快捷鍵 **Ctrl + Z** 撤銷操作, 或者在右鍵選單中選擇 **復原**。
+
+### 尋找文字
+
+1. 單擊 > **尋找** 或使用組合鍵 **Ctrl + F**,打開尋找視窗。
+2. 在尋找視窗中,輸入要搜尋的文字。
+3. 單擊 **上一個**、**下一個** 逐個尋找,或使用 **Enter** 鍵尋找下一個匹配項。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉尋找視窗。
+
+> 竅門:選中一段文字,再進行搜尋,則這段文字會自動出現在尋找視窗中。
+
+### 取代文字
+1. 單擊 > **取代** 或使用組合鍵 **Ctrl + H**,打開取代視窗。
+2. 在取代視窗中,輸入要取代的文字以及新文字。
+3. 單擊 **取代** 逐個取代,單擊 **取代剩餘部份**、**全部取代** 一次性取代剩餘的或所有的匹配文字。單擊 **跳過** 不取代目前匹配的文字。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉取代視窗。
+
+### 前往該行
+使用該功能可以迅速前往到任一行。在右鍵選單中選擇 **前往該行** 或者使用组合键 **Ctrl + G**,輸入行號即可前往到相應行。
+
+### 編輯行
+
+您可以使用以下快捷鍵迅速編輯行:
+
+| 功能 | 快捷鍵 |
+| ------------ | ------------ |
+| 於上方換行(在上方插入一行) | Ctrl + Enter |
+| 於下方換行(在下方插入一行) | Ctrl + Shift + Enter |
+| 複製一行 | Ctrl + Shift + D |
+| 切到上一行(與上一行交換位置) | Ctrl + Shift + Up |
+| 切到下一行(與下一行交換位置) | Ctrl + Shift + Down |
+| 捲到上一行 | Super + Shift + Up |
+| 捲到下一行 | Super + Shift + Down |
+| 標記 | Alt + H |
+| 取消標記 | Alt + Shift + H |
+| 複製一行 | Super + C |
+| 剪下一行 | Super + X |
+| 合併一行 | Ctrl + J |
+
+### 開啟/關閉唯讀模式
+
+1. 使用文字編輯器打開檔案,單擊右鍵,選擇 **開啟唯讀模式**。
+2. 在唯讀模式下,單擊右鍵,選擇 **關閉唯讀模式**。
+
+
+
+
+
+### 語音朗讀
+
+在「控制中心」>「輔助功能」中開啟語音朗讀、語音聽寫功能後,可以執行如下操作。
+
+1. 單擊右鍵,選擇 **語音聽寫**,使用者透過麥克風語音輸入後,轉譯文字將被編輯在檔案中。
+2. 選擇一段文字後,單擊右鍵,選擇 **語音朗讀**,語音播報選中的文字。
+
+ > 說明:當未選擇文字時,右鍵選單中 **語音朗讀** 不可啟動,處置灰狀態。
+
+
+
+
+### 文字翻譯
+
+在「控制中心」>「輔助功能」中開啟文字翻譯並選擇語言後,可以執行如下操作。
+
+1. 在文字編輯器介面選擇一段文字後,單擊右鍵,選擇 **文字翻譯**,可將該段文字內容翻譯成目標語言。
+
+
+
+
+### 列编辑
+在文字編輯器介面,按住鍵盤上的 **Alt** 鍵不放,滑鼠左鍵單擊多列啟動列編輯模式,為多行程式碼同時編輯相同的內容,提高工作效率。
+
+
+
+### 顏色標記
+
+在文字編輯器介面,滑鼠右鍵選擇 **顏色標記**,在其下拉選單中進行選擇。
+
+
+
+ - **添加標記**:對某一行或某一段文字內容添加顏色標記;有8種顏色按鈕可供選擇。
+ + 將游標定在某一行,標記目前所在的行。
+ + 選中一段文字內容後,標記選中的文字內容。
+ - **標記所有**:將文字內容全部標記或對已選中的文字內容,在全文中標記匹配項;有8種顏色按鈕可供選擇。
+ + 將游標定在任意一行,將文字內容全部標記。
+ + 選中一段文字內容,在全文中標記匹配項。
+ - **清除上次標記**:清除上次標記操作。
+ - **清除所有標記**:清除目前所有標記。
+
+
+
+### 書籤管理
+
+在文字編輯器設定介面,勾選 **顯示書籤圖標** 後,您可以為任意一行的文字內容添加書籤,將滑鼠遊標移至左側欄任意一行處會顯示 ,添加成功後該行的書籤圖示會變為藍色填充的圖示 。
+
+- 添加書籤
+
+ + 滑鼠左鍵單擊 ,為該行添加書籤。
+ + 滑鼠右鍵單擊 ,選擇 **添加書籤**,為該行添加一個書籤。
+ + 將游標定在文字中任意一行,使用組合鍵 **Ctrl + F2** 為該行添加一個書籤。
+
+- 刪除書籤
+
+ + 滑鼠左鍵單擊已填充顏色的書籤圖示,直接刪除該行書籤。
+ + 滑鼠右鍵單擊已填充顏色的書籤圖示,選擇 **清除書籤**,刪除該行書籤。
+ + 滑鼠右鍵單擊書籤圖示,選擇 **清除所有書籤**,刪除該文字的全部書籤。
+
+ >說明:滑鼠移到左側行號前面才會顯示書籤圖示,移出書籤區域,書籤圖示消失。添加書籤後,該圖示一直顯示。
+
+
+
+### 注釋管理
+
+在文字編輯器介面,您可對副檔名為cpp 、java 、py等程式碼類型的檔案進行添加注釋的操作。
+
+- 添加注釋
+ + 選中一段文字內容,在右鍵選單選擇 **添加注釋**。
+ + 選中一段文字內容,使用組合鍵 **Alt + A** 添加注釋。
+
+- 取消注釋
+ + 選中一段已添加注釋的文字內容,在右鍵選單中選擇 **取消注釋**。
+ + 選中一段已添加注釋的文字內容,使用組合鍵 **Alt + Z** 取消注釋。
+
+ >說明:支援不同程式碼語言的注釋,具體以實際為主。例如C,C#,Java注釋符號為 //,Python 注釋符號為 #。
+
+
+
+## 主選單
+
+在主選單中,您可以 建立新視窗、建立新標籤頁、[尋找文字](#尋找文字)、[取代文字](#取代文字)、儲存檔案、切換視窗主題、查看說明手冊,了解文字編輯器的更多訊息。
+
+### 設定
+您可以對基本訊息、快捷鍵和進階訊息進行設定。
+
+#### 基本設定
+
+1. 單擊 > **設定**。
+2. 在基本設定選項,您可以選擇:
+ - 設定字體樣式,選擇字體樣式和字體大小。
+ - 勾選 **文字換行**,在編輯區自動換行。
+ - 勾選 **顯示代碼摺疊標誌**,在左側欄顯示或者按鈕,右鍵單擊按鈕選擇摺疊/展開目前層次或所有層次。
+ - 勾選 **顯示行號**,在左側欄顯示行號。
+ - 勾選**當前行高亮**,游標所在的行突顯顯示。
+ - 勾選 **顯示書籤圖標**,在左側欄顯示書籤圖標。
+ - 勾選 **顯示空白制符/制表符**,顯示文字中的空白字符和制表符,您也可手動輸入或刪除空白字符和制表符。
+ > 竅門:您還可以使用 **Ctrl + 「+」/ 「-」** 調節文字編輯器的預設字號。使用 **Ctrl + 0** 復原預設字號。
+
+
+
+#### 快捷鍵設定
+
+1. 單擊 > **設定**,在 **快捷鍵** 選項查看目前快捷鍵。
+2. 選擇一種按鍵映射。
+3. 單擊並重新輸入快捷鍵,可以自訂快捷鍵。
+
+ > 說明: 按鍵映射允許您選擇某一種鍵盤快捷鍵。您可以使用標準快捷鍵、Emacs快捷鍵、或自訂快捷鍵,以符合您的使用習慣。
+
+
+#### 進階設定
+
+1. 單擊 > **設定**。
+2. 在 **進階設定** 選項,您可以設定:
+ - 視窗大小:一般、最大或全螢幕。
+ - Tab寬度:Tab縮排所占用的空間大小。
+
+
+
+### 主題
+
+視窗主題包含亮色主題、暗色主題和系統主題。
+
+1. 在文字編輯器介面,單擊。
+2. 單擊 **主題**,選擇一個主題顏色。
+
+### 說明
+
+查看說明手冊,進一步了解和使用文字編輯器。
+
+1. 在文字編輯器介面,單擊 。
+2. 單擊 **說明**。
+3. 查看文字編輯器的說明手冊。
+
+### 關於
+
+1. 在文字編輯器介面,單擊 。
+2. 單擊 **關於**。
+3. 查看文字編輯器的版本和介紹。
+
+### 退出
+
+1. 在文字編輯器介面,單擊 。
+2. 單擊 **退出**。
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/+.svg b/src/assets/loongarch64/deepin-editor/editor/common/+.svg
new file mode 100755
index 0000000000000000000000000000000000000000..886d90a83e33497d134bdb3dcc864a5c2df53f20
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/+.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/-.svg b/src/assets/loongarch64/deepin-editor/editor/common/-.svg
new file mode 100755
index 0000000000000000000000000000000000000000..594bc2ea751b91367ea2f591570a8dd11665af0d
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/-.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/0.svg b/src/assets/loongarch64/deepin-editor/editor/common/0.svg
new file mode 100755
index 0000000000000000000000000000000000000000..aa142654920e12798821847ee94c8befaaf646bc
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/0.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/A.svg b/src/assets/loongarch64/deepin-editor/editor/common/A.svg
new file mode 100755
index 0000000000000000000000000000000000000000..909d1da3e635a9773456570aa8e60dde4594b21c
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/A.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/Alt.svg b/src/assets/loongarch64/deepin-editor/editor/common/Alt.svg
new file mode 100755
index 0000000000000000000000000000000000000000..5903a36f213ff9139f202fd40d321eeccc49775c
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/Alt.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/C.svg b/src/assets/loongarch64/deepin-editor/editor/common/C.svg
new file mode 100755
index 0000000000000000000000000000000000000000..c1540bf04cc6cbcbc2fa3a932986b24f5277a97a
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/C.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/Ctrl.svg b/src/assets/loongarch64/deepin-editor/editor/common/Ctrl.svg
new file mode 100755
index 0000000000000000000000000000000000000000..a2bb6738b2825beac7f2239a80b084919d82a780
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/Ctrl.svg
@@ -0,0 +1,16 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/Enter.svg b/src/assets/loongarch64/deepin-editor/editor/common/Enter.svg
new file mode 100755
index 0000000000000000000000000000000000000000..1994b268ad19ddbc1bca8156aaea6fdb2734e9bf
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/Enter.svg
@@ -0,0 +1,17 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/Esc.svg b/src/assets/loongarch64/deepin-editor/editor/common/Esc.svg
new file mode 100755
index 0000000000000000000000000000000000000000..ad8e4937c4a44195ae96a61aaef035250262b3d7
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/Esc.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/F.svg b/src/assets/loongarch64/deepin-editor/editor/common/F.svg
new file mode 100755
index 0000000000000000000000000000000000000000..781b440c8e5893a922ca485c468fe39a007d5b5b
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/F.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/F2.svg b/src/assets/loongarch64/deepin-editor/editor/common/F2.svg
new file mode 100755
index 0000000000000000000000000000000000000000..051adae452a5fd25d55b6df9ec3d34fb99589788
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/F2.svg
@@ -0,0 +1,14 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/G.svg b/src/assets/loongarch64/deepin-editor/editor/common/G.svg
new file mode 100755
index 0000000000000000000000000000000000000000..b57ed109bda0d42386f01c481e160fc0cd2f9083
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/G.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/H.svg b/src/assets/loongarch64/deepin-editor/editor/common/H.svg
new file mode 100755
index 0000000000000000000000000000000000000000..9542c98f0ce653729556a204e2a93a7c9f10f951
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/H.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/L.svg b/src/assets/loongarch64/deepin-editor/editor/common/L.svg
new file mode 100755
index 0000000000000000000000000000000000000000..bb0619d791ff2629b925023301668a356b6be906
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/L.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/N.svg b/src/assets/loongarch64/deepin-editor/editor/common/N.svg
new file mode 100755
index 0000000000000000000000000000000000000000..b7033ae0f1c987ed23028f806a287b47aa8d3383
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/N.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/O.svg b/src/assets/loongarch64/deepin-editor/editor/common/O.svg
new file mode 100755
index 0000000000000000000000000000000000000000..db272edec6ee99dbc68e8dc03d70ee82d41f6b5d
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/O.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/P.svg b/src/assets/loongarch64/deepin-editor/editor/common/P.svg
new file mode 100755
index 0000000000000000000000000000000000000000..8b549241262a344de3ff84b7b27f7998fc1c1fd3
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/P.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/QM.svg b/src/assets/loongarch64/deepin-editor/editor/common/QM.svg
new file mode 100755
index 0000000000000000000000000000000000000000..8b2af9aa6298185307895e429aaf6b4fffe6c57f
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/QM.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/S.svg b/src/assets/loongarch64/deepin-editor/editor/common/S.svg
new file mode 100755
index 0000000000000000000000000000000000000000..8272a7858f352ed776a1a62eb4f74ebdf2bf82bd
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/S.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/Shift.svg b/src/assets/loongarch64/deepin-editor/editor/common/Shift.svg
new file mode 100755
index 0000000000000000000000000000000000000000..cdc7ce5f0034473065cbd73a45c316e180d3b2c0
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/Shift.svg
@@ -0,0 +1,18 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/T.svg b/src/assets/loongarch64/deepin-editor/editor/common/T.svg
new file mode 100755
index 0000000000000000000000000000000000000000..9bc555095472c66c1e811da3899418644a2e79b5
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/T.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/U.svg b/src/assets/loongarch64/deepin-editor/editor/common/U.svg
new file mode 100755
index 0000000000000000000000000000000000000000..c6c24af89cb8dd344c3bad3243f5a440c344032b
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/U.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/W.svg b/src/assets/loongarch64/deepin-editor/editor/common/W.svg
new file mode 100755
index 0000000000000000000000000000000000000000..cb22b6f4a4ac4b7c6ddf42366ba6e222b33bc9ec
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/W.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/Z.svg b/src/assets/loongarch64/deepin-editor/editor/common/Z.svg
new file mode 100755
index 0000000000000000000000000000000000000000..574de2344bd49e866aa3eeb1f71e6a036191fd36
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/Z.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/attention.svg b/src/assets/loongarch64/deepin-editor/editor/common/attention.svg
new file mode 100755
index 0000000000000000000000000000000000000000..23149c05873259cd39721b8ee9c3ab7db86d64c5
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/attention.svg
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/bookmark_normal_light.svg b/src/assets/loongarch64/deepin-editor/editor/common/bookmark_normal_light.svg
new file mode 100755
index 0000000000000000000000000000000000000000..6076d18b77121724a2860fd23b7a703718bdf927
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/bookmark_normal_light.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/bookmarkbig_checked_light.svg b/src/assets/loongarch64/deepin-editor/editor/common/bookmarkbig_checked_light.svg
new file mode 100755
index 0000000000000000000000000000000000000000..d00210a172c209246dd1a23ed78e9c4fbba82508
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/bookmarkbig_checked_light.svg
@@ -0,0 +1,24 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/close_icon.svg b/src/assets/loongarch64/deepin-editor/editor/common/close_icon.svg
new file mode 100755
index 0000000000000000000000000000000000000000..9047265ccb0b8c83821e9059d80a56054121b02a
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/close_icon.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/deepin-editor.svg b/src/assets/loongarch64/deepin-editor/editor/common/deepin-editor.svg
new file mode 100755
index 0000000000000000000000000000000000000000..a8e6fb96946f0b97e35383bf77a1f457e93aef4e
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/deepin-editor.svg
@@ -0,0 +1,23 @@
+
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/deepin_editor.svg b/src/assets/loongarch64/deepin-editor/editor/common/deepin_editor.svg
new file mode 100755
index 0000000000000000000000000000000000000000..ffb562a44c5c648709f9fa5e3cb1baf677e7200b
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/deepin_editor.svg
@@ -0,0 +1,23 @@
+
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/deepin_launcher.svg b/src/assets/loongarch64/deepin-editor/editor/common/deepin_launcher.svg
new file mode 100755
index 0000000000000000000000000000000000000000..5793b3846b7fe6a5758379591215b16c7f9e1b52
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/deepin_launcher.svg
@@ -0,0 +1,43 @@
+
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/icon_menu.svg b/src/assets/loongarch64/deepin-editor/editor/common/icon_menu.svg
new file mode 100755
index 0000000000000000000000000000000000000000..35dd6eacc54a933dc9ebc3f3010edfa7363fecc0
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/icon_menu.svg
@@ -0,0 +1,84 @@
+
+
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/next.svg b/src/assets/loongarch64/deepin-editor/editor/common/next.svg
new file mode 100755
index 0000000000000000000000000000000000000000..ba61fc3e5f99464e7dec7b166beb64d40641b0cf
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/next.svg
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/next_down.svg b/src/assets/loongarch64/deepin-editor/editor/common/next_down.svg
new file mode 100755
index 0000000000000000000000000000000000000000..95baac3db611107248dc47f19ecf596aca8059aa
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/next_down.svg
@@ -0,0 +1,15 @@
+
+
+
+
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/notes.svg b/src/assets/loongarch64/deepin-editor/editor/common/notes.svg
new file mode 100755
index 0000000000000000000000000000000000000000..e9a3aa60a51404c9390bfbea8d8ff09edc0e2e32
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/notes.svg
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/plus_icon.svg b/src/assets/loongarch64/deepin-editor/editor/common/plus_icon.svg
new file mode 100755
index 0000000000000000000000000000000000000000..6b69c7bc64ec9640a82bd3aac6a85939760d84df
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/plus_icon.svg
@@ -0,0 +1,10 @@
+
+
+
+
diff --git a/src/assets/loongarch64/deepin-editor/editor/common/tips.svg b/src/assets/loongarch64/deepin-editor/editor/common/tips.svg
new file mode 100755
index 0000000000000000000000000000000000000000..011c05f4b8f296867cd408a339230323fcbb28dd
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/common/tips.svg
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/editor.md b/src/assets/loongarch64/deepin-editor/editor/en_US/editor.md
new file mode 100644
index 0000000000000000000000000000000000000000..d352e2b72f9dd98ff74fb0c4b785db3212e55b21
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/en_US/editor.md
@@ -0,0 +1,299 @@
+# Text Editor|deepin-editor|
+
+## Overview
+
+Text Editor is a simple text editing tool. You can use it to write a simple text document, or make it a code editing tool with its advanced features which support code syntax highlighting.
+
+
+
+## Guide
+
+### Run Text Editor
+
+1. Click the Launcher icon  in the Dock to enter the Launcher interface.
+2. Locate Text Editor by scrolling the mouse wheel or searching "text editor" in the Launcher interface and click it to run.
+3. In Launcher, right-click Text Editor and you can:
+
+ - Click **Send to desktop** to create a desktop shortcut.
+ - Click **Send to dock** to fix it in the Dock.
+ - Click **Add to startup** to add it to startup and it will automatically run when system boots.
+
+### Exit Text Editor
+
+- On the Text Editor interface, click  to exit.
+- On the Text Editor interface, click  > **Exit** to exit.
+- Right-click  in the Dock and select **Close All** to exit.
+
+### View Shortcuts
+
+On the Text Editor Interface, press **Ctrl + Shift + ?** to view all the shortcuts. You can also check shortcuts in Settings. Proficiency in shortcuts will greatly improve your efficiency.
+
+
+
+## Basic Operations
+
+### Manage Tabs
+
+- Create New Tabs/Windows
+ - Click  or > **New tab** on the title bar or press **Ctrl + T** to create a new tab.
+ - Click > **New window** or press **Ctrl + N** to create a new window.
+
+- Adjust Tabs/Windows
+ - Drag the tab in the same window to reorder tabs.
+ - Scroll the mouse wheel on the title of a tab to reorder tabs in the same window.
+ - Move the tab out of the window to create a new window or move the tab from one window to another.
+
+- Close Tabs /Windows
+
+ The window will be closed as well when there is only one tab in the window.
+
+ - Press **Ctrl + W** to close the file on the file interface.
+ - Move the cursor to the file title, and click the  icon there or the mouse middle button to close the file.
+ - Right-click the file title and select **Close tab** or **Close other tabs** or **More options** to close the tabs.
+
+>  Notes: If you make changes to the file but does not save it, you will be prompted by Text Editor to save before closing the file.
+
+### Open Files
+
+You can open one or multiple text files at one time in the following ways, and the selected file will open in the new tab:
+
+- Drag the file directly to the Text Editor interface or the Text Editor icon.
+- Right-click the file and select **Open with** > **Text Editor**. After selecting Text Editor as the default application for text files in Control Center, you can double-click the file to open it directly.
+- On the Text Editor interface, click > **Open file**, or use the shortcuts **Ctrl + O** to open the file in File Manager.
+
+### Save Files
+
+- Press **Ctrl + S** or click > **Save** to save the current document.
+- Press **Ctrl + Shift + S** or click > **Save as** to save the file as a new one.
+
+### Print Files
+
+To print a file in Text Editor, you should connect and set up the printer first.
+
+1. Click > **Print**, or press **Ctrl + P** to open the print preview interface.
+2. On the preview interface, preview the document,select a printer and set the printing page.
+3. Click the **Advanced** option on the preview interface to select parameters including paper size and layout.
+4. Click **Print** to start printing.
+
+
+
+
+
+## Edit Texts
+
+### Move Cursor
+
+In addition to the arrow keys and mouse clicks, you can also use the following shortcuts to move the cursor quickly:
+
+| Function | Shortcuts |
+| --------------- | ------------ |
+| Save cursor position | Ctrl + Shift + > |
+| Reset cursor position (Jump to cursor last saving position) | Ctrl + Shift + < |
+| Forward one word (Jump forward over one word) | Ctrl + Right |
+| Backward one word (Jump backward over one word) | Ctrl + Left |
+| Move to end of line | End |
+| Move to start of line | Home |
+| Move to end of text | Ctrl + End |
+| Move to start of text | Ctrl + Home |
+| Move to line indentation | Ctrl + M |
+| Forward over a pair (Jump forward after the right parenthesis) | Alt + P |
+| Backward over a pair (Jump backward before the left parenthesis) | Alt + N |
+
+### Change Cases
+
+It helps you change the case of selected text. You can change it to lowercase, uppercase, or capitalize the initial.
+
+1. Select the text.
+2. Right-click and select **Change Case**.
+3. Choose **Upper Case**, **Lower Case**, or **Capitalize**. The changes will take effect immediately.
+
+You can also use **Alt** + **U / L / C** to quickly switch the cases.
+
+
+
+### Highlight Texts
+Text Editor supports highlighting different kinds of texts.
+
+Click the triangle symbol at the far right corner of the status bar at the bottom, and select the type of text you want to highlight. The corresponding contents in the text will be highlighted automatically.
+
+
+
+### Delete Texts
+
+In addition to deleting characters one by one, you can quickly delete characters by using the following shortcuts:
+
+| Function | Shortcuts |
+| --------------- | ------------ |
+| Delete to end of line | Ctrl + K |
+| Delete current line | Ctrl + Shift + K |
+| Delete one word backward | Alt + Shift + N |
+| Delete one word forward | Alt + Shift + M |
+
+### Undo
+
+If you make an incorrect operation, press **Ctrl + Z** to undo it, or right-click to select **Undo**.
+
+### Find Texts
+
+1. Click  and select **Find**, or press **Ctrl** + **F** to open the "Find" box below.
+2. Input the text you want to find.
+3. Click **Previous** /**Next** to find each match, or press the **Enter** key to find the next match.
+4. Press the **Esc** key or click the close icon to close the dialog box.
+
+> Tips: Select the text and conduct search. The text selected will be automatically displayed in the **Find** box.
+
+### Replace Texts
+1. Click , and select **Replace**, or press **Ctrl + H** to open the **Replace** box below.
+2. Input the text to be replaced and the new text.
+3. Click **Replace** to replace the matches one by one and click **Replace Rest** and **Replace All** to replace the rest or all the matches at once. Click **Skip** to skip the current matching text.
+4. Press **Esc** or click the close icon to close the dialog box.
+
+### Go to Line
+Use Go to Line to jump to the specific line directly.
+Right-click and select **Go to Line**, or press **Ctrl + G** and then input the line number to go to that line.
+
+### Edit Line
+
+Use the shortcuts below to edit lines easily:
+
+| Function | Shortcuts |
+| ------------ | ------------ |
+| New line above (Insert one line above) | Ctrl + Enter |
+| New line below (Insert one line below) | Ctrl + Shift + Enter |
+| Duplicate line | Ctrl + Shift + D |
+| Swap line up (Swap the current line with above line) | Ctrl + Shift + Up |
+| Swap line down (Swap the current line with below line) | Ctrl + Shift + Down |
+| Scroll up one line | Super + Shift + Up |
+| Scroll down one line | Super + Shift + Down |
+| Mark | Alt + H |
+| Unmark | Alt + Shift + H |
+| Copy line | Super + C |
+| Cut line | Super + X |
+| Merge lines | Ctrl + J |
+
+### Enable/Disable Read-only Mode
+
+1. Open the document with Text Editor and right-click to select **Turn on Read-only Mode**.
+
+
+
+
+2. Right-click to select **Turn off Read-only Mode** under the read-only mode.
+
+
+
+
+### Use Column Mode
+
+Press and hold the **Alt** key on the keyboard, drag the mouse to select multiple lines, and edit the identical contents in multiple lines of codes efficiently by using the column mode function.
+
+
+
+### Color Mark
+
+Select the text to be marked in Text Editor, right-click to select **Color Mark** and select the corresponding options in the drop-down list as needed.
+
+
+
+
+- Select **Mark** to mark a certain line or a paragraph of texts. You can choose from 8 colors displayed through icons.
+ - Place the cursor at any line and you can mark the current line.
+ - Select a paragraph of texts and you can mark the selected texts.
+- Select **Mark All** to mark all the contents in Text Editor, or mark all the matching contents of selected texts in Text Editor. You can choose from 8 colors displayed through icons.
+ - Place the cursor at any line and you can mark all contents.
+ - Select any content and you can mark the same content in the whole document.
+- Select **Clear Last Mark** to cancel the last mark operation.
+- Select **Clear All Marks** to cancel all the current marks.
+
+
+### Manage Bookmarks
+
+Check **Show bookmarks icon** in **Settings** and you can add a bookmark for any line on the Text Editor interface. The icon  shows up when you move the cursor to any line in the left column, and the icon  will appear after a bookmark is successfully added.
+
+- Add bookmarks
+
+ + Click  to add a bookmark for the line.
+ + Right-click  and select **Add bookmark** to add a bookmark for the line.
+ + Place the cursor on any line and press **Ctrl + F2** to add a bookmark for the line.
+
+- Delete bookmarks
+
+ + Click the colored bookmark icon  to delete the bookmark of the line directly.
+ + Right-click the colored bookmark icon  to select **Remove Bookmark** to delete the bookmark in the line.
+ + Right-click a bookmark to select **Remove All Bookmarks** to delete all the bookmarks in the text.
+ >Notes: The bookmark icon appears only when cursor is hovered over to the left of the line number in the left column; when it's moved beyond the left bookmark column, the bookmark icon will disappear. The bookmark icon will always be displayed after being added.
+
+
+### Manage Comments
+
+You can add comments to any text with a code type suffix, such as cpp and java, among others.
+
+- Add comments
+ - Select the text needed and right-click to select **Add Comment**.
+ - Select the text needed and press **Alt + A** to add comments.
+
+- Cancel comments
+ - Select the text with comments, and right-click to select **Remove Comment**.
+- Select the text with comments, and press **Alt + Z** to cancel comments.
+
+
+> Notes: This supports comments in different languages. Please refer to actual conditions for detailed information. For example, comment symbol for C, C# and Java is // and comment symbol for Python is #.
+
+## Main Menu
+
+On the main menu, you can Create New Windows, Create New Files, [Find Texts](#Find Texts), [Replace Texts](#Replace Texts), [Save Files](#Save Files), switch window themes, view help manual, and get more information about Text Editor.
+
+### Settings
+
+You can set the basic information, shortcuts and advanced information in settings.
+
+#### Basic Settings
+
+Click > **Settings** and you can perform the following in the Settings window:
+
+- Select the Font and Font Size.
+- Check or uncheck **Word wrap**.
+- Check **Code folding flag** and  or  are displayed in the edit area. Right-click to select **Fold/Unfold Current Level** or **Fold/Unfold All** to perform the corresponding operations.
+- Check **Show line numbers** to display the line number in the edit area.
+- Check **Highlight current line** to highlight the current line.
+- Check **Show bookmarks icon** to display the bookmarks in the text.
+- Check **Show whitespaces and tabs** to display all the white spaces and tabs. You can also input or delete white spaces and tabs manually.
+
+> Tips: You can also use **Ctrl + “+”/ “-”** to adjust the font size, and press **Ctrl + 0** to restore default font size.
+
+#### Shortcuts Settings
+1. Click > **Settings** to view the current shortcut in the **Shortcuts** option.
+2. Select a keymap in **Shortcuts** and view the shortcuts.
+3. You can click and customize new shortcuts.
+
+> Notes: You can choose a proper keymap to fit your habits, including standard keymap, Emacs keymap, or customize it as you like.
+
+#### Advanced Settings
+
+1. Click > **Settings**.
+2. In the **Advanced** option, you can set:
+ - Window size: Normal, Maximum, or Full screen;
+ - Tab width: The indentation width when pressing Tab.
+
+
+### Theme
+
+The window theme provides three theme types, namely Light Theme, Dark Theme and System Theme.
+
+1. On the Text Editor interface, click .
+2. Click **Theme** to select one theme.
+
+### Help
+
+1. On the Text Editor interface, click .
+2. Select **Help** to view the manual of Text Editor.
+
+### About
+
+1. On the Text Editor interface, click .
+2. Select **About** to view the version and introduction of Text Editor.
+
+### Exit
+
+1. On the Text Editor interface, click .
+2. Click **Exit** to exit Text Editor.
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/advanced-preview.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/advanced-preview.png
new file mode 100644
index 0000000000000000000000000000000000000000..b12ff1347c2ff1fc6d17805d44cc215b9b234d81
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/advanced-preview.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/changecase.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/changecase.png
new file mode 100644
index 0000000000000000000000000000000000000000..0f94f0f94b70e3a1e65bba684599dffda3985870
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/changecase.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/colormark.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/colormark.png
new file mode 100644
index 0000000000000000000000000000000000000000..ed393530f486cfd88c0e53881cbc6e1862edb8fb
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/colormark.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/column mode.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/column mode.png
new file mode 100644
index 0000000000000000000000000000000000000000..bc478448411363235bb3294c199cafe260b817ac
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/column mode.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_changecase.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_changecase.png
new file mode 100644
index 0000000000000000000000000000000000000000..53176e9378f77cac57e98266633c28c3bb5ebc90
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_changecase.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_colormark.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_colormark.png
new file mode 100644
index 0000000000000000000000000000000000000000..ee19302f254db85d79cd7a1dbf3920533ee83875
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_colormark.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_readonly.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_readonly.png
new file mode 100644
index 0000000000000000000000000000000000000000..13c25165f661754080ac0b8fbace48e935ed1138
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_readonly.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_turnoffreadonly.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_turnoffreadonly.png
new file mode 100644
index 0000000000000000000000000000000000000000..12a65856d37692ad03e203507ed05ada144afd21
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/d_turnoffreadonly.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/highlight.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/highlight.png
new file mode 100644
index 0000000000000000000000000000000000000000..0b561fa4cf89da7627d88279df78209384d1538e
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/highlight.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/hotkey.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/hotkey.png
new file mode 100644
index 0000000000000000000000000000000000000000..d046a1d3d405db2050d1a3dec831906c6c50f2f1
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/hotkey.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/mark.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/mark.png
new file mode 100644
index 0000000000000000000000000000000000000000..2d49df34f09e43372b9478381969d3d19102555b
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/mark.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/overview.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/overview.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce8e1b6c31ae66c186b22a30e67e98809495d5c9
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/overview.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/overviewx2.jpg b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/overviewx2.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..626835806e1f4751970f9de1f083246c28b655c0
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/overviewx2.jpg differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/pagesetup.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/pagesetup.png
new file mode 100644
index 0000000000000000000000000000000000000000..af37bba809612860509fddb4cb33aa4ad5075e79
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/pagesetup.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/preview.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/preview.png
new file mode 100644
index 0000000000000000000000000000000000000000..88ad6e0b5735bbd793a89aac5dfc4162c1f16f7a
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/preview.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/printer.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/printer.png
new file mode 100644
index 0000000000000000000000000000000000000000..e7e386de11866008179399223b542ab1952be2bb
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/printer.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/read_only.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/read_only.png
new file mode 100644
index 0000000000000000000000000000000000000000..6a67a2375e880e366cdd397fb79c81a86d6c5469
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/read_only.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/read_only_02.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/read_only_02.png
new file mode 100644
index 0000000000000000000000000000000000000000..8dac668ec8614d9c8a6b954eab16c830e37b168a
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/read_only_02.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/reading.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/reading.png
new file mode 100644
index 0000000000000000000000000000000000000000..0089c2cf21bb0247ffbea65eead4b7798d9819cc
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/reading.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/shortcuts.jpg b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/shortcuts.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..a109071e5aec5af0e6f8dcb18ec923c0812b07ce
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/shortcuts.jpg differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/shortcutsx2.jpg b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/shortcutsx2.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..d595feed21482567d3dc5383ef39452c58574c85
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/shortcutsx2.jpg differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/texttospeech.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/texttospeech.png
new file mode 100644
index 0000000000000000000000000000000000000000..41c37956862e9948f322891fc630f1643b7e950e
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/texttospeech.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/translate.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/translate.png
new file mode 100644
index 0000000000000000000000000000000000000000..7c2999b7c5378109de08573a245be9a3f69db7b4
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/translate.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/en_US/fig/translation.png b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/translation.png
new file mode 100644
index 0000000000000000000000000000000000000000..6b401d0b3033a8eb4c1a34269751f711bf783ca0
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/en_US/fig/translation.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/editor.md b/src/assets/loongarch64/deepin-editor/editor/zh_CN/editor.md
new file mode 100755
index 0000000000000000000000000000000000000000..400afe05dd62a80753dcfafb3299ceb89084195d
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/zh_CN/editor.md
@@ -0,0 +1,324 @@
+# 文本编辑器|deepin-editor|
+
+## 概述
+
+文本编辑器是一个简单的文本编辑工具。您可以用它书写简单的文本文档,也可以使用它的高级特性,让它成为一个代码编辑工具,支持代码语法高亮。
+
+
+
+## 使用入门
+
+通过以下方式运行或关闭文本编辑器,或者创建文本编辑器的快捷方式。
+
+### 运行文本编辑器
+
+1. 单击任务栏上的启动器图标 ,进入启动器界面。
+2. 上下滚动鼠标滚轮浏览或通过搜索,找到文本编辑器图标 ,单击运行。
+3. 右键单击,您可以:
+
+ - 单击 **发送到桌面**,在桌面创建快捷方式。
+ - 单击 **发送到任务栏**,将应用程序固定到任务栏。
+ - 单击 **开机自动启动**,将应用程序添加到开机启动项,在电脑开机时自动运行该应用。
+
+### 退出文本编辑器
+
+- 在文本编辑器界面,单击 ,退出文本编辑器。
+- 在文本编辑器界面,单击主菜单  > **退出** ,退出文本编辑器。
+- 在任务栏右键单击 ,选择 **关闭所有** ,退出文本编辑器。
+
+
+### 查看快捷键
+
+在文本编辑器界面,使用快捷键 **Ctrl + Shift + ?** 打开快捷键预览界面,您也可以在设置界面查看快捷键。熟练地使用快捷键,将大大提升您的操作效率。
+
+
+
+## 基本操作
+
+### 管理标签页
+
+- 新建标签页/窗口
+
+ - 单击标签页上的按钮  或  > **新标签页** 或使用快捷键 **Ctrl + T** 创建一个新的标签页。
+ - 单击 > **新窗口** 或使用快捷键 **Ctrl + N** 创建一个新的窗口。
+
+- 调整标签页/窗口
+
+ - 拖拽同一窗口内的标签页重新排序。
+ - 滚动鼠标切换同一窗口内的标签页。
+ - 移出标签页创建一个新的窗口,或者从一个窗口移到另外一个窗口中。
+
+- 关闭标签页/窗口
+
+ 当窗口中仅有一个标签页时,关闭标签页的同时也会关闭窗口。
+ - 使用快捷键 **Ctrl + W** 关闭当前标签页。
+ - 单击标签页上的按钮  或者单击鼠标中键,关闭当前标签页。
+ - 右键单击标签页,选择 **关闭标签页** 、**关闭其他标签页** 或 **更多关闭方式** 来关闭标签页。
+
+ > 说明:如果您的文件发生了变化而没有保存,文本编辑器会在关闭前提示您保存更改。
+
+
+
+### 打开文件
+
+
+您可以采用以下方式打开一个或同时打开多个文本文件,选中的文件将会在新标签页打开:
+
+- 直接拖动文件到文本编辑器界面或其图标上。
+- 右键单击文件,选择 **打开方式** > **文本编辑器**。选择文本编辑器为默认打开程序后,可直接双击打开。
+- 在文本编辑器界面,单击  > **打开文件** 或使用快捷键 **Ctrl + O**,在弹出的窗口中选择文件。
+
+
+
+### 保存文件
+- 单击  > **保存** 或使用快捷键 **Ctrl + S**,保存当前文件。
+- 单击  > **另存为** 或使用快捷键 **Ctrl + Shift + S**,另存当前文件。
+
+
+
+### 打印文件
+
+在文本编辑器中使用打印,需要您连接并配置好打印机。
+
+1. 单击  > **打印** 或使用快捷键 **Ctrl + P** 打开打印预览。
+2. 在打印预览界面,您可以预览文件,选择打印机并设置打印页面。
+3. 在打印预览界面,单击 **高级设置**,可配置纸张大小、打印方式等相关参数。
+4. 单击 **打印** 即可将文件发送到打印机打印。
+
+
+
+
+
+
+
+## 编辑文本
+
+### 移动光标
+
+除了使用方向键和鼠标点击移动光标,您还可以使用以下快捷键迅速移动光标:
+
+| 功能 | 快捷键 |
+| --------------- | ------------ |
+| 保存光标位置 | Ctrl + Shift + > |
+| 重置光标位置(跳转到上次光标保存的位置) | Ctrl + Shift + < |
+| 右移一个词 (光标向右跳过一个词) | Ctrl + 右方向键 |
+| 左移一个词 (光标向左跳过一个词) | Ctrl + 左方向键 |
+| 移动到行尾 | End |
+| 移动到行头 | Home |
+| 移动到文本结尾 | Ctrl + End |
+| 移动到文本开头 | Ctrl + Home |
+| 移动到行缩进 | Ctrl + M |
+| 向右匹配 (光标移动到右括号的后面) | Alt + P |
+| 向左匹配(光标移动到左括号的前面) | Alt + N |
+
+### 切换大小写
+
+切换大小写功能可以将选中的文本全部改为大写字母、小写字母或者让首字母大写。
+
+1. 选中待更改的文本内容。
+2. 单击右键,选择 **切换大小写**。
+3. 选择 **大写**/**小写**/**首字母大写** 选项,更改会立即生效。
+
+您也可以使用快捷键 **Alt + U/ L/ C** 迅速切换大小写。
+
+
+
+### 高亮文本
+
+文本编辑器支持高亮不同类型的文本。
+单击底部状态栏最右侧的三角符号, 选择某种文本类型。若文本中有相应内容则会自动高亮。
+
+
+
+### 删除文本
+除了向左或向右逐个删除字符外,您还可以使用以下快捷键迅速删除字符:
+
+| 功能 | 快捷键 |
+| --------------- | ------------ |
+| 删除到行尾 | Ctrl + K |
+| 删除当前行 | Ctrl + Shift + K |
+| 向左删除一个词 | Alt + Shift + N |
+| 向右删除一个词 | Alt + Shift + M |
+
+### 撤销操作
+
+如果在编辑文本时发生误操作,可以使用快捷键 **Ctrl + Z** 撤销操作,或者在右键菜单中选择 **撤销**。
+
+### 查找文本
+
+1. 单击  > **查找** 或使用快捷键 **Ctrl + F**,打开查找窗口。
+2. 在查找窗口中,输入要搜索的文本。
+3. 单击 **下一个**、**上一个** 逐个查找,或使用 **Enter** 键查找下一个匹配项。
+4. 按下 **Esc** 键或单击关闭按钮,关闭查找窗口。
+
+> 窍门:选中一段文本后再进行查找,则这段文本会自动出现在查找窗口中。
+
+### 替换文本
+1. 单击  > **替换** 或使用快捷键 **Ctrl + H** ,打开替换窗口。
+2. 在替换窗口中,输入要替换的文本以及新文本。
+3. 单击 **替换** 逐个替换;单击 **剩余替换**、**全部替换** 一次性替换剩余的或所有的匹配文本;单击 **跳过** 不替换当前匹配的文本。
+4. 按下 **Esc** 键或单击关闭按钮,关闭搜索窗口。
+
+### 跳到行
+使用该功能可以迅速跳转到任一行。
+在右键菜单中选择 **跳到行** 或者使用快捷键 **Ctrl + G** ,输入行号即可跳转到相应行。
+
+### 编辑行
+
+您可以使用以下快捷键迅速编辑行:
+
+| 功能 | 快捷键 |
+| ------------ | ------------ |
+| 向上插入一行(在上方插入一行) | Ctrl + Enter |
+| 向下插入一行(在下方插入一行) | Ctrl + Shift + Enter |
+| 复制并粘贴当前行 | Ctrl + Shift + D |
+| 上移一行(与上一行交换位置) | Ctrl + Shift + Up |
+| 下移一行(与下一行交换位置) | Ctrl + Shift + Down |
+| 向上滚动一行 | Super + Shift + Up |
+| 向下滚动一行 | Super + Shift + Down |
+| 设置标记 | Alt + H |
+| 取消标记 | Alt + Shift + H |
+| 复制行 | Super + C |
+| 剪切行 | Super + X |
+| 合并行 | Ctrl + J |
+
+### 开启/关闭只读模式
+
+1. 使用文本编辑器打开文档,单击右键,选择 **开启只读模式**。
+2. 在只读模式下,单击右键,选择 **关闭只读模式**。
+
+
+
+
+
+
+### 列编辑
+
+在文本编辑器界面,按住 **Alt** 键不放,鼠标左键单击多列启动列编辑模式,为多行代码同时编辑相同的内容,提高工作效率。
+
+
+
+
+
+### 颜色标记
+
+在文本编辑器界面,单击鼠标右键选择 **颜色标记**,在其下拉列表中进行选择。
+
+
+
+ - **添加标记**:对某一行或某一段文本内容添加颜色标记;有8种颜色按钮可供选择。
+ + 将光标定在某一行,标记当前所在的行。
+ + 选中一段文本内容后,标记选中的文本内容。
+ - **标记所有**:将文本内容全部标记或对已选中的文本内容,在全文中标记匹配项;有8种颜色按钮可供选择。
+ + 将光标定在任意一行,将文本内容全部标记。
+ + 选中一段文本内容,在全文中标记匹配项。
+
+ - **清除上次标记**:清除上次标记操作。
+ - **清除所有标记**:清除当前所有标记。
+
+
+
+### 书签管理
+
+在文本编辑器设置界面,勾选 **显示书签图标** 后,您可以为任意一行的文本内容添加书签。将鼠标指针移至左侧栏任意行号前面会显示图标 ,添加成功后该行的书签图标会变为蓝色填充的图标 。
+
+- 添加书签
+
+ + 鼠标左键单击 ,为该行添加书签。
+ + 鼠标右键单击 ,选择 **添加书签**,为该行添加一个书签。
+ + 将光标定在文本中任意一行,使用快捷键 **Ctrl + F2** 为该行添加一个书签。
+
+
+- 删除书签
+
+ + 鼠标左键单击已填充颜色的书签图标,直接删除该行书签。
+ + 鼠标右键单击已填充颜色的书签图标,选择 **清除书签**,删除该行书签。
+ + 鼠标右键单击书签图标,选择 **清除所有书签**,删除该文本的全部书签。
+
+ >说明:鼠标移到左侧行号前面才会显示书签图标,移出书签区域,书签图标消失。添加书签后,该图标一直显示。
+
+
+
+### 注释管理
+
+在文本编辑器界面,您可以对扩展名为.cpp 、.java 、.py等代码类型的文件进行添加注释的操作。
+
+- 添加注释
+ + 选中一段文本内容,单击右键并选择 **添加注释**。
+ + 选中一段文本内容,使用快捷键 **Alt + A** 添加注释。
+
+- 取消注释
+ + 选中一段已添加注释的文本内容,单击右键并选择 **取消注释**。
+ + 选中一段已添加注释的文本内容,使用快捷键 **Alt + Z** 取消注释。
+
+ >说明:支持不同代码语言的注释,具体以实际为主。例如C,C#,Java注释符号为 //,Python 注释符号为 #。
+
+
+
+## 主菜单
+
+在主菜单中,您可以新建窗口、新建标签页、[查找文本](#查找文本)、[替换文本](#替换文本)、保存文件、切换窗口主题、查看帮助手册,了解文本编辑器的更多信息。
+
+### 设置
+
+您可以对基础信息、快捷键和高级信息进行设置。
+
+#### 基础设置
+
+1. 单击 > **设置**。
+2. 在基础设置选项,您可以选择:
+ - 设置字体样式和字号大小。
+ - 勾选 **自动换行**,在编辑区自动换行。
+ - 勾选 **代码折叠标志**,在左侧栏显示按钮或者 ,右键单击按钮选择折叠/展开当前层次或所有层次。
+ - 勾选 **显示行号**,在左侧栏显示行号。
+ - 勾选 **当前行高亮**,光标所在的行高亮显示。
+ - 勾选 **显示书签图标**,在左侧栏显示书签图标。
+ - 勾选 **显示空白制符/制表符**,显示文本中的空白字符和制表符,您也可以手动输入或删除空白字符和制表符。
+
+ > 窍门:您还可以使用 **Ctrl + “+”/ “-”** 来调节文本编辑器的默认字号。使用 **Ctrl + 0** 恢复默认字号。
+
+
+
+#### 快捷键设置
+
+1. 单击  > **设置**,在 **快捷键** 选项查看当前快捷键。
+2. 选择一种快捷键映射。
+3. 您可以单击并重新输入快捷键,自定义快捷键。
+
+ > 说明: 快捷键映射允许您选择某一种键盘快捷键。您可以使用标准快捷键,Emacs快捷键,或自定义快捷键,以符合您的使用习惯。
+
+
+#### 高级设置
+
+1. 单击  > **设置**。
+2. 在 **高级设置** 选项,您可以设置:
+ - 窗口状态:正常窗口,最大化或全屏。
+ - Tab字符宽度:Tab缩进所占用的空间大小。
+
+
+
+### 主题
+
+窗口主题包含浅色主题、深色主题和系统主题。
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **主题**,选择一个主题颜色。
+
+### 帮助
+
+查看帮助手册,进一步了解和使用文本编辑器。
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **帮助**。
+3. 查看文本编辑器的帮助手册。
+
+### 关于
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **关于**。
+3. 查看文本编辑器的版本和介绍。
+
+### 退出
+
+1. 在文本编辑器界面,单击 。
+2. 选择 **退出**。
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/close.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/close.png
new file mode 100755
index 0000000000000000000000000000000000000000..eb5704b81bca1efccd06786eb2a324c63b3edcf0
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/close.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/colortag.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/colortag.png
new file mode 100755
index 0000000000000000000000000000000000000000..5b64f60d1096bbfc488196af98b4c546e64ff20d
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/colortag.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/column_mode.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/column_mode.png
new file mode 100755
index 0000000000000000000000000000000000000000..52ec0e407f09e3db763f9c17b0c39a52e9ca54fd
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/column_mode.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_colortag.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_colortag.png
new file mode 100755
index 0000000000000000000000000000000000000000..f7021f8e32c0237bd8cf2500545428ef5573ecd1
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_colortag.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_column_mode.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_column_mode.png
new file mode 100755
index 0000000000000000000000000000000000000000..76ee58b8e34c2ffc15d3a034d0399bbb401f8a80
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_column_mode.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_read_only.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_read_only.png
new file mode 100755
index 0000000000000000000000000000000000000000..384de02df149c88f91608b2787589a89b7dcbeb6
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_read_only.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_read_only02.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_read_only02.png
new file mode 100755
index 0000000000000000000000000000000000000000..f3200d80ae77470ca94e77561727ac1e1119e106
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_read_only02.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_toggle_case.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_toggle_case.png
new file mode 100755
index 0000000000000000000000000000000000000000..05733d417f05b52435eb62310f6b7f635439e66b
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/d_toggle_case.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/editer.psd b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/editer.psd
new file mode 100755
index 0000000000000000000000000000000000000000..d68083edaf82a349425c63540ac895a3dfa4bb5b
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/editer.psd differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/highlight.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/highlight.png
new file mode 100755
index 0000000000000000000000000000000000000000..955ff0130d4ade9801a58c4821aab115a0b64b77
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/highlight.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/hotkey.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/hotkey.png
new file mode 100755
index 0000000000000000000000000000000000000000..37e87eebeddeb9c6628793abbe1ef9cc4067f260
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/hotkey.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/listen.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/listen.png
new file mode 100755
index 0000000000000000000000000000000000000000..d397f90eaad0909f49535c74cb5cb58d949b2f2b
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/listen.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/overview.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/overview.png
new file mode 100755
index 0000000000000000000000000000000000000000..56e6ef348cb76f88f29dae3c3cbaa93e706260fd
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/overview.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/printer.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/printer.png
new file mode 100644
index 0000000000000000000000000000000000000000..180809cf56c67869cc00d997e25d52b9d7498627
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/printer.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/printer_setting.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/printer_setting.png
new file mode 100644
index 0000000000000000000000000000000000000000..7b0b7a5a077acf1e074da7fe969eb2b4dc7ac03f
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/printer_setting.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/read_only.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/read_only.png
new file mode 100755
index 0000000000000000000000000000000000000000..9d26b1e1e316a68c0abee8e3ad751078bfb0a427
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/read_only.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/read_only_02.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/read_only_02.png
new file mode 100755
index 0000000000000000000000000000000000000000..960b5a350fa3ab4dcf7917aa37101d8045b5c843
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/read_only_02.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/reading.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/reading.png
new file mode 100755
index 0000000000000000000000000000000000000000..7dbbeed5c8c7cb8933856dcdec4ec92e36b09ed1
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/reading.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/text_translation.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/text_translation.png
new file mode 100755
index 0000000000000000000000000000000000000000..890ecd017a37cc38886ab90c129cbd834137ffa1
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/text_translation.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/togglecase.png b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/togglecase.png
new file mode 100755
index 0000000000000000000000000000000000000000..63ac808ab35ececc3d630fda919d7a7b1609d896
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_CN/fig/togglecase.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/editor.md b/src/assets/loongarch64/deepin-editor/editor/zh_HK/editor.md
new file mode 100755
index 0000000000000000000000000000000000000000..051eb3d4cb8abeed711382b3946cde670f696c78
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/zh_HK/editor.md
@@ -0,0 +1,312 @@
+# 文本編輯器|deepin-editor|
+
+## 概述
+
+文本編輯器是一個簡單的文本編輯工具。您可以用它書寫簡單的文本文檔,也可以使用它的高級特性,讓它成為一個代碼編輯工具,支持代碼語法高亮。
+
+
+
+## 使用入門
+
+通過以下方式運行或關閉文本編輯器,或者創建文本編輯器的快捷方式。
+
+### 運行文本編輯器
+
+1. 單擊任務欄上的啟動器圖標 ,進入啟動器界面。
+2. 上下滾動鼠標滾輪瀏覽或通過搜索,找到文本編輯器圖標,單擊運行。
+3. 右鍵單擊,您可以:
+
+ - 單擊 **傳送到桌面**,在桌面創建快捷方式。
+ - 單擊 **傳送到任務欄**,將應用程序固定到任務欄。
+ - 單擊 **加至開機啟動**,將應用程序添加到開機啟動項,在電腦開機時自動運行該應用。
+
+### 關閉文本編輯器
+
+- 在文本編輯器界面,單擊 ,關閉文本編輯器。
+- 在文本編輯器界面,單擊主菜單  > **退出** ,關閉文本編輯器。
+- 在任務欄右鍵單擊 ,選擇 **關閉所有** ,關閉文本編輯器。
+
+
+### 查看快捷鍵
+
+在文本編輯器界面,使用快捷鍵 **Ctrl + Shift + ?** 打開快捷鍵預覽界面,您也可以在設置界面查看快捷鍵。熟練地使用快捷鍵,將大大提升您的操作效率。
+
+
+
+## 基本操作
+
+### 管理標籤頁
+
+- 新建標籤頁/窗口
+
+ - 單擊標籤頁上的  或  > **新標籤頁** 或使用快捷鍵 **Ctrl + T** 創建一個新的標籤頁。
+ - 單擊 > **新窗口** 或使用快捷鍵 **Ctrl + N** 創建一個新的窗口。
+
+- 調整標籤頁/窗口
+
+ - 拖拽同一窗口內的標籤頁重新排序。
+ - 滾動鼠標切換同一窗口內的標籤頁。
+ - 移出標籤頁創建一個新的窗口,或者從一個窗口移到另外一個窗口中。
+
+- 關閉標籤頁/窗口
+
+ 當窗口中僅有一個標籤頁時,關閉標籤頁的同時也會關閉窗口。
+ - 使用快捷鍵 **Ctrl + W** 關閉當前標籤頁。
+ - 單擊標籤頁上的按鈕  或者單擊鼠標中鍵,關閉當前標籤頁。
+ - 右鍵單擊標籤頁,選擇 **關閉標籤頁** 、**關閉其他標籤頁** 或 **更多關閉方式** 來關閉標籤頁。
+
+ > 說明:如果您的文件發生了變化而沒有保存,文本編輯器會在關閉前提示您保存更改。
+
+
+### 打開文件
+
+您可以採用以下方式打開一個或同時打開多個文本文件,選中的文件將會在新標籤頁中打開:
+
+- 直接拖動文件到文本編輯器界面或其圖標上。
+- 右鍵單擊文件,選擇 **打開方式** > **文本編輯器**。選擇文本編輯器為默認打開程序後,可直接雙擊打開。
+- 在文本編輯器界面,單擊  > **打開文件** 或使用快捷鍵 **Ctrl + O**,在彈出的窗口中選擇文件打開。
+
+
+### 保存文件
+- 單擊  > **保存** 或使用快捷鍵 **Ctrl + S**,保存當前文件。
+- 單擊  > **另存為** 或使用快捷鍵 **Ctrl + Shift + S**,另存當前文件。
+
+
+### 打印文件
+
+在文本編輯器中使用打印,需要您連接並配置好打印機。
+
+1. 單擊  > **打印**,也可以使用快捷鍵 **Ctrl + P** 打開打印預覽。
+2. 在打印預覽界面,您可以預覽文件,選擇打印機並設置打印頁面。
+3. 在打印預覽界面,單擊 **高級設置**,可配置紙張大小、打印方式等相關參數。
+4. 單擊 **打印** 即可將文件發送到打印機打印。
+
+
+
+## 編輯文本
+
+### 移動光標
+
+除了使用方向鍵和鼠標單擊移動光標,您還可以使用以下快捷鍵迅速移動光標:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 保存光標位置 | Ctrl + Shift + > |
+| 重置光標位置(跳轉到上次光標保存的位置) | Ctrl + Shift + < |
+| 右移一個詞 (光標向右跳過一個詞) | Ctrl + 右方向鍵 |
+| 左移一個詞 (光標向左跳過一個詞) | Ctrl + 左方向鍵 |
+| 移動到行尾 | End |
+| 移動到行頭 | Home |
+| 移動到文本結尾 | Ctrl + End |
+| 移動到文本開頭 | Ctrl + Home |
+| 移動到行縮進 | Ctrl + M |
+| 向右匹配 (光標移動到右括號的後面) | Alt + P |
+| 向左匹配(光標移動到左括號的前面) | Alt + N |
+
+### 切換大小寫
+
+切換大小寫功能可以將選中的文本全部改為大寫字母、小寫字母或者讓首字母大寫。
+
+1. 選中待更改的文本內容。
+2. 單擊右鍵,選擇 **切換大小寫**。
+3. 選擇 **大寫**/**小寫**/**首字母大寫** 選項,更改會立即生效。
+
+您也可以使用快捷鍵 **Alt + U/ L/ C** 迅速切換大小寫。
+
+
+
+### 高亮文本
+
+文本編輯器支持高亮不同類型的文本。
+單擊底部狀態欄最右側的三角符號, 選擇某種文本類型。若文本中有相應內容則會自動高亮。
+
+
+
+### 刪除文本
+除了向左或向右逐個刪除字符外,您還可以使用以下快捷鍵迅速刪除字符:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 刪除到行尾 | Ctrl + K |
+| 刪除當前行 | Ctrl + Shift + K |
+| 向左刪除一個詞 | Alt + Shift + N |
+| 向右刪除一個詞 | Alt + Shift + M |
+
+### 撤銷操作
+
+如果在編輯文本時發生誤操作, 可以使用快捷鍵 **Ctrl + Z** 撤銷操作, 或者在右鍵菜單中選擇 **撤銷**。
+
+### 查找文本
+
+1. 單擊  > **查找** 或使用快捷鍵 **Ctrl + F** 打開查找窗口。
+2. 在查找窗口中,輸入要搜索的文本。
+3. 單擊 **下一個**、**上一個** 逐個查找,或使用 **Enter** 鍵查找下一個匹配項。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉查找窗口。
+
+> 竅門:選中一段文本後再進行搜索,則這段文本會自動出現在查找窗口中。
+
+### 替換文本
+1. 單擊  > **替換** 或使用快捷鍵 **Ctrl + H** 打開替換窗口。
+2. 在替換窗口中,輸入要替換的文本以及新文本。
+3. 單擊 **替換** 逐個替換,單擊 **剩餘替換**、**全部替換** 一次性替換剩餘的或所有的匹配文本。單擊 **跳過** 不替換當前匹配的文本。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉搜索窗口。
+
+### 跳到行
+使用該功能可以迅速跳轉到任一行。
+在右鍵菜單中選擇 **跳到行** 或者使用快捷鍵 **Ctrl + G** ,輸入行號即可跳轉到相應行。
+
+### 編輯行
+
+您可以使用以下快捷鍵迅速編輯行:
+
+| 功能 | 快捷鍵 |
+| ------------ | ------------ |
+| 向上插入一行(在上方插入一行) | Ctrl + Enter |
+| 向下插入一行(在下方插入一行) | Ctrl + Shift + Enter |
+| 複製並黏貼當前行 | Ctrl + Shift + D |
+| 上移一行(與上一行交換位置) | Ctrl + Shift + Up |
+| 下移一行(與下一行交換位置) | Ctrl + Shift + Down |
+| 向上滾動一行 | Super + Shift + Up |
+| 向下滾動一行 | Super + Shift + Down |
+| 設置標記 | Alt + H |
+| 取消標記 | Alt + Shift + H |
+| 複製行 | Super + C |
+| 剪切行 | Super + X |
+| 合併行 | Ctrl + J |
+
+### 開啟/關閉只讀模式
+
+1. 使用文本編輯器打開文檔,單擊右鍵,選擇 **開啟只讀模式**。
+2. 在只讀模式下,單擊右鍵,選擇 **關閉只讀模式**。
+
+
+
+
+
+
+
+### 列編輯
+
+在文本編輯器界面,按住鍵盤上的 **Alt** 鍵不放,鼠標左鍵單擊多列啟動列編輯模式,為多行代碼同時編輯相同的內容,提高工作效率。
+
+
+
+### 顏色標記
+
+在文本編輯器界面,單擊鼠標右鍵選擇 **顏色標記**,在其下拉列表中進行選擇。
+
+
+
+ - **設置標記**:對某一行或某一段文本內容添加顏色標記;有8種顏色按鈕可供選擇。
+ + 將光標定在某一行,標記當前所在的行。
+ + 選中一段文本內容後,標記選中的文本內容。
+ - **標記所有**:將文本內容全部標記或對已選中的文本內容,在全文中標記匹配項;有8種顏色按鈕可供選擇。
+ + 將光標定在任意一行,將文本內容全部標記。
+ + 選中一段文本內容,在全文中標記匹配項。
+ - **清除上次標記**:清除上次標記操作。
+ - **清除所有標記**:清除當前所有標記。
+
+
+
+
+### 書籤管理
+
+在文本編輯器設置界面,勾選 **顯示書籤圖標** 後,您可以為任意一行的文本內容添加一個書籤。將鼠標指針移至左側欄任意行號前面會顯示圖標 ,添加成功後該行的書籤圖標會變為藍色填充的圖標 。
+
+- 添加書籤
+
+ + 鼠標左鍵單擊 ,為該行添加書籤。
+ + 鼠標右鍵單擊,選擇 **添加書籤**,為該行添加一個書籤。
+ + 將光標定在文本中任意一行,使用快捷鍵 **Ctrl + F2** 為該行添加一個書籤。
+
+- 刪除書籤
+
+ + 鼠標左鍵單擊已填充顏色的書籤圖標,直接刪除該行書籤。
+ + 鼠標右鍵單擊已填充顏色的書籤圖標,選擇 **清除書籤**,刪除該行書籤。
+ + 鼠標右鍵單擊書籤圖標,選擇 **清除所有書籤**,刪除該文本的全部書籤。
+
+ >說明:鼠標移到左側行號前面才會顯示書籤圖標,移出書籤區域,書籤圖標消失。添加書籤後,該圖標一直顯示。
+
+
+
+### 注釋管理
+
+在文本編輯器界面,您可對擴展名為.cpp 、.java 、.py等代碼類型的文件進行添加注釋的操作。
+- 添加注釋
+ + 選中一段文本內容,在右鍵菜單中選擇 **添加注釋**。
+ + 選中一段文本內容,使用快捷鍵 **Alt + A** 添加注釋。
+
+- 取消注釋
+ + 選中一段已添加注釋的文本內容,在右鍵菜單中選擇 **取消注釋**。
+ + 選中一段已添加注釋的文本內容,使用快捷鍵 **Alt + Z** 取消注釋。
+
+ >說明:支持不同代碼語言的注釋,具體以實際為主。例如C,C#,Java注釋符號為 //,Python 注釋符號為 #。
+
+
+
+## 主菜單
+
+在主菜單中,您可以新建窗口、新建標籤頁、[查找文本](#查找文本)、[替換文本](#替換文本)、保存文件、切換窗口主題、查看幫助手冊,了解文本編輯器的更多訊息。
+
+### 設置
+
+您可以對基礎訊息、快捷鍵和高級訊息進行設置。
+
+#### 基礎設置
+
+1. 單擊> **設置**。
+2. 在基礎設置選項,您可以選擇:
+ - 設置字體樣式和字號大小。
+ - 勾選 **自動換行**,在編輯區自動換行。
+ - 勾選 **顯示代碼摺疊標誌**,在左側欄顯示或者按鈕,右鍵單擊按鈕選擇摺疊/展開當前層次或所有層次。
+ - 勾選 **顯示行號**,在左側欄顯示行號。
+ - 勾選 **當前行高亮**,光標所在的行高亮顯示。
+ - 勾選 **顯示書籤圖標**,在左側欄顯示書籤圖標。
+ - 勾選 **顯示空白制符/製表符**,顯示文本中的空白字符和製表符,您也可手動輸入或刪除空白字符和製表符。
+
+ > 竅門:您還可以使用 **Ctrl + 「+」/ 「-」** 來調節文本編輯器的默認字號。使用 **Ctrl + 0** 恢復默認字號。
+
+
+#### 快捷鍵設置
+
+1. 單擊> **設置**,在 **快捷鍵** 選項查看當前快捷鍵。
+2. 選擇一種快捷鍵映射。
+3. 單擊快捷鍵編輯框 ,可以自定義快捷鍵。
+
+ > 說明: 快捷鍵映射允許您選擇某一種鍵盤快捷鍵。您可以使用標準快捷鍵,Emacs快捷鍵,或自定義快捷鍵,以符合您的使用習慣。
+
+
+#### 高級設置
+
+1. 單擊>**設置**。
+2. 在 **高級設置** 選項,您可以設置:
+ - 窗口狀態:正常窗口,最大化或全螢幕。
+ - Tab字符寬度:Tab縮進所佔用的空間大小。
+
+
+
+### 主題
+
+窗口主題包含淺色主題、深色主題和系統主題。
+
+1. 在文本編輯器界面,單擊。
+2. 單擊 **主題**,選擇一個主題顏色。
+
+### 幫助
+
+查看幫助手冊,進一步了解和使用文本編輯器。
+
+1. 在文本編輯器界面,單擊 。
+2. 單擊 **幫助**。
+3. 查看文本編輯器的幫助手冊。
+
+### 關於
+
+1. 在文本編輯器界面,單擊 。
+2. 單擊 **關於**。
+3. 查看文本編輯器的版本和介紹。
+
+### 退出
+
+1. 在文本編輯器界面,單擊 。
+2. 單擊 **退出**。
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/close.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/close.png
new file mode 100755
index 0000000000000000000000000000000000000000..eb5704b81bca1efccd06786eb2a324c63b3edcf0
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/close.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/color_tag.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/color_tag.png
new file mode 100755
index 0000000000000000000000000000000000000000..aa8b20067d4b65afa7cdb4f0ca21c1628240bfec
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/color_tag.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/column_mode.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/column_mode.png
new file mode 100755
index 0000000000000000000000000000000000000000..8d55fc7aa995f012faabb4139da55a9f3771a2c3
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/column_mode.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_color_tag.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_color_tag.png
new file mode 100755
index 0000000000000000000000000000000000000000..24a393283d28e2805018c16203220ba1afb82b9c
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_color_tag.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_read_only.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_read_only.png
new file mode 100755
index 0000000000000000000000000000000000000000..e5cdf3ab18903e84ce507aa386934cbdcf7ddca8
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_read_only.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_read_only02.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_read_only02.png
new file mode 100755
index 0000000000000000000000000000000000000000..c140b8083c385c43e57b059136137824704d77f4
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_read_only02.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_toggle_case.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_toggle_case.png
new file mode 100755
index 0000000000000000000000000000000000000000..bbe4afb482256cdcd5e5b761127506c57bab6b3b
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/d_toggle_case.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/highlight.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/highlight.png
new file mode 100755
index 0000000000000000000000000000000000000000..9ec23d428c003591fd448c0be2ce2d5c89e72089
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/highlight.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/hotkey.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/hotkey.png
new file mode 100755
index 0000000000000000000000000000000000000000..84c50b0cf0b2cf8007c6e7c671fa8455292f84a6
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/hotkey.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/listen.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/listen.png
new file mode 100755
index 0000000000000000000000000000000000000000..d397f90eaad0909f49535c74cb5cb58d949b2f2b
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/listen.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/overview.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/overview.png
new file mode 100755
index 0000000000000000000000000000000000000000..b20ade6435cee3855c8c36ad28f241c8ec71ceb0
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/overview.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/read_only.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/read_only.png
new file mode 100755
index 0000000000000000000000000000000000000000..e9ecb117bce231c927a54769d8446bc9f3a56092
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/read_only.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/read_only02.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/read_only02.png
new file mode 100755
index 0000000000000000000000000000000000000000..fe3fdee35c4d37144555001b17a2c51f14019afb
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/read_only02.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/reading.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/reading.png
new file mode 100755
index 0000000000000000000000000000000000000000..12ae8421d68a9b4c19d2600e111a879e3f7cbfdb
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/reading.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/toggle_case.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/toggle_case.png
new file mode 100755
index 0000000000000000000000000000000000000000..e7d395f2710ebf8247a5f9d6561c4415dd2f29e5
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/toggle_case.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/translation.png b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/translation.png
new file mode 100755
index 0000000000000000000000000000000000000000..b522e244afa264a01d52ccd08852cc6ca0ef826c
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_HK/fig/translation.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/editor.md b/src/assets/loongarch64/deepin-editor/editor/zh_TW/editor.md
new file mode 100644
index 0000000000000000000000000000000000000000..982b23e5f38e3ba7184fc7e8ed290582428d4975
--- /dev/null
+++ b/src/assets/loongarch64/deepin-editor/editor/zh_TW/editor.md
@@ -0,0 +1,306 @@
+# 文字編輯器|deepin-editor|
+
+## 概述
+
+文字編輯器是一個簡單的文字編輯工具。您可以用它書寫簡單的文字檔案,也可以使用它的進階特性,讓它成為一個程式碼編輯工具,支援程式碼語法突顯。
+
+
+
+## 使用入門
+
+### 執行文字編輯器
+
+1. 單擊任務欄上的啟動器圖示 ,進入啟動器介面。
+2. 上下滾動滑鼠滾輪瀏覽或透過搜尋,找到文字編輯器圖示,單擊執行。
+3. 右鍵單擊,您可以:
+
+ - 單擊 **建立桌面捷徑**,在桌面建立捷徑。
+ - 單擊 **釘選到Dock**,將應用程式固定到Dock。
+ - 單擊 **開機啟動**,將應用程式添加到開機啟動項,在電腦開機時自動執行該應用。
+
+### 關閉文字編輯器
+
+- 在文字編輯器介面,單擊 ,關閉文字編輯器。
+- 在文字編輯器介面,單擊主選單 > **離開**, 關閉文字編輯器。
+- 在Dock上右鍵單擊 ,選擇 **全部關閉**, 關閉文字編輯器。
+
+
+### 查看快捷鍵
+
+在文字編輯器介面,使用快捷鍵 **Ctrl + Shift + ?** 打開快捷鍵預覽介面。您也可以在設定介面查看快捷鍵。熟練地使用快捷鍵,將大大提升您的操作效率。
+
+
+
+## 基本操作
+
+### 管理標籤頁
+
+- 建立標籤頁/視窗
+
+ - 單擊標籤頁上的  或  > **建立新標籤頁** 或使用快捷鍵 **Ctrl + T** 建立一個新的標籤頁。
+ - 單擊 > **建立新視窗** 或使用快捷鍵 **Ctrl + N** 建立一個新的視窗。
+
+- 調整標籤頁/視窗
+
+ - 拖曳同一視窗內的標籤頁重新排序。
+ - 滾動滑鼠切換同一視窗內的標籤頁。
+ - 移出標籤頁建立一個新的視窗,或者從一個視窗移到另外一個視窗中。
+
+- 關閉標籤頁/視窗
+
+ 當視窗中僅有一個標籤頁時,關閉標籤頁的同時也會關閉視窗。
+
+ - 使用 快捷鍵**Ctrl + W** 關閉目前標籤頁。
+ - 單擊標籤頁上的  按鈕或者單擊滑鼠中鍵,關閉目前標籤頁。
+ - 右鍵單擊標籤頁,選擇 **關閉標籤頁** 、**關閉其他標籤頁** 或 **更多關閉方式** 來關閉標籤頁。
+
+ > 說明:如果您的檔案發生了變化而沒有儲存,文字編輯器會在關閉前提示您儲存更改。
+
+### 開啟檔案
+
+您可採用以下方式開啟一個或同時開啟多個文字檔案,選中的檔案將會在新標籤頁開啟:
+
+- 直接拖動檔案到文字編輯器介面或其圖示上。
+- 右鍵單擊檔案,選擇 **用其他程式開啟** > **文字編輯器**。選擇文字編輯器為預設開啟程式後,可直接雙擊檔案開啟。
+- 在文字編輯器介面,單擊 > **開啟檔案** 或使用快捷鍵 **Ctrl + O**,在彈出的視窗中選擇檔案。
+
+### 儲存檔案
+- 單擊 > **儲存** 或使用快捷鍵 **Ctrl + S** ,儲存目前檔案。
+- 單擊 > **另存新檔** 或使用快捷鍵 **Ctrl + Shift + S**, 另存目前檔案。
+
+
+### 列印檔案
+
+在文字編輯器中使用列印,需要您連接並配置好印表機。
+
+1. 單擊  > **列印** 或使用快捷鍵 **Ctrl + P** 打開列印預覽。
+2. 在列印預覽介面,您可以預覽檔案,選擇印表機並設定列印頁面。
+3. 在列印預覽介面,單擊 **進階設定**,可配置紙張大小、列印方式等相關參數。
+4. 單擊 **列印** 即可將檔案發送到印表機列印。
+
+
+
+
+
+## 編輯文字
+
+### 移動游標
+
+除了使用方向鍵和滑鼠單擊移動游標,您還可以使用以下快捷鍵迅速移動游標:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 儲存游標位置 | Ctrl + Shift + > |
+| 重設游標位置(跳轉到上次游標儲存的位置) | Ctrl + Shift + < |
+| 後一個字詞 (游標向右跳過一個字詞) | Ctrl + 右方向鍵 |
+| 前一個字詞 (游標向左跳過一個字詞) | Ctrl + 左方向鍵 |
+| 移動到行結尾 | End |
+| 移動到行開頭 | Home |
+| 移動到文字結尾 | Ctrl + End |
+| 移動到文字開頭 | Ctrl + Home |
+| 移到行縮排區塊 | Ctrl + M |
+| 往後一對 (游標移動到右括號的後面) | Alt + P |
+| 往前一對(游標移動到左括號的前面) | Alt + N |
+
+### 切換大小寫
+
+切換大小寫功能可以將選中文字全部改為大寫字母、小寫字母或者首字母大寫。
+
+1. 選中待更改的文字內容。
+2. 單擊右鍵,選擇 **變更大小寫**。
+3. 選擇 **大寫**/**小寫**/**首字母大寫** 選項。文字格式的更改會立即生效。
+
+您也可以使用快捷鍵 **Alt + U/L/C** 迅速切換大小寫。
+
+
+
+### 突顯文字
+
+文字編輯器支援突顯不同類型的文字。單擊底部狀態欄最右側的三角符號, 選擇某種文字類型。若文字中有相應內容則會自動突顯。
+
+
+
+### 刪除文字
+除了向左或向右逐個刪除字元外,您還可以使用以下快捷鍵迅速刪除字元:
+
+| 功能 | 快捷鍵 |
+| --------------- | ------------ |
+| 刪除至行結尾所有字元 | Ctrl + K |
+| 刪除目前整行 | Ctrl + Shift + K |
+| 刪除前一個字詞 | Alt + Shift + N |
+| 刪除後一個字詞 | Alt + Shift + M |
+
+### 復原操作
+
+如果在文字編輯時發生誤操作,您可以使用快捷鍵 **Ctrl + Z** 撤銷操作, 或者在右鍵選單中選擇 **復原**。
+
+### 尋找文字
+
+1. 單擊 > **尋找** 或使用快捷鍵 **Ctrl + F** ,打開尋找視窗。
+2. 在尋找視窗中,輸入要搜尋的文字。
+3. 單擊 **上一個**、**下一個** 逐個尋找,或使用 **Enter** 鍵尋找下一個匹配項。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉尋找視窗。
+
+> 竅門:選中一段文字,再選擇尋找,則這段文字會自動出現在尋找視窗中。
+
+### 取代文字
+1. 單擊 > **取代** 或使用快捷鍵 **Ctrl + H**,打開取代視窗。
+2. 在取代為視窗中,輸入要取代的文字以及新文字。
+3. 單擊 **取代** 逐個取代,單擊 **取代剩餘部份**、**全部取代** 一次性取代剩餘的或所有的匹配文字。單擊 **跳過** 不取代目前匹配的文字。
+4. 按下 **Esc** 鍵或單擊關閉按鈕,關閉取代視窗。
+
+### 前往該行
+使用該功能可以迅速前往到任一行。在右鍵選單中選擇 **前往該行** 或者使用快捷键 **Ctrl + G**,輸入行號即可前往到相應行。
+
+### 編輯行
+
+您可以使用以下快捷鍵迅速編輯行:
+
+| 功能 | 快捷鍵 |
+| ------------ | ------------ |
+| 於上方換行(在上方插入一行) | Ctrl + Enter |
+| 於下方換行(在下方插入一行) | Ctrl + Shift + Enter |
+| 複製一行 | Ctrl + Shift + D |
+| 切到上一行(與上一行交換位置) | Ctrl + Shift + Up |
+| 切到下一行(與下一行交換位置) | Ctrl + Shift + Down |
+| 捲到上一行 | Super + Shift + Up |
+| 捲到下一行 | Super + Shift + Down |
+| 標記 | Alt + H |
+| 取消標記 | Alt + Shift + H |
+| 複製一行 | Super + C |
+| 剪下一行 | Super + X |
+| 合併一行 | Ctrl + J |
+
+### 開啟/關閉唯讀模式
+
+1. 使用文字編輯器打開檔案,單擊右鍵,選擇 **開啟唯讀模式**。
+2. 在唯讀模式下,單擊右鍵,選擇 **關閉唯讀模式**。
+
+
+
+
+
+
+### 列编辑
+在文字編輯器介面,按住鍵盤上的 **Alt** 鍵不放,滑鼠左鍵單擊多列啟動列編輯模式,為多行程式碼同時編輯相同的內容,提高工作效率。
+
+
+
+### 顏色標記
+
+在文字編輯器介面,單擊滑鼠右鍵選擇 **顏色標記**,在其下拉選單中進行選擇。
+
+
+
+ - **標記**:對某一行或某一段文字內容添加顏色標記;有8種顏色按鈕可供選擇。
+ + 將游標定在某一行,標記目前所在的行。
+ + 選中一段文字內容後,標記選中的文字內容。
+ - **標記所有**:將文字內容全部標記或對已選中的文字內容,在全文中標記匹配項;有8種顏色按鈕可供選擇。
+ + 將游標定在任意一行,將文字內容全部標記。
+ + 選中一段文字內容,在全文中標記匹配項。
+ - **清除上次標記**:清除上次標記操作。
+ - **清除所有標記**:清除目前所有標記。
+
+
+
+### 書籤管理
+
+在文字編輯器設定介面,勾選 **顯示書籤圖標** 後,您可以為任意一行的文字內容添加書籤,將滑鼠遊標移至左側欄任意一行處會顯示 ,添加成功後該行的書籤圖示會變為藍色填充的圖示 。
+
+- 添加書籤
+
+ + 滑鼠左鍵單擊 ,為該行添加書籤。
+ + 滑鼠右鍵單擊 ,選擇 **添加書籤**,為該行添加書籤。
+ + 將游標定在文字中任意一行,使用快捷鍵 **Ctrl + F2** 為該行添加書籤。
+
+- 刪除書籤
+
+ + 滑鼠左鍵單擊已填充顏色的書籤圖示,直接刪除該行書籤。
+ + 滑鼠右鍵單擊已填充顏色的書籤圖示,選擇 **清除書籤**,刪除該行書籤。
+ + 滑鼠右鍵單擊書籤圖示,選擇 **清除所有書籤**,刪除該文字的全部書籤。
+
+ >說明:滑鼠移到左側行號前面才會顯示書籤圖示,移出書籤區域,書籤圖示消失。添加書籤後,該圖示一直顯示。
+
+
+
+### 注釋管理
+
+在文字編輯器介面,您可以對副檔名為cpp 、java 、py等程式碼類型的檔案進行添加注釋的操作。
+
+- 添加注釋
+ + 選中一段文字內容,單擊右鍵並選擇 **添加注釋**。
+ + 選中一段文字內容,使用快捷鍵 **Alt + A** 添加注釋。
+
+- 取消注釋
+ + 選中一段已添加注釋的文字內容,單擊右鍵並選擇 **取消注釋**。
+ + 選中一段已添加注釋的文字內容,使用快捷鍵 **Alt + Z** 取消注釋。
+
+ >說明:支援不同程式碼語言的注釋,具體以實際為主。例如C,C#,Java注釋符號為 //,Python 注釋符號為 #。
+
+
+
+## 主選單
+
+在主選單中,您可以 建立新視窗、建立新標籤頁、[尋找文字](#尋找文字)、[取代文字](#取代文字)、儲存檔案、切換視窗主題、查看說明手冊,了解文字編輯器的更多訊息。
+
+### 設定
+您可以對基本訊息、快捷鍵和進階訊息進行設定。
+
+#### 基本設定
+
+1. 單擊 > **設定**。
+2. 在基本設定選項,您可以選擇:
+ - 設定字體樣式,選擇字體和字體大小。
+ - 勾選 **文字換行**,在編輯區自動換行。
+ - 勾選 **顯示代碼摺疊標誌**,在左側欄顯示或者按鈕,右鍵單擊按鈕選擇摺疊/展開目前層次或所有層次。
+ - 勾選 **顯示行號**,在左側欄顯示行號。
+ - 勾選**當前行高亮**,游標所在的行突顯顯示。
+ - 勾選 **顯示書籤圖示**,在左側欄顯示書籤圖示。
+ - 勾選 **顯示空白制符/制表符**,顯示文字中的空白字符和制表符,您也可以手動輸入或刪除空白字符和制表符。
+ > 竅門:您還可以使用 **Ctrl + 「+」/ 「-」** 來調節文字編輯器的預設字號。使用 **Ctrl + 0** 復原預設字號。
+
+
+
+#### 快捷鍵設定
+
+1. 單擊 > **設定**,在 **快捷鍵** 選項查看目前快捷鍵。
+2. 選擇一種按鍵映射。
+3. 單擊並重新輸入快捷鍵,可以自訂快捷鍵。
+
+ > 說明: 按鍵映射允許您選擇某一種鍵盤快捷鍵。您可以使用標準快捷鍵、Emacs快捷鍵、或自訂快捷鍵,以符合您的使用習慣。
+
+
+#### 進階設定
+
+1. 單擊 > **設定**。
+2. 在 **進階設定** 選項,您可以設定:
+ - 視窗大小:一般、最大或全螢幕。
+ - Tab寬度:Tab縮排所占用的空間大小。
+
+
+
+### 主題
+
+視窗主題包含亮色主題、暗色主題和系統主題。
+
+1. 在文字編輯器介面,單擊。
+2. 單擊 **主題**,選擇一個主題顏色。
+
+### 說明
+
+查看說明手冊,進一步了解和使用文字編輯器。
+
+1. 在文字編輯器介面,單擊 。
+2. 單擊 **說明**。
+3. 查看文字編輯器的說明手冊。
+
+### 關於
+
+1. 在文字編輯器介面,單擊 。
+2. 單擊 **關於**。
+3. 查看文字編輯器的版本和介紹。
+
+### 離開
+
+1. 在文字編輯器介面,單擊 。
+2. 單擊 **離開**。
\ No newline at end of file
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/advanced_setting.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/advanced_setting.png
new file mode 100644
index 0000000000000000000000000000000000000000..7ecf14a7f1162b7c2ad15102f66f03ed97d62263
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/advanced_setting.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/close.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/close.png
new file mode 100644
index 0000000000000000000000000000000000000000..eb5704b81bca1efccd06786eb2a324c63b3edcf0
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/close.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/color_tag.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/color_tag.png
new file mode 100644
index 0000000000000000000000000000000000000000..31ebc41567d152199195fbc33b07d52a60b55df5
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/color_tag.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/column mode.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/column mode.png
new file mode 100644
index 0000000000000000000000000000000000000000..efeb5f854f7f16c90b298e3473dd4a9724c4a1cd
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/column mode.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_color_tag.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_color_tag.png
new file mode 100644
index 0000000000000000000000000000000000000000..a5923c736852e1e1e59160a5b733a6d579c0c247
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_color_tag.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_read-only_02.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_read-only_02.png
new file mode 100644
index 0000000000000000000000000000000000000000..db0fa12522ccc61290002dae7a524cd5a0727d19
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_read-only_02.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_read_only.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_read_only.png
new file mode 100644
index 0000000000000000000000000000000000000000..af2fcf4fa489ca5e4b178973601efe48467c4f95
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_read_only.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_read_only_02.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_read_only_02.png
new file mode 100644
index 0000000000000000000000000000000000000000..022dba9fb5956aef8851d907e6270673c3736413
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_read_only_02.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_toggle_case.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_toggle_case.png
new file mode 100644
index 0000000000000000000000000000000000000000..be9bdc902c80095e57d5c4dc0b50eb94a6bd8159
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/d_toggle_case.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/editer.psd b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/editer.psd
new file mode 100644
index 0000000000000000000000000000000000000000..d68083edaf82a349425c63540ac895a3dfa4bb5b
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/editer.psd differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/highlight.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/highlight.png
new file mode 100644
index 0000000000000000000000000000000000000000..f16308bd678e8650e3701ed9a994a8e7202c9072
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/highlight.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/hotkey.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/hotkey.png
new file mode 100644
index 0000000000000000000000000000000000000000..e3225d97e31be3827dc2b4bb222b097e61493c94
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/hotkey.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/listen.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/listen.png
new file mode 100644
index 0000000000000000000000000000000000000000..d397f90eaad0909f49535c74cb5cb58d949b2f2b
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/listen.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/overview.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/overview.png
new file mode 100644
index 0000000000000000000000000000000000000000..764cf82fcfce532c908bb8f38df53f6013bdab41
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/overview.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/print_setting.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/print_setting.png
new file mode 100644
index 0000000000000000000000000000000000000000..9d08dc8e9097beb003a7f5b9d5d13cb2e54c103a
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/print_setting.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/read_only.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/read_only.png
new file mode 100644
index 0000000000000000000000000000000000000000..96658be2ad45d728b8780d9ec4658b72bd56dd86
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/read_only.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/read_only_02.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/read_only_02.png
new file mode 100644
index 0000000000000000000000000000000000000000..a5f735b475e7c695f9c56c426a82616eb25c0525
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/read_only_02.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/reading.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/reading.png
new file mode 100644
index 0000000000000000000000000000000000000000..7fe6846cd99c737fe62a3b29e48e76576f170b4e
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/reading.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/text translation.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/text translation.png
new file mode 100644
index 0000000000000000000000000000000000000000..f76230034be4aecffeed0ee1c6129efd60590c47
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/text translation.png differ
diff --git a/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/toggle_case.png b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/toggle_case.png
new file mode 100644
index 0000000000000000000000000000000000000000..32351990a6966c71870ccfadedfcca381f573b75
Binary files /dev/null and b/src/assets/loongarch64/deepin-editor/editor/zh_TW/fig/toggle_case.png differ
diff --git "a/src/assets/loongarch64/deepin-editor/editor/\344\277\256\350\256\242\350\256\260\345\275\225.txt" "b/src/assets/loongarch64/deepin-editor/editor/\344\277\256\350\256\242\350\256\260\345\275\225.txt"
new file mode 100755
index 0000000000000000000000000000000000000000..9596082445064dcb344d14cd043c02800233b3e5
--- /dev/null
+++ "b/src/assets/loongarch64/deepin-editor/editor/\344\277\256\350\256\242\350\256\260\345\275\225.txt"
@@ -0,0 +1,3 @@
+龙芯3A5000 文本编辑器修订记录
+版本 5.9.16
+此版本镜像无语音助手,所以不支持语音朗读、语音听写、文本翻译这三个功能
\ No newline at end of file
diff --git a/src/common/CSyntaxHighlighter.cpp b/src/common/CSyntaxHighlighter.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d2e62ce86bd8fb13bac68f9055a96d3f8fa9d5e3
--- /dev/null
+++ b/src/common/CSyntaxHighlighter.cpp
@@ -0,0 +1,33 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "CSyntaxHighlighter.h"
+#include
+
+CSyntaxHighlighter::CSyntaxHighlighter(QObject *parent):
+ SyntaxHighlighter (parent),
+ m_bHighlight(false)
+{
+
+}
+
+CSyntaxHighlighter::CSyntaxHighlighter(QTextDocument *pDocument):
+ SyntaxHighlighter (pDocument),m_bHighlight(false)
+{
+
+}
+
+void CSyntaxHighlighter::setEnableHighlight(bool isEnable)
+{
+ m_bHighlight = isEnable;
+}
+
+void CSyntaxHighlighter::highlightBlock(const QString &text)
+{
+ if (!m_bHighlight) {
+ return;
+ }
+
+ KSyntaxHighlighting::SyntaxHighlighter::highlightBlock(text);
+}
diff --git a/src/common/CSyntaxHighlighter.h b/src/common/CSyntaxHighlighter.h
new file mode 100644
index 0000000000000000000000000000000000000000..4ff05468aa335b6e59f236a4e8a7be1b073b357e
--- /dev/null
+++ b/src/common/CSyntaxHighlighter.h
@@ -0,0 +1,24 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#pragma once
+#include
+#include
+#include
+
+using namespace KSyntaxHighlighting;
+class CSyntaxHighlighter : public SyntaxHighlighter
+{
+ Q_OBJECT
+public:
+ explicit CSyntaxHighlighter(QObject *parent = nullptr);
+ explicit CSyntaxHighlighter(QTextDocument *pDocument);
+ void setEnableHighlight(bool isEnable);
+
+protected:
+ virtual void highlightBlock(const QString & text) override;
+
+private:
+ bool m_bHighlight = false;
+};
diff --git a/src/common/comment_global.h b/src/common/comment_global.h
new file mode 100644
index 0000000000000000000000000000000000000000..60a60559f05dbed5cc466cb848f9a3554d2f549d
--- /dev/null
+++ b/src/common/comment_global.h
@@ -0,0 +1,15 @@
+// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#pragma once
+
+#include
+
+#if defined(UTILS_LIBRARY)
+# define COMMENT_EXPORT Q_DECL_EXPORT
+#elif defined(UTILS_STATIC_LIB)
+# define COMMENT_EXPORT
+#else
+# define COMMENT_EXPORT Q_DECL_IMPORT
+#endif
diff --git a/src/common/common.h b/src/common/common.h
new file mode 100644
index 0000000000000000000000000000000000000000..3413304541d7cc592b7138598953f4a33adc6749
--- /dev/null
+++ b/src/common/common.h
@@ -0,0 +1,51 @@
+// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef COMMON_H
+#define COMMON_H
+
+#include "../controls/findbar.h"
+#include "../controls/fontitemdelegate.h"
+#include "../controls/jumplinebar.h"
+#include "../controls/linebar.h"
+#include "../controls/replacebar.h"
+#include "../controls/tabbar.h"
+#include "../controls/toast.h"
+#include "../controls/toolbar.h"
+#include "../controls/warningnotices.h"
+
+
+#include "../common/comment_global.h"
+#include "../common/dbusinterface.h"
+#include "../common/encoding.h"
+#include "../common/fileloadthread.h"
+#include "../common/performancemonitor.h"
+#include "../common/settings.h"
+#include "../common/urlinfo.h"
+#include "../common/utils.h"
+
+
+#include "../encodes/detectcode.h"
+
+
+#include "../widgets/bottombar.h"
+#include "../widgets/ColorSelectWdg.h"
+#include "../widgets/ddropdownmenu.h"
+#include "../widgets/window.h"
+
+
+#include "../thememodule/themeitemdelegate.h"
+#include "../thememodule/themelistmodel.h"
+#include "../thememodule/themelistview.h"
+#include "../thememodule/themepanel.h"
+
+
+#include "../editor/bookmarkwidget.h"
+#include "../editor/codeflodarea.h"
+#include "../editor/editwrapper.h"
+#include "../editor/leftareaoftextedit.h"
+#include "../editor/linenumberarea.h"
+#include "../editor/showflodcodewidget.h"
+#include "../editor/uncommentselection.h"
+#endif // COMMON_H
diff --git a/src/common/config.cpp b/src/common/config.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c1aafb1bef53036a97e1bc5fca7e676e8fa5e36c
--- /dev/null
+++ b/src/common/config.cpp
@@ -0,0 +1,64 @@
+// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "config.h"
+
+#include
+
+#ifdef DTKCORE_CLASS_DConfigFile
+#include
+
+const QString g_keyDisableImproveGB18030 = "disableImproveGB18030";
+#endif
+
+/**
+ @class Config
+ @brief 获取DConfig配置
+ @details 取得DConfig配置,目前主要用于配置是否提高GB18030识别率。
+ 配置文件路径为 /usr/share/dsg/configs/org.deepin.editor/org.deepin.editor.json
+ */
+
+Config::Config(QObject *parent)
+ : QObject(parent)
+{
+#ifdef DTKCORE_CLASS_DConfigFile
+ dconfig = DConfig::create("org.deepin.editor", "org.deepin.editor");
+ if (dconfig->isValid()) {
+ // 默认提高GB18030识别率
+ improveGB18030 = !dconfig->value(g_keyDisableImproveGB18030).toBool();
+ qInfo() << "DConfig::ImproveGB18030:" << improveGB18030;
+
+ connect(dconfig, &DConfig::valueChanged, this, [this](const QString &key) {
+ if (key == g_keyDisableImproveGB18030) {
+ this->improveGB18030 = !this->dconfig->value(g_keyDisableImproveGB18030).toBool();
+ qInfo() << "DConfig::ImproveGB18030 Changed:" << improveGB18030;
+ }
+ });
+ } else {
+ qWarning() << "org.deepin.editor DConfig not valid!";
+ }
+#else
+ qWarning() << "DConfig is not supported by DTK!";
+#endif
+}
+
+Config::~Config()
+{
+#ifdef DTKCORE_CLASS_DConfigFile
+ if (dconfig) {
+ delete dconfig;
+ }
+#endif
+}
+
+Config *Config::instance()
+{
+ static Config config;
+ return &config;
+}
+
+bool Config::enableImproveGB18030() const
+{
+ return improveGB18030;
+}
diff --git a/src/common/config.h b/src/common/config.h
new file mode 100644
index 0000000000000000000000000000000000000000..a772bb0631b5e72fce29fdfaea5ab0c743291e00
--- /dev/null
+++ b/src/common/config.h
@@ -0,0 +1,33 @@
+// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+#include
+
+#include
+#ifdef DTKCORE_CLASS_DConfigFile
+#include
+DCORE_USE_NAMESPACE
+#endif
+
+class Config : public QObject
+{
+ Q_OBJECT
+ explicit Config(QObject *parent = nullptr);
+ ~Config() override;
+
+public:
+ static Config *instance();
+ bool enableImproveGB18030() const;
+
+private:
+#ifdef DTKCORE_CLASS_DConfigFile
+ DConfig *dconfig = nullptr;
+#endif
+ bool improveGB18030 = true; ///< 默认提高GB18030编码识别率
+};
+
+#endif // CONFIG_H
diff --git a/src/common/dbusinterface.cpp b/src/common/dbusinterface.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..764e52c8f4bab9255e8a8dae2e9df233edc43205
--- /dev/null
+++ b/src/common/dbusinterface.cpp
@@ -0,0 +1,14 @@
+// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "dbusinterface.h"
+
+SaveFileInterface::SaveFileInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
+ : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
+{
+}
+
+SaveFileInterface::~SaveFileInterface()
+{
+}
diff --git a/src/common/dbusinterface.h b/src/common/dbusinterface.h
new file mode 100644
index 0000000000000000000000000000000000000000..a7b1c20772d51167b0546567c925a34f71a3fa35
--- /dev/null
+++ b/src/common/dbusinterface.h
@@ -0,0 +1,42 @@
+// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef DBUS_INTERFACE_H
+#define DBUS_INTERFACE_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+class SaveFileInterface: public QDBusAbstractInterface
+{
+ Q_OBJECT
+public:
+ static inline const char *staticInterfaceName() {
+ return "com.deepin.editor.daemon";
+ }
+
+public:
+ SaveFileInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
+ ~SaveFileInterface();
+
+public Q_SLOTS: // METHODS
+// inline QDBusPendingReply saveFile(const QByteArray &filepath, const QByteArray &text, const QByteArray &encoding) {
+// QList argumentList;
+// argumentList << QVariant::fromValue(filepath) << QVariant::fromValue(text) << QVariant::fromValue(encoding);
+// return asyncCallWithArgumentList(QStringLiteral("saveFile"), argumentList);
+// }
+
+Q_SIGNALS: // SIGNALS
+};
+
+namespace DBusDaemon {
+ typedef ::SaveFileInterface dbus;
+}
+#endif
diff --git a/src/common/encoding.cpp b/src/common/encoding.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..40cd023f51d48f1e55170b358e53cd75ab59b7c4
--- /dev/null
+++ b/src/common/encoding.cpp
@@ -0,0 +1,684 @@
+/*
+ * Copyright (C) Pedram Pourang (aka Tsu Jan) 2014-2020
+ *
+ * FeatherPad 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FeatherPad 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 .
+ *
+ * @license GPL-2.0+
+ */
+
+/* This file was adapted from
+ * Leafpad - GTK+ based simple text editor
+ * File: src/encoding.c
+ * Copyright: 2004-2005 Tarot Osuji
+ * License: GPL-2.0+
+ * Homepage: http://tarot.freeshell.org/leafpad/
+ */
+
+#include
+#include // getenv (not used but, maybe, for *BSD)
+#include // CODESET, nl_langinfo
+#include // uint8_t, uint32_t
+//#include // needed by FreeBSD for setlocale
+#include "encoding.h"
+
+#define MAX_COUNTRY_NUM 10
+enum
+{
+ IANA = 0,
+ OPENI18N,
+ CODEPAGE,
+ ENCODING_MAX_ITEM_NUM
+};
+/*------------------------*/
+/* encoding numbers */
+enum
+{
+ LATIN1 = 0,
+ LATIN2,
+ LATIN3,
+ LATIN4,
+ LATINC,
+ LATINC_UA,
+ LATINC_TJ,
+ LATINA,
+ LATING,
+ LATINH,
+ LATIN5,
+ CHINESE_CN,
+ CHINESE_TW,
+ CHINESE_HK,
+ JAPANESE,
+ KOREAN,
+ VIETNAMESE,
+ THAI,
+ GEORGIAN,
+ TOTAL_NUM // 19
+};
+/*------------------------*/
+static const std::string countryTable[TOTAL_NUM][MAX_COUNTRY_NUM] =
+{
+ /* list of countries using each encoding set */
+ /* LATIN1 */ {"" , "", "", "", "", "", "", "", "", "" },
+ /* LATIN2 */ {"cs", "hr", "hu", "pl", "ro", "sk", "sl", "sq", "sr", "uz"},
+ /* LATIN3 */ {"eo", "mt", "", "", "", "", "", "", "", "" },
+ /* LATIN4 */ {"et", "lt", "lv", "mi", "", "", "", "", "", "" },
+ /* LATINC */ {"be", "bg", "ky", "mk", "mn", "ru", "tt", "", "", "" },
+ /* LATINC_UA */ {"uk", "", "", "", "", "", "", "", "", "" },
+ /* LATINC_TJ */ {"tg", "", "", "", "", "", "", "", "", "" },
+ /* LATINA */ {"ar", "fa", "ur", "", "", "", "", "", "", "" },
+ /* LATING */ {"el", "", "", "", "", "", "", "", "", "" },
+ /* LATINH */ {"he", "yi", "", "", "", "", "", "", "", "" },
+ /* LATIN5 */ {"az", "tr", "", "", "", "", "", "", "", "" },
+ /* CHINESE_CN */ {"zh_CN", "", "", "", "", "", "", "", "", "" },
+ /* CHINESE_TW */ {"zh_TW", "", "", "", "", "", "", "", "", "" },
+ /* CHINESE_HK */ {"zh_HK", "", "", "", "", "", "", "", "", "" },
+ /* JAPANESE */ {"ja", "", "", "", "", "", "", "", "", "" },
+ /* KOREAN */ {"ko", "", "", "", "", "", "", "", "", "" },
+ /* VIETNAMESE */ {"vi", "", "", "", "", "", "", "", "", "" },
+ /* THAI */ {"th", "", "", "", "", "", "", "", "", "" },
+ /* GEORGIAN */ {"ka", "", "", "", "", "", "", "", "", "" }
+};
+/*------------------------*/
+static const std::string encodingTable[TOTAL_NUM][ENCODING_MAX_ITEM_NUM] =
+{
+ /* IANA OpenI18N CODEPAGE */
+ /* LATIN1 */ { "ISO-8859-1", "ISO-8859-15", "CP1252" },
+ /* LATIN2 */ { "ISO-8859-2", "ISO-8859-16", "CP1250" },
+ /* LATIN3 */ { "ISO-8859-3", "", "" },
+ /* LATIN4 */ { "ISO-8859-4", "ISO-8859-13", "CP1257" },
+ /* LATINC */ { "ISO-8859-5", "KOI8-R", "CP1251" },
+ /* LATINC_UA */ { "ISO-8859-5", "KOI8-U", "CP1251" },
+ /* LATINC_TJ */ { "ISO-8859-5", "KOI8-T", "CP1251" },
+ /* LATINA */ { "ISO-8859-6", "", "CP1256" },
+ /* LATING */ { "ISO-8859-7", "", "CP1253" },
+ /* LATINH */ { "ISO-8859-8", "", "CP1255" },
+ /* LATIN5 */ { "ISO-8859-9", "", "CP1254" },
+ /* CHINESE_CN */ { "GB2312", "GB18030", "CP936" },
+ /* CHINESE_TW */ { "BIG5", "EUC-TW", "CP950" },
+ /* CHINESE_HK */ { "BIG5", "BIG5-HKSCS", "CP950" },
+ /* JAPANESE */ { "ISO-2022-JP", "EUC-JP", "CP932" },
+ /* KOREAN */ { "ISO-2022-KR", "EUC-KR", "CP949" },
+ /* VIETNAMESE */ { "", "VISCII", "CP1258" },
+ /* THAI */ { "", "TIS-620", "CP874" },
+ /* GEORGIAN */ { "", "GEORGIAN-PS", "" }
+};
+/*************************/
+static unsigned int getLocaleNum()
+{
+ static unsigned int code = 0; // for me
+ QStringList langs (QLocale::system().uiLanguages());
+ if (!langs.isEmpty())
+ {
+ QString lang = langs.first().replace ('-', '_');
+ if (lang.length() >= 2)
+ {
+ std::string env = lang.toStdString();
+ if (!env.empty() && env.length() >= 2)
+ {
+ int j = 1;
+ while (code == 0 && j < TOTAL_NUM)
+ {
+ for (int i = 0; i < MAX_COUNTRY_NUM; i++)
+ {
+ if (countryTable[j][i].empty())
+ break;
+ if (env.compare (0, countryTable[j][i].length(), countryTable[j][i]) == 0)
+ {
+ code = j;
+ break;
+ }
+ }
+ j++;
+ }
+ }
+ }
+ }
+ return code;
+}
+/*************************/
+static unsigned int localeNum = getLocaleNum();
+static const std::string encodingItem[ENCODING_MAX_ITEM_NUM] = {encodingTable[localeNum][0],
+ encodingTable[localeNum][1],
+ encodingTable[localeNum][2]};
+/*************************/
+static const std::string detectCharsetLatin (const char *text)
+{
+ uint8_t c = *text;
+ bool noniso = false;
+ bool noniso15 = false;
+ uint32_t xl = 0, xa = 0, xac = 0, xcC = 0, xcC1 = 0, xcS = 0, xcna = 0;
+ /* the OpenI18N for the locale ("ISO-8859-15" for me) */
+ std::string charset = encodingItem[OPENI18N];
+
+ while (c != '\0')
+ {
+ if (c >= 0x41 && c <= 0x7A)
+ {
+ /* ordinary Latin letters */
+ xl ++;
+ }
+ else if (c >= 0x80 && c <= 0x9F)
+ {
+ noniso = true;
+ }
+ else if (c >= 0xC0)
+ {
+ /* Arabic or Cyrillic letters */
+ xac ++;
+ if (c >= 0xC0 && c <= 0xCF)
+ {
+ /* Cyrillic capital letters */
+ xcC++;
+ }
+ else if (c >= 0xD0 && c <= 0xDF)
+ {
+ /* Cyrillic capital letters again */
+ xcC1++;
+ if (c == 0xDE || c == 0xDF)
+ {
+ /* not used in ISO-8859-15 (Icelandic or German) */
+ noniso15 = true;
+ }
+ }
+ else if (c >= 0xE0)
+ {
+ /* Cyrillic small letters */
+ xcS++;
+ /* Cyrillic but not Arabic letters */
+ if (c == 0xE0 || c == 0xE2 || (c >= 0xE7 && c <= 0xEB)
+ || c == 0xEE || c == 0xEF || c == 0xF4 || c == 0xF9
+ || c == 0xFB || c == 0xFC)
+ {
+ xcna ++;
+ }
+ /* Arabic LAM to HEH */
+ else if (c == 0xE1 || c == 0xE3 || c == 0xE4
+ || c == 0xE5 || c == 0xE6)
+ {
+ xa++;
+ }
+ }
+ }
+ c = *text++;
+ }
+
+ /* when there is a difference fom ISO-8859-1 and ISO-8859-15,
+ and ordinary Latin letters are more than Arabic ones,
+ and the text isn't Cyrillic KOI8-U */
+ if (noniso && xl >= xac && (xcC1 + xcS >= xcC || xcna == 0))
+ charset = "CP1252"; // Windows-1252
+ else // if (xl < xac)
+ {
+ if (!noniso && xcC + xcS < xcC1)
+ charset = "ISO-8859-15"; // FIXME: ISO-8859-5 ?
+ /* this is very tricky and I added it later */
+ else if (!noniso && xcC + xcC1 + xa >= xcS - xa && !(xcC1 + xcS < xcC && xcna > 0))
+ charset = "ISO-8859-1";
+ else if (xcC + xcC1 < xcS && xcna > 0)
+ {
+ if (noniso || noniso15) // FIXME: this is very inefficient
+ charset = "CP1251"; // Cyrillic-1251
+ else
+ charset = "ISO-8859-15";
+ }
+ else if (xcC1 + xcS < xcC && xcna > 0)
+ charset = "KOI8-U"; // Cyrillic-KOI
+ /* this should cover most cases */
+ else if (noniso || xcC + xcC1 + xa >= xcS - xa)
+ charset = "CP1256"; // MS Windows Arabic
+ }
+
+ return charset;
+}
+/*************************/
+static const std::string detectCharsetCyrillic (const char *text)
+{
+ uint8_t c = *text;
+ bool noniso = false;
+ uint32_t xl = 0, xa = 0, xac = 0, xcC = 0, xcC1 = 0, xcS = 0, xcna = 0;
+ std::string charset = encodingItem[OPENI18N];
+
+ while (c != '\0')
+ {
+ if (c >= 0x41 && c <= 0x7A)
+ xl ++;
+ if (c >= 0x80 && c <= 0x9F)
+ noniso = true;
+ else if (c >= 0xC0)
+ {
+ xac ++;
+ if (c >= 0xC0 && c <= 0xCF)
+ xcC++;
+ else if (c >= 0xD0 && c <= 0xDF)
+ xcC1++;
+ else if (c >= 0xE0)
+ {
+ xcS++;
+ if (c == 0xE0 || c == 0xE2 || (c >= 0xE7 && c <= 0xEB)
+ || c == 0xEE || c == 0xEF || c == 0xF4 || c == 0xF9
+ || c == 0xFB || c == 0xFC)
+ {
+ xcna ++;
+ }
+ else if (c == 0xE1 || c == 0xE3 || c == 0xE4
+ || c == 0xE5 || c == 0xE6)
+ {
+ xa++;
+ }
+ }
+ }
+ c = *text++;
+ }
+
+ if (xl < xac)
+ {
+ if (!noniso && (xcC + xcS < xcC1))
+ charset = "ISO-8859-5";
+ else if (xcC + xcC1 < xcS && xcna > 0)
+ charset = "CP1251";
+ else if (xcC1 + xcS < xcC && xcna > 0)
+ charset = "KOI8-U";
+ else if (noniso || xcC + xcC1 + xa >= xcS - xa)
+ charset = "CP1256";
+ }
+
+ return charset;
+}
+/*************************/
+static const std::string detectCharsetWinArabic (const char *text)
+{
+ uint8_t c = *text;
+ uint32_t xl = 0, xa = 0;
+ std::string charset = encodingItem[IANA];
+
+ while (c != '\0')
+ {
+ if (c >= 0x41 && c <= 0x7A)
+ xl ++;
+ else if (c >= 0xC0)
+ xa ++;
+ c = *text++;
+ }
+
+ if (xl < xa)
+ charset = "CP1256";
+
+ return charset;
+}
+/*************************/
+static const std::string detectCharsetChinese (const char *text)
+{
+ uint8_t c = *text;
+ std::string charset = encodingItem[IANA];
+
+ while ((c = *text++) != '\0')
+ {
+ if (c >= 0x81 && c <= 0x87)
+ {
+ charset = "GB18030";
+ break;
+ }
+ else if (c >= 0x88 && c <= 0xA0)
+ {
+ c = *text++;
+ if ((c >= 0x30 && c <= 0x39) || (c >= 0x80 && c <= 0xA0))
+ {
+ charset = "GB18030";
+ break;
+ } //else GBK/Big5-HKSCS cannot determine
+ }
+ else if ((c >= 0xA1 && c <= 0xC6) || (c >= 0xC9 && c <= 0xF9))
+ {
+ c = *text++;
+ if (c >= 0x40 && c <= 0x7E)
+ charset = "BIG5";
+ else if ((c >= 0x30 && c <= 0x39) || (c >= 0x80 && c <= 0xA0))
+ {
+ charset = "GB18030";
+ break;
+ }
+ }
+ else if (c >= 0xC7)
+ {
+ c = *text++;
+ if ((c >= 0x30 && c <= 0x39) || (c >= 0x80 && c <= 0xA0))
+ {
+ charset = "GB18030";
+ break;
+ }
+ }
+ }
+
+ return charset;
+}
+/*************************/
+static const std::string detectCharsetJapanese (const char *text)
+{
+ uint8_t c = *text;
+ std::string charset = "";
+
+ while (charset.empty() && (c = *text++) != '\0')
+ {
+ if (c >= 0x81 && c <= 0x9F)
+ {
+ if (c == 0x8E) /* SS2 */
+ {
+ c = *text++;
+ if ((c >= 0x40 && c <= 0xA0) || (c >= 0xE0 && c <= 0xFC))
+ charset = "CP932";
+ }
+ else if (c == 0x8F) /* SS3 */
+ {
+ c = *text++;
+ if (c >= 0x40 && c <= 0xA0)
+ charset = "CP932";
+ else if (c >= 0xFD)
+ break;
+ }
+ else
+ charset = "CP932";
+ }
+ else if (c >= 0xA1 && c <= 0xDF)
+ {
+ c = *text++;
+ if (c <= 0x9F)
+ charset = "CP932";
+ else if (c >= 0xFD)
+ break;
+ }
+ else if (c >= 0xE0 && c <= 0xEF)
+ {
+ c = *text++;
+ if (c >= 0x40 && c <= 0xA0)
+ charset = "CP932";
+ else if (c >= 0xFD)
+ break;
+ }
+ else if (c >= 0xF0)
+ break;
+ }
+
+ if (charset.empty())
+ charset = "EUC-JP";
+
+ return charset;
+}
+/*************************/
+static const std::string detectCharsetKorean (const char *text)
+{
+ uint8_t c = *text;
+ bool noneuc = false;
+ bool nonjohab = false;
+ std::string charset = "";
+
+ while (charset.empty() && (c = *text++) != '\0')
+ {
+ if (c >= 0x81 && c < 0x84)
+ {
+ charset = "CP949";
+ }
+ else if (c >= 0x84 && c < 0xA1)
+ {
+ noneuc = true;
+ c = *text++;
+ if ((c > 0x5A && c < 0x61) || (c > 0x7A && c < 0x81))
+ charset = "CP1361";
+ else if (c == 0x52 || c == 0x72 || c == 0x92 || (c > 0x9D && c < 0xA1)
+ || c == 0xB2 || (c > 0xBD && c < 0xC1) || c == 0xD2
+ || (c > 0xDD && c < 0xE1) || c == 0xF2 || c == 0xFE)
+ {
+ charset = "CP949";
+ }
+ }
+ else if (c >= 0xA1 && c <= 0xC6)
+ {
+ c = *text++;
+ if (c < 0xA1)
+ {
+ noneuc = true;
+ if ((c > 0x5A && c < 0x61) || (c > 0x7A && c < 0x81))
+ charset = "CP1361";
+ else if (c == 0x52 || c == 0x72 || c == 0x92 || (c > 0x9D && c < 0xA1))
+ charset = "CP949";
+ else if (c == 0xB2 || (c > 0xBD && c < 0xC1) || c == 0xD2
+ || (c > 0xDD && c < 0xE1) || c == 0xF2 || c == 0xFE)
+ {
+ nonjohab = true;
+ }
+ }
+ }
+ else if (c > 0xC6 && c <= 0xD3)
+ {
+ c = *text++;
+ if (c < 0xA1)
+ charset = "CP1361";
+ }
+ else if (c > 0xD3 && c < 0xD8)
+ {
+ nonjohab = true;
+ c = *text++;
+ }
+ else if (c >= 0xD8)
+ {
+ c = *text++;
+ if (c < 0xA1)
+ charset = "CP1361";
+ }
+ if (noneuc && nonjohab)
+ charset = "CP949";
+ }
+
+ if (charset.empty())
+ {
+ if (noneuc)
+ charset = "CP949";
+ else
+ charset = "EUC-KR";
+ }
+
+ return charset;
+
+}
+/*************************/
+// The character set of the locale
+// ("UTF-8" for me)
+static const std::string getDefaultCharset()
+{
+ if (setlocale (LC_ALL, "") == NULL)
+ return "UTF-8"; // something's wrong; fall back to UTF-8
+ const std::string charset = nl_langinfo (CODESET);
+ return charset;
+}
+/*************************/
+static bool detect_noniso (const char *text)
+{
+ uint8_t c = *text;
+
+ while ((c = *text++) != '\0')
+ {
+ if (c >= 0x80 && c <= 0x9F)
+ return true;
+ }
+ return false;
+}
+/*************************/
+/* In the GTK+ version, I used g_utf8_validate()
+ but this function validates UTF-8 directly
+ and seems faster than using QTextCodec::ConverterState
+ with QTextCodec::toUnicode(), which may give incorrect results. */
+bool validateUTF8 (const QByteArray byteArray)
+{
+ const char *string = byteArray.constData();
+ if (!string) return true;
+
+ const unsigned char *bytes = (const unsigned char*)string;
+ unsigned int cp; // code point
+ int bn; // bytes number
+
+ while (*bytes != 0x00)
+ {
+ /* assuming that UTF-8 maps a sequence of 1-4 bytes,
+ we find the code point and the number of bytes */
+ if ((*bytes & 0x80) == 0x00)
+ { // 0xxxxxxx, all ASCII characters (0-127)
+ cp = (*bytes & 0x7F);
+ bn = 1;
+ }
+ else if ((*bytes & 0xE0) == 0xC0)
+ { // 110xxxxx 10xxxxxx
+ cp = (*bytes & 0x1F);
+ bn = 2;
+ }
+ else if ((*bytes & 0xF0) == 0xE0)
+ { // 1110xxxx 10xxxxxx 10xxxxxx
+ cp = (*bytes & 0x0F);
+ bn = 3;
+ }
+ else if ((*bytes & 0xF8) == 0xF0)
+ { // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ cp = (*bytes & 0x07);
+ bn = 4;
+ }
+ else
+ return false;
+
+ bytes += 1;
+ for (int i = 1; i < bn; ++i)
+ {
+ /* all the other bytes should be of the form 10xxxxxx */
+ if ((*bytes & 0xC0) != 0x80)
+ return false;
+ cp = (cp << 6) | (*bytes & 0x3F);
+ bytes += 1;
+ }
+
+ if (cp > 0x10FFFF // max code point by definition
+ /* the range from 0xd800 to 0xdfff is reserved
+ for use with UTF-16 and excluded from UTF-8 */
+ || (cp >= 0xD800 && cp <= 0xDFFF)
+ /* logically impossible situations */
+ || (cp <= 0x007F && bn != 1)
+ || (cp >= 0x0080 && cp <= 0x07FF && bn != 2)
+ || (cp >= 0x0800 && cp <= 0xFFFF && bn != 3)
+ || (cp >= 0x10000 && cp <= 0x1FFFFF && bn != 4))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+/*************************/
+const QString detectCharset (const QByteArray& byteArray)
+{
+ const char* text = byteArray.constData();
+ uint8_t c = *text;
+ std::string charset;
+
+ if (validateUTF8 (byteArray))
+ {
+ while ((c = *text++) != '\0')
+ {
+ if (c > 0x7F)
+ {
+ charset = "UTF-8";
+ break;
+ }
+ if (c == 0x1B) /* ESC */
+ {
+ c = *text++;
+ if (c == '$')
+ {
+ c = *text++;
+ switch (c)
+ {
+ case 'B': // JIS X 0208-1983
+ case '@': // JIS X 0208-1978
+ charset = "ISO-2022-JP";
+ continue;
+ case 'A': // GB2312-1980
+ charset = "ISO-2022-JP-2";
+ break;
+ case '(':
+ c = *text++;
+ switch (c)
+ {
+ case 'C': // KSC5601-1987
+ case 'D': // JIS X 0212-1990
+ charset = "ISO-2022-JP-2";
+ }
+ break;
+ case ')':
+ c = *text++;
+ if (c == 'C')
+ charset = "ISO-2022-KR"; // KSC5601-1987
+ }
+ break;
+ }
+ }
+ }
+ if (charset.empty())
+ charset = getDefaultCharset();
+ }
+
+ if (charset.empty())
+ {
+ switch (localeNum)
+ {
+ case LATIN1:
+ /* Windows-1252 */
+ charset = detectCharsetLatin (text);
+ break;
+ case LATINC:
+ case LATINC_UA:
+ case LATINC_TJ:
+ /* Cyrillic */
+ charset = detectCharsetCyrillic (text);
+ break;
+ case LATINA:
+ /* MS Windows Arabic */
+ charset = detectCharsetWinArabic (text);
+ break;
+ case CHINESE_CN:
+ case CHINESE_TW:
+ case CHINESE_HK:
+ charset = detectCharsetChinese (text);
+ break;
+ case JAPANESE:
+ charset = detectCharsetJapanese (text);
+ break;
+ case KOREAN:
+ charset = detectCharsetKorean (text);
+ break;
+ case VIETNAMESE:
+ case THAI:
+ case GEORGIAN:
+ charset = encodingItem[OPENI18N];
+ break;
+ default:
+ if (getDefaultCharset() != "UTF-8")
+ charset = getDefaultCharset();
+ else if (detect_noniso (text))
+ charset = encodingItem[CODEPAGE];
+ else
+ charset = encodingItem[OPENI18N];
+ if (charset.empty())
+ charset = encodingItem[IANA];
+ }
+ }
+
+ return QString::fromStdString (charset);
+}
+
+
diff --git a/src/common/encoding.h b/src/common/encoding.h
new file mode 100644
index 0000000000000000000000000000000000000000..921a942454488400e0f8612c5ebdc9a4f4de5ffa
--- /dev/null
+++ b/src/common/encoding.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) Pedram Pourang (aka Tsu Jan) 2014-2020
+ *
+ * FeatherPad 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FeatherPad 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 .
+ *
+ * @license GPL-2.0+
+ */
+
+#ifndef ENCODING_H
+#define ENCODING_H
+
+#include
+
+const QString detectCharset (const QByteArray& byteArray);
+
+#endif // ENCODING_H
diff --git a/src/common/eventlogutils.cpp b/src/common/eventlogutils.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f8caa26fd31e0abf5f0f17129dca7f84f9474d91
--- /dev/null
+++ b/src/common/eventlogutils.cpp
@@ -0,0 +1,38 @@
+// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "eventlogutils.h"
+#include
+#include
+#include
+#include
+
+Eventlogutils *Eventlogutils::m_pInstance = nullptr;
+Eventlogutils *Eventlogutils::GetInstance()
+{
+ if (m_pInstance == nullptr) {
+ m_pInstance = new Eventlogutils();
+ }
+ return m_pInstance;
+}
+
+void Eventlogutils::writeLogs(QJsonObject &data)
+{
+ if (!writeEventLogFunc)
+ return;
+
+ writeEventLogFunc(QJsonDocument(data).toJson(QJsonDocument::Compact).toStdString());
+}
+
+Eventlogutils::Eventlogutils()
+{
+ QLibrary library("libdeepin-event-log.so");
+ initFunc = reinterpret_cast(library.resolve("Initialize"));
+ writeEventLogFunc = reinterpret_cast(library.resolve("WriteEventLog"));
+
+ if (!initFunc)
+ return;
+
+ initFunc("deepin-editor", true);
+}
diff --git a/src/common/eventlogutils.h b/src/common/eventlogutils.h
new file mode 100644
index 0000000000000000000000000000000000000000..27c55fe26a330b6fa552cfe27703571b296d6692
--- /dev/null
+++ b/src/common/eventlogutils.h
@@ -0,0 +1,30 @@
+// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef EVENTLOGUTILS_H
+#define EVENTLOGUTILS_H
+#include
+#include
+
+class Eventlogutils
+{
+public:
+ enum EventTID {
+ OpenTime = 1000000000,
+ CloseTime = 1000000001,
+ StartUp = 1000000003,
+ Quit = 1000000004,
+ };
+
+ static Eventlogutils *GetInstance();
+ void writeLogs(QJsonObject &data);
+private :
+ static Eventlogutils *m_pInstance;
+ Eventlogutils();
+
+ bool (*initFunc)(const std::string &packagename, bool enable_sig) = nullptr;
+ void (*writeEventLogFunc)(const std::string &eventdata) = nullptr;
+};
+
+#endif // EVENTLOGUTILS_H
diff --git a/src/common/fileloadthread.cpp b/src/common/fileloadthread.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..ed0b1902dd818228be095416d98851063b66c9e3
--- /dev/null
+++ b/src/common/fileloadthread.cpp
@@ -0,0 +1,84 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "fileloadthread.h"
+#include "utils.h"
+#include "../encodes/detectcode.h"
+#include
+#include
+
+FileLoadThread::FileLoadThread(const QString &filepath, QObject *parent)
+ : QThread(parent),
+ m_strFilePath(filepath)
+{
+
+}
+
+FileLoadThread::~FileLoadThread()
+{
+}
+
+void FileLoadThread::run()
+{
+ QFile file(m_strFilePath);
+
+ if (file.open(QIODevice::ReadOnly)) {
+ QByteArray encode;
+ QByteArray indata;
+
+ // 判断文件大小是否超过40MB, 超过40MB的文件过大,需要调整读取策略,优先加载头部文件
+ static const int s_maxDirectReadLen = 40 * DATA_SIZE_1024 * DATA_SIZE_1024;
+ if (file.size() > s_maxDirectReadLen) {
+ // 先读取1MB数据
+ indata = file.read(DATA_SIZE_1024 * DATA_SIZE_1024);
+ encode = DetectCode::GetFileEncodingFormat(m_strFilePath, indata);
+
+ // 发送文件头信息,用于预先加载数据
+ QString textEncode = QString::fromLocal8Bit(encode);
+ if (textEncode.contains("ASCII", Qt::CaseInsensitive) || textEncode.contains("UTF-8", Qt::CaseInsensitive)) {
+ emit sigPreProcess(encode, indata);
+ } else {
+ QByteArray outHeadData;
+ DetectCode::ChangeFileEncodingFormat(indata, outHeadData, textEncode, QString("UTF-8"));
+ emit sigPreProcess(encode, outHeadData);
+ }
+ }
+
+ // 读取申请开辟内存空间时,捕获可能出现的 std::bad_alloc() 异常,防止闪退。
+ try {
+ // reads all remaining data from the file.
+ indata += file.read(file.size());
+ file.close();
+ } catch (const std::exception &e) {
+ qWarning() << Q_FUNC_INFO << "Read file data error, " << QString(e.what());
+
+ file.close();
+ emit sigLoadFinished(encode, indata, true);
+ return;
+ }
+
+ if (encode.isEmpty()) {
+ //编码识别,如果文件数据大于1M,则只裁剪出1M文件数据去做编码探测
+ QByteArray dateUsedForCodeIdentify;
+ if (indata.length() > DATA_SIZE_1024 * DATA_SIZE_1024) {
+ dateUsedForCodeIdentify = indata.mid(0, DATA_SIZE_1024 * DATA_SIZE_1024);
+ } else {
+ dateUsedForCodeIdentify = indata;
+ }
+ encode = DetectCode::GetFileEncodingFormat(m_strFilePath, dateUsedForCodeIdentify);
+ }
+
+ QString textEncode = QString::fromLocal8Bit(encode);
+ if (textEncode.contains("ASCII", Qt::CaseInsensitive) || textEncode.contains("UTF-8", Qt::CaseInsensitive)) {
+ emit sigLoadFinished(encode, indata, false);
+ } else {
+ QByteArray outData;
+ DetectCode::ChangeFileEncodingFormat(indata, outData, textEncode, QString("UTF-8"));
+ emit sigLoadFinished(encode, outData, false);
+ }
+ }
+
+ this->quit();
+ this->deleteLater();
+}
diff --git a/src/common/fileloadthread.h b/src/common/fileloadthread.h
new file mode 100644
index 0000000000000000000000000000000000000000..f6a0996ae283e7bf690ab085a75b0befa60d52d5
--- /dev/null
+++ b/src/common/fileloadthread.h
@@ -0,0 +1,28 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef FILELOADTHREAD_H
+#define FILELOADTHREAD_H
+
+#include
+
+class FileLoadThread : public QThread
+{
+ Q_OBJECT
+public:
+ FileLoadThread(const QString &filepath, QObject *QObject = nullptr);
+ ~FileLoadThread();
+
+ void run();
+
+signals:
+ // 预处理信号,优先处理文件头,防止出现加载时间过长的情况
+ void sigPreProcess(const QByteArray &encode, const QByteArray &content);
+ void sigLoadFinished(const QByteArray &encode, const QByteArray &content, bool error = false);
+
+private:
+ QString m_strFilePath;
+};
+
+#endif
diff --git a/src/common/iflytekaiassistantthread.cpp b/src/common/iflytekaiassistantthread.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c9739386f1d75a4cc4108a472bfc3d20cb325920
--- /dev/null
+++ b/src/common/iflytekaiassistantthread.cpp
@@ -0,0 +1,27 @@
+// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "iflytekaiassistantthread.h"
+
+IflytekAiassistantThread::IflytekAiassistantThread(QObject *parent)
+ : QThread (parent)
+{}
+
+IflytekAiassistantThread::~IflytekAiassistantThread()
+{}
+
+void IflytekAiassistantThread::run()
+{
+ bool bIsRegistIflytekAiassistant = false;
+ QDBusConnection connection = QDBusConnection::sessionBus();
+ QDBusConnectionInterface *bus = connection.interface();
+ bool isVailid = bus->isServiceRegistered("com.iflytek.aiassistant");
+ if (isVailid) {
+ bIsRegistIflytekAiassistant = true;
+ } else {
+ qInfo() << "com.iflytek.aiassistant service no registered!";
+ }
+
+ emit sigIsRegisteredIflytekAiassistant(bIsRegistIflytekAiassistant);
+}
diff --git a/src/common/iflytekaiassistantthread.h b/src/common/iflytekaiassistantthread.h
new file mode 100644
index 0000000000000000000000000000000000000000..9fc676bc7a705f86c3cba6598e519d68fce76842
--- /dev/null
+++ b/src/common/iflytekaiassistantthread.h
@@ -0,0 +1,27 @@
+// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef IFLYTEKAIASSISTANTTHREAD_H
+#define IFLYTEKAIASSISTANTTHREAD_H
+
+#include
+#include
+#include
+#include
+
+class IflytekAiassistantThread : public QThread
+{
+ Q_OBJECT
+public:
+ IflytekAiassistantThread(QObject *object = nullptr);
+ ~IflytekAiassistantThread();
+
+private:
+ void run();
+
+signals:
+ void sigIsRegisteredIflytekAiassistant(const bool bIsRegistIflytekAiassistant);
+};
+
+#endif // IFLYTEKAIASSISTANTTHREAD_H
diff --git a/src/common/performancemonitor.cpp b/src/common/performancemonitor.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f5fffbdec6246ef0c3a0587aede13244f1c198f4
--- /dev/null
+++ b/src/common/performancemonitor.cpp
@@ -0,0 +1,84 @@
+// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "performancemonitor.h"
+
+const QString LOG_FLAG = "[PerformanceMonitor]";
+
+const QString GRAB_POINT_INIT_APP_TIME = "[GRABPOINT] POINT-01";
+const QString GRAB_POINT_CLOSE_APP_TIME = "[GRABPOINT] POINT-02";
+const QString GRAB_POINT_OPEN_FILE_TIME = "[GRABPOINT] POINT-04";
+
+qint64 PerformanceMonitor::initializeAppStartMs = 0;
+qint64 PerformanceMonitor::inittalizeApoFinishMs = 0;
+qint64 PerformanceMonitor::closeAppStartMs = 0;
+qint64 PerformanceMonitor::closeAppFinishMs = 0;
+qint64 PerformanceMonitor::openFileStartMs = 0;
+qint64 PerformanceMonitor::openFileFinishMs = 0;
+
+PerformanceMonitor::PerformanceMonitor()
+{
+
+}
+
+void PerformanceMonitor::initializeAppStart()
+{
+ QDateTime current = QDateTime::currentDateTime();
+ qDebug() << qPrintable(LOG_FLAG)
+ << QDateTime::currentDateTime().toString(Qt::ISODateWithMs)
+ << "start to initialize app";
+ initializeAppStartMs = current.toMSecsSinceEpoch();
+}
+
+void PerformanceMonitor::initializAppFinish()
+{
+ QDateTime current = QDateTime::currentDateTime();
+ qDebug() << qPrintable(LOG_FLAG)
+ << QDateTime::currentDateTime().toString(Qt::ISODateWithMs)
+ << " finish to initialize app";
+
+ inittalizeApoFinishMs = current.toMSecsSinceEpoch();
+ qint64 time = inittalizeApoFinishMs - initializeAppStartMs;
+ qInfo() << qPrintable(QString("%1 startduration=%2ms #(Init app time)").arg(GRAB_POINT_INIT_APP_TIME).arg(time));
+}
+
+void PerformanceMonitor::closeAppStart()
+{
+ QDateTime current = QDateTime::currentDateTime();
+ closeAppStartMs = current.toMSecsSinceEpoch();
+}
+
+void PerformanceMonitor::closeAPPFinish()
+{
+ QDateTime current = QDateTime::currentDateTime();
+ qDebug() << qPrintable(LOG_FLAG)
+ << QDateTime::currentDateTime().toString(Qt::ISODateWithMs)
+ << " finish to close app";
+
+ closeAppFinishMs = current.toMSecsSinceEpoch();
+ qint64 time = closeAppFinishMs - closeAppStartMs;
+ qInfo() << qPrintable(QString("%1 closeduration=%2ms #(Close app time)").arg(GRAB_POINT_CLOSE_APP_TIME).arg(time));
+}
+
+void PerformanceMonitor::openFileStart()
+{
+ QDateTime current = QDateTime::currentDateTime();
+ qDebug() << qPrintable(LOG_FLAG)
+ << QDateTime::currentDateTime().toString(Qt::ISODateWithMs)
+ << "start to open file";
+ openFileStartMs = current.toMSecsSinceEpoch();
+}
+
+void PerformanceMonitor::openFileFinish(const QString &strFileName, qint64 iFileSize)
+{
+ QDateTime current = QDateTime::currentDateTime();
+ qDebug() << qPrintable(LOG_FLAG)
+ << QDateTime::currentDateTime().toString(Qt::ISODateWithMs)
+ << " finish to open file";
+
+ openFileFinishMs = current.toMSecsSinceEpoch();
+ qint64 time = openFileFinishMs - openFileStartMs;
+ float fFilesize = iFileSize;
+ qInfo() << qPrintable(QString("%1 filename=%2 filezise=%3M opentime=%4ms #(Open file time)").arg(GRAB_POINT_OPEN_FILE_TIME).arg(strFileName).arg(QString::number(fFilesize/(1024*1024), 'f', 6)).arg(time));
+}
diff --git a/src/common/performancemonitor.h b/src/common/performancemonitor.h
new file mode 100644
index 0000000000000000000000000000000000000000..3b23b3538a7302d76429abffbd2cdffa079bd201
--- /dev/null
+++ b/src/common/performancemonitor.h
@@ -0,0 +1,37 @@
+// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef PERFORMANCEMONITOR_H
+#define PERFORMANCEMONITOR_H
+
+
+#include
+#include
+#include
+
+class PerformanceMonitor
+{
+
+public:
+ explicit PerformanceMonitor();
+
+ static void initializeAppStart();
+ static void initializAppFinish();
+ static void closeAppStart();
+ static void closeAPPFinish();
+ static void openFileStart();
+ static void openFileFinish(const QString &strFileName, qint64 iFileSize);
+
+private:
+ Q_DISABLE_COPY(PerformanceMonitor)
+
+ static qint64 initializeAppStartMs;
+ static qint64 inittalizeApoFinishMs;
+ static qint64 closeAppStartMs;
+ static qint64 closeAppFinishMs;
+ static qint64 openFileStartMs;
+ static qint64 openFileFinishMs;
+};
+
+#endif // PERFORMANCEMONITOR_H
diff --git a/src/common/settings.cpp b/src/common/settings.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..46133ea840f87a07e2ab631aac92df1ddd2a64d7
--- /dev/null
+++ b/src/common/settings.cpp
@@ -0,0 +1,726 @@
+// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "utils.h"
+#include "settings.h"
+
+#include "dthememanager.h"
+#include "../controls/fontitemdelegate.h"
+#include "../widgets/pathsettintwgt.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+Settings *Settings::s_pSetting = nullptr;
+
+CustemBackend::CustemBackend(const QString &filepath, QObject *parent)
+ : DSettingsBackend (parent),
+ m_settings (new QSettings(filepath, QSettings::IniFormat))
+{
+
+}
+
+void CustemBackend::doSync()
+{
+ m_settings->sync();
+}
+
+void CustemBackend::doSetOption(const QString &key, const QVariant &value)
+{
+ /*
+ * 将配置值写入config配置文件
+ * 为了规避数据写入重复或者错乱,配置写入之前上锁,写入结束后开锁
+ */
+ m_writeLock.lock();
+ m_settings->setValue(key, value);
+ m_settings->sync();
+ m_writeLock.unlock();
+}
+
+QStringList CustemBackend::keys() const
+{
+ QStringList keyList = m_settings->allKeys();
+
+ return keyList;
+}
+
+QVariant CustemBackend::getOption(const QString &key) const
+{
+ return m_settings->value(key);
+}
+
+CustemBackend::~CustemBackend()
+{}
+
+Settings::Settings(QWidget *parent)
+ : QObject(parent)
+{
+ QString strConfigPath = QString("%1/%2/%3/config.conf")
+ .arg(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation))
+ .arg(qApp->organizationName())
+ .arg(qApp->applicationName());
+
+ removeLockFiles();
+ m_backend = new QSettingBackend(strConfigPath);
+
+ settings = DSettings::fromJsonFile(":/resources/settings.json");
+ settings->setBackend(m_backend);
+
+ auto fontFamliy = settings->option("base.font.family");
+ connect(fontFamliy, &Dtk::Core::DSettingsOption::valueChanged, this, &Settings::slotsigAdjustFont);
+
+ auto fontSize = settings->option("base.font.size");
+ connect(fontSize, &Dtk::Core::DSettingsOption::valueChanged, this, &Settings::slotsigAdjustFontSize);
+
+ auto wordWrap = settings->option("base.font.wordwrap");
+ connect(wordWrap, &Dtk::Core::DSettingsOption::valueChanged, this, &Settings::slotsigAdjustWordWrap);
+
+ auto showLineNumber = settings->option("base.font.showlinenumber");
+ connect(showLineNumber, &Dtk::Core::DSettingsOption::valueChanged, this, &Settings::slotsigSetLineNumberShow);
+
+ auto bookmark = settings->option("base.font.showbookmark");
+ connect(bookmark, &Dtk::Core::DSettingsOption::valueChanged, this, &Settings::slotsigAdjustBookmark);
+
+ auto codeFlod = settings->option("base.font.codeflod");
+ connect(codeFlod, &Dtk::Core::DSettingsOption::valueChanged, this, &Settings::slotsigShowCodeFlodFlag);
+
+ //添加显示空白符 梁卫东
+ auto blankCharacter = settings->option("base.font.showblankcharacter");
+ connect(blankCharacter, &Dtk::Core::DSettingsOption::valueChanged, this, &Settings::slotsigShowBlankCharacter);
+
+ //hightlightcurrentline
+ auto hightlightCurrentLine = settings->option("base.font.hightlightcurrentline");
+ connect(hightlightCurrentLine, &Dtk::Core::DSettingsOption::valueChanged, this, &Settings::slotsigHightLightCurrentLine);
+
+ /* 设置页面主题变更信息监听,当前暂时无用,暂且做屏蔽处理
+ auto theme = settings->option("advance.editor.theme");
+ connect(theme, &Dtk::Core::DSettingsOption::valueChanged, this, [ = ](QVariant value) {
+ //emit themeChanged(value.toString());
+ }); */
+
+ auto tabSpaceNumber = settings->option("advance.editor.tabspacenumber");
+ connect(tabSpaceNumber, &Dtk::Core::DSettingsOption::valueChanged, this, &Settings::slotsigAdjustTabSpaceNumber);
+
+ auto keymap = settings->option("shortcuts.keymap.keymap");
+ QMap keymapMap;
+ keymapMap.insert("keys", QStringList() << "standard" << "emacs" << "customize");
+ keymapMap.insert("values", QStringList() << tr("Standard") << "Emacs" << tr("Customize"));
+ keymap->setData("items", keymapMap);
+ connect(keymap, &Dtk::Core::DSettingsOption::valueChanged, this, &Settings::slotupdateAllKeysWithKeymap);
+
+ //only used by new window
+ auto windowState = settings->option("advance.window.windowstate");
+ #if 0
+ connect(windowState, &Dtk::Core::DSettingsOption::valueChanged, this, [=] (QVariant value) {
+ emit sigChangeWindowSize(value.toString());
+ });
+ #endif
+ QMap windowStateMap;
+ windowStateMap.insert("keys", QStringList() << "window_normal" << "window_maximum" << "fullscreen");
+ windowStateMap.insert("values", QStringList() << tr("Normal") << tr("Maximum") << tr("Fullscreen"));
+ windowState->setData("items", windowStateMap);
+
+ connect(settings, &Dtk::Core::DSettings::valueChanged, this, &Settings::slotCustomshortcut);
+}
+
+void Settings::setSavePath(int id,const QString& path)
+{
+ switch (id) {
+ case PathSettingWgt::LastOptBox:{
+ auto opt = settings->option("advance.open_save_setting.open_save_lastopt_path");
+ opt->setValue(path);
+ break;
+ }
+ case PathSettingWgt::CurFileBox:{
+ auto opt = settings->option("advance.open_save_setting.open_save_curfile_path");
+ opt->setValue(path);
+ break;
+ }
+ case PathSettingWgt::CustomBox:{
+ auto opt = settings->option("advance.open_save_setting.open_save_custom_path");
+ opt->setValue(path);
+ break;
+ }
+ default:
+ break;
+ }
+}
+
+
+QString Settings::getSavePath(int id)
+{
+ QString path;
+ switch (id) {
+ case PathSettingWgt::LastOptBox:{
+ path = settings->option("advance.open_save_setting.open_save_lastopt_path")->value().toString();
+ break;
+ }
+ case PathSettingWgt::CurFileBox:{
+ path = settings->option("advance.open_save_setting.open_save_curfile_path")->value().toString();
+ break;
+ }
+ case PathSettingWgt::CustomBox:{
+ path = settings->option("advance.open_save_setting.open_save_custom_path")->value().toString();
+ break;
+ }
+ default:
+ break;
+ }
+
+ return path;
+}
+
+void Settings::setSavePathId(int id)
+{
+ auto opt = settings->option("advance.open_save_setting.savingpathwgt");
+ opt->setValue(QString::number(id));
+}
+int Settings::getSavePathId()
+{
+ return settings->option("advance.open_save_setting.savingpathwgt")->value().toInt();
+
+}
+Settings::~Settings()
+{
+ if (m_backend != nullptr) {
+ delete m_backend;
+ m_backend = nullptr;
+ }
+}
+
+void Settings::setSettingDialog(DSettingsDialog *settingsDialog)
+{
+ m_pSettingsDialog = settingsDialog;
+}
+
+// This function is workaround, it will remove after DTK fixed SettingDialog theme bug.
+void Settings::dtkThemeWorkaround(QWidget *parent, const QString &theme)
+{
+ parent->setStyle(QStyleFactory::create(theme));
+
+ for (auto obj : parent->children()) {
+ auto w = qobject_cast(obj);
+ if (!w) {
+ continue;
+ }
+
+ dtkThemeWorkaround(w, theme);
+ }
+}
+
+//QWidget *Settings::createFontComBoBoxHandle(QObject *obj)
+QPair Settings::createFontComBoBoxHandle(QObject *obj)
+{
+ auto option = qobject_cast(obj);
+
+ QComboBox *comboBox = new QComboBox;
+ //QWidget *optionWidget = DSettingsWidgetFactory::createTwoColumWidget(option, comboBox);
+ QPair optionWidget = DSettingsWidgetFactory::createStandardItem(QByteArray(), option, comboBox);
+
+ QFontDatabase fontDatabase;
+ comboBox->addItems(fontDatabase.families());
+ //comboBox->setItemDelegate(new FontItemDelegate);
+ //comboBox->setFixedSize(240, 36);
+
+ if (option->value().toString().isEmpty()) {
+ option->setValue(QFontDatabase::systemFont(QFontDatabase::FixedFont).family());
+ }
+
+ // init.
+ comboBox->setCurrentText(option->value().toString());
+
+ connect(option, &DSettingsOption::valueChanged, comboBox, [ = ](QVariant var) {
+ comboBox->setCurrentText(var.toString());
+ });
+
+ option->connect(comboBox, &QComboBox::currentTextChanged, option, [ = ](const QString & text) {
+ option->setValue(text);
+ });
+
+ return optionWidget;
+}
+
+QWidget* Settings::createSavingPathWgt(QObject* obj)
+{
+ auto option = qobject_cast(obj);
+ QString name = option->name();
+ PathSettingWgt* pathwgt = new PathSettingWgt;
+ QPair optionWidget = DSettingsWidgetFactory::createStandardItem(QByteArray(), option, pathwgt);
+
+ connect(option, &DSettingsOption::valueChanged, pathwgt, [ = ](QVariant var) {
+ int id = var.toInt();
+ pathwgt->onSaveIdChanged(id);
+ });
+
+ auto custompath = s_pSetting->settings->option("advance.open_save_setting.open_save_custom_path");
+ connect(custompath, &Dtk::Core::DSettingsOption::valueChanged, [=](QVariant var){
+ //pathwgt->setEditText(var.toString());
+ });
+
+
+ return optionWidget.second;
+}
+
+QPair Settings::createKeySequenceEditHandle(QObject *obj)
+{
+ auto option = qobject_cast(obj);
+ KeySequenceEdit *shortCutLineEdit = new KeySequenceEdit(option);
+
+ shortCutLineEdit->ShortcutDirection(Qt::AlignLeft);
+ shortCutLineEdit->setFocusPolicy(Qt::StrongFocus);
+
+ // init.
+ shortCutLineEdit->setKeySequence(QKeySequence(option->value().toString()));
+ QPair optionWidget = DSettingsWidgetFactory::createStandardItem(QByteArray(), option, shortCutLineEdit);
+
+ option->connect(shortCutLineEdit, &DKeySequenceEdit::editingFinished, [ = ](const QKeySequence & sequence) {
+ QString checkName = option->key();
+ QString reason;
+ bool bIsConflicts = false;
+ auto keymap = instance()->settings->option("shortcuts.keymap.keymap");
+ QStringList keySplitList = option->key().split(".");
+ keySplitList[1] = QString("%1_keymap_%2").arg(keySplitList[1]).arg(keymap->value().toString());
+
+ // 获取默认设置的组合键序列
+ QString defaultKey;
+ auto defaultOption = instance()->settings->option(keySplitList.join("."));
+ if (defaultOption) {
+ defaultKey = defaultOption->defaultValue().toString();
+ }
+
+ // 判断新设置的组合键序列是否允许
+ if (!instance()->checkShortcutValid(checkName, sequence.toString(), reason, bIsConflicts, defaultKey)) {
+ instance()->m_pDialog = instance()->createDialog(reason, "", bIsConflicts);
+ instance()->m_pDialog->exec();
+ // 恢复组合键序列
+ shortCutLineEdit->setKeySequence(instance()->settings->value(keySplitList.join(".")).toString());
+ keymap->setValue("emacs");
+ keymap->setValue("customize");
+ return;
+ }
+
+ bool bIsCustomize = false;
+ QString conflictsKeys;
+ QString originalKeys;
+
+ if (keymap->value().toString() != "customize") {
+ instance()->m_bUserChangeKey = true;
+
+ for (auto loopOption : instance()->settings->group("shortcuts.window_keymap_customize")->options()) {
+ QStringList loopKeySplitList = loopOption->key().split(".");
+ loopKeySplitList[1] = QString("window_keymap_%1").arg(keymap->value().toString());
+
+ if (loopOption->value().toString() == sequence.toString()) {
+
+ if (checkName.contains(loopKeySplitList.last())) {
+ keymap->setValue("customize");
+ //return;
+ } else {
+ bIsConflicts = true;
+ loopKeySplitList[1] = QString("window_keymap_%1").arg("customize");
+ conflictsKeys = loopKeySplitList.join(".");
+ }
+ }
+ }
+
+ for (auto loopOption : instance()->settings->group("shortcuts.editor_keymap_customize")->options()) {
+ QStringList loopKeySplitList = loopOption->key().split(".");
+ loopKeySplitList[1] = QString("editor_keymap_%1").arg(keymap->value().toString());
+
+ if (loopOption->value().toString() == sequence.toString()) {
+
+ if (checkName.contains(loopKeySplitList.last())) {
+ keymap->setValue("customize");
+ //return;
+ } else {
+ bIsConflicts = true;
+ loopKeySplitList[1] = QString("editor_keymap_%1").arg("customize");
+ conflictsKeys = loopKeySplitList.join(".");
+ }
+ }
+ }
+
+ instance()->m_bUserChangeKey = false;
+ } else {
+ bIsCustomize = true;
+ instance()->m_bUserChangeKey = true;
+ for (auto loopOption : instance()->settings->group("shortcuts.window_keymap_customize")->options()) {
+ QStringList loopKeySplitList = loopOption->key().split(".");
+ loopKeySplitList[1] = QString("window_keymap_%1").arg(keymap->value().toString());
+
+ if (loopOption->value().toString() == sequence.toString()) {
+
+ if (checkName.contains(loopKeySplitList.last())) {
+ //return;
+ } else {
+ bIsConflicts = true;
+ conflictsKeys = loopKeySplitList.join(".");
+ }
+ }
+ }
+
+ for (auto loopOption : instance()->settings->group("shortcuts.editor_keymap_customize")->options()) {
+ QStringList loopKeySplitList = loopOption->key().split(".");
+ loopKeySplitList[1] = QString("editor_keymap_%1").arg(keymap->value().toString());
+
+ if (loopOption->value().toString() == sequence.toString()) {
+
+ if (checkName.contains(loopKeySplitList.last())) {
+ //return;
+ } else {
+ bIsConflicts = true;
+ conflictsKeys = loopKeySplitList.join(".");
+ }
+ }
+ }
+ instance()->m_bUserChangeKey = false;
+ }
+
+ keySplitList = option->key().split(".");
+ keySplitList[1] = QString("%1_keymap_%2").arg(keySplitList[1]).arg(keymap->value().toString());
+ QString qstrSequence = sequence.toString();
+
+ if (sequence.toString().contains("<")) {
+ qstrSequence.replace(qstrSequence.indexOf("<"), 1, "<");
+ }
+
+ if (sequence.toString().contains("Return")) {
+ qstrSequence.replace(qstrSequence.indexOf("Return"), 6, "Enter");
+ }
+
+ QString style = QString("[%1]").arg(qstrSequence);
+
+ if (bIsConflicts || sequence.toString() == "Alt+M") {
+ if (sequence.toString() == "Alt+M") {
+ instance()->m_pDialog = instance()->createDialog(tr("This shortcut conflicts with system shortcut %1").arg(style), "", bIsConflicts);
+ } else {
+ instance()->m_pDialog = instance()->createDialog(tr("This shortcut conflicts with %1, click on Replace to make this shortcut effective immediately").arg(style), "", bIsConflicts);
+ }
+
+ int mode = instance()->m_pDialog->exec();
+
+ // click cancel button.
+ if (mode == -1 || mode == 0) {
+ shortCutLineEdit->setKeySequence(QKeySequence(instance()->settings->value(keySplitList.join(".")).toString()));
+ keymap->setValue("emacs");
+ keymap->setValue("customize");
+ return;
+ } else {
+ keySplitList = option->key().split(".");
+ keySplitList[1] = QString("%1_keymap_customize").arg(keySplitList[1]);
+
+ if (!bIsCustomize) {
+ instance()->settings->option(keySplitList.join("."))->setValue(sequence.toString());
+ instance()->settings->option(conflictsKeys)->setValue("");
+ shortCutLineEdit->setKeySequence(QKeySequence(instance()->settings->value(checkName).toString()));
+ } else {
+ instance()->settings->option(keySplitList.join("."))->setValue(sequence.toString());
+ instance()->settings->option(conflictsKeys)->setValue("");
+ }
+ keymap->setValue("emacs");
+ keymap->setValue("customize");
+ return;
+ }
+ }
+
+ if (!bIsCustomize) {
+ keySplitList = option->key().split(".");
+ keySplitList[1] = QString("%1_keymap_customize").arg(keySplitList[1]);
+ instance()->settings->option(keySplitList.join("."))->setValue(sequence.toString());
+ } else {
+ instance()->settings->option(keySplitList.join("."))->setValue(sequence.toString());
+ }
+ keymap->setValue("emacs");
+ keymap->setValue("customize");
+ });
+
+ // 配置修改
+ option->connect(option, &DTK_CORE_NAMESPACE::DSettingsOption::valueChanged, shortCutLineEdit, &KeySequenceEdit::slotDSettingsOptionvalueChanged);
+ return optionWidget;
+}
+
+void KeySequenceEdit::slotDSettingsOptionvalueChanged(const QVariant & value)
+{
+ QString keyseq = value.toString();
+
+ if (keyseq.isEmpty()) {
+ this->clear();
+ return;
+ }
+ this->setKeySequence(QKeySequence(keyseq));
+}
+
+bool KeySequenceEdit::eventFilter(QObject *object, QEvent *event)
+{
+ //设置界面 回车键和空格键 切换输入 梁卫东 2020-08-21 16:28:31
+ if (object == this) {
+ if (event->type() == QEvent::KeyPress) {
+ QKeyEvent* keyEvent = static_cast(event);
+
+ //判断是否包含组合键 梁卫东 2020-09-02 15:03:56
+ Qt::KeyboardModifiers modifiers = keyEvent->modifiers();
+ bool bHasModifier = (modifiers & Qt::ShiftModifier || modifiers & Qt::ControlModifier ||
+ modifiers & Qt::AltModifier);
+
+ if (!bHasModifier && (keyEvent->key() == Qt::Key_Return || keyEvent->key() == Qt::Key_Space)) {
+ QRect rect = this->rect();
+ QList childern = findChildren();
+
+ for (int i =0; i < childern.size(); i++) {
+ QPoint pos(25,rect.height()/2);
+
+ QMouseEvent event0(QEvent::MouseButtonPress, pos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
+ DApplication::sendEvent(childern[i], &event0);
+ }
+
+ return true;
+ }
+ }
+ }
+
+ return DKeySequenceEdit::eventFilter(object, event);
+}
+Settings *Settings::instance()
+{
+ if (s_pSetting == nullptr) {
+ s_pSetting = new Settings;
+ }
+ return s_pSetting;
+}
+
+void Settings::updateAllKeysWithKeymap(QString keymap)
+{
+ m_bUserChangeKey = true;
+
+ for (auto option : settings->group("shortcuts.window")->options()) {
+ QStringList keySplitList = option->key().split(".");
+ keySplitList[1] = QString("%1_keymap_%2").arg(keySplitList[1]).arg(keymap);
+ auto opt = settings->option(keySplitList.join("."));
+ if (opt) {
+ option->setValue(opt->value().toString());
+ } else {
+ qWarning() << "Unknown shortcut key:" << keySplitList.join(".");
+ }
+ }
+
+ for (auto option : settings->group("shortcuts.editor")->options()) {
+ QStringList keySplitList = option->key().split(".");
+ keySplitList[1] = QString("%1_keymap_%2").arg(keySplitList[1]).arg(keymap);
+ auto opt = settings->option(keySplitList.join("."));
+ if (opt) {
+ option->setValue(opt->value().toString());
+ } else {
+ qWarning() << "Unknown shortcut key:" << keySplitList.join(".");
+ }
+ }
+
+ m_bUserChangeKey = false;
+}
+
+void Settings::copyCustomizeKeysFromKeymap(QString keymap)
+{
+ m_bUserChangeKey = true;
+
+ for (auto option : settings->group("shortcuts.window_keymap_customize")->options()) {
+ QStringList keySplitList = option->key().split(".");
+ keySplitList[1] = QString("window_keymap_%1").arg(keymap);
+ option->setValue(settings->option(keySplitList.join("."))->value().toString());
+ }
+
+ for (auto option : settings->group("shortcuts.editor_keymap_customize")->options()) {
+ QStringList keySplitList = option->key().split(".");
+ keySplitList[1] = QString("editor_keymap_%1").arg(keymap);
+ option->setValue(settings->option(keySplitList.join("."))->value().toString());
+ }
+
+ m_bUserChangeKey = false;
+}
+
+bool Settings::checkShortcutValid(const QString &Name, QString Key, QString &Reason, bool &bIsConflicts, QString defaultValue)
+{
+ Q_UNUSED(Name);
+
+ if (Key.contains("<")) {
+ Key.replace(Key.indexOf("<"), 1, "<");
+ }
+
+ QString style = QString("[%1]").arg(Key);
+ // 单键
+ if (Key.count("+") == 0) {
+ //F1-F12是允许的,这个正则不够精确,但是没关系。
+ QRegExp regexp("^F[0-9]{1,2}$");
+ if (!Key.contains(regexp)) {
+ Reason = tr("The shortcut %1 is invalid, please set another one.").arg(style);
+ bIsConflicts = false;
+ return false;
+ }
+ }
+ // 小键盘单键都不允许
+ QRegExp regexpNum("^Num+.*");
+ if (Key.contains(regexpNum)) {
+ Reason = tr("The shortcut %1 is invalid, please set another one.").arg(style);
+ bIsConflicts = false;
+ return false;
+ }
+
+ // 屏蔽Shift组合键处理,但允许恢复为默认组合键序列
+ if (Key.contains("Shift")
+ && Key != defaultValue) {
+ Reason = tr("The shortcut %1 is invalid, please set another one.").arg(style);
+ bIsConflicts = false;
+ return false;
+ }
+
+ return true;
+}
+
+bool Settings::isShortcutConflict(const QString &Name, const QString &Key)
+{
+ for (QString tmpKey : settings->keys()) {
+ if (settings->value(tmpKey).toString() == Key/* && tmpKey.contains("customize")*/) {
+ if (Name != tmpKey) {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+DDialog *Settings::createDialog(const QString &title, const QString &content, const bool &bIsConflicts)
+{
+ DDialog *dialog = new DDialog(title, content, m_pSettingsDialog);
+ dialog->setWindowFlags(dialog->windowFlags() | Qt::WindowStaysOnBottomHint);
+ dialog->setIcon(QIcon::fromTheme("deepin-editor"));
+
+ if (bIsConflicts) {
+ dialog->addButton(QString(tr("Cancel")), true, DDialog::ButtonNormal);
+ dialog->addButton(QString(tr("Replace")), false, DDialog::ButtonRecommend);
+ } else {
+ dialog->addButton(QString(tr("OK")), true, DDialog::ButtonRecommend);
+ }
+
+ return dialog;
+}
+
+//删除config.conf配置文件目录下的.lock文件和.rmlock文件
+void Settings::removeLockFiles()
+{
+ QString configPath = QString("%1/%2/%3")
+ .arg(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation))
+ .arg(qApp->organizationName())
+ .arg(qApp->applicationName());
+
+ QDir dir(configPath);
+ if (!dir.exists()) {
+ return;
+ }
+
+ dir.setFilter(QDir::Files);
+ QStringList nameList = dir.entryList();
+ for (auto name: nameList) {
+ if (name.contains(".lock") || name.contains(".rmlock")) {
+ QFile file(name);
+ file.remove();
+ }
+ }
+}
+
+void Settings::slotCustomshortcut(const QString &key, const QVariant &value)
+{
+ auto keymap = settings->option("shortcuts.keymap.keymap");
+ if (!m_bUserChangeKey && key.startsWith("shortcuts.") && key != "shortcuts.keymap.keymap" && !key.contains("_keymap_")) {
+ m_bUserChangeKey = true;
+
+ QString currentKeymap = settings->option("shortcuts.keymap.keymap")->value().toString();
+
+ QStringList keySplitList = key.split(".");
+ keySplitList[1] = QString("%1_keymap_customize").arg(keySplitList[1]);
+ QString customizeKey = keySplitList.join(".");
+
+ // Just update customize key user input, don't change keymap.
+ if (currentKeymap == "customize") {
+ settings->option(customizeKey)->setValue(value);
+ }
+ // If current kemap is not "customize".
+ // Copy all customize keys from current keymap, and then update customize key just user input.
+ // Then change keymap name.
+ else {
+ copyCustomizeKeysFromKeymap(currentKeymap);
+ settings->option(customizeKey)->setValue(value);
+ keymap->setValue("customize");
+ }
+ m_bUserChangeKey = false;
+ }
+}
+
+
+void Settings::slotsigAdjustFont(QVariant value)
+{
+ emit sigAdjustFont(value.toString());
+}
+
+void Settings::slotsigAdjustFontSize(QVariant value)
+{
+ emit sigAdjustFontSize(value.toReal());
+}
+
+void Settings::slotsigAdjustWordWrap(QVariant value)
+{
+ emit sigAdjustWordWrap(value.toBool());
+}
+
+void Settings::slotsigSetLineNumberShow(QVariant value)
+{
+ emit sigSetLineNumberShow(value.toBool());
+}
+
+void Settings::slotsigAdjustBookmark(QVariant value)
+{
+ emit sigAdjustBookmark(value.toBool());
+}
+
+void Settings::slotsigShowCodeFlodFlag(QVariant value)
+{
+ emit sigShowCodeFlodFlag(value.toBool());
+}
+
+void Settings::slotsigShowBlankCharacter(QVariant value)
+{
+ emit sigShowBlankCharacter(value.toBool());
+}
+
+void Settings::slotsigHightLightCurrentLine(QVariant value)
+{
+ emit sigHightLightCurrentLine(value.toBool());
+}
+
+void Settings::slotsigAdjustTabSpaceNumber(QVariant value)
+{
+ emit sigAdjustTabSpaceNumber(value.toInt());
+}
+
+void Settings::slotupdateAllKeysWithKeymap(QVariant value)
+{
+ updateAllKeysWithKeymap(value.toString());
+}
+
+KeySequenceEdit::KeySequenceEdit(DTK_CORE_NAMESPACE::DSettingsOption *opt, QWidget *parent)
+ : DKeySequenceEdit(parent)
+{
+ m_pOption = opt;
+ this->installEventFilter(this);
+}
+
+DSettingsOption *KeySequenceEdit::option()
+{
+ return m_pOption;
+}
diff --git a/src/common/settings.h b/src/common/settings.h
new file mode 100644
index 0000000000000000000000000000000000000000..b3c9fb35091b61bdf2150d879e1e900863e63c69
--- /dev/null
+++ b/src/common/settings.h
@@ -0,0 +1,139 @@
+// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef SETTINGS_H
+#define SETTINGS_H
+
+#include "dsettingsdialog.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+DWIDGET_USE_NAMESPACE
+DCORE_USE_NAMESPACE
+DTK_USE_NAMESPACE
+
+class CustemBackend : public DSettingsBackend
+{
+ Q_OBJECT
+public:
+ explicit CustemBackend(const QString &filepath, QObject *parent = nullptr);
+ ~CustemBackend();
+
+ //获取参数所有的key值
+ QStringList keys() const override;
+ //根据key获取内容
+ QVariant getOption(const QString &key) const;
+ //同步数据
+ void doSync() override;
+ //根据key值设置内容
+ void doSetOption(const QString &key, const QVariant &value) override;
+
+ QSettings *m_settings {nullptr};
+ QMutex m_writeLock;
+};
+
+class Settings : public QObject
+{
+ Q_OBJECT
+public:
+ explicit Settings(QWidget *parent = 0);
+ ~Settings();
+
+ void dtkThemeWorkaround(QWidget *parent, const QString &theme);
+ //static QWidget *createFontComBoBoxHandle(QObject *obj);
+ static QPair createFontComBoBoxHandle(QObject *obj);
+ static QPair createKeySequenceEditHandle(QObject *obj);
+ static QWidget* createSavingPathWgt(QObject* objg);
+ static Settings* instance();
+ void setSettingDialog(DSettingsDialog *settingsDialog);
+
+ int m_iDefaultFontSize = 12;
+ int m_iMaxFontSize = 50;
+ int m_iMinFontSize = 8;
+ DSettings *settings {nullptr};
+
+ void setSavePath(int id,const QString& path);
+ QString getSavePath(int id);
+ void setSavePathId(int id);
+ int getSavePathId();
+
+signals:
+ void sigAdjustFont(QString name);
+ void sigAdjustFontSize(qreal fontSize);
+ void sigAdjustTabSpaceNumber(int number);
+ void sigAdjustWordWrap(bool enable);
+ void sigAdjustBookmark(bool enable);
+ void sigShowCodeFlodFlag(bool enable);
+ void sigShowBlankCharacter(bool enable);
+ void sigHightLightCurrentLine(bool enable);
+ void sigThemeChanged(const QString &theme);
+ void sigSetLineNumberShow(bool bIsShow);
+ void sigChangeWindowSize(QString mode);
+
+public slots:
+ //自定义快捷键 ut002764 2021.6.28
+ void slotCustomshortcut(const QString &key, const QVariant &value);
+
+ //添加信号槽 ut002764-07-05
+ void slotsigAdjustFont(QVariant value);
+ void slotsigAdjustFontSize(QVariant value);
+ void slotsigAdjustWordWrap(QVariant value);
+ void slotsigSetLineNumberShow(QVariant value);
+ void slotsigAdjustBookmark(QVariant value);
+ void slotsigShowCodeFlodFlag(QVariant value);
+ void slotsigShowBlankCharacter(QVariant value);
+ void slotsigHightLightCurrentLine(QVariant value);
+ void slotsigAdjustTabSpaceNumber(QVariant value);
+ void slotupdateAllKeysWithKeymap(QVariant value);
+
+private:
+ void updateAllKeysWithKeymap(QString keymap);
+ void copyCustomizeKeysFromKeymap(QString keymap);
+ bool checkShortcutValid(const QString &Name, QString Key, QString &Reason, bool &bIsConflicts, QString defaultValue = QString::null);
+ bool isShortcutConflict(const QString &Name, const QString &Key);
+ DDialog *createDialog(const QString &title, const QString &content, const bool &bIsConflicts);
+ void removeLockFiles();
+
+private:
+ Dtk::Core::QSettingBackend *m_backend {nullptr};
+
+ bool m_bUserChangeKey = false;
+ DSettingsDialog *m_pSettingsDialog;
+ static Settings* s_pSetting;
+ DDialog *m_pDialog;
+};
+
+class KeySequenceEdit : public DKeySequenceEdit
+{
+public:
+ explicit KeySequenceEdit(DTK_CORE_NAMESPACE::DSettingsOption *opt, QWidget *parent = nullptr);
+ /**
+ * @brief option 获取设置页面操作句柄
+ */
+ DTK_CORE_NAMESPACE::DSettingsOption *option();
+ /**
+ * @brief slotDSettingsOptionvalueChanged 设置页面配置修改
+ */
+ void slotDSettingsOptionvalueChanged(const QVariant &value);
+
+protected:
+ /**
+ * @brief eventFilter 设置页面快捷键类的事件过滤器
+ */
+ bool eventFilter(QObject *object, QEvent *event);
+
+private:
+ DTK_CORE_NAMESPACE::DSettingsOption *m_pOption = nullptr;
+};
+
+#endif // SETTINGS_H
diff --git a/src/common/urlinfo.h b/src/common/urlinfo.h
new file mode 100644
index 0000000000000000000000000000000000000000..eba32e543818f533647d605acb40104573ff51d9
--- /dev/null
+++ b/src/common/urlinfo.h
@@ -0,0 +1,47 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef URLINFO_H
+#define URLINFO_H
+
+#include
+#include
+#include
+#include
+#include
+
+class UrlInfo
+{
+public:
+ UrlInfo(QString path)
+ {
+ // Just check if the path is an existing file.
+ if (QFile::exists(path)) {
+ url = QUrl::fromLocalFile(QDir::current().absoluteFilePath(path));
+ return;
+ }
+
+ const auto match = QRegularExpression(QStringLiteral(":(\\d+)(?::(\\d+))?:?$")).match(path);
+
+ if (match.isValid()) {
+ // cut away line/column specification from the path.
+ path.chop(match.capturedLength());
+ }
+
+ // make relative paths absolute using the current working directory
+ // prefer local file, if in doubt!
+ url = QUrl::fromUserInput(path, QDir::currentPath(), QUrl::AssumeLocalFile);
+
+ // in some cases, this will fail, e.g.
+ // assume a local file and just convert it to an url.
+ if (!url.isValid()) {
+ // create absolute file path, we will e.g. pass this over dbus to other processes
+ url = QUrl::fromLocalFile(QDir::current().absoluteFilePath(path));
+ }
+ }
+
+ QUrl url;
+};
+
+#endif // URLINFO_H
diff --git a/src/common/utils.cpp b/src/common/utils.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e225b5b50cddb65c61da201d1e14d7f696e2613e
--- /dev/null
+++ b/src/common/utils.cpp
@@ -0,0 +1,1003 @@
+// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "utils.h"
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "qprocess.h"
+
+DCORE_USE_NAMESPACE
+
+QT_BEGIN_NAMESPACE
+extern Q_WIDGETS_EXPORT void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, bool quality, bool alphaOnly, int transposed = 0);
+QT_END_NAMESPACE
+
+QString Utils::m_systemLanguage;
+
+QString Utils::getQrcPath(const QString &imageName)
+{
+ return QString(":/images/%1").arg(imageName);
+}
+
+QString Utils::getQssPath(const QString &qssName)
+{
+ return QString(":/qss/%1").arg(qssName);
+}
+
+QSize Utils::getRenderSize(int fontSize, const QString &string)
+{
+ QFont font;
+ font.setPointSize(fontSize);
+ QFontMetrics fm(font);
+
+ int width = 0;
+ int height = 0;
+
+ for (const QString &line : string.split("\n")) {
+ int lineWidth = fm.width(line);
+ int lineHeight = fm.height();
+
+ if (lineWidth > width) {
+ width = lineWidth;
+ }
+
+ height += lineHeight;
+ }
+
+ return QSize(width, height);
+}
+
+void Utils::setFontSize(QPainter &painter, int textSize)
+{
+ QFont font = painter.font() ;
+ font.setPointSize(textSize);
+ painter.setFont(font);
+}
+
+void Utils::applyQss(QWidget *widget, const QString &qssName)
+{
+ QFile file(Utils::getQssPath(qssName));
+ file.open(QFile::ReadOnly);
+ QTextStream filetext(&file);
+ QString stylesheet = filetext.readAll();
+ widget->setStyleSheet(stylesheet);
+ file.close();
+}
+
+float Utils::codecConfidenceForData(const QTextCodec *codec, const QByteArray &data, const QLocale::Country &country)
+{
+ qreal hep_count = 0;
+ int non_base_latin_count = 0;
+ qreal unidentification_count = 0;
+ int replacement_count = 0;
+
+ QTextDecoder decoder(codec);
+ const QString &unicode_data = decoder.toUnicode(data);
+
+ for (int i = 0; i < unicode_data.size(); ++i) {
+ const QChar &ch = unicode_data.at(i);
+
+ if (ch.unicode() > 0x7f)
+ ++non_base_latin_count;
+
+ switch (ch.script()) {
+ case QChar::Script_Hiragana:
+ case QChar::Script_Katakana:
+ hep_count += (country == QLocale::Japan) ? 1.2 : 0.5;
+ unidentification_count += (country == QLocale::Japan) ? 0 : 0.3;
+ break;
+ case QChar::Script_Han:
+ hep_count += (country == QLocale::China) ? 1.2 : 0.5;
+ unidentification_count += (country == QLocale::China) ? 0 : 0.3;
+ break;
+ case QChar::Script_Hangul:
+ hep_count += (country == QLocale::NorthKorea) || (country == QLocale::SouthKorea) ? 1.2 : 0.5;
+ unidentification_count += (country == QLocale::NorthKorea) || (country == QLocale::SouthKorea) ? 0 : 0.3;
+ break;
+ case QChar::Script_Cyrillic:
+ hep_count += (country == QLocale::Russia) ? 1.2 : 0.5;
+ unidentification_count += (country == QLocale::Russia) ? 0 : 0.3;
+ break;
+ case QChar::Script_Devanagari:
+ hep_count += (country == QLocale::Nepal || country == QLocale::India) ? 1.2 : 0.5;
+ unidentification_count += (country == QLocale::Nepal || country == QLocale::India) ? 0 : 0.3;
+ break;
+ default:
+ // full-width character, emoji, 常用标点, 拉丁文补充1,天城文补充,CJK符号和标点符号(如:【】)
+ if ((ch.unicode() >= 0xff00 && ch <= 0xffef)
+ || (ch.unicode() >= 0x2600 && ch.unicode() <= 0x27ff)
+ || (ch.unicode() >= 0x2000 && ch.unicode() <= 0x206f)
+ || (ch.unicode() >= 0x80 && ch.unicode() <= 0xff)
+ || (ch.unicode() >= 0xa8e0 && ch.unicode() <= 0xa8ff)
+ || (ch.unicode() >= 0x0900 && ch.unicode() <= 0x097f)
+ || (ch.unicode() >= 0x3000 && ch.unicode() <= 0x303f)) {
+ ++hep_count;
+ } else if (ch.isSurrogate() && ch.isHighSurrogate()) {
+ ++i;
+
+ if (i < unicode_data.size()) {
+ const QChar &next_ch = unicode_data.at(i);
+
+ if (!next_ch.isLowSurrogate()) {
+ --i;
+ break;
+ }
+
+ uint unicode = QChar::surrogateToUcs4(ch, next_ch);
+
+ // emoji
+ if (unicode >= 0x1f000 && unicode <= 0x1f6ff) {
+ hep_count += 2;
+ }
+ }
+ } else if (ch.unicode() == QChar::ReplacementCharacter) {
+ ++replacement_count;
+ } else if (ch.unicode() > 0x7f) {
+ // 因为UTF-8编码的容错性很低,所以未识别的编码只需要判断是否为 QChar::ReplacementCharacter 就能排除
+ if (codec->name() != "UTF-8")
+ ++unidentification_count;
+ }
+ break;
+ }
+ }
+
+ float c = qreal(hep_count) / non_base_latin_count / 1.2;
+
+ c -= qreal(replacement_count) / non_base_latin_count;
+ c -= qreal(unidentification_count) / non_base_latin_count;
+
+ return qMax(0.0f, c);
+}
+
+QByteArray Utils::detectEncode(const QByteArray &data, const QString &fileName)
+{
+ // Return local encoding if nothing in file.
+ if (data.isEmpty()) {
+ return QTextCodec::codecForLocale()->name();
+ }
+
+ if (QTextCodec *c = QTextCodec::codecForUtfText(data, nullptr)) {
+ return c->name();
+ }
+
+ QMimeDatabase mime_database;
+ const QMimeType &mime_type = fileName.isEmpty() ? mime_database.mimeTypeForData(data) : mime_database.mimeTypeForFileNameAndData(fileName, data);
+ const QString &mimetype_name = mime_type.name();
+ KEncodingProber::ProberType proberType = KEncodingProber::Universal;
+
+ if (mimetype_name == QStringLiteral("application/xml")
+ || mimetype_name == QStringLiteral("text/html")
+ || mimetype_name == QStringLiteral("application/xhtml+xml")) {
+ const QString &_data = QString::fromLatin1(data);
+ QRegularExpression pattern("<\\bmeta.+\\bcharset=(?'charset'\\S+?)\\s*['\"/>]");
+
+ pattern.setPatternOptions(QRegularExpression::DontCaptureOption | QRegularExpression::CaseInsensitiveOption);
+ const QString &charset = pattern.match(_data, 0, QRegularExpression::PartialPreferFirstMatch,
+ QRegularExpression::DontCheckSubjectStringMatchOption).captured("charset");
+
+ if (!charset.isEmpty()) {
+ return charset.toLatin1();
+ }
+
+ pattern.setPattern("<\\bmeta\\s+http-equiv=\"Content-Language\"\\s+content=\"(?'language'[a-zA-Z-]+)\"");
+
+ const QString &language = pattern.match(_data, 0, QRegularExpression::PartialPreferFirstMatch,
+ QRegularExpression::DontCheckSubjectStringMatchOption).captured("language");
+
+ if (0 != language.size()) {
+ QLocale l(language);
+
+ switch (l.script()) {
+ case QLocale::ArabicScript:
+ proberType = KEncodingProber::Arabic;
+ break;
+ case QLocale::SimplifiedChineseScript:
+ proberType = KEncodingProber::ChineseSimplified;
+ break;
+ case QLocale::TraditionalChineseScript:
+ proberType = KEncodingProber::ChineseTraditional;
+ break;
+ case QLocale::CyrillicScript:
+ proberType = KEncodingProber::Cyrillic;
+ break;
+ case QLocale::GreekScript:
+ proberType = KEncodingProber::Greek;
+ break;
+ case QLocale::HebrewScript:
+ proberType = KEncodingProber::Hebrew;
+ break;
+ case QLocale::JapaneseScript:
+ proberType = KEncodingProber::Japanese;
+ break;
+ case QLocale::KoreanScript:
+ proberType = KEncodingProber::Korean;
+ break;
+ case QLocale::ThaiScript:
+ proberType = KEncodingProber::Thai;
+ break;
+ default:
+ break;
+ }
+ }
+ } else if (mimetype_name == "text/x-python") {
+ QRegularExpression pattern("^#coding\\s*:\\s*(?'coding'\\S+)$");
+ QTextStream stream(data);
+
+ pattern.setPatternOptions(QRegularExpression::DontCaptureOption | QRegularExpression::CaseInsensitiveOption);
+ stream.setCodec("latin1");
+
+ while (!stream.atEnd()) {
+ const QString &_data = stream.readLine();
+ const QString &coding = pattern.match(_data, 0).captured("coding");
+
+ if (!coding.isEmpty()) {
+ return coding.toLatin1();
+ }
+ }
+ }
+
+ // for CJK
+ const QList> fallback_list {
+ {KEncodingProber::ChineseSimplified, QLocale::China},
+ {KEncodingProber::ChineseTraditional, QLocale::China},
+ {KEncodingProber::Japanese, QLocale::Japan},
+ {KEncodingProber::Korean, QLocale::NorthKorea},
+ //{KEncodingProber::Cyrillic, QLocale::Russia},
+ //{KEncodingProber::Greek, QLocale::Greece},
+ //{proberType, QLocale::system().country()}
+ };
+
+ KEncodingProber prober(proberType);
+ prober.feed(data);
+ float pre_confidence = prober.confidence();
+ QByteArray pre_encoding = prober.encoding();
+
+ QTextCodec *def_codec = QTextCodec::codecForLocale();
+ QByteArray encoding;
+ float confidence = 0;
+
+ for (auto i : fallback_list) {
+ prober.setProberType(i.first);
+ prober.feed(data);
+
+ float prober_confidence = prober.confidence();
+ QByteArray prober_encoding = prober.encoding();
+
+ if (i.first != proberType && qFuzzyIsNull(prober_confidence)) {
+ prober_confidence = pre_confidence;
+ prober_encoding = pre_encoding;
+ }
+
+ confidence:
+ if (QTextCodec *codec = QTextCodec::codecForName(prober_encoding)) {
+ if (def_codec == codec)
+ def_codec = nullptr;
+
+ float c = Utils::codecConfidenceForData(codec, data, i.second);
+
+ if (prober_confidence > 0.5) {
+ c = c / 2 + prober_confidence / 2;
+ } else {
+ c = c / 3 * 2 + prober_confidence / 3;
+ }
+
+ if (c > confidence) {
+ confidence = c;
+ encoding = prober_encoding;
+ }
+
+ if (i.first == KEncodingProber::ChineseTraditional && c < 0.5) {
+ // test Big5
+ c = Utils::codecConfidenceForData(QTextCodec::codecForName("Big5"), data, i.second);
+
+ if (c > 0.5 && c > confidence) {
+ confidence = c;
+ encoding = "Big5";
+ }
+ }
+ }
+
+ if (i.first != proberType) {
+ // 使用 proberType 类型探测出的结果结合此国家再次做编码检查
+ i.first = proberType;
+ prober_confidence = pre_confidence;
+ prober_encoding = pre_encoding;
+ goto confidence;
+ }
+ }
+
+ if (def_codec && Utils::codecConfidenceForData(def_codec, data, QLocale::system().country()) > confidence) {
+ return def_codec->name();
+ }
+
+ return encoding;
+}
+
+QByteArray Utils::getEncode(const QByteArray &data)
+{
+ // try to get HTML header encoding.
+ if (QTextCodec *codecForHtml = QTextCodec::codecForHtml(data, nullptr)) {
+ return codecForHtml->name();
+ }
+
+ QTextCodec *codec = nullptr;
+ KEncodingProber prober(KEncodingProber::Universal);
+ prober.feed(data.constData(), data.size());
+
+ // we found codec with some confidence ?
+ if (prober.confidence() > 0.5) {
+ codec = QTextCodec::codecForName(prober.encoding());
+ }
+
+ if (!codec) {
+ return QByteArray();
+ }
+
+ return codec->name();
+}
+
+bool Utils::fileExists(const QString &path)
+{
+ QFileInfo check_file(path);
+
+ return check_file.exists() && check_file.isFile();
+}
+
+bool Utils::fileIsWritable(const QString &path)
+{
+ QFileDevice::Permissions permissions = QFile(path).permissions();
+
+ return permissions & QFileDevice::WriteUser;
+}
+
+bool Utils::fileIsHome(const QString &path)
+{
+ return path.startsWith(QDir::homePath());
+}
+
+QString Utils::getKeyshortcut(QKeyEvent *keyEvent)
+{
+ QStringList keys;
+ Qt::KeyboardModifiers modifiers = keyEvent->modifiers();
+ if (modifiers != Qt::NoModifier) {
+ if (modifiers.testFlag(Qt::MetaModifier)) {
+ keys.append("Meta");
+ }
+
+ if (modifiers.testFlag(Qt::ControlModifier)) {
+ keys.append("Ctrl");
+ }
+
+ if (modifiers.testFlag(Qt::AltModifier)) {
+ keys.append("Alt");
+ }
+
+ if (modifiers.testFlag(Qt::ShiftModifier)) {
+ keys.append("Shift");
+ }
+
+ // 添加小键盘处理,若为小键盘按键按下,组合键需添加 Num ,例如 Ctrl+Num+6 / Ctrl+Num+Up
+ if (modifiers.testFlag(Qt::KeypadModifier)) {
+ keys.append("Num");
+ }
+ }
+
+ if (keyEvent->key() != 0 && keyEvent->key() != Qt::Key_unknown) {
+ keys.append(QKeySequence(keyEvent->key()).toString());
+ }
+
+ for (int i = 0; i < keys.count(); i++) {
+ if (keys.value(i).contains("Return")) {
+ keys.replace(i, "Enter");
+ }
+ }
+
+ return keys.join("+");
+}
+
+QString Utils::getKeyshortcutFromKeymap(Settings *settings, const QString &keyCategory, const QString &keyName)
+{
+ return settings->settings->option(QString("shortcuts.%1.%2").arg(keyCategory).arg(keyName))->value().toString();
+}
+
+QPixmap Utils::dropShadow(const QPixmap &source, qreal radius, const QColor &color, const QPoint &offset)
+{
+ QImage shadow = dropShadow(source, radius, color);
+ shadow.setDevicePixelRatio(source.devicePixelRatio());
+
+ QPainter pa(&shadow);
+ pa.setCompositionMode(QPainter::CompositionMode_SourceOver);
+ pa.drawPixmap(radius - offset.x(), radius - offset.y(), source);
+ pa.end();
+
+ return QPixmap::fromImage(shadow);
+}
+
+QImage Utils::dropShadow(const QPixmap &px, qreal radius, const QColor &color)
+{
+ if (px.isNull()) {
+ return QImage();
+ }
+
+ QImage tmp(px.size() * px.devicePixelRatio() + QSize(radius * 2, radius * 2), QImage::Format_ARGB32_Premultiplied);
+ tmp.setDevicePixelRatio(px.devicePixelRatio());
+ tmp.fill(0);
+ QPainter tmpPainter(&tmp);
+ tmpPainter.setCompositionMode(QPainter::CompositionMode_Source);
+ tmpPainter.drawPixmap(QPoint(radius, radius), px);
+ tmpPainter.end();
+
+ // Blur the alpha channel.
+ QImage blurred(tmp.size() * px.devicePixelRatio(), QImage::Format_ARGB32_Premultiplied);
+ blurred.setDevicePixelRatio(px.devicePixelRatio());
+ blurred.fill(0);
+ QPainter blurPainter(&blurred);
+ qt_blurImage(&blurPainter, tmp, radius, false, true);
+ blurPainter.end();
+ if (color == QColor(Qt::black)) {
+ return blurred;
+ }
+ tmp = blurred;
+
+ // Blacken the image...
+ tmpPainter.begin(&tmp);
+ tmpPainter.setCompositionMode(QPainter::CompositionMode_SourceIn);
+ tmpPainter.fillRect(tmp.rect(), color);
+ tmpPainter.end();
+
+ return tmp;
+}
+
+qreal Utils::easeInOut(qreal x)
+{
+ return (1 - qCos(M_PI * x)) / 2;
+}
+
+qreal Utils::easeInQuad(qreal x)
+{
+ return qPow(x, 2);
+}
+
+qreal Utils::easeOutQuad(qreal x)
+{
+ return -1 * qPow(x - 1, 2) + 1;
+}
+
+qreal Utils::easeInQuint(qreal x)
+{
+ return qPow(x, 5);
+}
+
+qreal Utils::easeOutQuint(qreal x)
+{
+ return qPow(x - 1, 5) + 1;
+}
+
+QVariantMap Utils::getThemeMapFromPath(const QString &filepath)
+{
+ QFile file(filepath);
+ if (!file.open(QIODevice::ReadOnly)) {
+ qDebug() << "Failed to open " << filepath;
+ return QVariantMap();
+ }
+
+ QTextStream in(&file);
+ const QString jsonStr = in.readAll();
+ file.close();
+
+ QByteArray jsonBytes = jsonStr.toLocal8Bit();
+ QJsonDocument document = QJsonDocument::fromJson(jsonBytes);
+ QJsonObject object = document.object();
+
+ return object.toVariantMap();
+}
+
+bool Utils::isMimeTypeSupport(const QString &filepath)
+{
+ QString mimeType = QMimeDatabase().mimeTypeForFile(filepath).name();
+
+ if (mimeType.startsWith("text/")) {
+ return true;
+ }
+
+ if (filepath.endsWith("pub")) {
+ return true;
+ }
+ // Please check full mime type list from: https://www.freeformatter.com/mime-types-list.html
+ QStringList textMimeTypes;
+ textMimeTypes << "application/cmd"
+ << "application/javascript"
+ << "application/json"
+ << "application/pkix-cert"
+ << "application/octet-stream"
+ << "application/sql"
+ << "application/vnd.apple.mpegurl"
+ << "application/vnd.nokia.qt.qmakeprofile"
+ << "application/vnd.nokia.xml.qt.resource"
+ << "application/x-desktop"
+ << "application/x-designer"
+ << "application/x-empty"
+ << "application/x-msdos-program"
+ << "application/x-pearl"
+ << "application/x-php"
+ << "application/x-shellscript"
+ << "application/x-sh"
+ << "application/x-theme"
+ << "application/x-cue"
+ << "application/x-csh"
+ << "application/x-asp"
+ << "application/x-subrip"
+ << "application/x-text"
+ << "application/x-trash"
+ << "application/x-xbel"
+ << "application/x-yaml"
+ << "application/x-pem-key"
+ << "application/xml"
+ << "application/yaml"
+ << "application/x-zerosize"
+ << "image/svg+xml"
+ << "application/x-perl"
+ << "application/x-ruby"
+ << "application/x-mpegURL"
+ << "application/x-wine-extension-ini"
+ << "model/vrml"
+ << "application/pkix-cert+pem"
+ << "application/x-pak"
+ << "application/x-code-workspace";
+
+ if (textMimeTypes.contains(mimeType)) {
+ return true;
+ }
+
+ return false;
+}
+
+bool Utils::isDraftFile(const QString &filepath)
+{
+ QString draftDir = QDir(Utils::cleanPath(QStandardPaths::standardLocations(QStandardPaths::DataLocation)).first())
+ .filePath("blank-files");
+ draftDir = QDir::cleanPath(draftDir);
+ QString dir = QFileInfo(filepath).dir().absolutePath();
+ return dir == draftDir;
+}
+
+/**
+ * @param filepath 文件路径
+ * @return 返回传入文件路径 \a filepath 是否在备份文件夹 backup-files 中
+ */
+bool Utils::isBackupFile(const QString &filepath)
+{
+ QString backupDir = QDir(Utils::cleanPath(QStandardPaths::standardLocations(QStandardPaths::DataLocation)).first())
+ .filePath("backup-files");
+ QString dir = QFileInfo(filepath).dir().absolutePath();
+ return dir == backupDir;
+}
+
+QStringList Utils::cleanPath(const QStringList &filePaths)
+{
+ QStringList paths;
+ for (QString path : filePaths) {
+ paths.push_back(QDir::cleanPath(path));
+ }
+
+ return paths;
+}
+
+/**
+ * @return 返回程序使用的默认数据(存放临时、备份文件)存放位置,不同环境下路径不同
+ * [debian] /home/user/.local/share/deepin/deepin-editor/
+ * [linglong] /home/user/.linglong/org.deepin.editor/share/deepin/deepin-editor/
+ */
+QString Utils::localDataPath()
+{
+ auto dataPaths = Utils::cleanPath(QStandardPaths::standardLocations(QStandardPaths::DataLocation));
+ return dataPaths.isEmpty() ? QDir::homePath() + "/.local/share/deepin/deepin-editor/"
+ : dataPaths.first();
+}
+
+const QStringList Utils::getEncodeList()
+{
+ QStringList encodeList;
+
+ for (int mib : QTextCodec::availableMibs()) {
+ QTextCodec *codec = QTextCodec::codecForMib(mib);
+ QString encodeName = QString(codec->name()).toUpper();
+
+ if (encodeName != "UTF-8" && !encodeList.contains(encodeName)) {
+ encodeList.append(encodeName);
+ }
+ }
+
+ encodeList.sort();
+ encodeList.prepend("UTF-8");
+
+ return encodeList;
+}
+
+QPixmap Utils::renderSVG(const QString &filePath, const QSize &size, bool bIsScale)
+{
+ int scaled = 1;
+
+ if (qApp->devicePixelRatio() == 1.25 && bIsScale) {
+ scaled = 2;
+ }
+
+ QPixmap pixmap(size * scaled);
+ pixmap.fill(Qt::transparent);
+ QImageReader reader;
+
+ reader.setFileName(filePath);
+
+ if (reader.canRead()) {
+ reader.setScaledSize(size * scaled);
+ pixmap = QPixmap::fromImage(reader.read());
+ pixmap.setDevicePixelRatio(scaled);
+ } else {
+ pixmap.load(filePath);
+ }
+
+ return pixmap;
+}
+
+QList Utils::getHiglightColorList()
+{
+ QList listColor;
+ listColor.append(QColor("#FFA503"));
+ listColor.append(QColor("#FF1C49"));
+ listColor.append(QColor("#9023FC"));
+ listColor.append(QColor("#3468FF"));
+ listColor.append(QColor("#00C7E1"));
+ listColor.append(QColor("#05EA6B"));
+ listColor.append(QColor("#FEF144"));
+ listColor.append(QColor("#D5D5D1"));
+ return listColor;
+}
+
+void Utils::clearChildrenFocus(QObject *objParent)
+{
+ // 可以获取焦点的控件名称列表
+ QStringList foucswidgetlist;
+ //foucswidgetlist << "QLineEdit" << TERM_WIDGET_NAME;
+
+ //qDebug() << "checkChildrenFocus start" << objParent->children().size();
+ for (QObject *obj : objParent->children()) {
+ if (!obj->isWidgetType()) {
+ continue;
+ }
+ QWidget *widget = static_cast(obj);
+ if (Qt::NoFocus != widget->focusPolicy()) {
+ //qDebug() << widget << widget->focusPolicy() << widget->metaObject()->className();
+ if (!foucswidgetlist.contains(widget->metaObject()->className())) {
+ widget->setFocusPolicy(Qt::NoFocus);
+ }
+ }
+ clearChildrenFocus(obj);
+ }
+
+ //qDebug() << "checkChildrenFocus over" << objParent->children().size();
+}
+
+void Utils::clearChildrenFoucusEx(QWidget *pWidget)
+{
+ pWidget->clearFocus();
+
+ QObjectList childern = pWidget->children();
+
+ if (childern.size() <= 0) return;
+
+ foreach (QObject *child, childern) {
+ if (!child->isWidgetType()) {
+ continue;
+ }
+
+ QWidget *obj = static_cast(child);
+ clearChildrenFoucusEx(obj);
+ }
+}
+
+void Utils::setChildrenFocus(QWidget *pWidget, Qt::FocusPolicy policy)
+{
+ pWidget->setFocusPolicy(policy);
+
+ QObjectList childern = pWidget->children();
+
+ if (childern.size() <= 0) return;
+
+ foreach (QObject *child, childern) {
+ if (!child->isWidgetType()) {
+ continue;
+ }
+
+ QWidget *obj = static_cast(child);
+ setChildrenFocus(obj, policy);
+ }
+}
+
+int Utils::getProcessCountByName(const char *pstrName)
+{
+ FILE *fp = NULL;
+ int count = -1;
+ char command[1024];
+
+ if (NULL == pstrName || strlen(pstrName) == 0) {
+ return count;
+ }
+
+ memset(command, 0, sizeof(command));
+ sprintf(command, "ps -ef | grep %s | grep -v grep | wc -l", pstrName);
+
+ if ((fp = popen(command, "r")) != NULL) {
+ char buf[1024];
+ memset(buf, 0, sizeof(buf));
+ if ((fgets(buf, sizeof(buf) - 1, fp)) != NULL) {
+ count = atoi(buf);
+ }
+ pclose(fp);
+ } else {
+ qDebug() << ">>> popen error";
+ }
+
+ return count;
+}
+
+void Utils::killProcessByName(const char *pstrName)
+{
+ if (pstrName != NULL && strlen(pstrName) > 0) {
+ char command[1024];
+ memset(command, 0, sizeof(command));
+ sprintf(command, "killall %s", pstrName);
+ system(command);
+ }
+}
+
+QString Utils::getStringMD5Hash(const QString &input)
+{
+ QByteArray byteArray;
+ byteArray.append(input);
+ QByteArray md5Path = QCryptographicHash::hash(byteArray, QCryptographicHash::Md5);
+
+ return md5Path.toHex();
+}
+
+bool Utils::activeWindowFromDock(quintptr winId)
+{
+ bool bRet = true;
+ // 优先采用V23接口
+ QDBusInterface dockDbusInterfaceV23("org.deepin.dde.daemon.Dock1",
+ "/org/deepin/dde/daemon/Dock1",
+ "org.deepin.dde.daemon.Dock1");
+ if (dockDbusInterfaceV23.isValid()) {
+ QDBusReply reply = dockDbusInterfaceV23.call("ActivateWindow", winId);
+ if (!reply.isValid()) {
+ qDebug() << "call v23 org.deepin.dde.daemon.Dock1 failed" << reply.error();
+ bRet = false;
+ } else {
+ return bRet;
+ }
+ }
+
+ QDBusInterface dockDbusInterfaceV20("com.deepin.dde.daemon.Dock",
+ "/com/deepin/dde/daemon/Dock",
+ "com.deepin.dde.daemon.Dock");
+ if (dockDbusInterfaceV20.isValid() && !bRet) {
+ QDBusReply reply = dockDbusInterfaceV20.call("ActivateWindow", winId);
+ if (!reply.isValid()) {
+ qDebug() << "call v20 com.deepin.dde.daemon.Dock failed" << reply.error();
+ bRet = false;
+ }
+ }
+
+ return bRet;
+}
+
+bool Utils::isShareDirAndReadOnly(const QString &filePath)
+{
+ bool ret = false;
+
+ const QString sharePath = "/var/lib/samba/usershares";
+ QDir shareDir(sharePath);
+ if (shareDir.exists()) {
+ QFileInfo fileInfo(filePath);
+ auto name = fileInfo.dir().dirName();
+ if (shareDir.exists(name)) {
+ QFile file(sharePath + "/" + name);
+ if (file.open(QIODevice::ReadOnly)) {
+ QString fileContent = file.readAll();
+ if (fileContent.contains(":R"))
+ ret = true;
+ file.close();
+ }
+ }
+ }
+
+ return ret;
+
+}
+
+QString Utils::getSystemLan()
+{
+ if (!m_systemLanguage.isEmpty()) {
+ return m_systemLanguage;
+ } else {
+ switch (getSystemVersion()) {
+ case V23:
+ m_systemLanguage = QLocale::system().name();
+ break;
+ default: {
+ QDBusInterface ie("com.deepin.daemon.LangSelector",
+ "/com/deepin/daemon/LangSelector",
+ "com.deepin.daemon.LangSelector",
+ QDBusConnection::sessionBus());
+ m_systemLanguage = ie.property("CurrentLocale").toString();
+ break;
+ }
+ }
+
+ qWarning() << "getSystemLan is" << m_systemLanguage;
+ return m_systemLanguage;
+ }
+}
+
+/**
+ * @return 获取当前系统版本并返回
+ */
+Utils::SystemVersion Utils::getSystemVersion()
+{
+ QString version = DSysInfo::majorVersion();
+ if ("23" == version) {
+ return V23;
+ }
+
+ // 其它版本默认V20
+ return V20;
+}
+
+
+//judge whether the protocol is wayland
+bool Utils::isWayland()
+{
+ static QString protocol;
+ if (protocol.isEmpty()) {
+ protocol = QProcessEnvironment::systemEnvironment().value("XDG_SESSION_TYPE");
+ }
+
+ return protocol.contains("wayland");
+
+}
+
+QString Utils::lineFeed(const QString &text, int nWidth, const QFont &font, int nElidedRow)
+{
+ if (nElidedRow < 0)
+ nElidedRow = 2;
+
+ QString strText = text;
+ QStringList strListLine;
+ QFontMetrics fm(font);
+ // 一行就直接中间截断显示
+ if (1 == nElidedRow)
+ return fm.elidedText(text, Qt::ElideMiddle, nWidth);
+
+ if (!strText.isEmpty()) {
+ for (int i = 1; i <= strText.size(); i++) {
+ if (fm.width(strText.left(i)) >= nWidth) {
+ if (strListLine.size() + 1 == nElidedRow)
+ break;
+
+ strListLine.append(strText.left(i - 1));
+ strText = strText.right(strText.size() - i + 1);
+ i = 0;
+ }
+ }
+ }
+
+ // 多行时,对最后一行字符左侧省略
+ if (!strListLine.isEmpty()) {
+ strText = fm.elidedText(strText, Qt::ElideLeft, nWidth);
+ strListLine.append(strText);
+ strText = strListLine.join('\n');
+ }
+
+ return strText;
+}
+
+/**
+ * @brief 判断 [ \a x1, \a y1] 和 [ \a x2, \a y2] 区间是否存在交集
+ * @param x1 固定区间左边界
+ * @param y1 固定区间右边界
+ * @param x2 移动区间左边界
+ * @param y2 移动区间右边界
+ * @return RegionType 返回重叠区间类型
+ */
+Utils::RegionIntersectType Utils::checkRegionIntersect(int x1, int y1, int x2, int y2)
+{
+ if (y1 < x2) {
+ return ERight;
+ } else if (x1 > y2) {
+ return ELeft;
+ } else {
+ // 区间存在交集,判断交集类型
+ // 活动区间左边界超过固定区间左边界
+ bool outLeftBound = x1 > x2;
+ // 活动区间右边界超过固定区间右边界
+ bool outRightBound = y1 < y2;
+
+ if (outLeftBound && outRightBound) {
+ return EIntersectOutter;
+ } else if (outLeftBound) {
+ return EIntersectLeft;
+ } else if (outRightBound) {
+ return EIntersectRight;
+ } else {
+ return EIntersectInner;
+ }
+ }
+}
+
+/**
+ * @return 取得当前文本编辑器支持的编码格式,按区域划分,从文件 :/encodes/encodes.ini 中读取
+ * @note 非多线程安全,仅在 gui 线程调用
+ */
+QVector > Utils::getSupportEncoding()
+{
+ static QVector > s_groupEncodeVec;
+ if (s_groupEncodeVec.isEmpty()) {
+ QVector > tmpEncodeVec;
+
+ QFile file(":/encodes/encodes.ini");
+ QString data;
+ if (file.open(QIODevice::ReadOnly)) {
+ data = QString::fromUtf8(file.readAll());
+ file.close();
+ }
+
+ QTextStream readStream(&data,QIODevice::ReadOnly);
+ while (!readStream.atEnd()) {
+ QString group = readStream.readLine();
+ QString key = group.mid(1,group.length()-2);
+ QString encodes = readStream.readLine();
+ QString value = encodes.mid(8,encodes.length()-2);
+ tmpEncodeVec.append(QPair(key, value.split(",")));
+ }
+
+ s_groupEncodeVec = tmpEncodeVec;
+ }
+
+ return s_groupEncodeVec;
+}
+
+/**
+ * @return 取得当前文本编辑器支持的编码格式列表
+ */
+QStringList Utils::getSupportEncodingList()
+{
+ QStringList encodingList;
+ auto supportEncoding = getSupportEncoding();
+ for (auto encodingData : supportEncoding) {
+ encodingList.append(encodingData.second);
+ }
+ std::sort(encodingList.begin(), encodingList.end());
+
+ return encodingList;
+}
diff --git a/src/common/utils.h b/src/common/utils.h
new file mode 100644
index 0000000000000000000000000000000000000000..f2691e0cfc753f6165b04be28f70ddc9c4a2f4dc
--- /dev/null
+++ b/src/common/utils.h
@@ -0,0 +1,132 @@
+// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#pragma once
+#include "settings.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifndef SAFE_DELETE
+#define SAFE_DELETE(p) if((p)) { delete (p); (p) = nullptr;}
+#endif
+
+#ifndef LINGLONG_PREFIX
+#define LINGLONG_PREFIX "/usr/"
+#endif
+
+#define DEEPIN_THEME QString("%1share/deepin-editor/themes/deepin.theme").arg(LINGLONG_PREFIX)
+#define DEEPIN_DARK_THEME QString("%1share/deepin-editor/themes/deepin_dark.theme").arg(LINGLONG_PREFIX)
+#define DATA_SIZE_1024 1024
+#define TEXT_EIDT_MARK_ALL "MARK_ALL"
+#define PROC_MEMINFO_PATH "/proc/meminfo"
+#define COPY_CONSUME_MEMORY_MULTIPLE 9 //复制文本时内存占用系数
+#define PASTE_CONSUME_MEMORY_MULTIPLE 7 //粘贴文本时内存占用系数
+
+class Utils
+{
+public:
+ /**
+ * @brief 区间交叉类型
+ */
+ enum RegionIntersectType {
+ ELeft, ///< 活动区间在固定区间左侧 例如 [0, 9] 和 [-5, -1]
+ ERight, ///< 活动区间在固定区间右侧 例如 [0, 9] 和 [10, 15]
+
+ EIntersectLeft, ///< 活动区间在固定区间左侧存在范围重叠 例如 [0, 9] 和 [-5, 5]
+ EIntersectRight, ///< 活动区间在固定区间右侧存在范围重叠 例如 [0, 9] 和 [5, 15]
+ EIntersectOutter, ///< 活动区间包含固定区间 例如 [0, 9] 和 [-10, 10]
+ EIntersectInner, ///< 活动区间处于固定区间内部 例如 [0, 9] 和 [5, 6]
+ };
+
+ /**
+ * @brief 当前运行时系统环境
+ */
+ enum SystemVersion {
+ V20,
+ V23,
+ };
+
+ static QString getQrcPath(const QString &imageName);
+ static QString getQssPath(const QString &qssName);
+ static QSize getRenderSize(int fontSize, const QString &string);
+ static void setFontSize(QPainter &painter, int textSize);
+ static void applyQss(QWidget *widget, const QString &qssName);
+ static QString getKeyshortcut(QKeyEvent *keyEvent);
+ static QString getKeyshortcutFromKeymap(Settings *settings, const QString &keyCategory, const QString &keyName);
+ static bool fileExists(const QString &path);
+ static bool fileIsWritable(const QString &path);
+ static bool fileIsHome(const QString &path);
+ static void passInputEvent(int wid);
+ static QPixmap dropShadow(const QPixmap &source, qreal radius, const QColor &color, const QPoint &offset);
+ static QImage dropShadow(const QPixmap &px, qreal radius, const QColor &color);
+ static QByteArray detectEncode(const QByteArray &data, const QString &fileName = QString());
+ static QByteArray getEncode(const QByteArray &data);
+ static qreal easeInOut(qreal x);
+ static qreal easeInQuad(qreal x);
+ static qreal easeInQuint(qreal x);
+ static qreal easeOutQuad(qreal x);
+ static qreal easeOutQuint(qreal x);
+ static QVariantMap getThemeMapFromPath(const QString &filepath);
+ static bool isMimeTypeSupport(const QString &filepath);
+ static bool isDraftFile(const QString &filepath);
+ // 返回文件是否为备份文件
+ static bool isBackupFile(const QString &filepath);
+ static QStringList cleanPath(const QStringList &filePaths);
+ // 返回程序使用的本地数据路径(存放临时、备份文件)
+ static QString localDataPath();
+ static const QStringList getEncodeList();
+ static QPixmap renderSVG(const QString &filePath, const QSize &size, bool bIsScale = true);
+ static QList getHiglightColorList();
+ /*******************************************************************************
+ 1. @函数: clearChildrenFocus
+ 2. @作者: n014361 王培利
+ 3. @日期: 2020-05-08
+ 4. @说明: 清空控件内部所有子控件的焦点获取
+ 安全考虑,不要全局使用.仅在个别控件中使用
+ *******************************************************************************/
+ static void clearChildrenFocus(QObject *objParent);
+ //清除 控件及子控件所以焦点 梁卫东 2020-09-14 10:34:19
+ static void clearChildrenFoucusEx(QWidget *pWidget);
+ //设置所有控件焦点 梁卫东 2020-09-15 17:55:18
+ static void setChildrenFocus(QWidget *pWidget, Qt::FocusPolicy policy = Qt::StrongFocus);
+ //根据指定名称获取进程数量 秦浩玲 2021-01-26
+ static int getProcessCountByName(const char *pstrName);
+ //批量结束指定名称的进程 秦浩玲 2021-01-26
+ static void killProcessByName(const char *pstrName);
+ //计算字符串MD5哈希值 秦浩玲 2021-01-28
+ static QString getStringMD5Hash(const QString &input);
+ //通过dbus接口从任务栏激活窗口 add by guoshaoyu 2021-04-07
+ static bool activeWindowFromDock(quintptr winId);
+
+ //判断是否共享文件夹且只读
+ static bool isShareDirAndReadOnly(const QString &filePath);
+
+ static float codecConfidenceForData(const QTextCodec *codec, const QByteArray &data, const QLocale::Country &country);
+
+ //return system language
+ static QString getSystemLan();
+ // 取得系统版本是否为 V23
+ static SystemVersion getSystemVersion();
+
+ static bool isWayland();
+
+ // 计算换行内容 text: 原始文本内容, nWidth: 一行最大宽度, font:字体大小, nElideRow: 最大显示行数,超出最大行时,中间内容加···省略号显示
+ static QString lineFeed(const QString &text, int nWidth, const QFont &font, int nElidedRow = 2);
+
+ // 判断 [x1, y1] 和 [x2, y2] 区间是否存在交集,返回交集类型
+ static RegionIntersectType checkRegionIntersect(int x1, int y1, int x2, int y2);
+ // 取得当前文本编辑器支持的编码格式,从文件 :/encodes/encodes.ini 中读取
+ static QVector> getSupportEncoding();
+ static QStringList getSupportEncodingList();
+
+private:
+ static QString m_systemLanguage;
+};
diff --git a/src/controls/findbar.cpp b/src/controls/findbar.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f67ec49515d80c0de30cb9c1517691e463916245
--- /dev/null
+++ b/src/controls/findbar.cpp
@@ -0,0 +1,175 @@
+// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "findbar.h"
+#include "../common/utils.h"
+
+#include
+
+FindBar::FindBar(QWidget *parent)
+ : DFloatingWidget(parent)
+{
+ // Init.
+ //setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);
+ hide();
+ setFixedHeight(60);
+
+ // Init layout and widgets.
+
+ m_layout = new QHBoxLayout();
+ m_layout->setSpacing(10);
+ m_findLabel = new QLabel(tr("Find"));
+ m_findLabel->setMinimumHeight(36);
+ m_editLine = new LineBar();
+ m_editLine->lineEdit()->setMinimumHeight(36);
+ m_findPrevButton = new QPushButton(tr("Previous"));
+ //m_findPrevButton->setFixedSize(80, 36);
+ m_findNextButton = new QPushButton(tr("Next"));
+ //m_findNextButton->setFixedSize(80, 36);
+ m_closeButton = new DIconButton(DStyle::SP_CloseButton);
+ m_closeButton->setIconSize(QSize(30, 30));
+ m_closeButton->setFixedSize(30, 30);
+ m_closeButton->setEnabledCircle(true);
+ m_closeButton->setFlat(true);
+ m_layout->setContentsMargins(16, 6, 10, 6);
+
+ m_layout->addWidget(m_findLabel);
+ m_layout->addWidget(m_editLine);
+ m_layout->addWidget(m_findPrevButton);
+ m_layout->addWidget(m_findNextButton);
+ m_layout->addWidget(m_closeButton);
+ this->setLayout(m_layout);
+
+ // Make button don't grab keyboard focus after click it.
+ // m_findNextButton->setFocusPolicy(Qt::NoFocus);
+ // m_findPrevButton->setFocusPolicy(Qt::NoFocus);
+ // m_closeButton->setFocusPolicy(Qt::NoFocus);
+
+ connect(this, &FindBar::pressEsc, this, &FindBar::findCancel, Qt::QueuedConnection);
+ // connect(m_editLine, &LineBar::pressEnter, this, &FindBar::findNext, Qt::QueuedConnection); //Shielded by Hengbo ,for new demand. 20200220
+ //connect(m_editLine, &LineBar::pressCtrlEnter, this, &FindBar::findPrev, Qt::QueuedConnection);
+ connect(m_editLine, &LineBar::returnPressed, this, &FindBar::handleContentChanged, Qt::QueuedConnection);
+ connect(m_editLine, &LineBar::signal_sentText, this, &FindBar::receiveText, Qt::QueuedConnection);
+ //connect(m_editLine, &LineBar::contentChanged, this, &FindBar::slot_ifClearSearchWord, Qt::QueuedConnection);
+
+ connect(m_findNextButton, &QPushButton::clicked, this, &FindBar::handleFindNext, Qt::QueuedConnection);
+ connect(m_findPrevButton, &QPushButton::clicked, this, &FindBar::handleFindPrev, Qt::QueuedConnection);
+ //connect(m_findPrevButton, &QPushButton::clicked, this, &FindBar::findPrev, Qt::QueuedConnection);
+
+ connect(m_closeButton, &DIconButton::clicked, this, &FindBar::findCancel, Qt::QueuedConnection);
+}
+
+bool FindBar::isFocus()
+{
+ return m_editLine->lineEdit()->hasFocus();
+}
+
+void FindBar::focus()
+{
+ m_editLine->lineEdit()->setFocus();
+ m_editLine->lineEdit()->selectAll();
+}
+
+void FindBar::activeInput(QString text, QString file, int row, int column, int scrollOffset)
+{
+ // Try fill keyword with select text.
+ m_editLine->lineEdit()->clear();
+ m_editLine->lineEdit()->insert(text);
+ m_editLine->lineEdit()->selectAll();
+
+ // Show.
+ QWidget::show();
+
+ // Save file info for back to position.
+ m_findFile = file;
+ m_findFileRow = row;
+ m_findFileColumn = column;
+ m_findFileSrollOffset = scrollOffset;
+
+ // Focus.
+ focus();
+}
+
+void FindBar::findCancel()
+{
+ QWidget::hide();
+ emit sigFindbarClose();
+}
+
+void FindBar::handleContentChanged()
+{
+ updateSearchKeyword(m_findFile, m_editLine->lineEdit()->text());
+}
+
+void FindBar::handleFindPrev()
+{
+ findPrev(m_editLine->lineEdit()->text());
+}
+
+void FindBar::handleFindNext()
+{
+ findNext(m_editLine->lineEdit()->text());
+}
+
+void FindBar::hideEvent(QHideEvent *)
+{
+ //保留查询标记
+ //removeSearchKeyword();
+}
+
+bool FindBar::focusNextPrevChild(bool next)
+{
+ return false;
+}
+
+void FindBar::keyPressEvent(QKeyEvent *e)
+{
+ const QString &key = Utils::getKeyshortcut(e);
+ if (key == "Esc") {
+ QWidget::hide();
+ emit sigFindbarClose();
+ }
+ if (m_closeButton->hasFocus() && key == "Tab") {
+ m_editLine->lineEdit()->setFocus();
+ } else {
+ DFloatingWidget::keyPressEvent(e);
+ }
+ if (key == "Enter") {
+ if (m_findPrevButton->hasFocus()) {
+ m_findPrevButton->click();
+ }
+ if (m_findNextButton->hasFocus()) {
+ m_findNextButton->click();
+ }
+ }
+}
+
+void FindBar::setMismatchAlert(bool isAlert)
+{
+ m_editLine->setAlert(isAlert);
+}
+
+void FindBar::receiveText(QString t)
+{
+ searched = false;
+ if (t != "") {
+ m_receivedText = t;
+ }
+}
+
+void FindBar::setSearched(bool _)
+{
+ searched = _;
+}
+
+void FindBar::findPreClicked()
+{
+ if (!searched) {
+ updateSearchKeyword(m_findFile, m_editLine->lineEdit()->text());
+ emit findPrev(m_editLine->lineEdit()->text());
+ searched = true;
+ } else {
+ emit findPrev(m_editLine->lineEdit()->text());
+ }
+}
diff --git a/src/controls/findbar.h b/src/controls/findbar.h
new file mode 100644
index 0000000000000000000000000000000000000000..d971a7b02a66d76649c8e065c0625b05489975e3
--- /dev/null
+++ b/src/controls/findbar.h
@@ -0,0 +1,85 @@
+// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef FINDBAR_H
+#define FINDBAR_H
+
+#include "linebar.h"
+
+#include
+#include
+#include
+#include
+#include
+#include "dimagebutton.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+DWIDGET_USE_NAMESPACE
+
+class FindBar : public DFloatingWidget
+{
+ Q_OBJECT
+
+public:
+ explicit FindBar(QWidget *parent = 0);
+
+ bool isFocus();
+ void focus();
+
+ void activeInput(QString text, QString file, int row, int column, int scrollOffset);
+ void setMismatchAlert(bool isAlert);
+ void receiveText(QString t);
+ void setSearched(bool _);
+ void findPreClicked();
+
+signals:
+ void pressEsc();
+ void findNext(const QString &keyword);
+ void findPrev(const QString &keyword);
+
+ void removeSearchKeyword();
+ void updateSearchKeyword(QString file, QString keyword);
+
+ //add guoshao
+ void sigFindbarClose();
+
+public slots:
+ void findCancel();
+ void handleContentChanged();
+ void handleFindNext();
+ void handleFindPrev();
+
+protected:
+ void hideEvent(QHideEvent *event) override;
+ bool focusNextPrevChild(bool next) override;
+ void keyPressEvent(QKeyEvent *e) override;
+
+private:
+ QPushButton *m_findNextButton;
+ QPushButton *m_findPrevButton;
+ DIconButton *m_closeButton;
+ LineBar *m_editLine;
+ QHBoxLayout *m_layout;
+ QLabel *m_findLabel;
+ QString m_findFile;
+ int m_findFileColumn;
+ int m_findFileRow;
+ int m_findFileSrollOffset;
+ QColor m_backgroundColor;
+ QString m_receivedText = " ";
+ bool searched = false;
+
+ QPoint last;
+};
+
+#endif
diff --git a/src/controls/fontitemdelegate.cpp b/src/controls/fontitemdelegate.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..07235e8e89aa71041c72bd7aea3d6f074a2a8355
--- /dev/null
+++ b/src/controls/fontitemdelegate.cpp
@@ -0,0 +1,46 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "fontitemdelegate.h"
+#include
+
+FontItemDelegate::FontItemDelegate(QObject *parent)
+ : QStyledItemDelegate(parent)
+{
+
+}
+
+FontItemDelegate::~FontItemDelegate()
+{
+}
+
+void FontItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+ const QString text = index.data(Qt::DisplayRole).toString();
+ bool isSelected = option.state & QStyle::State_Selected;
+
+ painter->setPen(Qt::black);
+
+ if (isSelected) {
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(QColor("#2CA7F8"));
+ painter->drawRect(option.rect);
+ painter->setPen(Qt::white);
+ }
+
+ QFont font(painter->font());
+ font.setFamily(text);
+ painter->setFont(font);
+
+ QRect textRect = option.rect;
+ painter->drawText(QRect(textRect.x() + 10,
+ textRect.y(),
+ textRect.width() - 10,
+ textRect.height()), Qt::AlignVCenter | Qt::AlignLeft, text);
+}
+
+QSize FontItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+ return QSize(-1, 30);
+}
diff --git a/src/controls/fontitemdelegate.h b/src/controls/fontitemdelegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..50e9ebcf45e04206e65077b2da74a5c3db5d961c
--- /dev/null
+++ b/src/controls/fontitemdelegate.h
@@ -0,0 +1,23 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef FONTITEMDELEGATE_H
+#define FONTITEMDELEGATE_H
+
+#include
+
+class FontItemDelegate : public QStyledItemDelegate
+{
+ Q_OBJECT
+
+public:
+ explicit FontItemDelegate(QObject *parent = nullptr);
+ ~FontItemDelegate();
+
+protected:
+ void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
+ QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
+};
+
+#endif
diff --git a/src/controls/jumplinebar.cpp b/src/controls/jumplinebar.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..5ce32b49dacf89a21b9e3a7db9cc5c49b7c70386
--- /dev/null
+++ b/src/controls/jumplinebar.cpp
@@ -0,0 +1,163 @@
+// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "jumplinebar.h"
+
+#include
+
+#include
+
+// 各项组件的默认大小
+const int nJumpLineBarWidth = 212;
+const int nJumpLineBarHeight = 60;
+const int s_nJumpLineBarSpinBoxWidth = 124;
+const int s_nJumpLineBarSPinBoxHeight = 36;
+// 水平方向与边界间距
+const int s_nJumpLineBarHorizenMargin = 10;
+
+JumpLineBar::JumpLineBar(DFloatingWidget *parent)
+ : DFloatingWidget(parent)
+{
+ // Init layout and widgets.
+ m_layout = new QHBoxLayout();
+ m_layout->setContentsMargins(10, 6, 10, 6);
+ m_layout->setSpacing(5);
+
+ m_closeButton = new DIconButton(DStyle::SP_CloseButton);
+ m_closeButton->setIconSize(QSize(30, 30));
+ m_closeButton->setFixedSize(30, 30);
+ m_closeButton->setEnabledCircle(true);
+ m_closeButton->setFlat(true);
+
+ m_label = new QLabel();
+ m_label->setText(tr("Go to Line: "));
+ // 按文本长度计算显示宽度,不同语言下翻译文本长度不一,需完整显示
+ m_label->setFixedWidth(fontMetrics().width(m_label->text()));
+ m_pSpinBoxInput = new DSpinBox;
+ m_pSpinBoxInput->setFixedSize(s_nJumpLineBarSpinBoxWidth, s_nJumpLineBarSPinBoxHeight);
+ m_pSpinBoxInput->lineEdit()->clear();
+ m_pSpinBoxInput->setButtonSymbols(QAbstractSpinBox::NoButtons);
+ m_pSpinBoxInput->installEventFilter(this);
+
+ m_layout->addWidget(m_label);
+ m_layout->addWidget(m_pSpinBoxInput);
+ m_layout->addWidget(m_closeButton);
+ this->setLayout(m_layout);
+
+ // 初始化浮动条宽度,根据文本长度计算
+ setFixedHeight(nJumpLineBarHeight);
+ setFixedWidth(m_layout->sizeHint().width() + s_nJumpLineBarHorizenMargin);
+
+ connect(this, &JumpLineBar::pressEsc, this, &JumpLineBar::jumpCancel, Qt::QueuedConnection);
+ connect(m_pSpinBoxInput->lineEdit(), &QLineEdit::returnPressed, this, &JumpLineBar::jumpConfirm, Qt::QueuedConnection);
+ connect(m_pSpinBoxInput->lineEdit(), &QLineEdit::textChanged, this, &JumpLineBar::handleLineChanged, Qt::QueuedConnection);
+ connect(m_closeButton, &DIconButton::clicked, this, &JumpLineBar::close, Qt::QueuedConnection);
+}
+
+JumpLineBar::~JumpLineBar()
+{}
+
+void JumpLineBar::focus()
+{
+ m_pSpinBoxInput->lineEdit()->setFocus();
+}
+
+bool JumpLineBar::isFocus()
+{
+ return m_pSpinBoxInput->lineEdit()->hasFocus();
+}
+
+void JumpLineBar::activeInput(QString file, int row, int column, int lineCount, int scrollOffset)
+{
+ // Save file info for back to line.
+ m_jumpFile = file;
+ m_rowBeforeJump = row;
+ m_columnBeforeJump = column;
+ m_jumpFileScrollOffset = scrollOffset;
+ m_lineCount = lineCount;
+ // 调整为 0~lineCount ,0已被处理不允许首位输入,不影响仅单行的情况
+ // 设置 range 后会自动调整输入范围,不使用 clear() 防止在读取文件时已输入的行号被清空
+ m_pSpinBoxInput->setRange(0, lineCount);
+ int lineWidth = QString::number(lineCount).size() * fontMetrics().width('9');
+ if (m_pSpinBoxInput->minimumWidth() < lineWidth) {
+ m_pSpinBoxInput->setFixedWidth(lineWidth);
+ } else {
+ m_pSpinBoxInput->setFixedWidth(s_nJumpLineBarSpinBoxWidth);
+ }
+ setFixedWidth(m_layout->sizeHint().width() + s_nJumpLineBarHorizenMargin);
+
+ // Clear line number.
+ if (m_pSpinBoxInput->lineEdit()->text().toInt() > lineCount)
+ m_pSpinBoxInput->lineEdit()->setText("");
+}
+
+void JumpLineBar::handleFocusOut()
+{
+ //hide();
+ lostFocusExit();
+}
+
+void JumpLineBar::handleLineChanged()
+{
+ QString content = m_pSpinBoxInput->lineEdit()->text();
+ if (content != "") {
+ if (content.toInt() == 0) {
+ m_pSpinBoxInput->clear();
+ return;
+ }
+ jumpToLine(m_jumpFile, content.toInt(), false);
+ }
+}
+
+void JumpLineBar::jumpCancel()
+{
+ hide();
+ // esc键不跳转 返回当前
+ // backToPosition(m_jumpFile, m_rowBeforeJump, m_columnBeforeJump, m_jumpFileScrollOffset);
+}
+
+void JumpLineBar::jumpConfirm()
+{
+ QString content = m_pSpinBoxInput->lineEdit()->text();
+ if (content != "") {
+ jumpToLine(m_jumpFile, content.toInt(), true);
+ }
+}
+
+void JumpLineBar::slotFocusChanged(bool bFocus)
+{
+ if (bFocus == false) {
+ lostFocusExit();
+ }
+}
+
+// Hide 跳转到行窗口时,需要清空编辑框中的内容
+void JumpLineBar::hide()
+{
+ m_pSpinBoxInput->clear();
+ DFloatingWidget::hide();
+}
+
+int JumpLineBar::getLineCount()
+{
+ return m_lineCount;
+}
+
+bool JumpLineBar::eventFilter(QObject *pObject, QEvent *pEvent)
+{
+ if (pObject == m_pSpinBoxInput) {
+ if (pEvent->type() == QEvent::FocusOut) {
+ handleFocusOut();
+ /**
+ * 规避当DSpinBox输入框里为空且失去focus焦点时会显示上一次输入的数值内容的问题
+ */
+ if (m_pSpinBoxInput->lineEdit()->text() == "") {
+ m_pSpinBoxInput->lineEdit()->clear();
+ }
+ }
+ }
+
+ return DFloatingWidget::eventFilter(pObject, pEvent);
+}
+
diff --git a/src/controls/jumplinebar.h b/src/controls/jumplinebar.h
new file mode 100644
index 0000000000000000000000000000000000000000..f6431cd1db630db769552df5a629dcc843836a81
--- /dev/null
+++ b/src/controls/jumplinebar.h
@@ -0,0 +1,62 @@
+// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef JUMPLINEBAR_H
+#define JUMPLINEBAR_H
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+DWIDGET_USE_NAMESPACE
+
+class JumpLineBar : public DFloatingWidget
+{
+ Q_OBJECT
+public:
+ explicit JumpLineBar(DFloatingWidget *parent = 0);
+ ~JumpLineBar();
+
+public slots:
+ void focus();
+ bool isFocus();
+ void activeInput(QString file, int row, int column, int lineCount, int scrollOffset);
+ void handleFocusOut();
+ void handleLineChanged();
+ void jumpCancel();
+ void jumpConfirm();
+ void slotFocusChanged(bool bFocus);
+ void hide();
+ int getLineCount();
+
+signals:
+ void backToPosition(QString file, int row, int column, int scrollOffset);
+ void jumpToLine(QString file, int line, bool focusEditor);
+ void lostFocusExit();
+ void pressEsc();
+
+protected:
+ bool eventFilter(QObject *pObject, QEvent *pEvent);
+
+private:
+ DSpinBox *m_pSpinBoxInput {nullptr};
+ QHBoxLayout *m_layout {nullptr};
+ QLabel *m_label {nullptr};
+ QString m_jumpFile;
+ int m_jumpFileScrollOffset;
+ int m_rowBeforeJump;
+ int m_columnBeforeJump;
+ int m_lineCount;
+ QColor m_backgroundColor;
+ DIconButton *m_closeButton=nullptr;
+};
+
+#endif
diff --git a/src/controls/linebar.cpp b/src/controls/linebar.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..d9df662a02e723c494ca9440439c4a64fb9f18e8
--- /dev/null
+++ b/src/controls/linebar.cpp
@@ -0,0 +1,75 @@
+// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "linebar.h"
+#include "../common/utils.h"
+
+#include
+
+LineBar::LineBar(DLineEdit *parent)
+ : DLineEdit(parent)
+{
+ // Init.
+ setClearButtonEnabled(true);
+
+ m_autoSaveInternal = 50;
+ m_autoSaveTimer = new QTimer(this);
+ m_autoSaveTimer->setSingleShot(true);
+
+ connect(m_autoSaveTimer, &QTimer::timeout, this, &LineBar::handleTextChangeTimer);
+ connect(this, &DLineEdit::textEdited, this, &LineBar::sendText, Qt::QueuedConnection);
+ connect(this, &DLineEdit::textChanged, this, &LineBar::handleTextChanged, Qt::QueuedConnection);
+}
+
+void LineBar::handleTextChangeTimer()
+{
+ // Emit contentChanged signal.
+ contentChanged();
+}
+
+void LineBar::handleTextChanged(const QString &str)
+{
+ // Stop timer if new character is typed, avoid unused timer run.
+ if (m_autoSaveTimer->isActive()) {
+ m_autoSaveTimer->stop();
+ }
+ if(str.isEmpty()) {
+ setAlert(false);
+ }
+ // Start new timer.
+ m_autoSaveTimer->start(m_autoSaveInternal);
+}
+
+void LineBar::sendText(QString t)
+{
+ emit signal_sentText(t);
+}
+
+void LineBar::focusOutEvent(QFocusEvent *e)
+{
+ // Emit focus out signal.
+ focusOut();
+
+ // Throw event out avoid DLineEdit can't hide cursor after lost focus.
+ DLineEdit::focusOutEvent(e);
+}
+
+void LineBar::keyPressEvent(QKeyEvent *e)
+{
+ QString key = Utils::getKeyshortcut(e);
+ Qt::KeyboardModifiers modifiers = e->modifiers();
+
+ if(modifiers == Qt::ControlModifier && e->text() == "\r"){
+ pressCtrlEnter();
+ }else if(modifiers == Qt::AltModifier && e->text() == "\r"){
+ pressAltEnter();
+ }else if(modifiers == Qt::MetaModifier && e->text() == "\r"){
+ pressMetaEnter();
+ }else if(modifiers == Qt::NoModifier && e->text() == "\r"){
+ pressEnter();
+ }else {
+ // Pass event to DLineEdit continue, otherwise you can't type anything after here. ;)
+ DLineEdit::keyPressEvent(e);
+ }
+}
diff --git a/src/controls/linebar.h b/src/controls/linebar.h
new file mode 100644
index 0000000000000000000000000000000000000000..875348e052c062136a14d7a17c9d3ec00a81556f
--- /dev/null
+++ b/src/controls/linebar.h
@@ -0,0 +1,44 @@
+// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef LINEBAR_H
+#define LINEBAR_H
+
+#include "dlineedit.h"
+
+#include
+
+DWIDGET_USE_NAMESPACE
+
+class LineBar : public DLineEdit
+{
+ Q_OBJECT
+
+public:
+ explicit LineBar(DLineEdit *parent = 0);
+
+public slots:
+ void handleTextChangeTimer();
+ void handleTextChanged(const QString &str="");
+ void sendText(QString t);
+
+signals:
+ void contentChanged();
+ void focusOut();
+ void pressAltEnter();
+ void pressCtrlEnter();
+ void pressEnter();
+ void pressMetaEnter();
+ void signal_sentText(QString t);
+
+protected:
+ virtual void focusOutEvent(QFocusEvent *e);
+ virtual void keyPressEvent(QKeyEvent *e);
+
+private:
+ QTimer *m_autoSaveTimer;
+ int m_autoSaveInternal;
+};
+
+#endif
diff --git a/src/controls/replacebar.cpp b/src/controls/replacebar.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9c5c282456a8bc2d0efaf6339cccb7c287534536
--- /dev/null
+++ b/src/controls/replacebar.cpp
@@ -0,0 +1,221 @@
+// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "replacebar.h"
+#include "../common/utils.h"
+
+#include
+
+ReplaceBar::ReplaceBar(QWidget *parent)
+ : DFloatingWidget(parent)
+{
+ // Init.
+ hide();
+ setFixedHeight(60);
+
+ // Init layout and widgets.
+ m_layout = new QHBoxLayout();
+ m_layout->setSpacing(10);
+ m_layout->setContentsMargins(16, 6, 10, 6);
+ m_replaceLabel = new QLabel(tr("Find"));
+ //m_replaceLabel->setMinimumHeight(36);
+ m_replaceLine = new LineBar();
+ //m_replaceLine->lineEdit()->setMinimumHeight(36);
+ m_withLabel = new QLabel(tr("Replace With"));
+ //m_withLabel->setMinimumHeight(36);
+ m_withLine = new LineBar();
+ //m_withLine->lineEdit()->setMinimumHeight(36);
+ m_replaceButton = new QPushButton(tr("Replace"));
+ //m_replaceButton->setMinimumWidth(66);
+ //m_replaceButton->setMinimumHeight(36);
+ m_replaceSkipButton = new QPushButton(tr("Skip"));
+ //m_replaceSkipButton->setMinimumWidth(66);
+ //m_replaceSkipButton->setMinimumHeight(36);
+ m_replaceRestButton = new QPushButton(tr("Replace Rest"));
+ //m_replaceRestButton->setMinimumWidth(80);
+ //m_replaceRestButton->setMinimumHeight(36);
+ m_replaceAllButton = new QPushButton(tr("Replace All"));
+ //m_replaceAllButton->setMinimumWidth(80);
+ //m_replaceAllButton->setMinimumHeight(36);
+ m_closeButton = new DIconButton(DStyle::SP_CloseButton);
+ m_closeButton->setFlat(true);
+ m_closeButton->setFixedSize(30, 30);
+ m_closeButton->setEnabledCircle(true);
+ m_closeButton->setIconSize(QSize(30, 30));
+
+ m_layout->addWidget(m_replaceLabel);
+ m_layout->addWidget(m_replaceLine);
+ m_layout->addWidget(m_withLabel);
+ m_layout->addWidget(m_withLine);
+ m_layout->addWidget(m_replaceButton);
+ m_layout->addWidget(m_replaceSkipButton);
+ m_layout->addWidget(m_replaceRestButton);
+ m_layout->addWidget(m_replaceAllButton);
+ m_layout->addWidget(m_closeButton);
+ this->setLayout(m_layout);
+
+ // Make button don't grab keyboard focus after click it.
+ #if 0
+ m_replaceButton->setFocusPolicy(Qt::NoFocus);
+ m_replaceSkipButton->setFocusPolicy(Qt::NoFocus);
+ m_replaceRestButton->setFocusPolicy(Qt::NoFocus);
+ m_replaceAllButton->setFocusPolicy(Qt::NoFocus);
+ m_closeButton->setFocusPolicy(Qt::NoFocus);
+ #endif
+ connect(m_replaceLine, &LineBar::signal_sentText, this, &ReplaceBar::change, Qt::QueuedConnection);
+
+ connect(this, &ReplaceBar::pressEsc, this, &ReplaceBar::replaceClose, Qt::QueuedConnection);
+
+ //connect(m_replaceLine, &LineBar::pressEnter, this, &ReplaceBar::handleReplaceNext, Qt::QueuedConnection); //Shielded by Hengbo for new demand.
+ connect(m_withLine, &LineBar::returnPressed, this, &ReplaceBar::handleReplaceNext, Qt::QueuedConnection);
+ connect(m_replaceLine, &LineBar::pressCtrlEnter, this, &ReplaceBar::handleSkip,Qt::QueuedConnection);
+ connect(m_withLine, &LineBar::pressCtrlEnter, this, &ReplaceBar::handleSkip,Qt::QueuedConnection);
+ connect(m_replaceLine, &LineBar::pressAltEnter, this, &ReplaceBar::handleReplaceRest, Qt::QueuedConnection);
+ connect(m_withLine, &LineBar::pressAltEnter, this, &ReplaceBar::handleReplaceRest, Qt::QueuedConnection);
+ connect(m_replaceLine, &LineBar::pressMetaEnter, this, &ReplaceBar::handleReplaceAll, Qt::QueuedConnection);
+ connect(m_withLine, &LineBar::pressMetaEnter, this, &ReplaceBar::handleReplaceAll, Qt::QueuedConnection);
+ connect(m_replaceLine, &LineBar::returnPressed, this, &ReplaceBar::handleContentChanged, Qt::QueuedConnection);
+ connect(m_replaceButton, &QPushButton::clicked, this, &ReplaceBar::handleReplaceNext, Qt::QueuedConnection);
+ connect(m_replaceSkipButton, &QPushButton::clicked, this, &ReplaceBar::handleSkip,Qt::QueuedConnection);
+ connect(m_replaceRestButton, &QPushButton::clicked, this, &ReplaceBar::handleReplaceRest, Qt::QueuedConnection);
+ connect(m_replaceAllButton, &QPushButton::clicked, this, &ReplaceBar::handleReplaceAll, Qt::QueuedConnection);
+
+ connect(m_closeButton, &DIconButton::clicked, this, &ReplaceBar::replaceClose, Qt::QueuedConnection);
+}
+
+bool ReplaceBar::isFocus()
+{
+ return m_replaceLine->hasFocus();
+}
+
+void ReplaceBar::focus()
+{
+ m_replaceLine->lineEdit()->setFocus();
+}
+
+void ReplaceBar::activeInput(QString text, QString file, int row, int column, int scrollOffset)
+{
+ // Try fill keyword with select text.
+ m_withLine->lineEdit()->clear();
+ m_replaceLine->lineEdit()->clear();
+ m_replaceLine->lineEdit()->insert(text);
+ m_replaceLine->lineEdit()->selectAll();
+
+ // Show.
+ show();
+
+ // Save file info for back to position.
+ m_replaceFile = file;
+ m_replaceFileRow = row;
+ m_replaceFileColumn = column;
+ m_replaceFileSrollOffset = scrollOffset;
+
+ // Focus.
+ focus();
+}
+
+void ReplaceBar::handleSkip()
+{
+ emit replaceSkip(m_replaceFile, m_replaceLine->lineEdit()->text());
+}
+
+void ReplaceBar::replaceClose()
+{
+ searched = false;
+ hide();
+ emit sigReplacebarClose();
+}
+
+void ReplaceBar::handleContentChanged()
+{
+ updateSearchKeyword(m_replaceFile, m_replaceLine->lineEdit()->text());
+}
+
+void ReplaceBar::handleReplaceNext()
+{
+ if (!searched) {
+ emit removeSearchKeyword();
+ emit beforeReplace(m_replaceLine->lineEdit()->text());
+ }
+ replaceNext(m_replaceFile, m_replaceLine->lineEdit()->text(), m_withLine->lineEdit()->text());
+ searched = true;
+}
+
+void ReplaceBar::handleReplaceRest()
+{
+ replaceRest(m_replaceLine->lineEdit()->text(), m_withLine->lineEdit()->text());
+}
+
+void ReplaceBar::handleReplaceAll()
+{
+ replaceAll(m_replaceLine->lineEdit()->text(), m_withLine->lineEdit()->text());
+}
+
+void ReplaceBar::hideEvent(QHideEvent *)
+{
+ searched = false;
+ removeSearchKeyword();
+}
+
+bool ReplaceBar::focusNextPrevChild(bool)
+{
+ // Make keyword jump between two EditLine widgets.
+ auto *editWidget = qobject_cast(focusWidget());
+ if (editWidget != nullptr) {
+ if (editWidget == m_replaceLine) {
+ m_withLine->lineEdit()->setFocus();
+
+ return true;
+ } else if (editWidget == m_withLine) {
+ m_replaceLine->lineEdit()->setFocus();
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void ReplaceBar::keyPressEvent(QKeyEvent *e)
+{
+ const QString &key = Utils::getKeyshortcut(e);
+ if (key == "Esc") {
+ QWidget::hide();
+ emit sigReplacebarClose();
+ }
+ if (m_closeButton->hasFocus() && key == "Tab") {
+ m_replaceLine->lineEdit()->setFocus();
+ } else {
+ DFloatingWidget::keyPressEvent(e);
+ }
+ if (key == "Enter") {
+ if (m_replaceAllButton->hasFocus()) {
+ m_replaceAllButton->click();
+ }
+ if (m_replaceButton->hasFocus()) {
+ m_replaceButton->click();
+ }
+ if (m_replaceRestButton->hasFocus()) {
+ m_replaceRestButton->click();
+ }
+ if (m_replaceSkipButton->hasFocus()) {
+ m_replaceSkipButton->click();
+ }
+ }
+}
+
+void ReplaceBar::setMismatchAlert(bool isAlert)
+{
+ m_replaceLine->setAlert(isAlert);
+}
+
+void ReplaceBar::setsearched(bool _)
+{
+ searched = _;
+}
+
+void ReplaceBar::change()
+{
+ searched = false;
+}
diff --git a/src/controls/replacebar.h b/src/controls/replacebar.h
new file mode 100644
index 0000000000000000000000000000000000000000..bc8d17838271880e7d4dd56bdc7f32f9ab9abb16
--- /dev/null
+++ b/src/controls/replacebar.h
@@ -0,0 +1,86 @@
+// SPDX-FileCopyrightText: 2011-2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#ifndef REPLACEBAR_H
+#define REPLACEBAR_H
+
+#include
+#include "linebar.h"
+#include
+#include
+#include
+#include
+#include "dimagebutton.h"
+#include
+#include
+#include
+#include
+
+DWIDGET_USE_NAMESPACE
+
+class ReplaceBar : public DFloatingWidget
+{
+ Q_OBJECT
+
+public:
+ explicit ReplaceBar(QWidget *parent = 0);
+
+ bool isFocus();
+ void focus();
+
+ void activeInput(QString text, QString file, int row, int column, int scrollOffset);
+ void setMismatchAlert(bool isAlert);
+ void setsearched(bool _);
+
+signals:
+ void pressEsc();
+ void replaceNext(QString file, QString replaceText, QString withText);
+ void replaceSkip(QString file, QString keyword);
+ void replaceRest(QString replaceText, QString withText);
+ void replaceAll(QString replaceText, QString withText);
+ void beforeReplace(QString _);
+
+ void backToPosition(QString file, int row, int column, int scrollOffset);
+
+ void removeSearchKeyword();
+ void updateSearchKeyword(QString file, QString keyword);
+
+ void sigReplacebarClose();
+
+public slots:
+ void change();
+ void replaceClose();
+ void handleContentChanged();
+ void handleReplaceAll();
+ void handleReplaceNext();
+ void handleReplaceRest();
+ void handleSkip();
+
+protected:
+ void hideEvent(QHideEvent *event);
+ bool focusNextPrevChild(bool next);
+ void keyPressEvent(QKeyEvent *e);
+
+private:
+ QPushButton *m_replaceAllButton;
+ QPushButton *m_replaceButton;
+ QPushButton *m_replaceRestButton;
+ QPushButton *m_replaceSkipButton;
+ DIconButton *m_closeButton;
+ LineBar *m_replaceLine;
+ LineBar *m_withLine;
+ QHBoxLayout *m_layout;
+ QLabel *m_replaceLabel;
+ QLabel *m_withLabel;
+ QString m_replaceFile;
+ int m_replaceFileColumn;
+ int m_replaceFileRow;
+ int m_replaceFileSrollOffset;
+ QColor m_backgroundColor;
+ bool searched = false;
+
+ QPoint last;
+};
+
+#endif
diff --git a/src/controls/settingsdialog.cpp b/src/controls/settingsdialog.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..4a7f246d595dfbb36cfcae85b584bf50dd43b647
--- /dev/null
+++ b/src/controls/settingsdialog.cpp
@@ -0,0 +1,130 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include
+
+void GenerateSettingTranslate()
+{
+ auto group_baseName = QObject::tr("Basic");
+ auto base_fontName = QObject::tr("Font Style");
+ auto base_font_familyName = QObject::tr("Font");
+ auto base_font_sizeName = QObject::tr("Font Size");
+ auto group_shortcutsName = QObject::tr("Shortcuts");
+ auto shortcuts_keymapName = QObject::tr("Keymap");
+ auto shortcurs_keymap_keymap = QObject::tr("Keymap");
+ auto shortcuts_windowName = QObject::tr("Window");
+ auto shortcuts_window_addblanktabName = QObject::tr("New tab");
+ auto shortcuts_window_newwindowName = QObject::tr("New window");
+ auto shortcuts_window_savefileName = QObject::tr("Save");
+ auto shortcuts_window_saveasfileName = QObject::tr("Save as");
+ auto shortcuts_window_selectnexttabName = QObject::tr("Next tab");
+ auto shortcuts_window_selectprevtabName = QObject::tr("Previous tab");
+ auto shortcuts_window_closetabName = QObject::tr("Close tab");
+ auto shortcuts_window_closeothertabsName = QObject::tr("Close other tabs");
+ auto shortcuts_window_restoretabName = QObject::tr("Restore tab");
+ auto shortcuts_window_openfileName = QObject::tr("Open file");
+ auto shortcuts_window_incrementfontsizeName = QObject::tr("Increment font size");
+ auto shortcuts_window_decrementfontsizeName = QObject::tr("Decrement font size");
+ auto shortcuts_window_resetfontsizeName = QObject::tr("Reset font size");
+ auto shortcuts_window_help = QObject::tr("Help");
+ auto shortcuts_window_togglefullscreenName = QObject::tr("Toggle fullscreen");
+ auto shortcuts_window_findName = QObject::tr("Find");
+ Q_UNUSED(QObject::tr("Find Next"));
+ Q_UNUSED(QObject::tr("Find Previous"));
+ auto shortcuts_window_replaceName = QObject::tr("Replace");
+ auto shortcuts_window_jumptolineName = QObject::tr("Go to line");
+ auto shortcuts_window_savepositionName = QObject::tr("Save cursor position");
+ auto shortcuts_window_restorepositionName = QObject::tr("Reset cursor position");
+ auto shortcuts_window_escapeName = QObject::tr("Exit");
+ auto shortcuts_window_displayshortcutsName = QObject::tr("Display shortcuts");
+ auto shortcuts_window_printName = QObject::tr("Print");
+ auto group_editorName = QObject::tr("Editor");
+ auto shortcuts_editor_indentlineName = QObject::tr("Increase indent");
+ auto shortcuts_editor_backindentlineName = QObject::tr("Decrease indent");
+ auto shortcuts_editor_forwardcharName = QObject::tr("Forward character");
+ auto shortcuts_editor_backwardcharName = QObject::tr("Backward character");
+ auto shortcuts_editor_forwardwordName = QObject::tr("Forward word");
+ auto shortcuts_editor_backwarwordName = QObject::tr("Backward word");
+ auto shortcuts_editor_nextlineName = QObject::tr("Next line");
+ auto shortcuts_editor_prevlineName = QObject::tr("Previous line");
+ auto shortcuts_editor_newlineName = QObject::tr("New line");
+ auto shortcuts_editor_opennewlineaboveName = QObject::tr("New line above");
+ auto shortcuts_editor_opennewlinebelowName = QObject::tr("New line below");
+ auto shortcuts_editor_duplicatelineName = QObject::tr("Duplicate line");
+ auto shortcuts_editor_killlineName = QObject::tr("Delete to end of line");
+ auto shortcuts_editor_killcurrentlineName = QObject::tr("Delete current line");
+ auto shortcuts_editor_swaplineupName = QObject::tr("Swap line up");
+ auto shortcuts_editor_swaplinedownName = QObject::tr("Swap line down");
+ auto shortcuts_editor_scrolllineupName = QObject::tr("Scroll up one line");
+ auto shortcuts_editor_scrolllinedownName = QObject::tr("Scroll down one line");
+ auto shortcuts_editor_scrollupName = QObject::tr("Page up");
+ auto shortcuts_editor_scrolldownName = QObject::tr("Page down");
+ auto shortcuts_editor_movetoendoflineName = QObject::tr("Move to end of line");
+ auto shortcuts_editor_movetostartoflineName = QObject::tr("Move to start of line");
+ auto shortcuts_editor_movetoendName = QObject::tr("Move to end of text");
+ auto shortcuts_editor_movetostartName = QObject::tr("Move to start of text");
+ auto shortcuts_editor_movetolineindentationName = QObject::tr("Move to line indentation");
+ auto shortcuts_editor_upcasewordName = QObject::tr("Upper case");
+ auto shortcuts_editor_downcasewordName = QObject::tr("Lower case");
+ auto shortcuts_editor_capitalizewordName = QObject::tr("Capitalize");
+ auto shortcuts_editor_killbackwardwordName = QObject::tr("Delete backward word");
+ auto shortcuts_editor_killforwardwordName = QObject::tr("Delete forward word");
+ auto shortcuts_editor_forwardpairName = QObject::tr("Forward over a pair");
+ auto shortcuts_editor_backwardpairName = QObject::tr("Backward over a pair");
+ auto shortcuts_editor_selectallName = QObject::tr("Select all");
+ auto shortcuts_editor_copyName = QObject::tr("Copy");
+ auto shortcuts_editor_cutName = QObject::tr("Cut");
+ auto shortcuts_editor_pasteName = QObject::tr("Paste");
+ auto shortcuts_editor_transposecharName = QObject::tr("Transpose character");
+ auto shortcuts_editor_setmarkName = QObject::tr("Mark");
+ auto shortcuts_editor_exchangemarkName = QObject::tr("Unmark");
+ auto shortcuts_editor_copylinesName = QObject::tr("Copy line");
+ auto shortcuts_editor_cutlinesName = QObject::tr("Cut line");
+ auto shortcuts_editor_joinlinesName = QObject::tr("Merge lines");
+ auto shortcuts_editor_togglereadonlymodeName = QObject::tr("Read-Only mode");
+ auto shortcuts_editor_togglecommentName = QObject::tr("Add comment");
+ auto shortcuts_editor_removecommentName = QObject::tr("Remove comment");
+ auto shortcuts_editor_undoName = QObject::tr("Undo");
+ auto shortcuts_editor_redoName = QObject::tr("Redo");
+ auto shortcuts_editor_switchbookmarkName = QObject::tr("Add/Remove bookmark");
+ auto shortcuts_editor_movetoprebookmarkName = QObject::tr("Move to previous bookmark");
+ auto shortcuts_editor_movetonextbookmarkName = QObject::tr("Move to next bookmark");
+ auto group_advanceName = QObject::tr("Advanced");
+ auto advance_windowName = QObject::tr("Window");
+ auto advance_window_windowstateName = QObject::tr("Window size");
+ auto advance_editor_tabspacenumberName = QObject::tr("Tab width");
+ auto allow_midbutton_paste_name = QObject::tr("Paste by pressing a middle mouse button");
+
+ auto advance_startup_name = QObject::tr("Startup");
+ auto advance_startup_saveTabBeforeCloseName = QObject::tr("Reopen last closed tabs");
+
+ auto advance_open_save_setting_name = QObject::tr("Open/Save Settings");
+
+ auto base_font_wordwrapText = QObject::tr("Word wrap");
+ auto base_font_codeflod = QObject::tr("Code folding flag");
+ auto base_font_showLineNumber = QObject::tr("Show line numbers");
+ auto base_font_showBookmark = QObject::tr("Show bookmarks icon");
+ auto showblankcharacter = QObject::tr("Show whitespaces and tabs");
+ auto base_font_highlightCurrentLine = QObject::tr("Highlight current line");
+ auto shortcuts_editor_markName = QObject::tr("Color mark");
+
+ //编码翻译
+ auto Unicode = QObject::tr("Unicode");
+ auto WesternEuropean = QObject::tr("WesternEuropean");
+ auto CentralEuropean = QObject::tr("CentralEuropean");
+ auto Baltic = QObject::tr("Baltic");
+ auto Cyrillic = QObject::tr("Cyrillic");
+ auto Arabic = QObject::tr("Arabic");
+ auto Greek = QObject::tr("Greek");
+ auto Hebrew = QObject::tr("Hebrew");
+ auto Turkish = QObject::tr("Turkish");
+ auto Thai = QObject::tr("Thai");
+ auto Celtic = QObject::tr("Celtic");
+ auto SouthEasternEuropean = QObject::tr("SouthEasternEuropean");
+ auto Simplified = QObject::tr("ChineseSimplified");
+ auto Traditional = QObject::tr("ChineseTraditional");
+ auto Japanese = QObject::tr("Japanese");
+ auto Korean = QObject::tr("Korean");
+ auto Vietnamese = QObject::tr("Vietnamese");
+}
diff --git a/src/controls/tabbar.cpp b/src/controls/tabbar.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..17b4ab25035de4570fba16270f8a5bed3dff4744
--- /dev/null
+++ b/src/controls/tabbar.cpp
@@ -0,0 +1,805 @@
+// SPDX-FileCopyrightText: 2017 - 2022 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "tabbar.h"
+#include "../widgets/window.h"
+#include "../common/utils.h"
+#include "../editor/editwrapper.h"
+#include "../startmanager.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+QPixmap *Tabbar::sm_pDragPixmap = nullptr;
+
+/**
+ * @brief ‘&’在Qt中被标记为助记符,替换 \a str 中的‘&’字符为“&&”,以正确显示文件名中的‘&’符号
+ * painter 绘制 CE_ToolButtonLabel 时设置了 Qt::TextShowMnemonic
+ * @note 在插入、新建标签页时,内部已使用替换,部分外部更新标签页名称,需手动处理
+ * @sa Tabbar::addTabWithIndex(), Tabbar::insertFromMimeData(), Tabbar::setTabText()
+ */
+QString replaceMnemonic(const QString &str)
+{
+ QString tmp = str;
+ tmp.replace(QChar('&'), QString("&&"));
+ return tmp;
+}
+
+/**
+ * @brief ‘&’在Qt中被标记为助记符,替换 \a str 中的"&&字符为'&',以正确取得文件名中的‘&’符号
+ */
+QString restoreMnemonic(const QString &str)
+{
+ QString tmp = str;
+ tmp.replace(QString("&&"), QChar('&'));
+ return tmp;
+}
+
+Tabbar::Tabbar(QWidget *parent)
+ : DTabBar(parent)
+{
+ m_rightClickTab = -1;
+
+ installEventFilter(this);
+
+ setMovable(true);
+ setTabsClosable(true);
+ setVisibleAddButton(true);
+ setDragable(true);
+ // setStartDragDistance(40);
+ setElideMode(Qt::ElideMiddle);
+ setTabPalette(palette().buttonText().color().name(), palette().highlightedText().color().name());
+ setFocusPolicy(Qt::NoFocus);
+
+ connect(this, &DTabBar::dragStarted, this, &Tabbar::onTabDrapStart);
+ connect(this, &DTabBar::tabMoved, this, &Tabbar::handleTabMoved);
+ connect(this, &DTabBar::tabDroped, this, &Tabbar::handleTabDroped);
+ connect(this, &DTabBar::tabIsRemoved, this, &Tabbar::handleTabIsRemoved);
+ connect(this, &DTabBar::tabReleaseRequested, this, &Tabbar::handleTabReleased);
+ connect(this, &DTabBar::dragActionChanged, this, &Tabbar::handleDragActionChanged);
+}
+
+Tabbar::~Tabbar()
+{
+ if (m_moreWaysCloseMenu != nullptr) {
+ delete m_moreWaysCloseMenu;
+ m_moreWaysCloseMenu = nullptr;
+ }
+ if (m_rightMenu != nullptr) {
+ delete m_rightMenu;
+ m_rightMenu = nullptr;
+ }
+}
+
+void Tabbar::addTab(const QString &filePath, const QString &tabName, const QString &tipPath)
+{
+ addTabWithIndex(currentIndex() + 1, filePath, tabName, tipPath);
+}
+
+void Tabbar::addTabWithIndex(int index, const QString &filePath, const QString &tabName, const QString &tipPath)
+{
+ // FIXME(rekols): do not insert duplicate values.
+ if (m_tabPaths.contains(filePath)) {
+ return;
+ }
+ m_tabPaths.insert(index, filePath);
+ m_tabTruePaths.insert(index, tipPath);
+ // }
+
+ // 除去空白符 梁卫东 2020-08-26 14:49:15 ;适配助记符
+ QString trimmedName = replaceMnemonic(tabName.simplified());
+ DTabBar::insertTab(index, trimmedName);
+ DTabBar::setCurrentIndex(index);
+ if (filePath.contains(Utils::localDataPath())) {
+ if (Utils::isBackupFile(filePath) && !tipPath.isNull() && tipPath.length() > 0) {
+ setTabToolTip(index, tipPath);
+ } else {
+ setTabToolTip(index, tabName);
+ }
+ } else {
+ QString path = filePath;
+ QFontMetrics fontMetrics(font());
+ int nFontWidth = fontMetrics.width(path) * (qApp->devicePixelRatio() == 1.25 ? 2 : 1);
+
+ Window *pWindow = static_cast(this->window());
+ int w = pWindow->width() - 200;
+ if (w < 800) w = 800;
+
+ if (nFontWidth >= w) {
+ int mod = nFontWidth % w;
+
+ int step = nFontWidth / w + (mod > 0 ? 1 : 0);
+
+ for (int i = 1; i < step; i++) {
+ path.insert(i * (path.length() / step), '\n');
+ }
+ }
+
+ setTabToolTip(index, path);
+ }
+}
+
+void Tabbar::resizeEvent(QResizeEvent *event)
+{
+ int cnt = count();
+
+ for (int i = 0; i < cnt ; i++) {
+ QString path = tabToolTip(i);
+ path = path.replace("\n", "");
+ QFontMetrics fontMetrics(font());
+ int nFontWidth = fontMetrics.width(path) * (qApp->devicePixelRatio() == 1.25 ? 2 : 1);
+
+ Window *pWindow = static_cast(this->window());
+ int w = pWindow->width() - 200;
+ if (w < 800) w = 800;
+
+ if (nFontWidth >= w) {
+ int mod = nFontWidth % w;
+
+ int step = nFontWidth / w + (mod > 0 ? 1 : 0);
+
+ for (int j = 1; j < step; j++) {
+ path.insert(j * (path.length() / step), '\n');
+ }
+ }
+
+ setTabToolTip(i, path);
+ }
+
+ // 临时修改方案:通过调用setIconSize(),更新内部的layoutDirty标识,强制重新刷新标签页布局, BUG链接:https://pms.uniontech.com/bug-view-137607.html
+ // TODO: 需要dtk暴露接口重新布局
+ setIconSize(iconSize());
+
+ DTabBar::resizeEvent(event);
+}
+
+void Tabbar::closeTab(int index)
+{
+ if (index < 0) {
+ return;
+ }
+ emit requestHistorySaved(fileAt(index));
+ DTabBar::removeTab(index);
+}
+
+void Tabbar::closeCurrentTab()
+{
+ closeTab(currentIndex());
+}
+
+void Tabbar::closeCurrentTab(const QString &strFilePath)
+{
+ closeTab(this->indexOf(strFilePath));
+}
+
+void Tabbar::closeOtherTabs()
+{
+ closeOtherTabsExceptFile(currentPath());
+}
+
+void Tabbar::closeOtherTabsExceptFile(const QString &filePath)
+{
+ QStringList closePathList;
+
+ for (const QString &path : m_tabPaths) {
+ if (filePath != path) {
+ closePathList << path;
+ }
+ }
+
+ emit closeTabs(closePathList);
+}
+
+void Tabbar::closeLeftTabs(const QString &filePath)
+{
+ QStringList closePathList;
+
+ for (const QString &path : m_tabPaths) {
+ if (filePath == path) {
+ break;
+ }
+ closePathList << path;
+ }
+ emit closeTabs(closePathList);
+
+}
+
+void Tabbar::closeRightTabs(const QString &filePath)
+{
+
+ QStringList closePathlist;
+
+
+ for (int i = m_tabPaths.count() - 1; i >= 0; i--) {
+ m_tabPaths.value(i);
+
+ if (filePath == m_tabPaths.value(i)) {
+ break;
+ }
+ closePathlist << m_tabPaths.value(i);
+ }
+
+ emit closeTabs(closePathlist);
+}
+
+void Tabbar::updateTab(int index, const QString &filePath, const QString &tabName)
+{
+ // 适配助记符 '&' 后设置文本
+ setTabText(index, tabName);
+ m_tabPaths[index] = filePath;
+ m_tabTruePaths[index] = filePath;
+
+ //show file path at tab,blank file only show it's name.
+ if (filePath.contains(Utils::localDataPath())) {
+ setTabToolTip(index, tabName);
+ } else {
+ QString path = filePath;
+ QFontMetrics fontMetrics(font());
+ int nFontWidth = fontMetrics.width(path) * (qApp->devicePixelRatio() == 1.25 ? 2 : 1);
+
+ Window *pWindow = static_cast(this->window());
+ int w = pWindow->width() - 200;
+ if (w < 800) w = 800;
+
+ if (nFontWidth >= w) {
+ int mod = nFontWidth % w;
+
+ int step = nFontWidth / w + (mod > 0 ? 1 : 0);
+
+ for (int i = 1; i < step; i++) {
+ path.insert(i * (path.length() / step), '\n');
+ }
+ }
+
+ setTabToolTip(index, path);
+ }
+}
+
+void Tabbar::previousTab()
+{
+ int currentIndex = DTabBar::currentIndex();
+
+ if (currentIndex <= 0) {
+ DTabBar::setCurrentIndex(DTabBar::count() - 1);
+ } else {
+ DTabBar::setCurrentIndex(currentIndex - 1);
+ }
+}
+
+void Tabbar::nextTab()
+{
+ int currentIndex = DTabBar::currentIndex();
+
+ if (currentIndex >= DTabBar::count() - 1) {
+ DTabBar::setCurrentIndex(0);
+ } else {
+ DTabBar::setCurrentIndex(currentIndex + 1);
+ }
+}
+
+int Tabbar::indexOf(const QString &filePath)
+{
+ return m_tabPaths.indexOf(filePath);
+}
+
+QString Tabbar::currentName() const
+{
+ return textAt(currentIndex());
+}
+
+QString Tabbar::currentPath() const
+{
+ return m_tabPaths.value(currentIndex());
+}
+
+QString Tabbar::truePathAt(int index) const
+{
+ return m_tabTruePaths.value(index);
+}
+
+QString Tabbar::fileAt(int index) const
+{
+ return m_tabPaths.value(index);
+}
+
+QString Tabbar::textAt(int index) const
+{
+ // 获取显示文本时恢复设置的助记符 '&'
+ return restoreMnemonic(DTabBar::tabText(index));
+}
+
+/**
+ * @brief 设置索引 \a index 指向标签页显示文本为 \a text
+ */
+void Tabbar::setTabText(int index, const QString &text)
+{
+ // 替换助记符
+ QString tmp = replaceMnemonic(text);
+ DTabBar::setTabText(index, tmp);
+}
+
+void Tabbar::setTabPalette(const QString &activeColor, const QString &highlightColor)
+{
+ QPalette pa = this->palette();
+ pa.setColor(QPalette::Inactive, QPalette::HighlightedText, QColor(highlightColor));
+ pa.setColor(QPalette::Inactive, QPalette::WindowText, QColor(activeColor));
+ pa.setColor(QPalette::Active, QPalette::WindowText, QColor(activeColor));
+ setPalette(pa);
+}
+
+void Tabbar::setBackground(const QString &startColor, const QString &endColor)
+{
+ m_backgroundStartColor = startColor;
+ m_backgroundEndColor = endColor;
+}
+
+void Tabbar::setDNDColor(const QString &startColor, const QString &endColor)
+{
+ m_dndStartColor = startColor;
+ m_dndEndColor = endColor;
+}
+
+QPixmap Tabbar::createDragPixmapFromTab(int index, const QStyleOptionTab &option, QPoint *hotspot) const
+{
+ const qreal ratio = qApp->devicePixelRatio();
+
+ Window *window = static_cast(this->window());
+ EditWrapper *wrapper = window->wrapper(fileAt(index));
+ //加载大文本不允许拖拽
+ //if(wrapper && wrapper->getFileLoading()) return QPixmap();
+
+ TextEdit *textEdit = wrapper->textEditor();
+
+ int width = textEdit->width() * ratio;
+ int height = textEdit->height() * ratio;
+ QImage screenshotImage(width, height, QImage::Format_ARGB32_Premultiplied);
+ screenshotImage.setDevicePixelRatio(ratio);
+ textEdit->render(&screenshotImage, QPoint(), QRegion(0, 0, width, height));
+
+ // scaled image to smaller.
+ int scaledWidth = width * ratio / 5;
+ int scaledHeight = height * ratio / 5;
+ auto scaledImage = screenshotImage.scaled(scaledWidth, scaledHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
+
+ QImage backgroundImage(scaledWidth + 10, scaledHeight + 10, QImage::Format_ARGB32_Premultiplied);
+ backgroundImage.fill(QColor(palette().color(QPalette::Base)));
+ // clip screenshot image with window radius.
+ QPainter painter(&backgroundImage);
+ painter.drawImage(5, 5, scaledImage);
+ painter.setRenderHint(QPainter::Antialiasing, true);
+
+ if (!Utils::isWayland() && count() == 1) {
+ this->window()->showMinimized();
+ }
+
+ // adjust offset.
+ hotspot->setX(scaledWidth / 2);
+ hotspot->setY(scaledHeight / 2);
+
+ QPainterPath rectPath;
+
+ if (DWindowManagerHelper::instance()->hasComposite()) {
+ QPainterPath roundedRectPath;
+
+ rectPath.addRect(0, 0, scaledWidth + 10, scaledHeight + 10);
+ roundedRectPath.addRoundedRect(QRect(0, 0, scaledWidth / ratio + 10, scaledHeight / ratio + 10), 6, 6);
+
+ rectPath -= roundedRectPath;
+
+ painter.setCompositionMode(QPainter::CompositionMode_Source);
+ painter.fillPath(rectPath, Qt::transparent);
+
+ QColor shadowColor = QColor(palette().color(QPalette::BrightText));
+ shadowColor.setAlpha(80);
+
+ painter.end();
+ if (sm_pDragPixmap) delete sm_pDragPixmap;
+ sm_pDragPixmap = new QPixmap(Utils::dropShadow(QPixmap::fromImage(backgroundImage), 5, shadowColor, QPoint(0, 0)));
+ return Utils::dropShadow(QPixmap::fromImage(backgroundImage), 5, shadowColor, QPoint(0, 0));
+ } else {
+ painter.end();
+ if (sm_pDragPixmap) delete sm_pDragPixmap;
+ sm_pDragPixmap = new QPixmap(QPixmap::fromImage(backgroundImage));
+ return QPixmap::fromImage(backgroundImage);
+ }
+
+#if 0
+ QPixmap backgroundImage = DTabBar::createDragPixmapFromTab(index, option, hotspot);
+ if (sm_pDragPixmap) delete sm_pDragPixmap;
+ sm_pDragPixmap = new QPixmap(backgroundImage);
+ return backgroundImage;
+#endif
+}
+
+QMimeData *Tabbar::createMimeDataFromTab(int index, const QStyleOptionTab &option) const
+{
+ const QString tabName = textAt(index);
+
+ Window *window = static_cast(this->window());
+ EditWrapper *wrapper = window->wrapper(fileAt(index));
+
+ if (wrapper && wrapper->getFileLoading()) return nullptr;
+
+ QMimeData *mimeData = new QMimeData;
+ mimeData->setParent(window);
+
+ if (!wrapper) {
+ //m_tabbar->closeCurrentTab();
+ return nullptr;
+ }
+
+ mimeData->setProperty("wrapper", QVariant::fromValue(static_cast(wrapper)));
+ mimeData->setProperty("isModified", wrapper->isModified());
+ mimeData->setData("dedit/tabbar", tabName.toUtf8());
+ mimeData->removeFormat("text/plain");
+
+ return mimeData;
+}
+
+void Tabbar::insertFromMimeDataOnDragEnter(int index, const QMimeData *source)
+{
+ if (source == nullptr) {
+ return;
+ }
+
+ const QString tabName = QString::fromUtf8(source->data("dedit/tabbar"));
+ QVariant pVar = source->property("wrapper");
+ EditWrapper *wrapper = static_cast(pVar.value());
+
+ //大文本加载不允许拖拽
+ if (wrapper && (wrapper && wrapper->getFileLoading())) return;
+
+ Window *window = static_cast(this->window());
+
+ if (!wrapper) {
+ return;
+ }
+
+ window->addTabWithWrapper(wrapper, wrapper->textEditor()->getFilePath(), wrapper->textEditor()->getTruePath(), tabName, index);
+ //window->currentWrapper()->textEditor()->setModified(source->property("isModified").toBool());
+ wrapper->updateModifyStatus(source->property("isModified").toBool());
+ wrapper->OnUpdateHighlighter();
+ window->focusActiveEditor();
+}
+
+void Tabbar::insertFromMimeData(int index, const QMimeData *source)
+{
+ if (source == nullptr) {
+ return;
+ }
+
+ const QString tabName = QString::fromUtf8(source->data("dedit/tabbar"));
+ QVariant pVar = source->property("wrapper");
+ EditWrapper *wrapper = static_cast(pVar.value());
+ Window *window = static_cast(this->window());
+
+ if (!wrapper) {
+ return;
+ }
+
+ //qDebug() << "insertFromMimeData";
+ window->addTabWithWrapper(wrapper, wrapper->textEditor()->getFilePath(), wrapper->textEditor()->getTruePath(), tabName, index);
+ //window->currentWrapper()->textEditor()->setModified(source->property("isModified").toBool());
+ wrapper->updateModifyStatus(source->property("isModified").toBool());
+ wrapper->OnUpdateHighlighter();
+ window->focusActiveEditor();
+}
+
+bool Tabbar::canInsertFromMimeData(int index, const QMimeData *source) const
+{
+ return source->hasFormat("dedit/tabbar");
+}
+
+void Tabbar::handleDragActionChanged(Qt::DropAction action)
+{
+ // Reset cursor to Qt::ArrowCursor if drag tab to TextEditor widget.
+ if (action == Qt::IgnoreAction) {
+ if (dragIconWindow()) {
+ QGuiApplication::changeOverrideCursor(Qt::ArrowCursor);
+ DPlatformWindowHandle::setDisableWindowOverrideCursor(dragIconWindow(), true);
+ }
+ } else if (dragIconWindow()) {
+ DPlatformWindowHandle::setDisableWindowOverrideCursor(dragIconWindow(), false);
+ if (QGuiApplication::overrideCursor())
+ QGuiApplication::changeOverrideCursor(QGuiApplication::overrideCursor()->shape());
+ }
+}
+
+bool Tabbar::eventFilter(QObject *, QEvent *event)
+{
+
+ if (event->type() == QEvent::MouseButtonPress) {
+ QMouseEvent *mouseEvent = static_cast(event);
+
+ if (mouseEvent->button() == Qt::RightButton) {
+ QPoint position = mouseEvent->pos();
+ m_rightClickTab = this->tabAt(position);
+ int indexCount = this->count();
+
+// m_rightClickTab = -1;
+
+// for (int i = 0; i < count(); i++) {
+// if (tabRect(i).contains(position)) {
+// m_rightClickTab = i;
+// break;
+// }
+// }
+
+ // popup right menu on tab.
+ if (m_rightClickTab >= 0) {
+ m_rightMenu = new DMenu;
+ //m_rightMenu->setStyle(QStyleFactory::create("dlight"));
+
+ m_closeTabAction = new QAction(tr("Close tab"), this);
+ m_closeOtherTabAction = new QAction(tr("Close other tabs"), this);
+ m_moreWaysCloseMenu = new DMenu(tr("More options"), this);
+ m_closeLeftTabAction = new QAction(tr("Close tabs to the left"), this);
+ m_closeRightTabAction = new QAction(tr("Close tabs to the right"), this);
+ m_closeAllunModifiedTabAction = new QAction(tr("Close unmodified tabs"), this);
+
+ m_moreWaysCloseMenu->addAction(m_closeLeftTabAction);
+ m_moreWaysCloseMenu->addAction(m_closeRightTabAction);
+ m_moreWaysCloseMenu->addAction(m_closeAllunModifiedTabAction);
+
+ if (m_tabPaths.length() < 2) {
+ m_closeOtherTabAction->setEnabled(false);
+ m_closeLeftTabAction->setEnabled(false);
+ m_closeRightTabAction->setEnabled(false);
+ }
+
+ //优化tab菜单显示 梁卫东
+ if (m_rightClickTab == 0 && indexCount == 1) {
+ m_closeLeftTabAction->setEnabled(false);
+ m_closeRightTabAction->setEnabled(false);
+ } else if (m_rightClickTab == 0 && indexCount > 1) {
+ m_closeLeftTabAction->setEnabled(false);
+ m_closeRightTabAction->setEnabled(true);
+ } else if (m_rightClickTab == indexCount - 1 && indexCount == 1) {
+ m_closeLeftTabAction->setEnabled(false);
+ m_closeRightTabAction->setEnabled(false);
+ } else if (m_rightClickTab == indexCount - 1 && indexCount > 1) {
+ m_closeLeftTabAction->setEnabled(true);
+ m_closeRightTabAction->setEnabled(false);
+ } else {
+ m_closeLeftTabAction->setEnabled(true);
+ m_closeRightTabAction->setEnabled(true);
+ }
+
+ //showTabs();
+
+ connect(m_closeTabAction, &QAction::triggered, this, [ = ] {
+ Q_EMIT tabCloseRequested(m_rightClickTab);
+ });
+
+ connect(m_closeOtherTabAction, &QAction::triggered, this, [ = ] {
+ closeOtherTabsExceptFile(fileAt(m_rightClickTab));
+ });
+
+ connect(m_closeLeftTabAction, &QAction::triggered, this, [ = ] {
+ closeLeftTabs(fileAt(m_rightClickTab));
+// int currentIndex = DTabBar::currentIndex();
+// if(currentIndex>=0) {
+// for (int i=0;i=0){
+// for (int i=count;i>currentIndex;i--) {
+// closeTab(currentIndex+1);
+// }
+// }
+ });
+
+ connect(m_closeAllunModifiedTabAction, &QAction::triggered, this, [ = ] {
+ Window *window = static_cast(this->window());//确定在哪个窗口关闭
+// for (int i=0;iwrapper(m_tabPaths.value(i));
+// if (!wrapper->textEditor()->document()->isModified()){
+// closeTab(this->indexOf(m_tabPaths.value(i)));
+// }
+// }
+ for (auto path : m_tabPaths)
+ {
+ EditWrapper *wrapper = window->wrapper(path);//路径获取文件
+ if (!wrapper->isModified()) {
+ window->removeWrapper(path, true);
+ closeTab(this->indexOf(path));
+ }
+ }
+
+ });
+
+ m_rightMenu->addAction(m_closeTabAction);
+ m_rightMenu->addAction(m_closeOtherTabAction);
+ m_rightMenu->addMenu(m_moreWaysCloseMenu);
+ //yanyuhan 只有一个标签页时不显示更多方式关闭
+ if (m_tabPaths.size() > 1) {
+ m_moreWaysCloseMenu->setEnabled(true);
+ } else {
+ m_moreWaysCloseMenu->setEnabled(false);
+ }
+
+ m_rightMenu->exec(mapToGlobal(position));
+
+ return true;
+ }
+ }
+
+ } else if (event->type() == QEvent::DragEnter) {
+
+// if ((!e->source() || e->source()->parent() != this) &&
+// mimeData->hasFormat("dedit/tabbar")) {
+// static_cast(this->window())->changeTitlebarBackground(m_dndStartColor, m_dndEndColor);
+// }
+ } else if (event->type() == QEvent::DragLeave) {
+ } else if (event->type() == QEvent::Drop) {
+ } else if (event->type() == QEvent::DragMove) {
+ event->accept();
+ }
+
+ return false;
+}
+
+void Tabbar::mousePressEvent(QMouseEvent *e)
+{
+ if (e->button() == Qt::MidButton) {
+ emit tabCloseRequested(tabAt(QPoint(e->x(), e->y())));
+ }
+
+ DTabBar::mousePressEvent(e);
+}
+
+void Tabbar::dropEvent(QDropEvent *e)
+{
+ if (e->dropAction() == Qt::CopyAction && e->mimeData()->hasFormat("dedit/tabbar")) {
+ if (sm_pDragPixmap) {
+ QPoint cursorPos = QCursor::pos() - QPoint(sm_pDragPixmap->width() / 2, 20);
+ DLabel *pLabel = new DLabel();
+ pLabel->setWindowFlags(Qt::FramelessWindowHint);
+ pLabel->move(cursorPos);
+ pLabel->setPixmap(*sm_pDragPixmap);
+ pLabel->setMaximumSize(sm_pDragPixmap->size());
+ pLabel->show();
+
+ QRect startRect = QRect(cursorPos, sm_pDragPixmap->size());
+ QRect endRect = QRect(QCursor::pos(), QSize(0, 0));
+ QPropertyAnimation *geometry = new QPropertyAnimation(pLabel, "geometry");
+ connect(geometry, &QPropertyAnimation::finished, pLabel, &DLabel::deleteLater);
+ connect(geometry, &QPropertyAnimation::finished, geometry, &QPropertyAnimation::deleteLater);
+ geometry->setDuration(100);
+ geometry->setStartValue(startRect);
+ geometry->setEndValue(endRect);
+ geometry->setEasingCurve(QEasingCurve::InCubic);
+ geometry->start();
+ }
+ }
+
+ DTabBar::dropEvent(e);
+}
+
+QSize Tabbar::tabSizeHint(int index) const
+{
+
+ if (index >= 0) {
+ int total = this->width();
+
+ //计算每个tab平均宽度 返回 100到160
+ int aveargeWidth = 160;
+ aveargeWidth = total / DTabBar::count();
+
+ if (aveargeWidth >= 160) {
+ aveargeWidth = 160;
+ } else if (aveargeWidth <= 110) {
+ aveargeWidth = 110;
+ }
+
+ return QSize(aveargeWidth, 40);
+ }
+
+ return DTabBar::tabSizeHint(index);
+}
+
+QSize Tabbar::minimumTabSizeHint(int index) const
+{
+ Q_UNUSED(index)
+ return QSize(110, 40);
+}
+
+QSize Tabbar::maximumTabSizeHint(int index) const
+{
+ Q_UNUSED(index)
+ return QSize(160, 40);
+}
+
+void Tabbar::handleTabMoved(int fromIndex, int toIndex)
+{
+ //qDebug () << "handleTabMoved";
+ if (m_tabPaths.count() > fromIndex && m_tabPaths.count() > toIndex && fromIndex >= 0 && toIndex >= 0) {
+ m_tabPaths.swap(fromIndex, toIndex);
+ m_tabTruePaths.swap(fromIndex, toIndex);
+ }
+}
+
+void Tabbar::showTabs()
+{
+ int currentIndex = DTabBar::currentIndex();
+ if (currentIndex <= 0) {
+ m_closeLeftTabAction->setEnabled(false);
+ }
+ if (currentIndex >= DTabBar::count() - 1) {
+ m_closeRightTabAction->setEnabled(false);
+ }
+}
+
+void Tabbar::handleTabReleased(int index)
+{
+ if (index == -1) index = 0;
+ QString path = m_listOldTabPath.value(index);
+ if (path.isEmpty()) {
+ return;
+ }
+
+ int newIndex = m_tabPaths.indexOf(path);
+ const QString tabPath = fileAt(newIndex);
+ const QString tabName = textAt(newIndex);
+
+ Window *window = static_cast(this->window());
+ EditWrapper *wrapper = window->wrapper(tabPath);
+ if (!wrapper) {
+ return;
+ }
+
+ StartManager::instance()->createWindowFromWrapper(tabName, tabPath, wrapper->textEditor()->getTruePath(), wrapper, wrapper->isModified());
+
+ closeTab(newIndex);
+ // remove wrapper from window, not delete.
+ window->removeWrapper(tabPath, false);
+}
+
+void Tabbar::handleTabIsRemoved(int index)
+{
+ //qDebug() << "handleTabIsRemoved" << index;
+ const QString filePath = m_tabPaths.at(index);
+ Window *window = static_cast