pywin32 annotations improvements (#11177)

This commit is contained in:
Avasam
2023-12-18 07:33:56 -05:00
committed by GitHub
parent d3bf2805b4
commit 96526875f7
6 changed files with 45 additions and 34 deletions

View File

@@ -1,5 +1,5 @@
# Not available at runtime. Contains type definitions that are otherwise not exposed and not part of a specific module.
from _typeshed import Incomplete
from _typeshed import Incomplete, Unused
from collections.abc import Iterable
from typing import overload
from typing_extensions import Literal, Self, final
@@ -4029,7 +4029,7 @@ class PyIOleInPlaceSiteWindowless:
def GetFocus(self) -> None: ...
def SetFocus(self, fFocus) -> None: ...
def GetDC(self, grfFlags, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete]) -> None: ...
def ReleaseDC(self, hDC) -> None: ...
def ReleaseDC(self, __hDC: PyCDC) -> None: ...
def InvalidateRect(self, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete], fErase) -> None: ...
def InvalidateRgn(self, hRgn, fErase) -> None: ...
def ScrollRect(self, dx, dy) -> None: ...
@@ -4788,9 +4788,9 @@ class PyAssocObject:
def GetAttachedObject(self): ...
class PyCBitmap:
def CreateCompatibleBitmap(self, dc: PyCDC, width, height) -> None: ...
def CreateCompatibleBitmap(self, __dc: PyCDC, __width: int, __height: int) -> None: ...
def GetSize(self) -> tuple[Incomplete, Incomplete]: ...
def GetHandle(self) -> PyGdiHANDLE: ...
def GetHandle(self, *args: Unused) -> int: ...
def LoadBitmap(self, idRes, obDLL: PyDLL | None = ...) -> None: ...
def LoadBitmapFile(self, fileObject) -> None: ...
def LoadPPMFile(self, fileObject, cols, rows) -> None: ...
@@ -4919,12 +4919,7 @@ class PyCDC:
) -> None: ...
def BeginPath(self) -> None: ...
def BitBlt(
self,
destPos: tuple[Incomplete, Incomplete],
size: tuple[Incomplete, Incomplete],
dc: PyCDC,
srcPos: tuple[Incomplete, Incomplete],
rop,
self, __destPos: tuple[int, int], __size: tuple[int, int], __dc: PyCDC, __srcPos: tuple[int, int], __rop: int
) -> None: ...
def Chord(
self,
@@ -4932,7 +4927,7 @@ class PyCDC:
pointStart: tuple[Incomplete, Incomplete],
pointEnd: tuple[Incomplete, Incomplete],
) -> None: ...
def CreateCompatibleDC(self, dcFrom: PyCDC | None = ...) -> PyCDC: ...
def CreateCompatibleDC(self, __dcFrom: PyCDC | None = ...) -> PyCDC: ...
def CreatePrinterDC(self, printerName: str | None = ...) -> None: ...
def DeleteDC(self) -> None: ...
def DPtoLP(self, point: tuple[Incomplete, Incomplete], x, y) -> tuple[Incomplete, Incomplete]: ...
@@ -4969,7 +4964,7 @@ class PyCDC:
def GetMapMode(self): ...
def GetNearestColor(self, color): ...
def GetPixel(self, x, y) -> None: ...
def GetSafeHdc(self): ...
def GetSafeHdc(self) -> int: ...
def GetTextExtent(self, text: str) -> tuple[Incomplete, Incomplete]: ...
def GetTextExtentPoint(self, text: str) -> tuple[Incomplete, Incomplete]: ...
def GetTextFace(self) -> str: ...
@@ -4998,7 +4993,7 @@ class PyCDC:
def ScaleWindowExt(self) -> tuple[Incomplete, Incomplete]: ...
def ScaleViewportExt(self) -> tuple[Incomplete, Incomplete]: ...
def SelectClipRgn(self): ...
def SelectObject(self, ob): ...
def SelectObject(self, __ob: PyCBitmap) -> PyCBitmap: ...
def SetBkColor(self, color): ...
def SetBkMode(self, mode): ...
def SetBrushOrg(self, point: tuple[Incomplete, Incomplete]) -> tuple[Incomplete, Incomplete]: ...
@@ -5856,7 +5851,7 @@ class PyCWnd:
def GetWindow(self, _type) -> PyCWnd: ...
def GetWindowDC(self) -> PyCDC: ...
def GetWindowPlacement(self): ...
def GetWindowRect(self) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ...
def GetWindowRect(self) -> tuple[int, int, int, int]: ...
def GetWindowText(self) -> str: ...
def HideCaret(self) -> None: ...
def HookAllKeyStrokes(self, obHandler) -> None: ...
@@ -5894,7 +5889,7 @@ class PyCWnd:
self, _object: PyCRgn, flags, rect: tuple[Incomplete, Incomplete, Incomplete, Incomplete] | None = ...
) -> None: ...
def ReleaseCapture(self) -> None: ...
def ReleaseDC(self, dc: PyCDC) -> None: ...
def ReleaseDC(self, __dc: PyCDC) -> None: ...
def RepositionBars(self, idFirst, idLast, idLeftOver) -> None: ...
def RunModalLoop(self, flags): ...
def PostMessage(self, idMessage, wParam: int = ..., lParam: int = ...) -> None: ...

View File

@@ -1,4 +1,4 @@
from _typeshed import Incomplete
from _typeshed import Incomplete, Unused
import _win32typing
@@ -7,7 +7,7 @@ class error(Exception): ...
def ComparePath(path1: str, path2: str): ...
def CreateMDIFrame() -> _win32typing.PyCMDIFrameWnd: ...
def CreateMDIChild() -> _win32typing.PyCMDIChildWnd: ...
def CreateBitmap() -> _win32typing.PyCBitmap: ...
def CreateBitmap(*args: Unused) -> _win32typing.PyCBitmap: ...
def CreateBitmapFromHandle(): ...
def CreateBrush() -> _win32typing.PyCBrush: ...
def CreateButton() -> _win32typing.PyCButton: ...
@@ -28,7 +28,7 @@ def CreateControl(
def CreateControlBar() -> _win32typing.PyCControlBar: ...
def CreateCtrlView(doc: _win32typing.PyCDocument, className: str, style: int = ...) -> _win32typing.PyCCtrlView: ...
def CreateDC() -> None: ...
def CreateDCFromHandle(hwnd: int) -> _win32typing.PyCDC: ...
def CreateDCFromHandle(__hwnd: int | _win32typing.PyHANDLE) -> _win32typing.PyCDC: ...
def CreateDialog(idRes, dll: _win32typing.PyDLL | None = ...) -> _win32typing.PyCDialog: ...
def CreateDialogBar() -> _win32typing.PyCDialogBar: ...
def CreateDialogIndirect(oblist) -> _win32typing.PyCDialog: ...

View File

@@ -137,7 +137,7 @@ def GetSystemFileCacheSize(): ...
def SetSystemFileCacheSize(MinimumFileCacheSize, MaximumFileCacheSize, Flags=...) -> None: ...
def GetSystemInfo(): ...
def GetNativeSystemInfo(): ...
def GetSystemMetrics(index): ...
def GetSystemMetrics(__index: int) -> int: ...
def GetSystemPowerStatus() -> dict[str, int]: ...
def GetSystemTime(): ...
def GetTempFileName(path: str, prefix: str, nUnique): ...

View File

@@ -98,8 +98,18 @@ def CreateIconFromResource(bits: str, fIcon, ver: int = ...) -> int: ...
def LoadImage(
__hinst: int, __name: str, __type: int, __cxDesired: int, __cyDesired: int, __fuLoad: int
) -> _win32typing.PyGdiHANDLE: ...
def DeleteObject(handle: _win32typing.PyGdiHANDLE) -> None: ...
def BitBlt(hdcDest, x, y, width, height, hdcSrc, nXSrc, nYSrc, dwRop) -> None: ...
def DeleteObject(__handle: int | _win32typing.PyGdiHANDLE) -> None: ...
def BitBlt(
__hdcDest: int | _win32typing.PyGdiHANDLE,
__x: int,
__y: int,
__width: int,
__height: int,
__hdcSrc: int | _win32typing.PyGdiHANDLE | None,
__nXSrc: int,
__nYSrc: int,
__dwRop: int,
) -> None: ...
def StretchBlt(hdcDest, x, y, width, height, hdcSrc, nXSrc, nYSrc, nWidthSrc, nHeightSrc, dwRop) -> None: ...
def PatBlt(hdc: int, XLeft, YLeft, Width, Height, Rop) -> None: ...
def SetStretchBltMode(hdc: int, StretchMode): ...
@@ -167,13 +177,17 @@ def GetClientRect(hwnd: int) -> tuple[int, int, int, int]: ...
def GetDC(hwnd: int): ...
def SaveDC(hdc: int): ...
def RestoreDC(hdc: int, SavedDC) -> None: ...
def DeleteDC(hdc) -> None: ...
def CreateCompatibleDC(dc): ...
def CreateCompatibleBitmap(hdc, width, height) -> _win32typing.PyGdiHANDLE: ...
def CreateBitmap(width, height, cPlanes, cBitsPerPixel, bitmap_bits) -> _win32typing.PyGdiHANDLE: ...
def SelectObject(hdc, _object): ...
def DeleteDC(__hdc: int | _win32typing.PyHANDLE) -> None: ...
def CreateCompatibleDC(__dc: int | _win32typing.PyHANDLE | None) -> int: ...
def CreateCompatibleBitmap(
__hdc: int | _win32typing.PyHANDLE | None, __width: int, __height: int
) -> _win32typing.PyGdiHANDLE: ...
def CreateBitmap(
__width: int, __height: int, __cPlanes: int, __cBitsPerPixel: int, __bitmap_bits: None
) -> _win32typing.PyGdiHANDLE: ...
def SelectObject(__hdc: int | _win32typing.PyHANDLE | None, __object: int | _win32typing.PyHANDLE | None) -> int: ...
def GetCurrentObject(hdc: int, ObjectType) -> int: ...
def GetWindowRect(hwnd: int) -> tuple[int, int, int, int]: ...
def GetWindowRect(__hwnd: int | _win32typing.PyHANDLE) -> tuple[int, int, int, int]: ...
def GetStockObject(Object) -> int: ...
def PostQuitMessage(__rc: int) -> None: ...
def WaitMessage() -> None: ...
@@ -360,18 +374,18 @@ def CreateWindowEx(
dwExStyle, className: str, windowTitle: str, style, x, y, width, height, parent, menu, hinstance, reserved
): ...
def GetParent(child: int) -> int: ...
def SetParent(__child: int, __child1: int | None | _win32typing.PyHANDLE) -> int: ...
def SetParent(__child: int, __child1: int | _win32typing.PyHANDLE | None) -> int: ...
def GetCursorPos() -> tuple[Incomplete, Incomplete]: ...
def GetDesktopWindow(): ...
def GetWindow(__hWnd: int, __uCmd: int) -> int: ...
def GetWindowDC(hWnd: int) -> int: ...
def GetWindowDC(__hWnd: int | _win32typing.PyHANDLE | None) -> int: ...
def IsIconic(__hWnd: int) -> int: ...
def IsWindow(__hWnd: int) -> int: ...
def IsChild(__hWndParent: int, hWnd: int) -> int: ...
def ReleaseCapture() -> None: ...
def GetCapture(): ...
def SetCapture() -> None: ...
def ReleaseDC(hWnd: int, hDC): ...
def ReleaseDC(__hWnd: int | _win32typing.PyHANDLE | None, __hDC: int | _win32typing.PyHANDLE | None) -> Literal[0, 1]: ...
def CreateCaret(hWnd: int, hBitmap: _win32typing.PyGdiHANDLE, nWidth, nHeight) -> None: ...
def DestroyCaret() -> None: ...
def ScrollWindowEx(

View File

@@ -14,7 +14,9 @@ def GetDefaultPrinter() -> str: ...
def GetDefaultPrinterW() -> str: ...
def SetDefaultPrinter(printer: str): ...
def SetDefaultPrinterW(Printer: str): ...
def StartDocPrinter(__hprinter: _win32typing.PyPrinterHANDLE | int, __level: Literal[1], __tuple: tuple[str, str, str]): ...
def StartDocPrinter(
__hprinter: _win32typing.PyPrinterHANDLE | int, __level: Literal[1], __tuple: tuple[str, str, str | None]
) -> int: ...
def EndDocPrinter(hPrinter: _win32typing.PyPrinterHANDLE): ...
def AbortPrinter(hPrinter: _win32typing.PyPrinterHANDLE) -> None: ...
def StartPagePrinter(hprinter: _win32typing.PyPrinterHANDLE) -> None: ...
@@ -24,7 +26,7 @@ def EndDoc(hdc: int) -> None: ...
def AbortDoc(hdc: int) -> None: ...
def StartPage(hdc: int) -> None: ...
def EndPage(hdc: int) -> None: ...
def WritePrinter(hprinter: _win32typing.PyPrinterHANDLE, buf: str): ...
def WritePrinter(__hprinter: int | _win32typing.PyPrinterHANDLE, __buf: bytes | bytearray | memoryview) -> int: ...
def EnumJobs(hPrinter: _win32typing.PyPrinterHANDLE, FirstJob, NoJobs, Level=...): ...
def GetJob(hPrinter: _win32typing.PyPrinterHANDLE, JobID, Level: int = ...): ...
def SetJob(hPrinter: _win32typing.PyPrinterHANDLE, JobID, Level, JobInfo, Command): ...

View File

@@ -97,8 +97,8 @@ def SHCreateShellItem(
) -> _win32typing.PyIShellItem: ...
def SHOpenFolderAndSelectItems(Folder: _win32typing.PyIDL, Items: tuple[_win32typing.PyIDL, ...], Flags=...) -> None: ...
def SHCreateStreamOnFileEx(File, Mode, Attributes, Create, Template: Incomplete | None = ...) -> _win32typing.PyIStream: ...
def SetCurrentProcessExplicitAppUserModelID(AppID) -> None: ...
def GetCurrentProcessExplicitAppUserModelID(): ...
def SetCurrentProcessExplicitAppUserModelID(__AppID: str) -> None: ...
def GetCurrentProcessExplicitAppUserModelID() -> str: ...
def SHParseDisplayName(
Name, Attributes, BindCtx: _win32typing.PyIBindCtx | None = ...
) -> tuple[_win32typing.PyIDL, Incomplete]: ...