Skip to content

Commit

Permalink
Merge pull request #2 from MaxBQb/dev
Browse files Browse the repository at this point in the history
Merge dev to master
  • Loading branch information
MaxBQb authored Jul 27, 2022
2 parents f084f11 + fb926ee commit 85a1410
Show file tree
Hide file tree
Showing 30 changed files with 2,864 additions and 663 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
branches: [ "master", "CI-Test" ]
paths:
- 'win_magnification/**'
- 'example/windows_utils'
- 'tests/**'
- '.github/workflows/python-package.yml'
pull_request:
branches: [ "master" ]
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,5 @@ $RECYCLE.BIN/

# End of https://www.toptal.com/developers/gitignore/api/python,venv,pycharm+all,windows
/.pycrunch-config.yaml
/docs/source/_autosummary/
/docs/source/generated/
14 changes: 14 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-20.04
tools:
python: "3.10"

python:
install:
- requirements: docs/requirements.txt
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# [WinMagnification](https://pypi.org/project/WinMagnification/)
# WinMagnification
[![Windows](https://svgshare.com/i/ZhY.svg)](https://svgshare.com/i/ZhY.svg)
[![PyPI version shields.io](https://img.shields.io/pypi/v/WinMagnification.svg)](https://pypi.org/project/WinMagnification/)
[![Documentation Status](https://readthedocs.org/projects/winmagnification/badge/?version=latest)](https://winmagnification.readthedocs.io/en/latest/)
[![GitHub license](https://img.shields.io/github/license/MaxBQb/WinMagnification.svg)](https://github.com/MaxBQb/WinMagnification/blob/master/LICENSE.md)
---

Python wrapper for [Windows Magnification API](https://docs.microsoft.com/en-us/windows/win32/api/_magapi/)

```cmd
pip install WinMagnification
```

Covered functions:
+ MagInitialize
+ MagUninitialize
Expand Down
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14 changes: 14 additions & 0 deletions docs/clear.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os.path
import shutil


for path in [
r'.\source\generated',
r'.\build',
]:
try:
path = os.path.abspath(path)
shutil.rmtree(path)
print("Removed", path)
except FileNotFoundError:
print("Skipped", path)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
5 changes: 5 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
sphinx-rtd-theme==1.0.0
Sphinx==4.5.0
sphinx-design==0.2.0
sphinx-toolbox==3.1.2
sphinx-hoverxref==1.1.3
15 changes: 15 additions & 0 deletions docs/source/_templates/module.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{ fullname | escape | underline}}

.. article-info::
:avatar: https://avatars.githubusercontent.com/u/27343275?s=40&v=4
:avatar-alt: @MaxBQb
:avatar-link: https://github.com/MaxBQb
:author: :bdg-link-secondary:`MaxBQb <https://github.com/MaxBQb>`
:date: |today|
:class-container: sd-p-2 sd-outline-warning sd-rounded-3

.. automodule:: {{ fullname }}
:imported-members:
:members:
:undoc-members:
:show-inheritance:
15 changes: 15 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
API Description
===============

.. autosummary::
:toctree: generated/
:template: module.rst

win_magnification
win_magnification.types
win_magnification.const
win_magnification.tools
win_magnification._object_utils
win_magnification._objects
win_magnification.effects
win_magnification.old
115 changes: 115 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join('..', '..')))


# -- Project information -----------------------------------------------------

project = 'WinMagnification'
# noinspection PyShadowingBuiltins
copyright = '2022, MaxBQb'
author = 'MaxBQb'

# The full version, including alpha/beta/rc tags
release = '0.0.1'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
# noinspection SpellCheckingInspection
extensions = [
'sphinx.ext.duration',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'hoverxref.extension', # https://sphinx-hoverxref.readthedocs.io/en/latest/
'sphinx_design', # https://sphinx-design.readthedocs.io/en/rtd-theme/badges_buttons.html
'sphinx.ext.viewcode',
'sphinx_tabs.tabs',
'sphinx-prompt',
'sphinx_toolbox', # https://sphinx-toolbox.readthedocs.io/en/stable/extensions/
'sphinx_toolbox.sidebar_links',
'sphinx_toolbox.github',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
]
github_username = 'MaxBQb'
github_repository = 'WinMagnification'
add_module_names = False
hoverxref_auto_ref = True
hoverxref_domains = ['py']
autodoc_typehints = 'signature'
# noinspection SpellCheckingInspection
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'sphinx': ('https://www.sphinx-doc.org/en/master/', None),
}
# noinspection SpellCheckingInspection
intersphinx_disabled_domains = ['std']
# noinspection SpellCheckingInspection
autosummary_generate = True
# noinspection SpellCheckingInspection
autodoc_member_order = 'bysource'


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = [] # type: ignore


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'

autodoc_type_aliases = {
'types.ColorMatrix': 'types.ColorMatrix',
'ColorMatrix': 'types.ColorMatrix',
'types.TransformationMatrix': 'types.TransformationMatrix',
'types.RectangleRaw': 'Tuple[int, int, int, int]',
'T': 'T',
'WrappedFieldType': 'WrappedFieldType',
'Transition': 'Transition',
}
autodoc_typehints_format = 'short'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = [] # type: ignore

rst_prolog = """
.. |up-left| replace:: :octicon:`arrow-up-left;1em;sd-text-success`
.. |down-right| replace:: :octicon:`arrow-down-right;1em;sd-text-success`
.. |up| replace:: :octicon:`arrow-up;1em;sd-text-success`
.. |down| replace:: :octicon:`arrow-down;1em;sd-text-success`
.. |left| replace:: :octicon:`arrow-left;1em;sd-text-success`
.. |right| replace:: :octicon:`arrow-right;1em;sd-text-success`
.. |single thread| replace:: On call from thead other than the first one, where :func:`.initialize` was called
.. |accessor getter| replace:: :octicon:`eye;1em;sd-text-warning` :bdg-link-warning:`Get <https://docs.python.org/3/library/functions.html#getattr>`
.. |accessor setter| replace:: :octicon:`pencil;1em;sd-text-success` :bdg-link-success:`Set <https://docs.python.org/3/library/functions.html#setattr>`
.. |accessor deleter| replace:: :octicon:`trash;1em;sd-text-danger` :bdg-link-danger:`Delete <https://docs.python.org/3/library/functions.html#delattr>`
.. |Accessors: Get| replace:: **Accessors**: |accessor getter| :bdg-link-success-line:`Readonly <https://docs.python.org/3/library/functions.html?highlight=read-only#property>`
.. |Accessors: Get Set| replace:: **Accessors**: |accessor getter| |accessor setter|
.. |Accessors: Get Set Delete| replace:: **Accessors**: |accessor getter| |accessor setter| |accessor deleter|
"""
31 changes: 31 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. WinMagnification documentation master file, created by
sphinx-quickstart on Sun Jul 3 12:07:52 2022.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to WinMagnification's documentation!
============================================

Installation
============

.. installation:: WinMagnification
:pypi:
:github:

.. toctree::
:maxdepth: 2
:caption: Contents:

api

.. sidebar-links::
:github:
:pypi: WinMagnification

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
2 changes: 2 additions & 0 deletions docs/source/shared/wrapper/common.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
| :attr:`Default value <.default>` available for this field.
| Also all values of this field can be :meth:`.reset` at once
13 changes: 13 additions & 0 deletions docs/source/shared/wrapper/component.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.. dropdown:: Parameter wrapper
:color: warning
:animate: fade-in-slide-down
:icon: container

This is wrapper for argument of :abbr:`complex (Have many parameters)` :mod:`winapi <win_magnification>` function, so
at the time this property accessed the real value is already retrieved.
Any changes made for this property, or its inner properties are immediately update real value.
To apply changes at once you may use :meth:`.WrappedField.batch`.
Also you may use :attr:`.raw` which is equivalent of change all inner fields at once

.. note::
.. include:: ../shared/wrapper/common.rst
14 changes: 14 additions & 0 deletions docs/source/shared/wrapper/head.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.. dropdown:: Function wrapper
:color: success
:animate: fade-in-slide-down
:icon: package

This is wrapper for :abbr:`complex (Have many parameters)` :mod:`winapi <win_magnification>` function, so
each time inner property accessed it will retrieve real values
by calling this function, which can be used to change some
parameters independently of others, to get/set a couple of values at once
use :meth:`.WrappedField.batch`, also you may use :attr:`.raw`, it works just like
direct winapi function call.

.. note::
.. include:: ../shared/wrapper/common.rst
Loading

0 comments on commit 85a1410

Please sign in to comment.