Metadata-Version: 2.1
Name: WinMagnification
Version: 0.0.1
Summary: Python wrapper for Windows Magnification API
Author: MaxBQb
License: MIT License
        
        Copyright (c) 2022 MaxBQb
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/MaxBQb/WinMagnification
Project-URL: Bug Tracker, https://github.com/MaxBQb/WinMagnification/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE.md

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

Covered functions:
+ MagInitialize
+ MagUninitialize
+ MagGetFullscreenColorEffect
+ MagSetFullscreenColorEffect
+ MagSetFullscreenTransform
+ MagGetFullscreenTransform
+ MagSetColorEffect
+ MagGetColorEffect
+ MagSetWindowTransform
+ MagGetWindowTransform
+ MagSetWindowSource
+ MagGetWindowSource
+ MagSetWindowFilterList
+ MagGetWindowFilterList
+ MagGetInputTransform
+ MagSetInputTransform
+ MagShowSystemCursor

You may use old-style function names:
```py
import win_magnification as mag
import win_magnification.old as old_mag

old_mag.MagInitialize()
old_mag.MagSetFullscreenColorEffect(mag.const.COLOR_INVERSION_EFFECT)
old_mag.MagSetFullscreenColorEffect(mag.const.DEFAULT_COLOR_EFFECT)
old_mag.MagUninitialize()
```

Or you may use more pythonic function names:
```py
import win_magnification as mag

mag.initialize()
mag.set_fullscreen_color_effect(mag.const.COLOR_INVERSION_EFFECT)
mag.reset_fullscreen_color_effect()
mag.finalize()
```

Or... you can even use Object-Oriented wrapper:
```py
import win_magnification as mag

api = mag.WinMagnificationAPI()
api.fullscreen.color_effect.raw = mag.const.COLOR_INVERSION_EFFECT
api.fullscreen.color_effect.reset()
```

# Restrictions
There are 3.5 groups of functions:

- Fullscreen (nothing required, call and chill) have limited functional, but simple:
  + get/set_fullscreen_color_effect
  + get/set_fullscreen_transform
  + **get_input_transform**
- Window (requires window creation as shown in [example](https://github.com/MaxBQb/WinMagnification/blob/master/example/windows_utils.py)),
more powerful, but requires such things like custom window creation (hello from [pywin32](https://pypi.org/project/pywin32/)),
[UiAccess](https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/user-account-control-allow-uiaccess-applications-to-prompt-for-elevation-without-using-the-secure-desktop) (Hard to obtain) if you need your magnifier [above everything](https://blog.adeltax.com/window-z-order-in-windows-10/), but you can simulate all fullscreen functions too:
  + get/set_color_effect
  + get/set_transform
  + get/set_source
  + get/set_filters (supports exclusion only, looks like excluded windows never exist for magnifier)
- [UiAccess](https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/user-account-control-allow-uiaccess-applications-to-prompt-for-elevation-without-using-the-secure-desktop) required:
  + **set_input_transform**
- Other:
  + initialize
  + finalize
  + set_cursor_visibility (cursor stay hidden until active)

# Known alternatives
[Pymagnification](https://pypi.org/project/pymagnification/)

I can't actually use this lib, I don't know why, it just does nothing and imports nothing.
Also, it doesn't support fullscreen* functions

# Known issues
Working from different threads is pain, and I'm trying to solve/restrict this somehow

# [PyWin32](https://pypi.org/project/pywin32/) Integration?
This package uses ctypes only, so no pywin32 required.
But, well, you can use pywin32 for creating magnifier windows and so on (see [example](https://github.com/MaxBQb/WinMagnification/blob/master/example/windows_utils.py))
