Skip to content

Latest commit

 

History

History
179 lines (139 loc) · 7.7 KB

CONTRIBUTING.md

File metadata and controls

179 lines (139 loc) · 7.7 KB

Contributing

Patches are welcome in whatever form. However, you must agree that your code will be provided by MIT License.

To Documentation

You can contribute to the homepage by sending pull-request to the gh-pages branch if there is an error or a better way to describe the content. Jekyll is used as the framework, and can be written in markdown format. We also use Just the Docs as a theme, which allows extended expressions.

To Development

You can contribute to development by sending pull requests to the master branch to fix or add features, add test cases, modify typos and expressions, improve security. When adding new code, please consider adding test cases in the test directory to satisfy branch coverage. Codacy and Travis and Actions run by pushing, and Coverity checks programmatic resources at releasing as Continuous Integration. If you want to discuss development, please create a thread in Discussion with #Development category.

Quick Start for Build

If you have already installed MinGW-w64 or Visual Studio 2019, all you need is the next steps.

1. Install dependent libraries in the project root
$ ./tools/setup_libs.bat [-mingw/-msvc] [32/64] [-update (optional)]
2. Build this project with cmake and execute it
Automatically (Recommended)
$ ./build.bat [-debug/-release] [-mingw/-msvc] [32/64]
$ ./debug/win-vind.exe
Manually (Visual Studio 2019)
$ cmake -B build -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 16 2019" -A x64 -DBIT_TYPE=64 .
$ cmake --build build --config Debug
$ ./debug/Debug/win-vind.exe
Manually (MinGW-w64)
$ cmake -B debug -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" -DBIT_TYPE=64 .
$ cmake --build debug --config Debug
$ ./debug/win-vind.exe

Run Test

Automatically (Recommended)
$ ./build.bat -test
Manually (Visual Studio 2019)
$ cmake -B test/build -DCMAKE_BUILD_TYPE=Debug -G "Visual Studio 16 2019" test
$ cmake --build test/build
$ cd test/build ; ctest -C Debug ; cd ../..
Manually (MinGW-w64)
$ cmake -B test/build -DCMAKE_BUILD_TYPE=Debug -G "MinGW Makefiles" test
$ cmake --build test/build
$ cd test/build ; ctest -C Debug ; cd ../..

You can refer to ToDo at Projects/win-vind and its architecture at devdocs.

Development Environment Versions

I recommend to install follow softwares or libraries.

Name Recommended Version Download Link
MinGW-w64 GCC-8.1.0-x86_64-posix-seh MinGW-w64 SourceForge.net
CMake 3.14.4 Download - CMake
wxWidgets 3.1.5 Downloads - wxWidgets
NSIS 3.06.1 Download - NSIS
Windows10 SDK 10.0.19041.0 Microsoft Windows10 SDK - Windows app development

This project use <mutex>, so some MinGW without it will fail a build. In this case, you will need to install other MinGW with . (select posix at item called Thread in MinGW-Installer.)

Dependencies

Name What is Purpose License
wxWidgets GUI framework Create GUI for the system tray or popups. modified LGPL
nlohmann-json JSON parser Parse json style settings MIT License
maddy Markdown to HTML parser Display the release note via Check Update MIT License
doctest Unit test framework For basic unit test MIT License
fff Macro-based fake function framework To mock Windows API MIT License

Example for making original feature

Please read its architecture at devdocs.

All binded functions of win-vind derive from BindedFunc. However, these are based on polymorphism, so recommends to derive from BindedFuncCreator to have a factory function.

New KeyBinding Example

mybinding.hpp

#ifndef MY_BINDING_HPP
#define MY_BINDING_HPP

#include "bind/base/binded_func_creator.hpp"

namespace vind
{
    struct MyBinding : public BindedFuncCreator<MyBinding> {
        explicit MyBinding() ;
        static void sprocess() ;
        static void sprocess(NTypeLogger& parent_lgr) ;
        static void sprocess(const CharLogger& parent_lgr) ;
    } ;
}

#endif

mybinding.cpp

#include "bind/dev/mybindings.hpp"

#include "bind/base/ntype_logger.hpp"
#include "io/keybrd.hpp"
#include "io/mouse.hpp"
#include "opt/virtual_cmd_line.hpp"
#include "util/def.hpp"


namespace vind
{
    MyBinding::MyBinding()
    : BindedFuncCreator("my_binding") //Give the unique identifier.
    {}
    // A one-shot function to call inside win-vind
    void MyBinding::sprocess() {
        mouse::click(KEYCODE_MOUSE_LEFT) ; //left click

        keybrd::pushup(KEYCODE_LWIN, KEYCODE_D) ; //minimize all window

        VirtualCmdLine::msgout("Hello World !") ;
    }
    // A function called by sequence commands such as `23gg`
    void MyBinding::sprocess(NTypeLogger& parent_lgr) {
        if(!parent_lgr.is_long_pressing()) {
            sprocess() ;
        }
    }
    // A function called by the command line style commands like `:sample`
    void MyBinding::sprocess(const CharLogger& UNUSED(parent_lgr)) {
        sprocess() ;
    }
}
    MyBinding::create(),
    {
        "name": "my_binding",
        "cdef": ["sample"],
        "endef": [],
        "evdef": [],
        "gndef": [],
        "gvdef": [],
        "idef": [],
        "rdef": [],
        "en": "Sample",
        "ja": "Sample"
    },