├── .atom-build.yml ├── .bzrignore ├── .gitignore ├── CMakeLists.txt ├── Contributors.md ├── License.txt ├── ReadMe.md ├── circle.yml ├── cmake ├── FallbackVersion.cmake.in ├── FindGLibTools.cmake ├── FindGirCompiler.cmake ├── FindVala.cmake ├── Format.cmake ├── GLibHelpers.cmake ├── GObjectIntrospectionMacros.cmake ├── GResource.cmake ├── GResources.cmake ├── GSettings.cmake ├── GetGitRevisionDescription.cmake ├── GetGitRevisionDescription.cmake.in ├── GitVersion.cmake ├── ParseArguments.cmake ├── Tests.cmake ├── Translations.cmake ├── UseRPMTools.cmake ├── ValaPrecompile.cmake └── ValaVersion.cmake ├── data ├── CMakeLists.txt ├── im.konv.client.desktop.in.in ├── interfaces │ ├── components │ │ └── HeaderBar.ui │ ├── widgets │ │ ├── ContactListRow.ui │ │ ├── ContactPreview.ui │ │ └── WelcomeView.ui │ └── windows │ │ └── MainWindow.ui ├── konv.appdata.xml.in.in ├── konv.gresource.xml ├── pixmaps │ ├── left-arrow-dark.svg │ ├── left-arrow-white.svg │ ├── status │ │ ├── busy.png │ │ ├── busy_notification.png │ │ ├── idle.png │ │ ├── idle_notification.png │ │ ├── invisible.png │ │ ├── offline.png │ │ ├── offline_notification.png │ │ ├── online.png │ │ └── online_notification.png │ ├── tmp │ │ ├── avatar.png │ │ ├── bot.png │ │ ├── gun.png │ │ ├── kungfu-panda.jpg │ │ ├── lacrim.jpg │ │ ├── lil-wayne.jpg │ │ ├── ne-yo.jpg │ │ ├── rihanna.jpg │ │ ├── satan.jpg │ │ └── the-rock.jpg │ ├── tox-logo-256.png │ └── welcome-left-arrow.svg └── resources │ └── styles │ └── helpers.css ├── misc ├── build-linux.sh ├── format-style.sh ├── lint.rb └── screens │ ├── main-settings-dark-0.1.0.png │ ├── main-window-0.1.0.png │ └── main-window-menu-0.1.0.png ├── po ├── CMakeLists.txt ├── aa.po ├── ab.po ├── ae.po ├── af.po ├── ak.po ├── am.po ├── an.po ├── ar.po ├── as.po ├── ast.po ├── av.po ├── ay.po ├── az.po ├── ba.po ├── be.po ├── bg.po ├── bh.po ├── bi.po ├── bm.po ├── bn.po ├── bo.po ├── br.po ├── bs.po ├── ca.po ├── ce.po ├── ch.po ├── ckb.po ├── co.po ├── cr.po ├── cs.po ├── cu.po ├── cv.po ├── cy.po ├── da.po ├── de.po ├── dv.po ├── dz.po ├── ee.po ├── el.po ├── en_AU.po ├── en_CA.po ├── en_GB.po ├── eo.po ├── es.po ├── et.po ├── eu.po ├── fa.po ├── ff.po ├── fi.po ├── fj.po ├── fo.po ├── fr.po ├── fr_CA.po ├── fy.po ├── ga.po ├── gd.po ├── gl.po ├── gn.po ├── gu.po ├── gv.po ├── ha.po ├── he.po ├── hi.po ├── ho.po ├── hr.po ├── ht.po ├── hu.po ├── hy.po ├── hz.po ├── ia.po ├── id.po ├── ie.po ├── ig.po ├── ii.po ├── ik.po ├── io.po ├── is.po ├── it.po ├── iu.po ├── ja.po ├── jv.po ├── ka.po ├── kg.po ├── ki.po ├── kj.po ├── kk.po ├── kl.po ├── km.po ├── kn.po ├── ko.po ├── konv.pot ├── kr.po ├── ks.po ├── ku.po ├── kv.po ├── kw.po ├── ky.po ├── la.po ├── lb.po ├── lg.po ├── li.po ├── ln.po ├── lo.po ├── lt.po ├── lu.po ├── lv.po ├── mg.po ├── mh.po ├── mi.po ├── mk.po ├── ml.po ├── mn.po ├── mo.po ├── mr.po ├── ms.po ├── mt.po ├── my.po ├── na.po ├── nb.po ├── nd.po ├── ne.po ├── ng.po ├── nl.po ├── nn.po ├── no.po ├── nr.po ├── nv.po ├── ny.po ├── oc.po ├── oj.po ├── om.po ├── or.po ├── os.po ├── pa.po ├── pi.po ├── pl.po ├── ps.po ├── pt.po ├── pt_BR.po ├── qu.po ├── rm.po ├── rn.po ├── ro.po ├── ru.po ├── ru_RU.po ├── rue.po ├── rw.po ├── sa.po ├── sc.po ├── sd.po ├── se.po ├── sg.po ├── si.po ├── sk.po ├── sl.po ├── sm.po ├── sma.po ├── sn.po ├── so.po ├── sq.po ├── sr.po ├── ss.po ├── st.po ├── su.po ├── sv.po ├── sw.po ├── ta.po ├── te.po ├── tg.po ├── th.po ├── ti.po ├── tk.po ├── tl.po ├── tn.po ├── to.po ├── tr.po ├── ts.po ├── tt.po ├── tw.po ├── ty.po ├── ug.po ├── uk.po ├── ur.po ├── uz.po ├── ve.po ├── vi.po ├── vo.po ├── wa.po ├── wo.po ├── xh.po ├── yi.po ├── yo.po ├── za.po ├── zh.po ├── zh_CN.po ├── zh_HK.po ├── zh_TW.po └── zu.po ├── poulp.toml └── src ├── CMakeLists.txt ├── Config.vala.in ├── Konv.vala ├── core └── ToxSession.vala ├── gui ├── components │ ├── HeaderBar.vala │ ├── SettingsListBox.vala │ ├── TabContainer.vala │ └── TabNavbar.vala ├── widgets │ ├── AvatarWidget.vala │ ├── BaseView.vala │ ├── ContactListRow.vala │ ├── ContactPreview.vala │ ├── ViewStack.vala │ └── WelcomeView.vala └── windows │ ├── MainWindow.vala │ └── SettingsWindow.vala ├── pthread └── pthread.h ├── utils └── RoundImage.vala └── vapis ├── libtoxav.deps ├── libtoxav.vapi ├── libtoxcore.vapi ├── libtoxencryptsave.deps └── libtoxencryptsave.vapi /.atom-build.yml: -------------------------------------------------------------------------------- 1 | name: "Build & run" 2 | cmd: cd build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make && LANG=C ./src/konv 3 | sh: true 4 | errorMatch: (?[\\/0-9a-zA-Z\\._]+):(?\\d+)\.(?\\d+)\-(?\\d+)\.(?\\d+):\\s+(?.+) 5 | 6 | # MainWindow.vala:127.33-127.33: error: syntax error, expected identifier 7 | -------------------------------------------------------------------------------- /.bzrignore: -------------------------------------------------------------------------------- 1 | # Build files. 2 | build/* 3 | build-*/* 4 | .buildconfig 5 | *.proj 6 | .tags 7 | 8 | # Glade temp files. 9 | *.ui~ 10 | *.ui# 11 | *.vala~ 12 | *~ 13 | 14 | # AStyle orig files. 15 | *.orig 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Build files. 2 | build/* 3 | build-*/* 4 | .buildconfig 5 | *.proj 6 | .tags 7 | 8 | # Glade temp files. 9 | *.ui~ 10 | *.ui# 11 | *.vala~ 12 | *~ 13 | 14 | # AStyle orig files. 15 | *.orig 16 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright (c) 2017 SkyzohKey 3 | # 4 | # MIT License 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining 7 | # a copy of this software and associated documentation files (the 8 | # "Software"), to deal in the Software without restriction, including 9 | # without limitation the rights to use, copy, modify, merge, publish, 10 | # distribute, sublicense, and/or sell copies of the Software, and to 11 | # permit persons to whom the Software is furnished to do so, subject to 12 | # the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be 15 | # included in all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | ## 25 | 26 | # Project name. 27 | project (konv C) 28 | 29 | # CMake Minimum version allowed. 30 | cmake_minimum_required (VERSION 2.6) 31 | 32 | # Tell CMake where it can find modules. 33 | list (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") 34 | list (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/src") 35 | 36 | # Let's define some useful vars. 37 | set (DATADIR "${CMAKE_INSTALL_PREFIX}/share") 38 | set (PKGDIR "${DATADIR}/${PROJECT_NAME}") 39 | set (GETTEXT_PACKAGE "${CMAKE_PROJECT_NAME}") 40 | set (GETTEXT_PATH "${CMAKE_INSTALL_PREFIX}/share/locale") 41 | #set (GETTEXT_PATH "${CMAKE_BINARY_DIR}/po") 42 | 43 | set (EXEC_NAME "${PROJECT_NAME}") 44 | set (APP_NAME "Konv") 45 | set (DESKTOP_ICON "tox") 46 | set (RELEASE_NAME "Secure P2P instant messenger") 47 | set (VERSION "0.1.0") 48 | set (VERSION_INFO "looneypig") 49 | 50 | add_definitions (-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\") 51 | 52 | # Load PkgConfig. 53 | find_package (PkgConfig) 54 | 55 | # Check for the package Konv needs to compile/run. 56 | pkg_check_modules (DEPS REQUIRED 57 | gtk+-3.0 58 | json-glib-1.0 59 | libtoxcore 60 | #libtoxencryptsave 61 | #libsoup-2.4 62 | ) 63 | 64 | add_definitions (${DEPS_CFLAGS}) 65 | link_libraries (${DEPS_LIBRARIES}) 66 | link_directories (${DEPS_LIBRARY_DIRS}) 67 | 68 | # Make sure we have Valac before. 69 | find_package (Vala REQUIRED) 70 | include (ValaVersion) 71 | ensure_vala_version ("0.30" MINIMUM) 72 | include (ValaPrecompile) 73 | 74 | add_subdirectory ("data") 75 | add_subdirectory ("po") 76 | add_subdirectory ("src") 77 | 78 | # Install the .desktop file. 79 | install (FILES ${CMAKE_BINARY_DIR}/data/im.konv.client.desktop DESTINATION ${DATADIR}/applications/) 80 | -------------------------------------------------------------------------------- /Contributors.md: -------------------------------------------------------------------------------- 1 | # Konv.im Contributors 2 | 3 | ## Author/Maintainer 4 | - SkyzohKey - « A developer is a machine that converts 5 | coffee into quality code. » 6 | 7 | ## Contributors 8 | Looks like there are no contributors yet, feel free to [open a pull-request], 9 | if it gets merged, your name will appears here! :) 10 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © 2017 SkyzohKey 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the “Software”), to deal in 7 | the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is furnished 10 | to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 18 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 19 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | # /!\ Disclaimer: Project moved to a new repository /!\ 2 | 3 | *tl;dr. Project moved at [TheToxProject/client](https://github.com/TheToxProject/client).* 4 | 5 | Hey dear community! 6 | 7 | A lot of people have asked me about the state of Ricin & Konv projects, so let me clarify the situation. 8 | 9 | Ricin was mostly a "proof of concept" that permited me to learn to code in Vala. Once I was enough confident in developing with Vala, I realised that Ricin's source code was a shit-code. Nightmare to maintain, hard to update. So I decided to rewrite/rebrand it under the Konv project-name. I worked on Konv during some time before I had a vision. 10 | 11 | So let's talk about that vision. I dreamed people would just download Tox, and start to chat, without missing important IM features, nor security features. I dreamed that Tox would replace Skype, Messenger, Whatsapp and other IM apps, because it's decentralized, and would be looking good, with features parity with other IMs + gamification. User would see & use the same interface not depending on the device he is using. Whether it's desktop, mobile or web browser. 12 | 13 | The Universal Tox Client is my attempt to realize this. 14 | You can find the new repository at [TheToxProject/client](https://github.com/TheToxProject/client). 15 | 16 | Also feel free to look at the contribute or donations part of the readme if you want to get involved ! :) 17 | 18 | I hope I clarified the situation enough. 19 | Thanks for the interest. 20 | 21 | ---- 22 | 23 | # Konv.im - Secure P2P instant messenger 24 | 25 | | [![CircleCI][3]][2] | [![Make a donation on Liberapay][5]][6] | 26 | |:-------------:|:-------------:| 27 | | **[Install Konv][7]** | [Help us translating Konv][4] | 28 | 29 | 30 | 31 | [Konv.im] is an open-source, libre and secure instant messaging application that 32 | aims to replace Skype, Whatsapp, and other proprietary services. I believe that 33 | bringing a free (as in freedom, aswell as in price) software that enable 34 | individuals to communicate freely, without the fear to be censored or sued, is 35 | primordial in this post-Snowden era. Free speech enables **real** sharing of 36 | ideas, concepts, researchs, etc. That's how I want to contribute saving what 37 | stays of people liberties and rights. 38 | 39 | | [![A screenshot of Konv's MainWindow + SettingsWindow running 0.1.0-looneypig](https://a.doko.moe/pjrjbp.png)](https://a.doko.moe/jsfcgo.ogv) | 40 | |:--:| 41 | | Click the screenshot to see the **preview** video. | 42 | 43 | ## Features 44 | 45 | Here is a tentative list of the features that Konv.im must have in order to be 46 | usable and useful. The list is **not** ordered nor complete. This list also 47 | serves as a sort of Roadmap for me. 48 | 49 | - [ ] Usable, bug-free and user-friendly interface ; 50 | - [ ] Modern way to communicate with contacts (messages, actions, auto-reply) ; 51 | - [ ] File transfers : Inline images, inline musics, inline videos, regular 52 | files, avatars ; 53 | - [ ] Simple and convenient way to share a contact (drag&drop, right click) ; 54 | - [ ] Customizable interface ; 55 | - [x] Intuitive and not cluttered settings interface (advanced mode?) ; 56 | - [ ] Group chats, with simple way to add people inside ; 57 | - [ ] Avatars, status messages, presence ; 58 | - [ ] Audio calls, video calls, desktop sharing/streaming ; 59 | - [ ] Secure way to add peoples from an user-friendly ID (no ToxID, 60 | decentralized ToxMe-like) ; 61 | - [ ] Custom bootstrap nodes list. 62 | - [x] Social welcome screen. 63 | 64 | ## Protocol 65 | 66 | Konv.im is an instant messaging application that uses [the Tox protocol] in 67 | order to enable truely secure communications. By so, it can be called a [Tox 68 | client]. 69 | 70 | ToxCore (the Tox core library) provides an easy and intuitive API for building 71 | secure communication platforms. It is maintained by [The TokTok Project]. 72 | 73 | I'm using [TokTok/c-toxcore] instead of the old [irungentoo/toxcore] library for convenience and 74 | security related concerns. 75 | 76 | ## Install 77 | 78 | You can run and install Konv with a few lines, just type the following in a 79 | shell 80 | 81 | ```bash 82 | # Download it! 83 | $ git clone https://github.com/SkyzohKey/Konv.git && cd Konv 84 | 85 | # Build it! 86 | $ mkdir build && cd build 87 | $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr 88 | $ make 89 | 90 | # [Optional] If you want to install it system-wide 91 | $ sudo make install 92 | ``` 93 | 94 | ## License 95 | 96 | Konv.im is released under [The MIT License] while the ToxCore binaries are 97 | licensed under [The GPLv3 License]. 98 | 99 | 100 | [Konv.im]: https://konv.im 101 | [the Tox protocol]: https://tox.chat 102 | [Tox client]: https://tox.chat/clients.html 103 | [The TokTok Project]: https://toktok.ltd 104 | [TokTok/c-toxcore]: https://github.com/TokTok/c-toxcore 105 | [irungentoo/toxcore]: https://github.com/irungentoo/toxcore 106 | [The MIT License]: License.txt 107 | [The GPLv3 License]: https://github.com/TokTok/c-toxcore/blob/master/COPYING 108 | 109 | [1]: https://chat.konv.im 110 | [2]: https://circleci.com/gh/SkyzohKey/Konv 111 | [3]: https://circleci.com/gh/SkyzohKey/Konv.svg?style=svg 112 | [4]: https://www.transifex.com/ricinapp/im-konv-client/ 113 | [5]: https://liberapay.com/assets/widgets/donate.svg 114 | [6]: https://liberapay.com/SkyzohKey/donate 115 | [7]: #install 116 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | pre: 3 | - ./misc/build-linux.sh --deps 4 | 5 | compile: 6 | override: 7 | - ./misc/build-linux.sh --build 8 | 9 | test: 10 | override: 11 | - ruby ./misc/lint.rb 12 | -------------------------------------------------------------------------------- /cmake/FallbackVersion.cmake.in: -------------------------------------------------------------------------------- 1 | set(VERSION @VERSION_GIT@) 2 | set(VERSION_MAJOR @GIT_VERSION_MAJOR@) 3 | set(VERSION_MINOR @GIT_VERSION_MINOR@) 4 | set(VERSION_PATCH @GIT_VERSION_PATCH@) 5 | -------------------------------------------------------------------------------- /cmake/FindGLibTools.cmake: -------------------------------------------------------------------------------- 1 | 2 | FIND_PROGRAM(GLIB-GENMARSHAL_EXECUTABLE NAMES glib-genmarshal) 3 | 4 | FIND_PROGRAM(GLIB-MKENUMS_EXECUTABLE NAMES glib-mkenums) 5 | 6 | FIND_PROGRAM(GDBUS-CODEGEN_EXECUTABLE NAMES gdbus-codegen) 7 | 8 | # handle the QUIETLY and REQUIRED arguments and set GLIB-MKENUMS_FOUND to TRUE if 9 | # all listed variables are TRUE 10 | INCLUDE(FindPackageHandleStandardArgs) 11 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLibTools 12 | REQUIRED_VARS GLIB-MKENUMS_EXECUTABLE GLIB-GENMARSHAL_EXECUTABLE 13 | GDBUS-CODEGEN_EXECUTABLE) -------------------------------------------------------------------------------- /cmake/FindGirCompiler.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2010 Jakob Westhoff. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # 1. Redistributions of source code must retain the above copyright notice, 8 | # this list of conditions and the following disclaimer. 9 | # 10 | # 2. Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR 15 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 16 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 17 | # EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 21 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 22 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | # 25 | # The views and conclusions contained in the software and documentation are those 26 | # of the authors and should not be interpreted as representing official policies, 27 | # either expressed or implied, of Jakob Westhoff 28 | ## 29 | 30 | ## 31 | # Find module for the Gir compiler (g-ir-compiler) 32 | # 33 | # This module determines wheter a Gir compiler is installed on the current 34 | # system and where its executable is. 35 | # 36 | # Call the module using "find_package(GirCompiler) from within your CMakeLists.txt. 37 | # 38 | # The following variables will be set after an invocation: 39 | # 40 | # G_IR_COMPILER_FOUND Whether the g-ir-compiler compiler has been found or not 41 | # G_IR_COMPILER_EXECUTABLE Full path to the g-ir-compiler executable if it has been found 42 | ## 43 | 44 | 45 | # Search for the g-ir-compiler executable in the usual system paths. 46 | find_program (G_IR_COMPILER_EXECUTABLE 47 | NAMES g-ir-compiler) 48 | 49 | # Handle the QUIETLY and REQUIRED arguments, which may be given to the find call. 50 | # Furthermore set G_IR_COMPILER_FOUND to TRUE if the g-ir-compiler has been found (aka. 51 | # G_IR_COMPILER_EXECUTABLE is set) 52 | 53 | include (FindPackageHandleStandardArgs) 54 | find_package_handle_standard_args (GirCompiler DEFAULT_MSG G_IR_COMPILER_EXECUTABLE) 55 | 56 | mark_as_advanced (G_IR_COMPILER_EXECUTABLE) 57 | -------------------------------------------------------------------------------- /cmake/FindVala.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2010 Jakob Westhoff. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # 1. Redistributions of source code must retain the above copyright notice, 8 | # this list of conditions and the following disclaimer. 9 | # 10 | # 2. Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR 15 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 16 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 17 | # EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 21 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 22 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | # 25 | # The views and conclusions contained in the software and documentation are those 26 | # of the authors and should not be interpreted as representing official policies, 27 | # either expressed or implied, of Jakob Westhoff 28 | ## 29 | 30 | ## 31 | # Find module for the Vala compiler (valac) 32 | # 33 | # This module determines wheter a Vala compiler is installed on the current 34 | # system and where its executable is. 35 | # 36 | # Call the module using "find_package(Vala) from within your CMakeLists.txt. 37 | # 38 | # The following variables will be set after an invocation: 39 | # 40 | # VALA_FOUND Whether the vala compiler has been found or not 41 | # VALA_EXECUTABLE Full path to the valac executable if it has been found 42 | # VALA_VERSION Version number of the available valac 43 | ## 44 | 45 | 46 | # Search for the valac executable in the usual system paths. 47 | find_program(VALA_EXECUTABLE 48 | NAMES valac valac-0.28 valac-0.26 valac-0.24) 49 | 50 | # Handle the QUIETLY and REQUIRED arguments, which may be given to the find call. 51 | # Furthermore set VALA_FOUND to TRUE if Vala has been found (aka. 52 | # VALA_EXECUTABLE is set) 53 | 54 | include(FindPackageHandleStandardArgs) 55 | find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE) 56 | 57 | mark_as_advanced(VALA_EXECUTABLE) 58 | 59 | # Determine the valac version 60 | if(VALA_FOUND) 61 | execute_process(COMMAND ${VALA_EXECUTABLE} "--version" 62 | OUTPUT_VARIABLE "VALA_VERSION") 63 | string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION}) 64 | string(STRIP ${VALA_VERSION} "VALA_VERSION") 65 | endif(VALA_FOUND) 66 | -------------------------------------------------------------------------------- /cmake/Format.cmake: -------------------------------------------------------------------------------- 1 | # additional target to perform clang-format run, requires clang-format 2 | 3 | # get all project files 4 | file(GLOB_RECURSE ALL_SOURCE_FILES *.c *.h) 5 | add_custom_target( 6 | clangformat 7 | COMMAND /usr/bin/clang-format 8 | -style=file 9 | -i 10 | ${ALL_SOURCE_FILES} 11 | ) 12 | 13 | -------------------------------------------------------------------------------- /cmake/GLibHelpers.cmake: -------------------------------------------------------------------------------- 1 | macro(add_glib_marshal outsources outincludes name prefix) 2 | find_package(GLibTools REQUIRED) 3 | add_custom_command( 4 | OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" 5 | COMMAND ${GLIB-GENMARSHAL_EXECUTABLE} --header "--prefix=${prefix}" 6 | "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list" 7 | > "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" 8 | DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list" 9 | ) 10 | add_custom_command( 11 | OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.c" 12 | COMMAND ${GLIB-GENMARSHAL_EXECUTABLE} --body "--prefix=${prefix}" 13 | "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list" 14 | > "${CMAKE_CURRENT_BINARY_DIR}/${name}.c" 15 | DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list" 16 | "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" 17 | ) 18 | list(APPEND ${outsources} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c") 19 | list(APPEND ${outincludes} "${CMAKE_CURRENT_BINARY_DIR}/${name}.h") 20 | endmacro(add_glib_marshal) 21 | 22 | macro(add_glib_enumtypes outsources outheaders name) 23 | set(files ${ARGN}) 24 | add_custom_command( 25 | OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" 26 | COMMAND ${GLIB-MKENUMS_EXECUTABLE} ARGS --template ${name}".h.template" 27 | ${files} 28 | > "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" 29 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 30 | DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.h.template" 31 | ${files} 32 | ) 33 | add_custom_command( 34 | OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.c" 35 | COMMAND ${GLIB-MKENUMS_EXECUTABLE} ARGS --template ${name}".c.template" 36 | ${files} 37 | > "${CMAKE_CURRENT_BINARY_DIR}/${name}.c" 38 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 39 | DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.c.template" 40 | ${files} 41 | ) 42 | list(APPEND ${outsources} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c") 43 | list(APPEND ${outheaders} "${CMAKE_CURRENT_BINARY_DIR}/${name}.h") 44 | endmacro(add_glib_enumtypes) 45 | 46 | -------------------------------------------------------------------------------- /cmake/GObjectIntrospectionMacros.cmake: -------------------------------------------------------------------------------- 1 | macro(add_target_gir TARGET_NAME GIR_NAME HEADER CFLAGS GRANITE_VERSION) 2 | set(PACKAGES "") 3 | foreach(PKG ${ARGN}) 4 | set(PACKAGES ${PACKAGES} --include=${PKG}) 5 | endforeach() 6 | install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\") 7 | execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME} 8 | --quiet 9 | --library ${TARGET_NAME} ${PACKAGES} 10 | -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir 11 | -L${CMAKE_CURRENT_BINARY_DIR} 12 | --nsversion=${GRANITE_VERSION} ${HEADER})") 13 | install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)") 14 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/ COMPONENT ${ARGV5}) 15 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/ COMPONENT ${ARGV5}) 16 | endmacro() 17 | 18 | macro(add_target_gir_with_executable TARGET_NAME EXE_NAME GIR_NAME HEADER EXE_HEADER CFLAGS GRANITE_VERSION) 19 | set(PACKAGES "") 20 | foreach(PKG ${ARGN}) 21 | set(PACKAGES ${PACKAGES} --include=${PKG}) 22 | endforeach() 23 | install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\") 24 | execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME} 25 | --quiet 26 | --library ${TARGET_NAME} --program ${EXE_NAME} ${PACKAGES} 27 | -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir 28 | -L${CMAKE_CURRENT_BINARY_DIR} 29 | -I${CMAKE_CURRENT_BINARY_DIR} 30 | --nsversion=${GRANITE_VERSION} ${HEADER} ${EXE_HEADER})") 31 | install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)") 32 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/ COMPONENT ${ARGV5}) 33 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/ COMPONENT ${ARGV5}) 34 | endmacro() 35 | -------------------------------------------------------------------------------- /cmake/GResource.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013 Venom authors and contributors 3 | # 4 | # This file is part of Venom. 5 | # 6 | # Venom is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # Venom is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with Venom. If not, see . 18 | # 19 | 20 | FIND_PROGRAM(GLIB_COMPILE_RESOURCES_EXECUTABLE NAMES glib-compile-resources) 21 | MARK_AS_ADVANCED(GLIB_COMPILE_RESOURCES_EXECUTABLE) 22 | 23 | INCLUDE(CMakeParseArguments) 24 | 25 | FUNCTION(GLIB_COMPILE_RESOURCES output) 26 | CMAKE_PARSE_ARGUMENTS(ARGS "" "SOURCE" ${ARGN}) 27 | SET(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 28 | SET(out_files "") 29 | 30 | FOREACH(src ${ARGS_SOURCE} ${ARGS_UNPARSED_ARGUMENTS}) 31 | SET(in_file "${CMAKE_CURRENT_SOURCE_DIR}/${src}") 32 | GET_FILENAME_COMPONENT(WORKING_DIR ${in_file} PATH) 33 | STRING(REPLACE ".xml" ".c" src ${src}) 34 | SET(out_file "${DIRECTORY}/${src}") 35 | GET_FILENAME_COMPONENT(OUPUT_DIR ${out_file} PATH) 36 | FILE(MAKE_DIRECTORY ${OUPUT_DIR}) 37 | LIST(APPEND out_files "${DIRECTORY}/${src}") 38 | 39 | #FIXME implicit depends currently not working 40 | EXECUTE_PROCESS( 41 | COMMAND 42 | ${GLIB_COMPILE_RESOURCES_EXECUTABLE} 43 | "--generate-dependencies" 44 | ${in_file} 45 | WORKING_DIRECTORY ${WORKING_DIR} 46 | OUTPUT_VARIABLE in_file_dep 47 | ) 48 | STRING(REGEX REPLACE "(\r?\n)" ";" in_file_dep "${in_file_dep}") 49 | SET(in_file_dep_path "") 50 | FOREACH(dep ${in_file_dep}) 51 | LIST(APPEND in_file_dep_path "${WORKING_DIR}/${dep}") 52 | ENDFOREACH(dep ${in_file_dep}) 53 | ADD_CUSTOM_COMMAND( 54 | OUTPUT ${out_file} 55 | WORKING_DIRECTORY ${WORKING_DIR} 56 | COMMAND 57 | ${GLIB_COMPILE_RESOURCES_EXECUTABLE} 58 | ARGS 59 | "--generate-source" 60 | "--target=${out_file}" 61 | ${in_file} 62 | DEPENDS 63 | ${in_file};${in_file_dep_path} 64 | ) 65 | ENDFOREACH(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS}) 66 | SET(${output} ${out_files} PARENT_SCOPE) 67 | ENDFUNCTION(GLIB_COMPILE_RESOURCES) 68 | -------------------------------------------------------------------------------- /cmake/GResources.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2013 Venom authors and contributors 3 | # 4 | # This file is part of Venom. 5 | # 6 | # Venom is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # Venom is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU General Public License 17 | # along with Venom. If not, see . 18 | # 19 | 20 | FIND_PROGRAM(GLIB_COMPILE_RESOURCES_EXECUTABLE NAMES glib-compile-resources) 21 | MARK_AS_ADVANCED(GLIB_COMPILE_RESOURCES_EXECUTABLE) 22 | 23 | INCLUDE(CMakeParseArguments) 24 | 25 | FUNCTION(GLIB_COMPILE_RESOURCES output) 26 | CMAKE_PARSE_ARGUMENTS(ARGS "" "SOURCE" "" ${ARGN}) 27 | SET(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) 28 | SET(out_files "") 29 | 30 | FOREACH(src ${ARGS_SOURCE} ${ARGS_UNPARSED_ARGUMENTS}) 31 | SET(in_file "${CMAKE_CURRENT_SOURCE_DIR}/${src}") 32 | GET_FILENAME_COMPONENT(WORKING_DIR ${in_file} PATH) 33 | STRING(REPLACE ".xml" ".c" src ${src}) 34 | SET(out_file "${DIRECTORY}/${src}") 35 | GET_FILENAME_COMPONENT(OUPUT_DIR ${out_file} PATH) 36 | FILE(MAKE_DIRECTORY ${OUPUT_DIR}) 37 | LIST(APPEND out_files "${DIRECTORY}/${src}") 38 | 39 | #FIXME implicit depends currently not working 40 | EXECUTE_PROCESS( 41 | COMMAND 42 | ${GLIB_COMPILE_RESOURCES_EXECUTABLE} 43 | "--generate-dependencies" 44 | ${in_file} 45 | WORKING_DIRECTORY ${WORKING_DIR} 46 | OUTPUT_VARIABLE in_file_dep 47 | ) 48 | STRING(REGEX REPLACE "(\r?\n)" ";" in_file_dep "${in_file_dep}") 49 | SET(in_file_dep_path "") 50 | FOREACH(dep ${in_file_dep}) 51 | LIST(APPEND in_file_dep_path "${WORKING_DIR}/${dep}") 52 | ENDFOREACH(dep ${in_file_dep}) 53 | ADD_CUSTOM_COMMAND( 54 | OUTPUT ${out_file} 55 | WORKING_DIRECTORY ${WORKING_DIR} 56 | COMMAND 57 | ${GLIB_COMPILE_RESOURCES_EXECUTABLE} 58 | ARGS 59 | "--generate-source" 60 | "--target=${out_file}" 61 | ${in_file} 62 | DEPENDS 63 | ${in_file};${in_file_dep_path} 64 | ) 65 | ENDFOREACH(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS}) 66 | SET(${output} ${out_files} PARENT_SCOPE) 67 | ENDFUNCTION(GLIB_COMPILE_RESOURCES) 68 | -------------------------------------------------------------------------------- /cmake/GSettings.cmake: -------------------------------------------------------------------------------- 1 | # GSettings.cmake, CMake macros written for Marlin, feel free to re-use them. 2 | 3 | option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" ON) 4 | 5 | option (GSETTINGS_COMPILE "Compile GSettings Schemas after installation" ${GSETTINGS_LOCALINSTALL}) 6 | 7 | if(GSETTINGS_LOCALINSTALL) 8 | message(STATUS "GSettings schemas will be installed locally.") 9 | endif() 10 | 11 | if(GSETTINGS_COMPILE) 12 | message(STATUS "GSettings schemas will be compiled.") 13 | endif() 14 | 15 | macro(add_schema SCHEMA_NAME) 16 | 17 | set(PKG_CONFIG_EXECUTABLE pkg-config) 18 | # Have an option to not install the schema into where GLib is 19 | SET (GSETTINGS_DIR "${CMAKE_INSTALL_DATAROOTDIR}/glib-2.0/schemas/") 20 | if (GSETTINGS_LOCALINSTALL) 21 | SET (GSETTINGS_PREFIX "${CMAKE_INSTALL_PREFIX}") 22 | else (GSETTINGS_LOCALINSTALL) 23 | execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE) 24 | SET (GSETTINGS_PREFIX "${_glib_prefix}/share/glib-2.0/schemas/") 25 | endif (GSETTINGS_LOCALINSTALL) 26 | 27 | # Run the validator and error if it fails 28 | execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE) 29 | execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE) 30 | 31 | if (_schemas_invalid) 32 | message (SEND_ERROR "Schema validation error: ${_schemas_invalid}") 33 | endif (_schemas_invalid) 34 | 35 | # Actually install and recomple schemas 36 | message (STATUS "GSettings schemas will be installed into ${GSETTINGS_PREFIX}/${GSETTINGS_DIR}") 37 | install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} COMPONENT ${ARGV1} OPTIONAL) 38 | 39 | if (GSETTINGS_COMPILE) 40 | install (CODE "message (STATUS \"Compiling GSettings schemas\")") 41 | install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_PREFIX}/${GSETTINGS_DIR})") 42 | endif () 43 | endmacro() 44 | -------------------------------------------------------------------------------- /cmake/GetGitRevisionDescription.cmake: -------------------------------------------------------------------------------- 1 | # - Returns a version string from Git 2 | # 3 | # These functions force a re-configure on each git commit so that you can 4 | # trust the values of the variables in your build system. 5 | # 6 | # get_git_head_revision( [ ...]) 7 | # 8 | # Returns the refspec and sha hash of the current head revision 9 | # 10 | # git_describe( [ ...]) 11 | # 12 | # Returns the results of git describe on the source tree, and adjusting 13 | # the output so that it tests false if an error occurs. 14 | # 15 | # git_get_exact_tag( [ ...]) 16 | # 17 | # Returns the results of git describe --exact-match on the source tree, 18 | # and adjusting the output so that it tests false if there was no exact 19 | # matching tag. 20 | # 21 | # Requires CMake 2.6 or newer (uses the 'function' command) 22 | # 23 | # Original Author: 24 | # 2009-2010 Ryan Pavlik 25 | # http://academic.cleardefinition.com 26 | # Iowa State University HCI Graduate Program/VRAC 27 | # 28 | # Copyright Iowa State University 2009-2010. 29 | # Distributed under the Boost Software License, Version 1.0. 30 | # (See accompanying file LICENSE_1_0.txt or copy at 31 | # http://www.boost.org/LICENSE_1_0.txt) 32 | 33 | if(__get_git_revision_description) 34 | return() 35 | endif() 36 | set(__get_git_revision_description YES) 37 | 38 | # We must run the following at "include" time, not at function call time, 39 | # to find the path to this module rather than the path to a calling list file 40 | get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) 41 | 42 | function(get_git_head_revision _refspecvar _hashvar) 43 | set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") 44 | set(GIT_DIR "${GIT_PARENT_DIR}/.git") 45 | while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories 46 | set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") 47 | get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) 48 | if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) 49 | # We have reached the root directory, we are not in git 50 | set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) 51 | set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) 52 | return() 53 | endif() 54 | set(GIT_DIR "${GIT_PARENT_DIR}/.git") 55 | endwhile() 56 | # check if this is a submodule 57 | if(NOT IS_DIRECTORY ${GIT_DIR}) 58 | file(READ ${GIT_DIR} submodule) 59 | string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule}) 60 | get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) 61 | get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE) 62 | endif() 63 | set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") 64 | if(NOT EXISTS "${GIT_DATA}") 65 | file(MAKE_DIRECTORY "${GIT_DATA}") 66 | endif() 67 | 68 | if(NOT EXISTS "${GIT_DIR}/HEAD") 69 | return() 70 | endif() 71 | set(HEAD_FILE "${GIT_DATA}/HEAD") 72 | configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) 73 | 74 | configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" 75 | "${GIT_DATA}/grabRef.cmake" 76 | @ONLY) 77 | include("${GIT_DATA}/grabRef.cmake") 78 | 79 | set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) 80 | set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) 81 | endfunction() 82 | 83 | function(git_describe _var) 84 | if(NOT GIT_FOUND) 85 | find_package(Git QUIET) 86 | endif() 87 | get_git_head_revision(refspec hash) 88 | if(NOT GIT_FOUND) 89 | set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) 90 | return() 91 | endif() 92 | if(NOT hash) 93 | set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) 94 | return() 95 | endif() 96 | 97 | # TODO sanitize 98 | #if((${ARGN}" MATCHES "&&") OR 99 | # (ARGN MATCHES "||") OR 100 | # (ARGN MATCHES "\\;")) 101 | # message("Please report the following error to the project!") 102 | # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") 103 | #endif() 104 | 105 | #message(STATUS "Arguments to execute_process: ${ARGN}") 106 | 107 | execute_process(COMMAND 108 | "${GIT_EXECUTABLE}" 109 | describe 110 | ${hash} 111 | ${ARGN} 112 | WORKING_DIRECTORY 113 | "${CMAKE_SOURCE_DIR}" 114 | RESULT_VARIABLE 115 | res 116 | OUTPUT_VARIABLE 117 | out 118 | ERROR_QUIET 119 | OUTPUT_STRIP_TRAILING_WHITESPACE) 120 | if(NOT res EQUAL 0) 121 | set(out "${out}-${res}-NOTFOUND") 122 | endif() 123 | 124 | set(${_var} "${out}" PARENT_SCOPE) 125 | endfunction() 126 | 127 | function(git_get_exact_tag _var) 128 | git_describe(out --exact-match ${ARGN}) 129 | set(${_var} "${out}" PARENT_SCOPE) 130 | endfunction() 131 | -------------------------------------------------------------------------------- /cmake/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | if(HEAD_CONTENTS MATCHES "ref") 22 | # named branch 23 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 24 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 25 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 26 | else() 27 | configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) 28 | file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) 29 | if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") 30 | set(HEAD_HASH "${CMAKE_MATCH_1}") 31 | endif() 32 | endif() 33 | else() 34 | # detached HEAD 35 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 36 | endif() 37 | 38 | if(NOT HEAD_HASH) 39 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 40 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 41 | endif() 42 | -------------------------------------------------------------------------------- /cmake/GitVersion.cmake: -------------------------------------------------------------------------------- 1 | macro(determine_fallback_version CMAKE_VERSION_MODULE_PATH) 2 | if(EXISTS ${CMAKE_SOURCE_DIR}/.git) 3 | # 4 | # Make a version containing the current version from git. 5 | # 6 | 7 | include(GetGitRevisionDescription) 8 | git_describe(VERSION_LONG --tags) 9 | 10 | #parse the version information into pieces. 11 | string(REGEX REPLACE "^v*([0-9]+)\\..*" "\\1" GIT_VERSION_MAJOR "${VERSION_LONG}") 12 | string(REGEX REPLACE "^v*[0-9]+\\.([0-9]+).*" "\\1" GIT_VERSION_MINOR "${VERSION_LONG}") 13 | string(REGEX REPLACE "^v*[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" GIT_VERSION_PATCH "${VERSION_LONG}") 14 | string(REGEX REPLACE "^v*[0-9]+\\.[0-9]+\\.[0-9]+(.*)" "\\1" GIT_VERSION_SHA1 "${VERSION_LONG}") 15 | set(VERSION_GIT "${GIT_VERSION_MAJOR}.${GIT_VERSION_MINOR}.${GIT_VERSION_PATCH}") 16 | configure_file(${CMAKE_VERSION_MODULE_PATH}/FallbackVersion.cmake.in ${CMAKE_VERSION_MODULE_PATH}/FallbackVersion.cmake) 17 | endif() 18 | endmacro() 19 | -------------------------------------------------------------------------------- /cmake/ParseArguments.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | # This is a helper Macro to parse optional arguments in Macros/Functions 3 | # It has been taken from the public CMake wiki. 4 | # See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and 5 | # licensing. 6 | ## 7 | macro(parse_arguments prefix arg_names option_names) 8 | set(DEFAULT_ARGS) 9 | foreach(arg_name ${arg_names}) 10 | set(${prefix}_${arg_name}) 11 | endforeach(arg_name) 12 | foreach(option ${option_names}) 13 | set(${prefix}_${option} FALSE) 14 | endforeach(option) 15 | 16 | set(current_arg_name DEFAULT_ARGS) 17 | set(current_arg_list) 18 | foreach(arg ${ARGN}) 19 | set(larg_names ${arg_names}) 20 | list(FIND larg_names "${arg}" is_arg_name) 21 | if(is_arg_name GREATER -1) 22 | set(${prefix}_${current_arg_name} ${current_arg_list}) 23 | set(current_arg_name ${arg}) 24 | set(current_arg_list) 25 | else(is_arg_name GREATER -1) 26 | set(loption_names ${option_names}) 27 | list(FIND loption_names "${arg}" is_option) 28 | if(is_option GREATER -1) 29 | set(${prefix}_${arg} TRUE) 30 | else(is_option GREATER -1) 31 | set(current_arg_list ${current_arg_list} ${arg}) 32 | endif(is_option GREATER -1) 33 | endif(is_arg_name GREATER -1) 34 | endforeach(arg) 35 | set(${prefix}_${current_arg_name} ${current_arg_list}) 36 | endmacro(parse_arguments) 37 | -------------------------------------------------------------------------------- /cmake/Tests.cmake: -------------------------------------------------------------------------------- 1 | # Test macros for Marlin, feel free to re-use them. 2 | 3 | macro(add_test_executable EXE_NAME) 4 | add_test(${EXE_NAME} gtester ${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME}) 5 | endmacro() 6 | -------------------------------------------------------------------------------- /cmake/UseRPMTools.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # - Find tools needed for building RPM Packages 3 | # on Linux systems and defines macro that helps to 4 | # build source or binary RPM, the MACRO assumes 5 | # CMake 2.4.x which includes CPack support. 6 | # CPack is used to build tar.gz source tarball 7 | # which may be used by a custom user-made spec file. 8 | # 9 | # - Define RPMTools_ADD_RPM_TARGETS which defines 10 | # two (top-level) CUSTOM targets for building 11 | # source and binary RPMs 12 | # 13 | # Those CMake macros are provided by the TSP Developer Team 14 | # https://savannah.nongnu.org/projects/tsp 15 | # 16 | 17 | IF (WIN32) 18 | MESSAGE(STATUS "RPM tools not available on Win32 systems") 19 | ENDIF(WIN32) 20 | 21 | IF (UNIX) 22 | # Look for RPM builder executable 23 | FIND_PROGRAM(RPMTools_RPMBUILD_EXECUTABLE 24 | NAMES rpmbuild 25 | PATHS "/usr/bin;/usr/lib/rpm" 26 | PATH_SUFFIXES bin 27 | DOC "The RPM builder tool") 28 | 29 | IF (RPMTools_RPMBUILD_EXECUTABLE) 30 | MESSAGE(STATUS "Looking for RPMTools... - found rpmuild is ${RPMTools_RPMBUILD_EXECUTABLE}") 31 | SET(RPMTools_RPMBUILD_FOUND "YES") 32 | GET_FILENAME_COMPONENT(RPMTools_BINARY_DIRS ${RPMTools_RPMBUILD_EXECUTABLE} PATH) 33 | ELSE (RPMTools_RPMBUILD_EXECUTABLE) 34 | SET(RPMTools_RPMBUILD_FOUND "NO") 35 | MESSAGE(STATUS "Looking for RPMTools... - rpmbuild NOT FOUND") 36 | ENDIF (RPMTools_RPMBUILD_EXECUTABLE) 37 | 38 | # Detect if CPack was included or not 39 | IF (NOT DEFINED "CPACK_PACKAGE_NAME") 40 | MESSAGE(FATAL_ERROR "CPack was not included, you should include CPack before Using RPMTools") 41 | ENDIF (NOT DEFINED "CPACK_PACKAGE_NAME") 42 | 43 | IF (RPMTools_RPMBUILD_FOUND) 44 | SET(RPMTools_FOUND TRUE) 45 | # 46 | # - first arg (ARGV0) is RPM name 47 | # - second arg (ARGV1) is the RPM spec file path [optional] 48 | # - third arg (ARGV2) is the RPM ROOT DIRECTORY used to build RPMs [optional] 49 | # 50 | MACRO(RPMTools_ADD_RPM_TARGETS RPMNAME) 51 | 52 | # 53 | # If no spec file is provided create a minimal one 54 | # 55 | IF ("${ARGV1}" STREQUAL "") 56 | SET(SPECFILE_PATH "${CMAKE_BINARY_DIR}/${RPMNAME}.spec") 57 | ELSE ("${ARGV1}" STREQUAL "") 58 | SET(SPECFILE_PATH "${ARGV1}") 59 | ENDIF("${ARGV1}" STREQUAL "") 60 | 61 | # Verify whether if RPM_ROOTDIR was provided or not 62 | IF("${ARGV2}" STREQUAL "") 63 | SET(RPM_ROOTDIR ${CMAKE_BINARY_DIR}/RPM) 64 | ELSE ("${ARGV2}" STREQUAL "") 65 | SET(RPM_ROOTDIR "${ARGV2}") 66 | ENDIF("${ARGV2}" STREQUAL "") 67 | MESSAGE(STATUS "RPMTools:: Using RPM_ROOTDIR=${RPM_ROOTDIR}") 68 | 69 | # Prepare RPM build tree 70 | FILE(MAKE_DIRECTORY ${RPM_ROOTDIR}) 71 | FILE(MAKE_DIRECTORY ${RPM_ROOTDIR}/tmp) 72 | FILE(MAKE_DIRECTORY ${RPM_ROOTDIR}/BUILD) 73 | FILE(MAKE_DIRECTORY ${RPM_ROOTDIR}/RPMS) 74 | FILE(MAKE_DIRECTORY ${RPM_ROOTDIR}/SOURCES) 75 | FILE(MAKE_DIRECTORY ${RPM_ROOTDIR}/SPECS) 76 | FILE(MAKE_DIRECTORY ${RPM_ROOTDIR}/SRPMS) 77 | 78 | # 79 | # We check whether if the provided spec file is 80 | # to be configure or not. 81 | # 82 | IF ("${ARGV1}" STREQUAL "") 83 | SET(SPECFILE_PATH "${RPM_ROOTDIR}/SPECS/${RPMNAME}.spec") 84 | SET(SPECFILE_NAME "${RPMNAME}.spec") 85 | MESSAGE(STATUS "No Spec file given generate a minimal one --> ${RPM_ROOTDIR}/SPECS/${RPMNAME}.spec") 86 | FILE(WRITE ${RPM_ROOTDIR}/SPECS/${RPMNAME}.spec 87 | "# -*- rpm-spec -*- 88 | Summary: ${RPMNAME} 89 | Name: ${RPMNAME} 90 | Version: ${PACKAGE_VERSION} 91 | Release: 1 92 | License: Unknown 93 | Group: Unknown 94 | Source: ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz 95 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root 96 | BuildRequires: cmake 97 | 98 | %define prefix /opt/${RPMNAME}-%{version} 99 | %define rpmprefix $RPM_BUILD_ROOT%{prefix} 100 | %define srcdirname %{name}-%{version}-Source 101 | 102 | %description 103 | ${RPMNAME} : No description for now 104 | 105 | %prep 106 | %setup -q -n %{srcdirname} 107 | 108 | %build 109 | cd .. 110 | rm -rf build_tree 111 | mkdir build_tree 112 | cd build_tree 113 | cmake -DCMAKE_INSTALL_PREFIX=%{rpmprefix} ../%{srcdirname} 114 | make 115 | 116 | %install 117 | cd ../build_tree 118 | make install 119 | 120 | %clean 121 | rm -rf %{srcdirname} 122 | rm -rf build_tree 123 | 124 | %files 125 | %defattr(-,root,root,-) 126 | %dir %{prefix} 127 | %{prefix}/* 128 | 129 | %changelog 130 | * Wed Feb 28 2007 Erk 131 | Generated by CMake UseRPMTools macros" 132 | ) 133 | 134 | ELSE ("${ARGV1}" STREQUAL "") 135 | SET(SPECFILE_PATH "${ARGV1}") 136 | 137 | GET_FILENAME_COMPONENT(SPECFILE_EXT ${SPECFILE_PATH} EXT) 138 | IF ("${SPECFILE_EXT}" STREQUAL ".spec") 139 | # This is a 'ready-to-use' spec file which does not need to be CONFIGURED 140 | GET_FILENAME_COMPONENT(SPECFILE_NAME ${SPECFILE_PATH} NAME) 141 | MESSAGE(STATUS "Simple copy spec file <${SPECFILE_PATH}> --> <${RPM_ROOTDIR}/SPECS/${SPECFILE_NAME}>") 142 | CONFIGURE_FILE( 143 | ${SPECFILE_PATH} 144 | ${RPM_ROOTDIR}/SPECS/${SPECFILE_NAME} 145 | COPYONLY) 146 | ELSE ("${SPECFILE_EXT}" STREQUAL ".spec") 147 | # This is a to-be-configured spec file 148 | GET_FILENAME_COMPONENT(SPECFILE_NAME ${SPECFILE_PATH} NAME_WE) 149 | SET(SPECFILE_NAME "${SPECFILE_NAME}.spec") 150 | MESSAGE(STATUS "Configuring spec file <${SPECFILE_PATH}> --> <${RPM_ROOTDIR}/SPECS/${SPECFILE_NAME}>") 151 | CONFIGURE_FILE( 152 | ${SPECFILE_PATH} 153 | ${RPM_ROOTDIR}/SPECS/${SPECFILE_NAME} 154 | @ONLY) 155 | ENDIF ("${SPECFILE_EXT}" STREQUAL ".spec") 156 | ENDIF("${ARGV1}" STREQUAL "") 157 | 158 | ADD_CUSTOM_TARGET(${RPMNAME}_srpm 159 | COMMAND cpack -G TGZ --config CPackSourceConfig.cmake 160 | COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz ${RPM_ROOTDIR}/SOURCES 161 | COMMAND ${RPMTools_RPMBUILD_EXECUTABLE} -bs --define=\"_topdir ${RPM_ROOTDIR}\" --buildroot=${RPM_ROOTDIR}/tmp ${RPM_ROOTDIR}/SPECS/${SPECFILE_NAME} 162 | ) 163 | 164 | ADD_CUSTOM_TARGET(${RPMNAME}_rpm 165 | COMMAND cpack -G TGZ --config CPackSourceConfig.cmake 166 | COMMAND ${CMAKE_COMMAND} -E copy ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz ${RPM_ROOTDIR}/SOURCES 167 | COMMAND ${RPMTools_RPMBUILD_EXECUTABLE} -bb --define=\"_topdir ${RPM_ROOTDIR}\" --buildroot=${RPM_ROOTDIR}/tmp ${RPM_ROOTDIR}/SPECS/${SPECFILE_NAME} 168 | ) 169 | ENDMACRO(RPMTools_ADD_RPM_TARGETS) 170 | 171 | ELSE (RPMTools_RPMBUILD_FOUND) 172 | SET(RPMTools FALSE) 173 | ENDIF (RPMTools_RPMBUILD_FOUND) 174 | 175 | ENDIF (UNIX) 176 | 177 | -------------------------------------------------------------------------------- /cmake/ValaVersion.cmake: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright 2009-2010 Jakob Westhoff. All rights reserved. 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # 1. Redistributions of source code must retain the above copyright notice, 8 | # this list of conditions and the following disclaimer. 9 | # 10 | # 2. Redistributions in binary form must reproduce the above copyright notice, 11 | # this list of conditions and the following disclaimer in the documentation 12 | # and/or other materials provided with the distribution. 13 | # 14 | # THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR 15 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 16 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 17 | # EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 19 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 | # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 21 | # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 22 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | # 25 | # The views and conclusions contained in the software and documentation are those 26 | # of the authors and should not be interpreted as representing official policies, 27 | # either expressed or implied, of Jakob Westhoff 28 | ## 29 | 30 | include(ParseArguments) 31 | find_package(Vala REQUIRED) 32 | 33 | ## 34 | # Ensure a certain valac version is available 35 | # 36 | # The initial argument is the version to check for 37 | # 38 | # It may be followed by a optional parameter to specifiy a version range. The 39 | # following options are valid: 40 | # 41 | # EXACT 42 | # Vala needs to be available in the exact version given 43 | # 44 | # MINIMUM 45 | # The provided version is the minimum version. Therefore Vala needs to be 46 | # available in the given version or any higher version 47 | # 48 | # MAXIMUM 49 | # The provided version is the maximum. Therefore Vala needs to be available 50 | # in the given version or any version older than this 51 | # 52 | # If no option is specified the version will be treated as a minimal version. 53 | ## 54 | macro(ensure_vala_version version) 55 | parse_arguments(ARGS "" "MINIMUM;MAXIMUM;EXACT" ${ARGN}) 56 | set(compare_message "") 57 | set(error_message "") 58 | if(ARGS_MINIMUM) 59 | set(compare_message "a minimum ") 60 | set(error_message "or greater ") 61 | elseif(ARGS_MAXIMUM) 62 | set(compare_message "a maximum ") 63 | set(error_message "or less ") 64 | endif(ARGS_MINIMUM) 65 | 66 | message(STATUS 67 | "checking for ${compare_message}Vala version of ${version}" 68 | ) 69 | 70 | unset(version_accepted) 71 | 72 | # MINIMUM is the default if no option is specified 73 | if(ARGS_EXACT) 74 | if(${VALA_VERSION} VERSION_EQUAL ${version} ) 75 | set(version_accepted TRUE) 76 | endif(${VALA_VERSION} VERSION_EQUAL ${version}) 77 | elseif(ARGS_MAXIMUM) 78 | if(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) 79 | set(version_accepted TRUE) 80 | endif(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) 81 | else(ARGS_MAXIMUM) 82 | if(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) 83 | set(version_accepted TRUE) 84 | endif(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) 85 | endif(ARGS_EXACT) 86 | 87 | if (NOT version_accepted) 88 | message(FATAL_ERROR 89 | "Vala version ${version} ${error_message}is required." 90 | ) 91 | endif(NOT version_accepted) 92 | 93 | message(STATUS 94 | " found Vala, version ${VALA_VERSION}" 95 | ) 96 | endmacro(ensure_vala_version) 97 | -------------------------------------------------------------------------------- /data/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright (c) 2017 SkyzohKey 3 | # 4 | # MIT License 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining 7 | # a copy of this software and associated documentation files (the 8 | # "Software"), to deal in the Software without restriction, including 9 | # without limitation the rights to use, copy, modify, merge, publish, 10 | # distribute, sublicense, and/or sell copies of the Software, and to 11 | # permit persons to whom the Software is furnished to do so, subject to 12 | # the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be 15 | # included in all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | ## 25 | 26 | include (Translations) 27 | 28 | # Configure .desktop 29 | configure_file( 30 | im.konv.client.desktop.in.in 31 | ${CMAKE_CURRENT_BINARY_DIR}/im.konv.client.desktop.in 32 | ) 33 | 34 | # Configure appdata. 35 | configure_file( 36 | konv.appdata.xml.in.in 37 | ${CMAKE_CURRENT_BINARY_DIR}/konv.appdata.xml.in 38 | ) 39 | 40 | # Translate .desktop 41 | configure_file_translation( 42 | ${CMAKE_CURRENT_BINARY_DIR}/im.konv.client.desktop.in 43 | ${CMAKE_CURRENT_BINARY_DIR}/im.konv.client.desktop 44 | ${CMAKE_SOURCE_DIR}/po/ 45 | ) 46 | 47 | # Translate appdata. 48 | configure_file_translation( 49 | ${CMAKE_CURRENT_BINARY_DIR}/konv.appdata.xml.in 50 | ${CMAKE_CURRENT_BINARY_DIR}/konv.appdata.xml 51 | ${CMAKE_SOURCE_DIR}/po/ 52 | ) 53 | 54 | # Install files. 55 | install (FILES ${CMAKE_CURRENT_BINARY_DIR}/im.konv.client.desktop DESTINATION share/applications) 56 | install (FILES ${CMAKE_CURRENT_BINARY_DIR}/konv.appdata.xml DESTINATION share/appdata) 57 | -------------------------------------------------------------------------------- /data/im.konv.client.desktop.in.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | _Name=@APP_NAME@ 4 | _Comment=@RELEASE_NAME@ 5 | _Keywords=Konv;Messaging;Tox;P2P;Internet; 6 | Exec=@EXEC_NAME@ %U 7 | Icon=@DESKTOP_ICON@ 8 | Categories=InstantMessaging;Network;P2P; 9 | MimeType=x-scheme-handler/tox; 10 | Terminal=false 11 | Type=Application 12 | X-GNOME-Gettext-Domain=@GETTEXT_PACKAGE@ 13 | X-GNOME-UsesNotifications=true 14 | X-UserData=$CONFIG/konv; 15 | Actions=AboutDialog; 16 | 17 | [Desktop Action AboutDialog] 18 | _Name=About @APP_NAME@ 19 | Exec=@EXEC_NAME@ --about 20 | -------------------------------------------------------------------------------- /data/interfaces/components/HeaderBar.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 106 | 107 | -------------------------------------------------------------------------------- /data/interfaces/widgets/ContactListRow.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 159 | 160 | -------------------------------------------------------------------------------- /data/interfaces/widgets/ContactPreview.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 58 | 59 | -------------------------------------------------------------------------------- /data/interfaces/widgets/WelcomeView.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 168 | 169 | -------------------------------------------------------------------------------- /data/konv.appdata.xml.in.in: -------------------------------------------------------------------------------- 1 | 25 | 26 | 27 | 28 | 29 | im.konv.client.desktop 30 | CC0-1.0 31 | SkyzohKey 32 | MIT 33 | <_name>@APP_NAME@ 34 | <_summary>@RELEASE_NAME@ 35 | 36 | <_p> 37 | Konv.im is an open-source, libre and secure instant messaging application that 38 | aims to replace Skype, Whatsapp, and other proprietary services. I believe that 39 | bringing a free (as in freedom, aswell as in price) software that enable 40 | individuals to communicate freely, without the fear to be censored or sued, is 41 | primordial in this post-Snowden era. Free speech enables **real** sharing of 42 | ideas, concepts, researchs, etc. That's how I want to contribute saving what 43 | stays of people liberties and rights. 44 | 45 | 46 | 47 | 48 | 49 | 50 | @EXEC_NAME@ 51 | 52 | SkyzohKey 53 | https://konv.im 54 | https://github.com/SkyzohKey/Konv/issues 55 | https://github.com/SkyzohKey/Konv#funding 56 | https://github.com/SkyzohKey/Konv/wiki 57 | contact_at_konv.im 58 | 59 | -------------------------------------------------------------------------------- /data/konv.gresource.xml: -------------------------------------------------------------------------------- 1 | 25 | 26 | 27 | 28 | 29 | 30 | interfaces/windows/MainWindow.ui 31 | 32 | 33 | interfaces/widgets/WelcomeView.ui 34 | interfaces/widgets/ContactPreview.ui 35 | interfaces/widgets/ContactListRow.ui 36 | 37 | 38 | interfaces/components/HeaderBar.ui 39 | 40 | 41 | pixmaps/status/online.png 42 | pixmaps/status/busy.png 43 | pixmaps/status/idle.png 44 | pixmaps/status/offline.png 45 | 46 | pixmaps/tmp/avatar.png 47 | pixmaps/tmp/bot.png 48 | pixmaps/tmp/gun.png 49 | pixmaps/tmp/rihanna.jpg 50 | pixmaps/tmp/the-rock.jpg 51 | pixmaps/tmp/lil-wayne.jpg 52 | pixmaps/tmp/kungfu-panda.jpg 53 | pixmaps/tmp/lacrim.jpg 54 | pixmaps/tmp/ne-yo.jpg 55 | pixmaps/tmp/satan.jpg 56 | 57 | pixmaps/tox-logo-256.png 58 | pixmaps/welcome-left-arrow.svg 59 | pixmaps/left-arrow-white.svg 60 | pixmaps/left-arrow-dark.svg 61 | 62 | 63 | resources/styles/helpers.css 64 | 65 | 66 | -------------------------------------------------------------------------------- /data/pixmaps/left-arrow-dark.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 42 | 46 | 50 | 54 | 58 | 62 | 63 | 65 | 66 | 68 | image/svg+xml 69 | 71 | 72 | 73 | 74 | 75 | 80 | 83 | 86 | 89 | 95 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /data/pixmaps/left-arrow-white.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 42 | 46 | 50 | 54 | 58 | 62 | 63 | 65 | 66 | 68 | image/svg+xml 69 | 71 | 72 | 73 | 74 | 75 | 80 | 83 | 86 | 89 | 95 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /data/pixmaps/status/busy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/status/busy.png -------------------------------------------------------------------------------- /data/pixmaps/status/busy_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/status/busy_notification.png -------------------------------------------------------------------------------- /data/pixmaps/status/idle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/status/idle.png -------------------------------------------------------------------------------- /data/pixmaps/status/idle_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/status/idle_notification.png -------------------------------------------------------------------------------- /data/pixmaps/status/invisible.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/status/invisible.png -------------------------------------------------------------------------------- /data/pixmaps/status/offline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/status/offline.png -------------------------------------------------------------------------------- /data/pixmaps/status/offline_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/status/offline_notification.png -------------------------------------------------------------------------------- /data/pixmaps/status/online.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/status/online.png -------------------------------------------------------------------------------- /data/pixmaps/status/online_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/status/online_notification.png -------------------------------------------------------------------------------- /data/pixmaps/tmp/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/tmp/avatar.png -------------------------------------------------------------------------------- /data/pixmaps/tmp/bot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/tmp/bot.png -------------------------------------------------------------------------------- /data/pixmaps/tmp/gun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/tmp/gun.png -------------------------------------------------------------------------------- /data/pixmaps/tmp/kungfu-panda.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/tmp/kungfu-panda.jpg -------------------------------------------------------------------------------- /data/pixmaps/tmp/lacrim.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/tmp/lacrim.jpg -------------------------------------------------------------------------------- /data/pixmaps/tmp/lil-wayne.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/tmp/lil-wayne.jpg -------------------------------------------------------------------------------- /data/pixmaps/tmp/ne-yo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/tmp/ne-yo.jpg -------------------------------------------------------------------------------- /data/pixmaps/tmp/rihanna.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/tmp/rihanna.jpg -------------------------------------------------------------------------------- /data/pixmaps/tmp/satan.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/tmp/satan.jpg -------------------------------------------------------------------------------- /data/pixmaps/tmp/the-rock.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/tmp/the-rock.jpg -------------------------------------------------------------------------------- /data/pixmaps/tox-logo-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/data/pixmaps/tox-logo-256.png -------------------------------------------------------------------------------- /data/pixmaps/welcome-left-arrow.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 42 | 46 | 50 | 54 | 58 | 62 | 63 | 65 | 66 | 68 | image/svg+xml 69 | 71 | 72 | 73 | 74 | 75 | 80 | 83 | 86 | 89 | 95 | 101 | 102 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /data/resources/styles/helpers.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | KonvGuiWindowsMainWindow > .vertical > *, 27 | KonvGuiWindowsSettingsWindow > .horizontal > * { 28 | font-family: "Roboto", "Verdana", sans-serif; 29 | } 30 | 31 | .ic-avatar { 32 | border-radius: 200px; 33 | } 34 | 35 | .badge { 36 | padding: 4px; 37 | 38 | background-color: #4CAF50; 39 | border-radius: 200px; 40 | color: white; 41 | font-weight: bold; 42 | } 43 | 44 | .text-little { 45 | font-size: 10px; 46 | font-weight: lighter; 47 | } 48 | 49 | .no-radius, .no-radius * { border-radius: 0; } 50 | .no-border, .no-border * { 51 | border-image: none; 52 | border: none; 53 | } 54 | .no-borders-horizontal { 55 | border-left: 0; 56 | border-right: 0; 57 | } 58 | .no-borders-horizontal > *:first-child { 59 | border-left: none; 60 | } 61 | .no-borders-horizontal > *:last-child { 62 | border-right: none; 63 | } 64 | .no-borders-vertical { 65 | border-bottom: 0; 66 | border-top: 0; 67 | } 68 | 69 | .no-border-top, 70 | .no-border-top > * { 71 | border-top: 0; 72 | } 73 | 74 | 75 | .no-border-bottom { border-bottom: 0; } 76 | .no-border-left { border-left: 0; } 77 | .no-border-right { border-right: 0; } 78 | -------------------------------------------------------------------------------- /misc/build-linux.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function install_deps { 4 | sudo add-apt-repository -y ppa:vala-team/ppa 5 | sudo add-apt-repository -y ppa:rebuntu16/glade-3.19+-trusty 6 | sudo apt-get update 7 | 8 | # Packages needed for building, linting, etc... 9 | sudo apt-get install -y build-essential vala-0.30 valac libgtk-3-dev libjson-glib-dev libsoup2.4-dev 10 | sudo apt-get install -y libtool autotools-dev checkinstall check git yasm 11 | sudo apt-get install -y libgdbm-dev libncurses5-dev automake libtool bison libffi-dev 12 | 13 | install_ruby 14 | install_libsodium 15 | install_libvpx 16 | install_libopus 17 | install_libtoxcore 18 | } 19 | 20 | function install_ruby { 21 | # Ruby is needed to lint code. 22 | gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 23 | curl -sSL https://get.rvm.io | bash -s stable 24 | source ~/.rvm/scripts/rvm 25 | rvm install 2.4.0 26 | rvm use 2.4.0 --default 27 | ruby -v 28 | } 29 | function install_libsodium { 30 | git clone https://github.com/jedisct1/libsodium.git 31 | cd libsodium 32 | git checkout tags/1.0.11 33 | ./autogen.sh 34 | ./configure && make check 35 | sudo checkinstall --default --install --pkgname libsodium --pkgversion 1.0.0 --nodoc 36 | sudo ldconfig 37 | cd .. 38 | } 39 | function install_libvpx { 40 | git clone https://chromium.googlesource.com/webm/libvpx 41 | cd libvpx 42 | ./configure -fPIC 43 | make -j3 -fPIC 44 | sudo make install 45 | cd .. 46 | } 47 | function install_libopus { 48 | wget http://downloads.xiph.org/releases/opus/opus-1.0.3.tar.gz 49 | tar xvzf opus-1.0.3.tar.gz 50 | cd opus-1.0.3 51 | ./configure 52 | make -j3 53 | sudo make install 54 | cd .. 55 | } 56 | function install_libtoxcore { 57 | git clone https://github.com/TokTok/c-toxcore.git c-toxcore 58 | cd c-toxcore 59 | autoreconf -i 60 | ./configure 61 | make 62 | sudo make install 63 | } 64 | 65 | function build { 66 | mkdir -p build/ 67 | cd build/ 68 | cmake .. -DCMAKE_INSTALL_PREFIX=/usr 69 | make 70 | } 71 | 72 | function install { 73 | cd build/ 74 | sudo make install 75 | } 76 | 77 | if [[ "$1" == "--deps" ]]; then 78 | install_deps 79 | elif [[ "$1" == "--build" ]]; then 80 | build 81 | elif [[ "$1" == "--install" ]]; then 82 | install 83 | fi 84 | -------------------------------------------------------------------------------- /misc/format-style.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | astyle \ 4 | --style=attach \ 5 | --indent=spaces=2 \ 6 | --indent-namespaces \ 7 | --indent-switches \ 8 | --add-brackets \ 9 | --pad-first-paren-out \ 10 | src/Konv.vala \ 11 | src/gui/components/*.vala \ 12 | src/gui/windows/*.vala 13 | -------------------------------------------------------------------------------- /misc/lint.rb: -------------------------------------------------------------------------------- 1 | # encoding: UTF-8 2 | def explore top 3 | vala_files = [] 4 | 5 | Dir.entries(top).each do |file| 6 | next if file == '.' || file == '..' || file == '.git' 7 | 8 | if file.end_with? '.vala' 9 | vala_files << file 10 | else 11 | if File.directory? "#{top}/#{file}" 12 | explore("#{top}/#{file}").each {|sub_file| vala_files << "#{file}/#{sub_file}"} 13 | end 14 | end 15 | end 16 | 17 | vala_files 18 | end 19 | 20 | def check file 21 | content = '' 22 | errors, warnings, lines = 0, 0, 0 23 | 24 | open(file, 'r:UTF-8') do |f| 25 | line_num = 0 26 | in_comm = false 27 | 28 | while (line = f.gets) 29 | unless line.index(/\*\//).nil? 30 | in_comm = false 31 | line = line.gsub /.*\*\//, '' 32 | end 33 | 34 | if in_comm 35 | line_num += 1 36 | next 37 | end 38 | 39 | unless line.index(/\/\*/).nil? 40 | in_comm = true 41 | line = line.gsub /.*\/\*/, '' 42 | end 43 | 44 | # removing comments 45 | line = line.gsub /\/\/.*/, '' 46 | content += line 47 | line_num += 1 48 | 49 | # don't use as 50 | if line.include? ' as ' 51 | puts "#{file}:#{line_num}: Avoid using the \"as\" keyword, it might create unwanted behaviors." 52 | errors += 1 53 | end 54 | 55 | # capitals const 56 | const_re = /const [[:graph:]]* (?[[:graph:]]*)/ 57 | res = const_re.match line 58 | 59 | unless res.nil? 60 | name = res[1] 61 | if name != name.upcase 62 | puts "#{file}:#{line_num}: Constants must be uppercased. #{name} -> #{name.upcase}" 63 | errors += 1 64 | end 65 | end 66 | 67 | # never forget the space before a ( or a { 68 | space_re = /(?!\()[[:graph:]]*\(.*\)/ 69 | space_res = space_re.match(line.gsub(/".*?"/, '')) 70 | 71 | unless space_res.nil? 72 | puts "#{file}:#{line_num}: Space missing before a parenthesis." 73 | errors += 1 74 | end 75 | 76 | curly_re = /(?!\{)[[:graph:]]*\{.*\}/ 77 | curly_res = curly_re.match(line.gsub(/".*?"/, '')) 78 | 79 | unless curly_res.nil? 80 | puts "#{file}:#{line_num}: Space missing before a curly brace." 81 | errors += 1 82 | end 83 | 84 | # Put whitespace in math 85 | math_re = /(.)(=|\+|-|\*|\/|(\d)+)(.)/ 86 | allowed_re = /(\(|\[|\s|=|>|<|!|\+|-|\/|\*)/ 87 | math_res = math_re.match(line.gsub(/".*?"/, '')) 88 | 89 | if !(math_res.nil?) && !(math_res[1].match(allowed_re) || math_res[2].match(allowed_re)) 90 | puts "#{file}:#{line_num}: Math symbols are not well spaced." 91 | errors += 1 92 | end 93 | 94 | if line.strip == '{' 95 | puts "#{file}:#{line_num}: Curly braces shouldn't be on their own line." 96 | errors += 1 97 | end 98 | 99 | if line.strip == 'using GLib;' || line.include?('GLib.print') 100 | puts "#{file}:#{line_num}: Useless reference to GLib." 101 | warnings += 1 102 | end 103 | 104 | if line.include? 'stdout.printf' 105 | puts "#{file}:#{line_num}: Use `print ()` instead of `stdout.printf ()`." 106 | warnings += 1 107 | end 108 | end 109 | 110 | lines = line_num 111 | end 112 | 113 | content = content.gsub /\/\*.*\*\//su, '' 114 | 115 | # one class, struct or iterface by file 116 | if content.scan(' class ').length + content.scan(' interface ').length + content.scan(' struct').length > 1 117 | puts "#{file}: Too many classes, structs or interfaces defined here." 118 | errors += 1 119 | end 120 | 121 | if (errors > 0) then return true, errors, warnings, lines else return false, errors, warnings, lines end 122 | end 123 | 124 | to_check = explore '.' 125 | bad_files, errors, warnings, lines = 0, 0, 0, 0 126 | 127 | to_check.each do |vala| 128 | file = check vala 129 | if file[0] 130 | bad_files += 1 131 | errors += file[1] 132 | warnings += file[2] 133 | lines += file[3] 134 | end 135 | end 136 | 137 | puts "\nBad files: #{bad_files} - Total files: #{to_check.length}" 138 | puts "Bad lines: #{errors + warnings} - Total lines: #{lines}" 139 | puts "Errors: #{errors} - Warnings: #{warnings}" 140 | puts "\nCoverage: #{(100 - (100 * errors.to_f / lines.to_f)).to_s[0..4]}" -------------------------------------------------------------------------------- /misc/screens/main-settings-dark-0.1.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/misc/screens/main-settings-dark-0.1.0.png -------------------------------------------------------------------------------- /misc/screens/main-window-0.1.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/misc/screens/main-window-0.1.0.png -------------------------------------------------------------------------------- /misc/screens/main-window-menu-0.1.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SkyzohKey/Konv/5e95edb5600453dc492f77169bd629159b7d6e25/misc/screens/main-window-menu-0.1.0.png -------------------------------------------------------------------------------- /po/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright (c) 2017 SkyzohKey 3 | # 4 | # MIT License 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining 7 | # a copy of this software and associated documentation files (the 8 | # "Software"), to deal in the Software without restriction, including 9 | # without limitation the rights to use, copy, modify, merge, publish, 10 | # distribute, sublicense, and/or sell copies of the Software, and to 11 | # permit persons to whom the Software is furnished to do so, subject to 12 | # the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be 15 | # included in all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | ## 25 | 26 | include (Translations) 27 | add_translations_directory (${GETTEXT_PACKAGE}) 28 | add_translations_catalog (${GETTEXT_PACKAGE} 29 | ../src/ 30 | ../data/interfaces/* 31 | ) 32 | -------------------------------------------------------------------------------- /po/aa.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ab.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ae.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/af.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ak.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/am.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/an.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ar.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/as.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ast.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/av.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ay.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/az.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ba.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/be.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 6 | -------------------------------------------------------------------------------- /po/bg.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/bh.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/bi.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/bm.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/bn.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/bo.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/br.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/bs.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ca.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ce.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ch.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ckb.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/co.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/cr.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/cs.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" 6 | -------------------------------------------------------------------------------- /po/cu.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/cv.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/cy.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/da.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/de.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/dv.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/dz.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ee.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/el.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/en_AU.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/en_CA.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/en_GB.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/eo.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/es.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/et.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/eu.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/fa.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ff.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/fi.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/fj.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/fo.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/fr_CA.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n>1;\n" 6 | -------------------------------------------------------------------------------- /po/fy.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ga.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/gd.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/gl.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/gn.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/gu.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/gv.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ha.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/he.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/hi.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ho.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/hr.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 6 | -------------------------------------------------------------------------------- /po/ht.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/hu.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/hy.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/hz.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ia.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/id.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ie.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ig.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ii.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ik.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/io.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/is.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/it.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/iu.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ja.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n" 6 | -------------------------------------------------------------------------------- /po/jv.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ka.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/kg.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ki.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/kj.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/kk.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/kl.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/km.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/kn.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ko.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n" 6 | -------------------------------------------------------------------------------- /po/kr.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ks.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ku.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/kv.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/kw.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ky.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/la.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/lb.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/lg.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/li.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ln.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/lo.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/lt.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 6 | -------------------------------------------------------------------------------- /po/lu.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/lv.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2;\n" 6 | -------------------------------------------------------------------------------- /po/mg.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/mh.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/mi.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/mk.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ml.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/mn.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/mo.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/mr.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ms.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/mt.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/my.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/na.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/nb.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/nd.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ne.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ng.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/nl.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/nn.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/no.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/nr.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/nv.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ny.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/oc.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/oj.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/om.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/or.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/os.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/pa.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/pi.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/pl.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 6 | -------------------------------------------------------------------------------- /po/ps.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/pt.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/pt_BR.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n>1;\n" 6 | -------------------------------------------------------------------------------- /po/qu.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/rm.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/rn.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ro.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2;\n" 6 | -------------------------------------------------------------------------------- /po/ru.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 6 | -------------------------------------------------------------------------------- /po/rue.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/rw.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/sa.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/sc.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/sd.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/se.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/sg.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/si.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/sk.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" 6 | -------------------------------------------------------------------------------- /po/sl.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3;\n" 6 | -------------------------------------------------------------------------------- /po/sm.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/sma.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/sn.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/so.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/sq.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/sr.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 6 | -------------------------------------------------------------------------------- /po/ss.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/st.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/su.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/sv.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/sw.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ta.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/te.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/tg.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/th.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ti.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/tk.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/tl.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/tn.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/to.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/tr.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 6 | -------------------------------------------------------------------------------- /po/ts.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/tt.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/tw.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ty.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ug.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/uk.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" 6 | -------------------------------------------------------------------------------- /po/ur.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/uz.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/ve.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/vi.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | "Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1;\n" 6 | -------------------------------------------------------------------------------- /po/vo.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/wa.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/wo.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/xh.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/yi.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/yo.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/za.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/zh.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/zh_CN.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/zh_HK.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/zh_TW.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /po/zu.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "MIME-Version: 1.0\n" 4 | "Content-Type: text/plain; charset=UTF-8\n" 5 | -------------------------------------------------------------------------------- /poulp.toml: -------------------------------------------------------------------------------- 1 | # First we define the valac version(s) targeted 2 | vala-version = ">=0.30.0" 3 | 4 | # Basic informations about our app 5 | name = "konv" 6 | description = "Secure P2P instant messenger" 7 | 8 | # Use semantic versionning 9 | version = "0.1.0" 10 | 11 | # To help find your project 12 | keywords = [ 13 | "konv", "instant messaging", "messenger", "chat", "p2p", "encrypted", 14 | "encryption", "secure", "user-friendly", "skype-like", "tox", "toxcore" 15 | ] 16 | license = "MIT" 17 | 18 | homepage = "https://konv.im" 19 | repository = "https://github.com/SkyzohKey/Konv.git" 20 | 21 | # Where to report bugs 22 | bugs = { 23 | email = "contact@konv.im", 24 | url = "https://github.com/SkyzohKey/Konv/issues" 25 | } 26 | 27 | # Dev team members informations. 28 | author = "SkyzohKey " 29 | maintainers = [ 30 | "SkyzohKey " 31 | ] 32 | 33 | # The files to compile, supports wildcard (*). 34 | files = [ 35 | "src/core/*.vala", 36 | "src/gui/components/*.vala", 37 | "src/gui/widgets/*.vala", 38 | "src/gui/windows/*.vala", 39 | "src/*.vala", 40 | ] 41 | 42 | # VAPIs directory. 43 | vapi-dir = "src/vapis/" 44 | 45 | # Custom output path, if not specified defaults to `build/$(app-name)`. 46 | output = "build/konv" 47 | 48 | # Other arguments to give to valac. 49 | compilerParams = [ 50 | "-DGETTEXT_PACKAGE", "konv" 51 | ] 52 | 53 | # If true, we add flags to compile as a library 54 | library = false 55 | 56 | # Poulp has support for npm-like scripts. 57 | [scripts] 58 | run = [ "poulp build", "./$(POULP_BUILD_OUPUT)" ] 59 | 60 | [dependencies] 61 | "gio-2.0" = "*" 62 | "gtk+-3.0" = "*" 63 | "json-glib-1.0" = "*" 64 | "libtoxcore" = ">=0.1.0" 65 | 66 | [dev-dependencies] 67 | valadate = "^0.1.0" 68 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ## 2 | # Copyright (c) 2017 SkyzohKey 3 | # 4 | # MIT License 5 | # 6 | # Permission is hereby granted, free of charge, to any person obtaining 7 | # a copy of this software and associated documentation files (the 8 | # "Software"), to deal in the Software without restriction, including 9 | # without limitation the rights to use, copy, modify, merge, publish, 10 | # distribute, sublicense, and/or sell copies of the Software, and to 11 | # permit persons to whom the Software is furnished to do so, subject to 12 | # the following conditions: 13 | # 14 | # The above copyright notice and this permission notice shall be 15 | # included in all copies or substantial portions of the Software. 16 | # 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | ## 25 | 26 | # Build the config file. 27 | configure_file( 28 | Config.vala.in 29 | ${CMAKE_CURRENT_BINARY_DIR}/Config.vala 30 | ) 31 | 32 | # Compile resources. 33 | include (GResources) 34 | glib_compile_resources (GLIB_RESOURCES_KONV 35 | SOURCE 36 | ../data/konv.gresource.xml 37 | ) 38 | 39 | set(KONV_BUILD_OS, "UNKNOWN") # Default value. 40 | IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 41 | set(KONV_BUILD_OS, "OSX") 42 | ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") 43 | set(KONV_BUILD_OS, "LINUX") 44 | ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") 45 | set(KONV_BUILD_OS, "BSD") 46 | ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Windows") 47 | set(KONV_BUILD_OS, "WIN32") 48 | ENDIF() 49 | 50 | vala_precompile (VALA_C ${EXEC_NAME} 51 | # List the sources files that needs to be compiled. 52 | ${CMAKE_CURRENT_BINARY_DIR}/Config.vala 53 | 54 | #pthread/pthread.h 55 | core/ToxSession.vala 56 | 57 | Konv.vala 58 | utils/RoundImage.vala 59 | gui/components/HeaderBar.vala 60 | gui/components/SettingsListBox.vala 61 | gui/components/TabContainer.vala 62 | gui/components/TabNavbar.vala 63 | gui/widgets/BaseView.vala 64 | gui/widgets/WelcomeView.vala 65 | gui/widgets/AvatarWidget.vala 66 | gui/widgets/ContactPreview.vala 67 | gui/widgets/ContactListRow.vala 68 | gui/windows/MainWindow.vala 69 | gui/windows/SettingsWindow.vala 70 | 71 | # List the package that we need. 72 | PACKAGES 73 | gtk+-3.0 74 | json-glib-1.0 75 | libtoxcore 76 | #libsoup-2.4 77 | 78 | # Valac options 79 | OPTIONS 80 | --vapidir="${CMAKE_SOURCE_DIR}/src/vapis" 81 | --target-glib="2.38" 82 | --gresources=${CMAKE_SOURCE_DIR}/data/konv.gresource.xml 83 | --disable-warnings # Remove this in development. 84 | -D SYSTEM_${KONV_BUILD_OS} 85 | ) 86 | 87 | # Tell CMake to build the executable. 88 | add_executable (${EXEC_NAME} ${VALA_C} ${GLIB_RESOURCES_KONV}) 89 | 90 | # Link. 91 | target_link_libraries (${EXEC_NAME} ${DEPS_LIBRARIES}) 92 | 93 | # Install the executable in the proper location. 94 | install (TARGETS ${EXEC_NAME} RUNTIME DESTINATION bin) 95 | -------------------------------------------------------------------------------- /src/Config.vala.in: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | namespace Konv.Constants { 27 | public const string DATADIR = "@DATADIR@"; 28 | public const string PKGDIR = "@PKGDIR@"; 29 | public const string GETTEXT_PACKAGE = "@GETTEXT_PACKAGE@"; 30 | public const string GETTEXT_PATH = "@GETTEXT_PATH@"; 31 | public const string EXEC_NAME = "@EXEC_NAME@"; 32 | public const string APP_NAME = "@APP_NAME@"; 33 | public const string DESKTOP_ICON = "@DESKTOP_ICON@"; 34 | public const string RELEASE_NAME = "@RELEASE_NAME@"; 35 | public const string VERSION = "@VERSION@"; 36 | public const string VERSION_INFO = "@VERSION_INFO@"; 37 | 38 | public const string RES_PATH = "/im/konv/client"; 39 | public const string WEBSITE_URL = "https://konv.im"; 40 | public const string SOURCE_URL = "https://github.com/SkyzohKey/Konv"; 41 | public const string ISSUES_URL = "https://github.com/SkyzohKey/Konv/issues"; 42 | } 43 | -------------------------------------------------------------------------------- /src/Konv.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | using Konv; 27 | using Konv.Gui; 28 | // using Konv.Core; // Uncomment later once core is ready. 29 | 30 | /** 31 | * @class Konv.App - Entrypoint of the application. 32 | **/ 33 | namespace Konv { 34 | 35 | public class App : Gtk.Application { 36 | 37 | private static bool display_version = false; 38 | private static bool show_about = false; 39 | private const OptionEntry[] OPTIONS = { 40 | { "version", 'v', 0, OptionArg.NONE, ref display_version, "Display the application version.", null }, 41 | { "about", 'a', 0, OptionArg.NONE, ref show_about, "Show the about window.", null }, 42 | { null } // List terminator 43 | }; 44 | 45 | private List windows; 46 | 47 | /** 48 | * @private {string} args - The arguments used in this instance. 49 | **/ 50 | private string[] args = {}; 51 | 52 | /** 53 | * @public {Konv.Gui.Windows.MainWindow} main_window - The main window used by the app. 54 | **/ 55 | public Konv.Gui.Windows.MainWindow main_window { get; set; default = null; } 56 | 57 | /** 58 | * @constructor Konv.App 59 | * @param {string[]} args - The arguments array to parse. 60 | **/ 61 | public App (string[] args) { 62 | GLib.Object ( 63 | application_id: "im.konv.client", 64 | flags: ApplicationFlags.FLAGS_NONE 65 | ); 66 | 67 | this.args = args; 68 | 69 | this.init_gettext (); 70 | } 71 | 72 | private void init_gettext () { 73 | Intl.setlocale (LocaleCategory.MESSAGES, ""); 74 | Intl.textdomain (Konv.Constants.GETTEXT_PACKAGE); 75 | Intl.bind_textdomain_codeset (Konv.Constants.GETTEXT_PACKAGE, "utf-8"); 76 | Intl.bindtextdomain (Konv.Constants.GETTEXT_PACKAGE, Konv.Constants.GETTEXT_PATH); 77 | } 78 | 79 | private void init_actions () { 80 | SimpleAction action_menubar_toggle = new SimpleAction ("toggle-menubar", null); 81 | action_menubar_toggle.activate.connect ((variant) => { 82 | if (this.main_window != null) { 83 | this.main_window.toggle_menubar (); 84 | } 85 | }); 86 | 87 | SimpleAction action_about = new SimpleAction ("show-about", null); 88 | action_about.activate.connect ((variant) => { 89 | if (this.main_window != null) { 90 | this.main_window.show_about (); 91 | } 92 | }); 93 | 94 | SimpleAction action_show_preferences = new SimpleAction ("show-preferences", null); 95 | action_show_preferences.activate.connect ((variant) => { 96 | if (this.main_window != null) { 97 | this.main_window.show_preferences (); 98 | } 99 | }); 100 | 101 | SimpleAction action_show_welcome = new SimpleAction ("show-welcome", null); 102 | action_show_welcome.activate.connect ((variant) => { 103 | if (this.main_window != null) { 104 | this.main_window.show_welcome_screen (); 105 | } 106 | }); 107 | 108 | this.set_accels_for_action ("app.toggle-menubar", { "M" }); 109 | this.set_accels_for_action ("app.show-about", { "H" }); 110 | this.set_accels_for_action ("app.show-preferences", { "P" }); 111 | this.set_accels_for_action ("app.show-welcome", { "H" }); 112 | 113 | this.add_action (action_menubar_toggle); 114 | this.add_action (action_about); 115 | this.add_action (action_show_preferences); 116 | this.add_action (action_show_welcome); 117 | } 118 | 119 | public override void activate () { 120 | /** 121 | * TODO: Load settings and show app in correct theme variant (dark/white). 122 | **/ 123 | Gtk.Settings.get_default ().set ("gtk-application-prefer-dark-theme", true); 124 | 125 | this.main_window = new Konv.Gui.Windows.MainWindow (this); 126 | this.init_actions (); 127 | 128 | if (show_about && this.main_window != null) { 129 | this.main_window.show_about (); 130 | return; 131 | } 132 | 133 | this.main_window.show_all (); 134 | } 135 | 136 | public static int main (string[] argv) { 137 | try { 138 | var opt_context = new OptionContext ("- %s: %s".printf (Konv.Constants.APP_NAME, Konv.Constants.RELEASE_NAME)); 139 | opt_context.set_help_enabled (true); 140 | opt_context.add_main_entries (OPTIONS, null); 141 | opt_context.parse (ref argv); 142 | } catch (OptionError e) { 143 | print ("error: %s\n", e.message); 144 | print ("Run '%s --help' to see a full list of available command line options.\n", argv[0]); 145 | return 1; 146 | } 147 | 148 | if (display_version) { 149 | print ("%s version %s-%s\n", Konv.Constants.APP_NAME, Konv.Constants.VERSION, Konv.Constants.VERSION_INFO); 150 | print ("libtoxcore version %lu.%lu.%lu\n", ToxCore.Version.MAJOR, ToxCore.Version.MINOR, ToxCore.Version.PATCH); 151 | return 0; 152 | } 153 | 154 | Konv.App app = new Konv.App (argv); 155 | 156 | try { 157 | app.register (null); 158 | } catch (Error e) { 159 | print (@"Cannot register app. Error: $(e.message)"); 160 | } 161 | return app.run (argv); 162 | } 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /src/core/ToxSession.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | using ToxCore; 27 | 28 | class ToxSession : Object { 29 | /* 30 | * @param {@links ToxCore.Tox} tox - The Tox handle for this instance. 31 | */ 32 | internal ToxCore.Tox tox; 33 | 34 | public ToxSession () { 35 | this.tox = new Tox (null, null); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/gui/components/HeaderBar.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | using Konv; 27 | using Konv.Gui.Widgets; 28 | using Gtk; 29 | 30 | namespace Konv.Gui.Components { 31 | 32 | [GtkTemplate (ui = "/im/konv/client/interfaces/components/HeaderBar.ui")] 33 | public class HeaderBar : Gtk.Box { 34 | 35 | [GtkChild] private Gtk.Button button_profile; 36 | [GtkChild] private Gtk.Label label_profile_name; 37 | [GtkChild] private Gtk.Label label_profile_status; 38 | [GtkChild] private Gtk.Box box_avatar; 39 | 40 | private Avatar avatar; 41 | 42 | public signal void clicked (); 43 | 44 | /** 45 | * @constructor HeaderBar - The HeaderBar component constructor. 46 | **/ 47 | public HeaderBar () { 48 | this.init_widgets (); 49 | this.connect_signals (); 50 | } 51 | 52 | /** 53 | * @private init_widgits - Initialize the widgets, only that. KISS. 54 | **/ 55 | private void init_widgets () { 56 | this.button_profile.get_style_context ().add_class ("no-radius"); 57 | this.button_profile.get_style_context ().add_class ("no-border-bottom"); 58 | this.button_profile.get_style_context ().add_class ("no-borders-horizontal"); 59 | 60 | this.avatar = new Avatar.from_resource (@"$(Konv.Constants.RES_PATH)/pixmaps/tmp/avatar.png", 48, 48); 61 | this.box_avatar.pack_start (this.avatar); 62 | this.avatar.get_style_context ().remove_class ("avatar"); 63 | } 64 | 65 | private void connect_signals () { 66 | this.button_profile.clicked.connect (() => { 67 | this.clicked (); 68 | }); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /src/gui/components/SettingsListBox.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | using Konv; 27 | using Gtk; 28 | 29 | namespace Konv.Gui.Components { 30 | 31 | public class SettingsListBox: Gtk.Box { 32 | 33 | public Gtk.Box scrolled_box; 34 | public Gtk.ListBox listbox; 35 | 36 | public SettingsListBox () { 37 | this.set_orientation (Gtk.Orientation.HORIZONTAL); 38 | this.set_size_request (400, 1); 39 | 40 | Gtk.ScrolledWindow scroll = new Gtk.ScrolledWindow (null, null); 41 | scroll.set_size_request (400, 1); 42 | this.pack_start (scroll, true, true, 0); 43 | 44 | Gtk.Box hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); 45 | scroll.add (hbox); 46 | 47 | this.scrolled_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); 48 | this.scrolled_box.set_size_request (400, 1); 49 | hbox.pack_start (this.scrolled_box, true, true, 0); 50 | 51 | this.listbox = new Gtk.ListBox (); 52 | this.listbox.set_selection_mode (Gtk.SelectionMode.NONE); 53 | this.scrolled_box.pack_start (this.listbox, false, false, 0); 54 | } 55 | 56 | public Gtk.Box new_section (string name) { 57 | Gtk.Box box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); 58 | this.scrolled_box.pack_start (box, false, false, 5); 59 | 60 | Gtk.Label label = new Gtk.Label (null); 61 | label.set_markup (@"$name"); 62 | label.set_line_wrap (true); 63 | label.set_margin_top (4); 64 | label.set_margin_start (6); 65 | box.pack_start (label, false, false, 2); 66 | 67 | this.listbox = new Gtk.ListBox (); 68 | this.listbox.set_selection_mode (Gtk.SelectionMode.NONE); 69 | this.scrolled_box.pack_start (this.listbox, false, false, 0); 70 | 71 | return box; 72 | } 73 | 74 | public Gtk.Box new_row (Gtk.Widget widget, string name, string? help = null) { 75 | Gtk.ListBoxRow row = new Gtk.ListBoxRow (); 76 | row.set_size_request (1, 50); 77 | this.listbox.add (row); 78 | 79 | Gtk.Box box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); 80 | box.set_border_width (5); 81 | row.add (box); 82 | 83 | Gtk.Box vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); 84 | box.pack_start (vbox, false, true, 0); 85 | 86 | Gtk.Label label = new Gtk.Label (name); 87 | label.set_line_wrap (true); 88 | label.set_xalign (0); 89 | vbox.pack_start (label, false, false, 0); 90 | 91 | if (help != null) { 92 | label = new Gtk.Label (null); 93 | label.set_xalign (0); 94 | label.set_line_wrap (true); 95 | label.set_sensitive (false); 96 | label.set_markup (@"$help"); 97 | vbox.pack_start (label, false, false, 0); 98 | } 99 | 100 | vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); 101 | vbox.set_center_widget (widget); 102 | box.pack_end (vbox, false, false, 0); 103 | 104 | return box; 105 | } 106 | 107 | public void new_widget (Gtk.Widget child, bool expand = true, bool fill = true, uint padding = 0) { 108 | Gtk.ListBoxRow row = new Gtk.ListBoxRow (); 109 | row.set_size_request (1, 50); 110 | this.listbox.add (row); 111 | 112 | Gtk.Box box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); 113 | row.add (box); 114 | 115 | Gtk.Box vbox = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); 116 | vbox.set_center_widget (child); 117 | box.pack_end (vbox, expand, fill, padding); 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /src/gui/components/TabContainer.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | using Konv; 27 | using Gtk; 28 | 29 | namespace Konv.Gui.Components { 30 | public class TabContainer : Gtk.Box { 31 | public string id { get; private set; default = ""; } 32 | public string title { get; set; default = ""; } 33 | public string icon_name { get; set; default = ""; } 34 | 35 | public TabContainer (string id, Gtk.Orientation orientation) { 36 | this.id = id; 37 | this.orientation = orientation; 38 | this.spacing = 0; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/gui/widgets/AvatarWidget.vala: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015-2017 Granite Developers (https://launchpad.net/granite) 3 | * 4 | * This program or library is free software; you can redistribute it 5 | * and/or modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 3 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General 15 | * Public License along with this library; if not, write to the 16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 | * Boston, MA 02110-1301 USA. 18 | * 19 | * Authored by: Felipe Escoto , Rico Tzschichholz 20 | */ 21 | 22 | /** 23 | * The Avatar widget allowes to theme and crop images with css BORDER_RADIUS 24 | * property in the .avatar class. 25 | */ 26 | public class Konv.Gui.Widgets.Avatar : Gtk.EventBox { 27 | private const string DEFAULT_ICON = "avatar-default"; 28 | private const string DEFAULT_STYLE = "ic-avatar"; 29 | private const int EXTRA_MARGIN = 4; 30 | private const int BORDER_RADIUS = 100; 31 | private bool draw_theme_background = true; 32 | 33 | public Gdk.Pixbuf? pixbuf { get; set; } 34 | public bool border { get; set; default = true; } 35 | 36 | private Gdk.RGBA status_color { get; set; default = Gdk.RGBA (){ 37 | red = 0.0, 38 | green = 0.9, 39 | blue = 0.4, 40 | alpha = 0.7 }; 41 | } 42 | 43 | /** 44 | * Makes new Avatar widget 45 | */ 46 | public Avatar () { 47 | this.set_status ("idle"); 48 | } 49 | 50 | /** 51 | * Creates a new Avatar from the speficied pixbuf 52 | * 53 | * @param pixbuf image to be used 54 | */ 55 | public Avatar.from_pixbuf (Gdk.Pixbuf pixbuf) { 56 | Object (pixbuf: pixbuf); 57 | } 58 | 59 | /** 60 | * Creates a new Avatar from the speficied resource 61 | * 62 | * @param path resource image to be used 63 | */ 64 | public Avatar.from_resource (string path, int width, int height) { 65 | Object (pixbuf: new Gdk.Pixbuf.from_resource_at_scale (path, width, height, false)); 66 | } 67 | 68 | /** 69 | * Creates a new Avatar from the speficied filepath and icon size 70 | * 71 | * @param filepath image to be used 72 | * @param size to scale the image 73 | */ 74 | public Avatar.from_file (string filepath, int icon_size) { 75 | try { 76 | var size = icon_size * this.get_style_context ().get_scale (); 77 | pixbuf = new Gdk.Pixbuf.from_file_at_size (filepath, size - 1, size - 1); 78 | } catch (Error e) { 79 | show_default (icon_size); 80 | } 81 | } 82 | 83 | /** 84 | * Creates a new Avatar with the default icon from theme without applying the css style 85 | * 86 | * @param icon_size size of the icon to be loaded 87 | */ 88 | public Avatar.with_default_icon (int icon_size) { 89 | show_default (icon_size); 90 | } 91 | 92 | construct { 93 | valign = Gtk.Align.CENTER; 94 | halign = Gtk.Align.CENTER; 95 | visible_window = false; 96 | var style_context = this.get_style_context (); 97 | style_context.add_class (DEFAULT_STYLE); 98 | 99 | notify["pixbuf"].connect (refresh_size_request); 100 | } 101 | 102 | ~Avatar () { 103 | notify["pixbuf"].disconnect (refresh_size_request); 104 | } 105 | 106 | public void set_status (string status) { 107 | if (status == "online") { 108 | this.status_color = { 0.29, 0.68, 0.31, 1 }; 109 | this.set_tooltip_text (_("Online")); 110 | } else if (status == "idle") { 111 | this.status_color = { 1.00, 0.92, 0.23, 1 }; 112 | this.set_tooltip_text (_("Away")); 113 | } else if (status == "busy") { 114 | this.status_color = { 0.95, 0.26, 0.21, 1 }; 115 | this.set_tooltip_text (_("Busy")); 116 | } else { 117 | this.status_color = { 0.61, 0.61, 0.61, 1 }; 118 | this.set_tooltip_text (_("Offline")); 119 | } 120 | 121 | queue_draw (); 122 | } 123 | 124 | private void refresh_size_request () { 125 | if (pixbuf != null) { 126 | var scale_factor = this.get_style_context ().get_scale (); 127 | set_size_request ((pixbuf.width - EXTRA_MARGIN / 2) / scale_factor + EXTRA_MARGIN * 2, (pixbuf.height - EXTRA_MARGIN / 2) / scale_factor + EXTRA_MARGIN * 2); 128 | draw_theme_background = true; 129 | } else { 130 | set_size_request (0, 0); 131 | } 132 | 133 | queue_draw (); 134 | } 135 | 136 | /** 137 | * Load the default avatar icon from theme into the widget without applying the css style 138 | * 139 | * @param icon_size size of the icon to be loaded 140 | */ 141 | public void show_default (int icon_size) { 142 | Gtk.IconTheme icon_theme = Gtk.IconTheme.get_default (); 143 | try { 144 | pixbuf = icon_theme.load_icon_for_scale (DEFAULT_ICON, icon_size, this.get_style_context ().get_scale (), 0); 145 | } catch (Error e) { 146 | stderr.printf ("Error setting default avatar icon: %s ", e.message); 147 | } 148 | 149 | draw_theme_background = false; 150 | } 151 | 152 | public override bool draw (Cairo.Context cr) { 153 | if (pixbuf == null) { 154 | return base.draw (cr); 155 | } 156 | 157 | unowned Gtk.StyleContext style_context = this.get_style_context (); 158 | var width = get_allocated_width () - EXTRA_MARGIN * 2; 159 | var height = get_allocated_height () - EXTRA_MARGIN * 2; 160 | var scale_factor = style_context.get_scale (); 161 | 162 | if (draw_theme_background) { 163 | var border_radius = BORDER_RADIUS; 164 | var crop_radius = int.min (width / 2, border_radius * width / 100); 165 | 166 | Utils.cairo_rounded_rectangle (cr, EXTRA_MARGIN / 2 + 2, EXTRA_MARGIN / 2 + 2, width + EXTRA_MARGIN - 2, height + EXTRA_MARGIN - 2, crop_radius); 167 | cr.set_source_rgba ( 168 | this.status_color.red, 169 | this.status_color.green, 170 | this.status_color.blue, 171 | this.status_color.alpha 172 | ); 173 | cr.fill_preserve (); 174 | cr.save (); 175 | #if SYSTEM_OSX 176 | cr.scale (1.0 / scale_factor, 1.0 / scale_factor); 177 | #else 178 | cr.scale (1.0 / scale_factor, 1.0 / scale_factor); 179 | #endif 180 | cr.new_path (); 181 | Utils.cairo_rounded_rectangle (cr, EXTRA_MARGIN + 2, EXTRA_MARGIN + 2, width - 2, height - 2, crop_radius); 182 | Gdk.cairo_set_source_pixbuf (cr, pixbuf, EXTRA_MARGIN * scale_factor, EXTRA_MARGIN * scale_factor); 183 | cr.fill_preserve (); 184 | cr.restore (); 185 | style_context.render_background (cr, EXTRA_MARGIN + 1, EXTRA_MARGIN + 1, width - 1, height - 1); 186 | style_context.render_frame (cr, 0, 0, width, height); 187 | 188 | } else { 189 | cr.save (); 190 | #if SYSTEM_OSX 191 | cr.scale (1.0 / scale_factor, 1.0 / scale_factor); 192 | #else 193 | cr.scale (1.0 / scale_factor, 1.0 / scale_factor); 194 | #endif 195 | 196 | style_context.render_icon (cr, pixbuf, EXTRA_MARGIN, EXTRA_MARGIN); 197 | cr.restore (); 198 | } 199 | 200 | return Gdk.EVENT_STOP; 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /src/gui/widgets/BaseView.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | namespace Konv.Gui.Widgets { 27 | 28 | public enum ViewType { 29 | WELCOME, 30 | CHAT, 31 | GROUP, 32 | UNKNOWN 33 | } 34 | 35 | public class BaseView : Gtk.Box { 36 | 37 | public string id { get; private set; default = null; } 38 | public ViewType view_type { get; private set; default = ViewType.UNKNOWN; } 39 | 40 | public BaseView () { 41 | 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/gui/widgets/ContactListRow.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | namespace Konv.Gui.Widgets { 27 | 28 | [GtkTemplate (ui="/im/konv/client/interfaces/widgets/ContactListRow.ui")] 29 | public class ContactListRow : Gtk.EventBox { 30 | 31 | [GtkChild] private Gtk.Box box_avatar; 32 | [GtkChild] private Gtk.Label name; 33 | [GtkChild] private Gtk.Label status_message; 34 | [GtkChild] private Gtk.Revealer revealer_unread; 35 | [GtkChild] private Gtk.Label unread_count; 36 | [GtkChild] private Gtk.Label secondary_text; 37 | 38 | public Avatar avatar; 39 | public int count; 40 | public string second_text; 41 | 42 | public ContactListRow (string name, string status_message, string avatar, string status) { 43 | this.name.set_text (name); 44 | this.status_message.set_text (status_message); 45 | 46 | this.avatar = new Avatar.from_resource (avatar, 36, 36); 47 | this.avatar.set_status (status); 48 | this.box_avatar.pack_start (this.avatar); 49 | 50 | this.remove_second_text (); 51 | this.remove_unread_count (); 52 | 53 | this.connect_signals (); 54 | } 55 | 56 | private void connect_signals () { 57 | this.notify["count"].connect ((o, p) => { 58 | this.set_unread_count (this.count); 59 | }); 60 | 61 | this.notify["second-text"].connect ((o, p) => { 62 | this.set_second_text (this.second_text); 63 | }); 64 | } 65 | 66 | public void set_second_text (string text) { 67 | this.second_text = text; 68 | this.secondary_text.set_text (this.second_text); 69 | this.secondary_text.show (); 70 | } 71 | 72 | public void remove_second_text () { 73 | this.secondary_text.visible = false; 74 | } 75 | 76 | public void set_unread_count (int count) { 77 | this.count = count; 78 | this.unread_count.set_text ("%d".printf (this.count)); 79 | 80 | if (this.revealer_unread.visible == false) { 81 | Idle.add (() => { // Avoid issues with animations/transitions. 82 | this.revealer_unread.show (); 83 | this.revealer_unread.reveal_child = true; 84 | return false; 85 | }); 86 | } 87 | } 88 | 89 | public void remove_unread_count () { 90 | Idle.add (() => { // Avoid issues with animations/transitions. 91 | this.revealer_unread.reveal_child = false; 92 | this.revealer_unread.hide (); 93 | return false; 94 | }); 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /src/gui/widgets/ContactPreview.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | namespace Konv.Gui.Widgets { 27 | 28 | [GtkTemplate (ui="/im/konv/client/interfaces/widgets/ContactPreview.ui")] 29 | public class ContactPreview : Gtk.Button { 30 | [GtkChild] private Gtk.Label name; 31 | [GtkChild] private Gtk.Box box_avatar; 32 | 33 | private Avatar avatar; 34 | 35 | public ContactPreview (string name, string avatar, string status) { 36 | this.name.set_text (name); 37 | this.name.get_style_context ().add_class ("text-little"); 38 | 39 | this.avatar = new Avatar.from_resource (avatar, 48, 48); 40 | this.box_avatar.pack_start (this.avatar); 41 | 42 | this.avatar.set_status (status); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/gui/widgets/ViewStack.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | namespace Konv.Gui.Widgets { 27 | 28 | public enum ViewType { 29 | WELCOME, 30 | CHAT, 31 | GROUP, 32 | UNKNOWN 33 | } 34 | 35 | public class BaseView : Gtk.Stack { 36 | 37 | public string id { get; private set; default = null; } 38 | public ViewType view_type { get; private set; default = ViewType.UNKNOWN; } 39 | 40 | public BaseView () { 41 | 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/gui/widgets/WelcomeView.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | namespace Konv.Gui.Widgets { 27 | 28 | [GtkTemplate (ui="/im/konv/client/interfaces/widgets/WelcomeView.ui")] 29 | public class WelcomeView : Gtk.Box { 30 | 31 | // Welcome screen. 32 | [GtkChild] private Gtk.Label label_welcome_user; 33 | [GtkChild] private Gtk.Label label_welcome_help; 34 | [GtkChild] private Gtk.Image image_left_arrow; 35 | 36 | // Online contacts. 37 | [GtkChild] private Gtk.Box box_online_contacts; 38 | 39 | private string user_name { get; private set; default = ""; } 40 | private string welcome_text { get; private set; default = ""; } 41 | 42 | public WelcomeView (string user_name) { 43 | this.user_name = user_name; 44 | this.welcome_text = this.label_welcome_user.label; 45 | 46 | this.init_widgets (); 47 | this.connect_signals (); 48 | } 49 | 50 | private void init_widgets () { 51 | this.set_welcome_sentence (); 52 | this.set_arrow_accent (); 53 | this.init_online_contacts (); 54 | } 55 | 56 | private void connect_signals () { 57 | Gtk.Settings.get_default ().notify["gtk-application-prefer-dark-theme"].connect ((o, p) => { 58 | this.set_arrow_accent (); 59 | }); 60 | } 61 | 62 | public void set_arrow_accent () { 63 | if (Gtk.Settings.get_default ().gtk_application_prefer_dark_theme == true) { 64 | this.image_left_arrow.set_from_resource (@"$(Konv.Constants.RES_PATH)/pixmaps/left-arrow-white.svg"); 65 | } else { 66 | this.image_left_arrow.set_from_resource (@"$(Konv.Constants.RES_PATH)/pixmaps/left-arrow-dark.svg"); 67 | } 68 | } 69 | 70 | public void set_welcome_sentence () { 71 | string welcome = this.welcome_text; 72 | this.label_welcome_user.set_text (welcome.printf (this.user_name)); 73 | } 74 | 75 | public void init_online_contacts () { 76 | // Clear the online contacts. 77 | List contacts = this.box_online_contacts.get_children (); 78 | foreach (Gtk.Widget item in contacts) { 79 | this.box_online_contacts.remove (item); 80 | } 81 | 82 | ContactPreview prev = new ContactPreview ("Dumby", @"$(Konv.Constants.RES_PATH)/pixmaps/tmp/gun.png", "online"); 83 | this.box_online_contacts.pack_start (prev, true, true, 0); 84 | 85 | prev = new ContactPreview ("Lil Wayne", @"$(Konv.Constants.RES_PATH)/pixmaps/tmp/lil-wayne.jpg", "online"); 86 | this.box_online_contacts.pack_start (prev, true, true, 0); 87 | 88 | prev = new ContactPreview ("The Rock", @"$(Konv.Constants.RES_PATH)/pixmaps/tmp/the-rock.jpg", "busy"); 89 | this.box_online_contacts.pack_start (prev, true, true, 0); 90 | 91 | prev = new ContactPreview ("Rihanna", @"$(Konv.Constants.RES_PATH)/pixmaps/tmp/rihanna.jpg", "busy"); 92 | this.box_online_contacts.pack_start (prev, true, true, 0); 93 | 94 | prev = new ContactPreview ("Kungfu Panda", @"$(Konv.Constants.RES_PATH)/pixmaps/tmp/kungfu-panda.jpg", "busy"); 95 | this.box_online_contacts.pack_start (prev, true, true, 0); 96 | 97 | prev = new ContactPreview ("Ne-Yo", @"$(Konv.Constants.RES_PATH)/pixmaps/tmp/ne-yo.jpg", "busy"); 98 | this.box_online_contacts.pack_start (prev, true, true, 0); 99 | 100 | prev = new ContactPreview ("Satan", @"$(Konv.Constants.RES_PATH)/pixmaps/tmp/satan.jpg", "idle"); 101 | this.box_online_contacts.pack_start (prev, true, true, 0); 102 | 103 | prev = new ContactPreview ("Lacrim", @"$(Konv.Constants.RES_PATH)/pixmaps/tmp/lacrim.jpg", "idle"); 104 | this.box_online_contacts.pack_start (prev, true, true, 0); 105 | } 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /src/pthread/pthread.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // eah, simple threads emulation (just mutex), compatible with pthread lib 4 | 5 | #ifdef _WIN32 6 | #include 7 | #include 8 | 9 | #ifndef pthread_self 10 | #define pthread_self GetCurrentThreadId 11 | #endif 12 | 13 | #pragma intrinsic (_InterlockedCompareExchange) 14 | #endif 15 | 16 | typedef long lock_t; 17 | 18 | typedef struct 19 | { 20 | lock_t lock; 21 | 22 | } pthread_mutex_t; 23 | 24 | typedef struct 25 | { 26 | int dummy; 27 | 28 | } pthread_mutexattr_t; 29 | 30 | enum 31 | { 32 | PTHREAD_MUTEX_RECURSIVE, 33 | }; 34 | 35 | int inline pthread_mutexattr_init (pthread_mutexattr_t * attr) {return 0;} 36 | int inline pthread_mutexattr_settype( pthread_mutexattr_t *attr, int kind ) { return 0; } 37 | void inline pthread_mutexattr_destroy(pthread_mutexattr_t *attr) {} 38 | 39 | int inline pthread_mutex_init(pthread_mutex_t * mutex, const pthread_mutexattr_t *attr) 40 | { 41 | mutex->lock = 0; 42 | return 0; 43 | } 44 | 45 | 46 | int inline pthread_mutex_trylock(pthread_mutex_t * mutex) 47 | { 48 | volatile lock_t *l = &mutex->lock; 49 | lock_t thread = 0xFFFFFF & pthread_self(); 50 | lock_t val = *l; 51 | if ((val & 0xFFFFFF) == thread) 52 | { 53 | *l += 0x1000000; // simple increment due mutex locked by current thread 54 | return 0; 55 | } 56 | thread |= 0x1000000; 57 | 58 | lock_t tmp = 0; 59 | val = thread; 60 | val = _InterlockedCompareExchange(l, val, tmp); 61 | return (val == tmp) ? 0 : 1; 62 | } 63 | 64 | int inline pthread_mutex_lock (pthread_mutex_t * mutex) 65 | { 66 | volatile lock_t *l = &mutex->lock; 67 | lock_t thread = 0xFFFFFF & pthread_self(); 68 | lock_t val = *l; 69 | if ((val & 0xFFFFFF) == thread) 70 | { 71 | *l += 0x1000000; // simple increment due mutex locked by current thread 72 | return 0; 73 | } 74 | thread |= 0x1000000; 75 | 76 | for (;;) 77 | { 78 | lock_t tmp = 0; 79 | val = thread; 80 | val = _InterlockedCompareExchange(l, val, tmp); 81 | if (val == tmp) 82 | break; 83 | _mm_pause(); 84 | } 85 | 86 | 87 | return 0; 88 | } 89 | 90 | int inline pthread_mutex_unlock (pthread_mutex_t * mutex) 91 | { 92 | volatile lock_t *l = &mutex->lock; 93 | lock_t tmp = *l; 94 | 95 | #ifdef _DEBUG 96 | lock_t thread = 0xFFFFFF & pthread_self(); 97 | if ((*l & 0xFFFFFF) != thread) 98 | __debugbreak(); // fail fail fail 99 | #endif // _DEBUG 100 | 101 | lock_t val = tmp - 0x1000000; 102 | if (!(val & 0xFF000000)) 103 | val = 0; 104 | _InterlockedCompareExchange(l, val, tmp); 105 | 106 | return 0; 107 | } 108 | 109 | int inline pthread_mutex_destroy (pthread_mutex_t * mutex) 110 | { 111 | return 0; 112 | } 113 | -------------------------------------------------------------------------------- /src/utils/RoundImage.vala: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017 SkyzohKey 3 | * 4 | * MIT License 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | **/ 25 | 26 | using Cairo; 27 | 28 | namespace Konv.Gui.Utils { 29 | 30 | /** 31 | * Adds a closed sub-path rounded rectangle of the given size and border radius to the current path 32 | * at position (x, y) in user-space coordinates. 33 | * 34 | * @param cr a {@link Cairo.Context} 35 | * @param x the X coordinate of the top left corner of the rounded rectangle 36 | * @param y the Y coordinate to the top left corner of the rounded rectangle 37 | * @param width the width of the rounded rectangle 38 | * @param height the height of the rounded rectangle 39 | * @param radius the border radius of the rounded rectangle 40 | */ 41 | public static void cairo_rounded_rectangle (Cairo.Context cr, double x, double y, double width, double height, double radius) { 42 | 43 | cr.move_to (x + radius, y); 44 | cr.arc (x + width - radius, y + radius, radius, Math.PI * 1.5, Math.PI * 2); 45 | cr.arc (x + width - radius, y + height - radius, radius, 0, Math.PI * 0.5); 46 | cr.arc (x + radius, y + height - radius, radius, Math.PI * 0.5, Math.PI); 47 | cr.arc (x + radius, y + radius, radius, Math.PI, Math.PI * 1.5); 48 | cr.close_path (); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/vapis/libtoxav.deps: -------------------------------------------------------------------------------- 1 | libtoxcore 2 | -------------------------------------------------------------------------------- /src/vapis/libtoxencryptsave.deps: -------------------------------------------------------------------------------- 1 | libtoxcore 2 | -------------------------------------------------------------------------------- /src/vapis/libtoxencryptsave.vapi: -------------------------------------------------------------------------------- 1 | [CCode (cheader_filename="tox/toxencryptsave.h", cprefix="Tox", lower_case_cprefix="tox_")] 2 | namespace ToxEncrypt { 3 | public const uint32 PASS_SALT_LENGTH; 4 | public const uint32 PASS_KEY_LENGTH; 5 | public const int PASS_ENCRYPTION_EXTRA_LENGTH; 6 | 7 | /** 8 | * This key structure's internals should not be used by any client program, even 9 | * if they are straightforward here. 10 | */ 11 | [CCode (cname="struct TOX_PASS_KEY", destroy_function="", has_type_id=false)] 12 | [Compact] 13 | public class PassKey { 14 | [CCode (array_length=false, array_length_cexpr="TOX_PASS_SALT_LENGTH")] 15 | public uint8[] salt; 16 | [CCode (array_length=false, array_length_cexpr="TOX_PASS_KEY_LENGTH")] 17 | public uint8[] key; 18 | 19 | public PassKey (); 20 | } 21 | 22 | 23 | /******************************************************************************* 24 | * 25 | * :: Errors enums 26 | * 27 | ******************************************************************************/ 28 | [CCode (cname="TOX_ERR_KEY_DERIVATION", cprefix="TOX_ERR_KEY_DERIVATION_")] 29 | public enum ERR_KEY_DERIVATION { 30 | OK, 31 | /** 32 | * Some input data, or maybe the output pointer, was null. 33 | */ 34 | NULL, 35 | /** 36 | * The crypto lib was unable to derive a key from the given passphrase, 37 | * which is usually a lack of memory issue. The functions accepting keys 38 | * do not produce this error. 39 | */ 40 | FAILED 41 | } 42 | 43 | [CCode (cname="TOX_ERR_ENCRYPTION", cprefix="TOX_ERR_ENCRYPTION_")] 44 | public enum ERR_ENCRYPTION { 45 | OK, 46 | /** 47 | * Some input data, or maybe the output pointer, was null. 48 | */ 49 | NULL, 50 | /** 51 | * The crypto lib was unable to derive a key from the given passphrase, 52 | * which is usually a lack of memory issue. The functions accepting keys 53 | * do not produce this error. 54 | */ 55 | KEY_DERIVATION_FAILED, 56 | /** 57 | * The encryption itself failed. 58 | */ 59 | FAILED 60 | } 61 | 62 | [CCode (cname="TOX_ERR_DECRYPTION", cprefix="TOX_ERR_DECRYPTION_")] 63 | public enum ERR_DECRYPTION { 64 | OK, 65 | /** 66 | * Some input data, or maybe the output pointer, was null. 67 | */ 68 | NULL, 69 | /** 70 | * The input data was shorter than TOX_PASS_ENCRYPTION_EXTRA_LENGTH bytes 71 | */ 72 | INVALID_LENGTH, 73 | /** 74 | * The input data is missing the magic number (i.e. wasn't created by this 75 | * module, or is corrupted) 76 | */ 77 | BAD_FORMAT, 78 | /** 79 | * The crypto lib was unable to derive a key from the given passphrase, 80 | * which is usually a lack of memory issue. The functions accepting keys 81 | * do not produce this error. 82 | */ 83 | KEY_DERIVATION_FAILED, 84 | /** 85 | * The encrypted byte array could not be decrypted. Either the data was 86 | * corrupt or the password/key was incorrect. 87 | */ 88 | FAILED 89 | } 90 | 91 | /** 92 | * Encrypts the given data with the given passphrase. The output array must be 93 | * at least data_len + TOX_PASS_ENCRYPTION_EXTRA_LENGTH bytes long. This delegates 94 | * to tox_derive_key_from_pass and tox_pass_key_encrypt. 95 | * 96 | * returns true on success 97 | */ 98 | public static bool pass_encrypt ( 99 | [CCode (array_length_type="size_t")] uint8[] data, 100 | [CCode (array_length_type="size_t")] uint8[] passphrase, 101 | [CCode (array_length=false)] uint8[] encrypted_data, 102 | out ERR_ENCRYPTION error 103 | ); 104 | 105 | /** 106 | * Decrypts the given data with the given passphrase. The output array must be 107 | * at least data_len - TOX_PASS_ENCRYPTION_EXTRA_LENGTH bytes long. This delegates 108 | * to tox_pass_key_decrypt. 109 | * 110 | * the output data has size data_length - TOX_PASS_ENCRYPTION_EXTRA_LENGTH 111 | * 112 | * returns true on success 113 | */ 114 | public static bool pass_decrypt ( 115 | [CCode (array_length_type="size_t")] uint8[] data, 116 | [CCode (array_length_type="size_t")] uint8[] passphrase, 117 | [CCode (array_length=false)] uint8[] decrypted_data, 118 | out ERR_DECRYPTION error 119 | ); 120 | 121 | /** 122 | * Generates a secret symmetric key from the given passphrase. out_key must be at least 123 | * TOX_PASS_KEY_LENGTH bytes long. 124 | * Be sure to not compromise the key! Only keep it in memory, do not write to disk. 125 | * The password is zeroed after key derivation. 126 | * The key should only be used with the other functions in this module, as it 127 | * includes a salt. 128 | * Note that this function is not deterministic; to derive the same key from a 129 | * password, you also must know the random salt that was used. See below. 130 | * 131 | * returns true on success 132 | */ 133 | public static bool derive_key_from_pass ( 134 | [CCode (array_length_type="size_t")] uint8[] passphrase, 135 | out PassKey out_key, out ERR_KEY_DERIVATION error 136 | ); 137 | 138 | /** 139 | * Same as derive_key_from_pass, except use the given salt for deterministic key derivation. 140 | * The salt must be TOX_PASS_SALT_LENGTH bytes in length. 141 | */ 142 | public static bool derive_key_with_salt ( 143 | [CCode (array_length_type="size_t")] uint8[] passphrase, 144 | [CCode (array_length=false)] uint8[] salt, 145 | out PassKey out_key, out ERR_KEY_DERIVATION error 146 | ); 147 | 148 | /** 149 | * This retrieves the salt used to encrypt the given data, which can then be passed to 150 | * derive_key_with_salt to produce the same key as was previously used. Any encrpyted 151 | * data with this module can be used as input. 152 | * 153 | * returns true if magic number matches 154 | * success does not say anything about the validity of the data, only that data of 155 | * the appropriate size was copied 156 | */ 157 | public static bool get_salt ( 158 | [CCode (array_length=false)] uint8[] data, 159 | [CCode (array_length=false)] out uint8[] salt 160 | ); 161 | 162 | /** 163 | * Encrypt arbitrary with a key produced by tox_derive_key_*. The output 164 | * array must be at least data_len + TOX_PASS_ENCRYPTION_EXTRA_LENGTH bytes long. 165 | * key must be TOX_PASS_KEY_LENGTH bytes. 166 | * If you already have a symmetric key from somewhere besides this module, simply 167 | * call encrypt_data_symmetric in toxcore/crypto_core directly. 168 | * 169 | * returns true on success 170 | */ 171 | public static bool pass_key_encrypt ( 172 | [CCode (array_length_type="size_t")] uint8[] data, 173 | PassKey key, 174 | [CCode (array_length=false)] out uint8 @out, 175 | out ERR_DECRYPTION error 176 | ); 177 | 178 | 179 | /** 180 | * This is the inverse of tox_pass_key_encrypt, also using only keys produced by 181 | * tox_derive_key_from_pass. 182 | * 183 | * the output data has size data_length - TOX_PASS_ENCRYPTION_EXTRA_LENGTH 184 | * 185 | * returns true on success 186 | */ 187 | public static bool pass_key_decrypt ([CCode (array_length_type="size_t")] uint8[] data, PassKey key, [CCode (array_length=false)] out uint8[] @out, out ERR_DECRYPTION error); 188 | 189 | /** 190 | * Determines whether or not the given data is encrypted (by checking the magic number) 191 | */ 192 | public static bool is_data_encrypted ([CCode (array_length=false)] uint8[] data); 193 | } 194 | --------------------------------------------------------------------------------