added from repo

emdee 2022-10-18 10:29:22 +00:00
parent d04d768bfe
commit 6a94710922
6 changed files with 152 additions and 5 deletions

19
CompilingToxygen.md Normal file

@ -0,0 +1,19 @@
# Compile Toxygen
You can compile Toxygen using [PyInstaller](http://www.pyinstaller.org/)
Use Dockerfile and build script from `build` directory:
1. Build image:
```
docker build -t toxygen .
```
2. Run container:
```
docker run -it toxygen bash
```
3. Execute `build.sh` script:
```./build.sh```

@ -0,0 +1,22 @@
# Plugins
Toxygen is the first [Tox](https://tox.chat/) client with plugins support. Plugin is Python 3.5 - 3.6 module (.py file) and directory with plugin's data which provide some additional functionality.
# How to write plugin
Check [Plugin API](/docs/plugin_api.md) for more info
# How to install plugin
Toxygen comes without preinstalled plugins.
1. Put plugin and directory with its data into /src/plugins/ or import it via GUI (In menu: Plugins => Import plugin)
2. Restart Toxygen or choose Plugins => Reload plugins in menu.
## Note: /src/plugins/ should contain plugin_super_class.py and __init__.py
# Plugins list
WARNING: It is unsecure to install plugin not from this list!
[Main repo](https://github.com/toxygen-project/toxygen_plugins)

14
Home.md

@ -1,5 +1,9 @@
Welcome to the Wiki.
These wiki pages are from the original Toxygen project and may be out of date.
They are from the ```docs``` directory of the repo.
Welcome to the Wiki.
These wiki pages are from the original Toxygen project and may be out of date.
They are from the ```docs``` directory of the repo.
* [[CompilingToxygen]]
* [[InstallingToxygen]]
* [[CompilingToxygenPlugins]]
* [[ToxygenPluginsApi]]

44
InstallingToxygen.md Normal file

@ -0,0 +1,44 @@
# How to install Toxygen
### Linux
1. Install [c-toxcore](https://github.com/TokTok/c-toxcore/)
2. Install PortAudio:
``sudo apt-get install portaudio19-dev``
3. For 32-bit Linux install PyQt5: ``sudo apt-get install python3-pyqt5``
4. Install [OpenCV](http://docs.opencv.org/trunk/d7/d9f/tutorial_linux_install.html) or via ``sudo pip3 install opencv-python``
5. Install [toxygen](https://git.plastiras.org/emdee/toxygen/)
6. Run toxygen using ``toxygen`` command.
## From source code (recommended for developers)
### Windows
Note: 32-bit Python isn't supported due to bug with videocalls. It is strictly recommended to use 64-bit Python.
1. [Download and install latest Python 3 64-bit](https://www.python.org/downloads/windows/)
2. Install PyQt5: ``pip install pyqt5``
3. Install PyAudio: ``pip install pyaudio``
4. Install numpy: ``pip install numpy``
5. Install OpenCV: ``pip install opencv-python``
6. [Download toxygen](https://github.com/toxygen-project/toxygen/archive/master.zip)
7. Unpack archive
8. Download latest libtox.dll build, download latest libsodium.a build, put it into \toxygen\libs\
9. Run \toxygen\main.py.
### Linux
1. Install latest Python3:
``sudo apt-get install python3``
2. Install PyQt5: ``sudo apt-get install python3-pyqt5`` or ``sudo pip3 install pyqt5``
3. Install [toxcore](https://github.com/TokTok/c-toxcore) with toxav support)
4. Install PyAudio:
``sudo apt-get install portaudio19-dev`` and ``sudo apt-get install python3-pyaudio`` (or ``sudo pip3 install pyaudio``)
5. Install NumPy: ``sudo pip3 install numpy``
6. Install [OpenCV](http://docs.opencv.org/trunk/d7/d9f/tutorial_linux_install.html) or via ``sudo pip3 install opencv-python``
7. [Download toxygen](https://git.plastiras.org/emdee/toxygen/)
8. Unpack archive
9. Run app:
``python3 main.py``
Optional: install toxygen using setup.py: ``python3 setup.py install``

57
ToxygenPluginsApi.md Normal file

@ -0,0 +1,57 @@
# Plugins API
In Toxygen plugin is single python module (.py file) and directory with data associated with it.
Every module must contain one class derived from PluginSuperClass defined in [plugin_super_class.py](/src/plugins/plugin_super_class.py). Instance of this class will be created by PluginLoader class (defined in [plugin_support.py](/src/plugin_support.py) ). This class can enable/disable plugins and send data to it.
Every plugin has its own full name and unique short name (1-5 symbols). Main app can get it using special methods.
All plugin's data should be stored in following structure:
```
/plugins/
|---plugin_short_name.py
|---/plugin_short_name/
|---settings.json
|---readme.txt
|---logs.txt
|---other_files
```
Plugin MUST override:
- __init__ with params: tox (Tox instance), profile (Profile instance), settings (Settings instance), encrypt_save (ToxES instance). Call super().__init__ with params plugin_full_name, plugin_short_name, tox, profile, settings, encrypt_save.
Plugin can override following methods:
- get_description - this method should return plugin description.
- get_menu - plugins allowed to add items in friend menu. User can open this menu making right click on friend in friends list. This method should return list of QAction's. Plugin must connect to QAction's triggered() signal.
- get_window - plugins can have GUI, this method should return window instance or None for plugins without GUI.
- start - plugin was started.
- stop - plugin was stopped.
- close - app is closing, stop plugin.
- command - new command to plugin. Command can be entered in message field in format '/plugin <plugin_short_name> <command>'. Command 'help' should show list of supported commands.
- lossless_packet - callback - incoming lossless packet from friend.
- lossy_packet - callback - incoming lossy packet from friend.
- friend_connected - callback - friend became online. Note that it called from friend_connection_status callback so friend is not really connected and ready for sending packets.
Other methods:
- send_lossless - this method sends custom lossless packet. Plugins MUST send lossless packets using this method.
- send_lossy - this method sends custom lossy packet. Plugins MUST send lossy packets using this method.
- load_settings - loads settings stored in default location.
- save_settings - saves settings to default location.
- load_translator - loads translations. Translations must be stored in directory with plugin's data. Files with translations must have the same name as in main app (example: ru_RU.qm).
About import:
Import statement will not work in case you import module that wasn't previously imported by main program and user uses precompiled binary. It's recommended to use importlib module instead: importlib.import_module(module_name)
About GUI:
GUI is available via PyQt5. Plugin can have no GUI at all.
Exceptions:
Plugin's methods MUST NOT raise exceptions.
# Examples
You can find examples in [official repo](https://github.com/toxygen-project/toxygen_plugins)

1
_Footer.md Normal file

@ -0,0 +1 @@
Up: [[Home]]