|
1 | 1 | # Not available at runtime. Contains type definitions that are otherwise not exposed and not part of a specific module. |
2 | 2 | from _typeshed import Incomplete, Unused |
3 | 3 | from collections.abc import Iterable, Sequence |
4 | | -from typing import Literal, NoReturn, SupportsIndex, TypeAlias, final, overload |
5 | | -from typing_extensions import Self, deprecated, disjoint_base |
| 4 | +from typing import Literal, NoReturn, SupportsIndex, TypeAlias, TypedDict, final, overload, type_check_only |
| 5 | +from typing_extensions import Never, Required, Self, deprecated, disjoint_base |
6 | 6 |
|
7 | 7 | from win32.lib.pywintypes import TimeType |
8 | 8 |
|
@@ -120,15 +120,39 @@ class DOCINFO: |
120 | 120 |
|
121 | 121 | class ExportCallback: ... |
122 | 122 |
|
123 | | -class FORM_INFO_1: |
124 | | - @property |
125 | | - def Flags(self): ... |
126 | | - @property |
127 | | - def Name(self) -> str: ... |
128 | | - @property |
129 | | - def Size(self): ... |
130 | | - @property |
131 | | - def ImageableArea(self): ... |
| 123 | +@type_check_only |
| 124 | +class PrinterExtents(TypedDict): |
| 125 | + Length: int |
| 126 | + Width: int |
| 127 | + |
| 128 | +@type_check_only |
| 129 | +class PrinterDpi(TypedDict): |
| 130 | + xdpi: int |
| 131 | + ydpi: int |
| 132 | + |
| 133 | +@type_check_only |
| 134 | +class PrinterPaperSize(TypedDict): |
| 135 | + x: int |
| 136 | + y: int |
| 137 | + |
| 138 | +@type_check_only |
| 139 | +class SizeL(TypedDict): |
| 140 | + cx: int |
| 141 | + cy: int |
| 142 | + |
| 143 | +@type_check_only |
| 144 | +class RectL(TypedDict): |
| 145 | + bottom: int |
| 146 | + left: int |
| 147 | + right: int |
| 148 | + top: int |
| 149 | + |
| 150 | +@type_check_only |
| 151 | +class FormInfo1(TypedDict): |
| 152 | + Flags: int |
| 153 | + Name: str |
| 154 | + Size: SizeL |
| 155 | + ImageableArea: RectL |
132 | 156 |
|
133 | 157 | class ImportCallback: ... |
134 | 158 |
|
@@ -166,13 +190,186 @@ class NCB: |
166 | 190 | @property |
167 | 191 | def Post(self): ... |
168 | 192 |
|
169 | | -class PRINTER_DEFAULTS: |
170 | | - @property |
171 | | - def pDatatype(self) -> str: ... |
172 | | - @property |
173 | | - def pDevMode(self) -> PyDEVMODE: ... |
174 | | - @property |
175 | | - def DesiredAccess(self): ... |
| 193 | +@type_check_only |
| 194 | +class PrinterDefaults(TypedDict, total=False): |
| 195 | + pDataType: str | None |
| 196 | + pDevMode: PyDEVMODEW | None |
| 197 | + DesiredAccess: Required[int] |
| 198 | + |
| 199 | +@type_check_only |
| 200 | +class PrinterInfo1(TypedDict): |
| 201 | + Flags: int |
| 202 | + pDescription: str |
| 203 | + pName: str |
| 204 | + pComment: str |
| 205 | + |
| 206 | +PrinterInfo1Tuple: TypeAlias = tuple[int, str, str, str] |
| 207 | + |
| 208 | +@type_check_only |
| 209 | +class PrinterInfo2(TypedDict): |
| 210 | + Attributes: int |
| 211 | + AveragePPM: int |
| 212 | + DefaultPriority: int |
| 213 | + Priority: int |
| 214 | + StartTime: int |
| 215 | + Status: int |
| 216 | + UntilTime: int |
| 217 | + cJobs: int |
| 218 | + pComment: str | None |
| 219 | + pDatatype: str | None |
| 220 | + pDevMode: PyDEVMODEW | None |
| 221 | + pDriverName: str |
| 222 | + pLocation: str | None |
| 223 | + pParameters: str | None |
| 224 | + pPortName: str |
| 225 | + pPrintProcessor: str |
| 226 | + pPrinterName: str |
| 227 | + pSecurityDescriptor: PySECURITY_DESCRIPTOR | None |
| 228 | + pSepFile: str | None |
| 229 | + pServerName: str | None |
| 230 | + pShareName: str | None |
| 231 | + |
| 232 | +PrinterInfo2Tuple: TypeAlias = tuple[ |
| 233 | + str | None, # pServerName |
| 234 | + str, # pPrinterName |
| 235 | + str, # pShareName |
| 236 | + str, # pPortName |
| 237 | + str, # pDriverName |
| 238 | + str, # pComment |
| 239 | + str, # pLocation |
| 240 | + None, # (always None) |
| 241 | + str, # pSepFile |
| 242 | + str, # pPrintProcessor |
| 243 | + str, # pDatatype |
| 244 | + str, # pParameters |
| 245 | + None, # (always None) |
| 246 | + int, # Attributes |
| 247 | + int, # Priority |
| 248 | + int, # DefaultPriority |
| 249 | + int, # StartTime |
| 250 | + int, # UntilTime |
| 251 | + int, # Status |
| 252 | + int, # cJobs |
| 253 | + int, # AveragePPM |
| 254 | +] |
| 255 | + |
| 256 | +@type_check_only |
| 257 | +class PrinterInfo3(TypedDict): |
| 258 | + pSecurityDescriptor: PySECURITY_DESCRIPTOR |
| 259 | + |
| 260 | +@type_check_only |
| 261 | +class PrinterInfo4(TypedDict): |
| 262 | + Attributes: int |
| 263 | + pPrinterName: str |
| 264 | + pServerName: str | None |
| 265 | + |
| 266 | +@type_check_only |
| 267 | +class PrinterInfo5(TypedDict): |
| 268 | + Attributes: int |
| 269 | + DeviceNotSelectedTimeout: int |
| 270 | + TransmissionRetryTimeout: int |
| 271 | + pPortName: str |
| 272 | + pPrinterName: str |
| 273 | + |
| 274 | +@type_check_only |
| 275 | +class PrinterInfo6(TypedDict): |
| 276 | + Status: int |
| 277 | + |
| 278 | +@type_check_only |
| 279 | +class PrinterInfo7(TypedDict): |
| 280 | + Action: int |
| 281 | + ObjectGUID: str | None |
| 282 | + |
| 283 | +@type_check_only |
| 284 | +class PrinterInfo89(TypedDict): |
| 285 | + pDevMode: PyDEVMODEW | None |
| 286 | + |
| 287 | +@type_check_only |
| 288 | +class JobInfo1(TypedDict): |
| 289 | + JobId: int |
| 290 | + pPrinterName: str |
| 291 | + pMachineName: str |
| 292 | + pUserName: str |
| 293 | + pDocument: str |
| 294 | + pDatatype: str |
| 295 | + pStatus: str | None |
| 296 | + Status: int |
| 297 | + Priority: int |
| 298 | + Position: int |
| 299 | + TotalPages: int |
| 300 | + PagesPrinted: int |
| 301 | + Submitted: TimeType |
| 302 | + |
| 303 | +@type_check_only |
| 304 | +class JobInfo2(JobInfo1): |
| 305 | + pNotifyName: str |
| 306 | + pPrintProcessor: str |
| 307 | + pParameters: str |
| 308 | + pDriverName: str |
| 309 | + pDevMode: PyDEVMODEW |
| 310 | + pSecurityDescriptor: PySECURITY_DESCRIPTOR | None |
| 311 | + StartTime: int |
| 312 | + UntilTime: int |
| 313 | + Size: int |
| 314 | + Time: int |
| 315 | + |
| 316 | +@type_check_only |
| 317 | +class JobInfo3(TypedDict): |
| 318 | + JobId: int |
| 319 | + NextJobId: int |
| 320 | + Reserved: int |
| 321 | + |
| 322 | +@type_check_only |
| 323 | +class DriverInfo1(TypedDict): |
| 324 | + Name: str |
| 325 | + |
| 326 | +MonitorInfo1: TypeAlias = DriverInfo1 |
| 327 | +PortInfo1: TypeAlias = DriverInfo1 |
| 328 | + |
| 329 | +@type_check_only |
| 330 | +class MonitorInfo2(MonitorInfo1): |
| 331 | + DLLName: str |
| 332 | + Environment: str |
| 333 | + |
| 334 | +@type_check_only |
| 335 | +class PortInfo2(PortInfo1): |
| 336 | + Description: str |
| 337 | + MonitorName: str |
| 338 | + PortType: int |
| 339 | + Reserved: int |
| 340 | + |
| 341 | +@type_check_only |
| 342 | +class DriverInfo2(DriverInfo1): |
| 343 | + ConfigFile: str |
| 344 | + DataFile: str |
| 345 | + DriverPath: str |
| 346 | + Environment: str |
| 347 | + Version: int |
| 348 | + |
| 349 | +@type_check_only |
| 350 | +class DriverInfo3(DriverInfo2): |
| 351 | + DefaultDataType: str | None |
| 352 | + DependentFiles: list[str] |
| 353 | + HelpFile: str | None |
| 354 | + MonitorName: str | None |
| 355 | + |
| 356 | +@type_check_only |
| 357 | +class DriverInfo4(DriverInfo3): |
| 358 | + PreviousNames: str | None |
| 359 | + |
| 360 | +@type_check_only |
| 361 | +class DriverInfo5(DriverInfo2): |
| 362 | + ConfigVersion: int |
| 363 | + DriverAttributes: int |
| 364 | + DriverVersion: int |
| 365 | + |
| 366 | +@type_check_only |
| 367 | +class DriverInfo6(DriverInfo4): |
| 368 | + MfgName: str |
| 369 | + OEMUrl: str | None |
| 370 | + Provider: str |
| 371 | + DriverDate: TimeType |
| 372 | + DriverVersion: int |
176 | 373 |
|
177 | 374 | class PyACL: |
178 | 375 | def Initialize(self) -> None: ... |
@@ -692,91 +889,10 @@ class PyDCB: |
692 | 889 | @property |
693 | 890 | def fDummy2(self) -> int: ... |
694 | 891 |
|
695 | | -class PyDEVMODE: |
696 | | - @property |
697 | | - def SpecVersion(self) -> int: ... |
698 | | - @property |
699 | | - def DriverVersion(self) -> int: ... |
700 | | - @property |
701 | | - def Size(self) -> int: ... |
702 | | - @property |
703 | | - def DriverExtra(self) -> int: ... |
704 | | - @property |
705 | | - def Fields(self) -> int: ... |
706 | | - @property |
707 | | - def Orientation(self) -> int: ... |
708 | | - @property |
709 | | - def PaperSize(self) -> int: ... |
710 | | - @property |
711 | | - def PaperLength(self) -> int: ... |
712 | | - @property |
713 | | - def PaperWidth(self) -> int: ... |
714 | | - @property |
715 | | - def Position_x(self) -> int: ... |
716 | | - @property |
717 | | - def Position_y(self) -> int: ... |
718 | | - @property |
719 | | - def DisplayOrientation(self) -> int: ... |
720 | | - @property |
721 | | - def DisplayFixedOutput(self) -> int: ... |
722 | | - @property |
723 | | - def Scale(self) -> int: ... |
724 | | - @property |
725 | | - def Copies(self) -> int: ... |
726 | | - @property |
727 | | - def DefaultSource(self) -> int: ... |
728 | | - @property |
729 | | - def PrintQuality(self) -> int: ... |
730 | | - @property |
731 | | - def Color(self) -> int: ... |
732 | | - @property |
733 | | - def Duplex(self) -> int: ... |
734 | | - @property |
735 | | - def YResolution(self) -> int: ... |
736 | | - @property |
737 | | - def TTOption(self) -> int: ... |
738 | | - @property |
739 | | - def Collate(self) -> int: ... |
740 | | - @property |
741 | | - def LogPixels(self) -> int: ... |
742 | | - @property |
743 | | - def BitsPerPel(self) -> int: ... |
744 | | - @property |
745 | | - def PelsWidth(self) -> int: ... |
746 | | - @property |
747 | | - def PelsHeight(self) -> int: ... |
748 | | - @property |
749 | | - def DisplayFlags(self) -> int: ... |
750 | | - @property |
751 | | - def DisplayFrequency(self) -> int: ... |
752 | | - @property |
753 | | - def ICMMethod(self) -> int: ... |
754 | | - @property |
755 | | - def ICMIntent(self) -> int: ... |
756 | | - @property |
757 | | - def MediaType(self) -> int: ... |
758 | | - @property |
759 | | - def DitherType(self) -> int: ... |
760 | | - @property |
761 | | - def Reserved1(self) -> int: ... |
762 | | - @property |
763 | | - def Reserved2(self) -> int: ... |
764 | | - @property |
765 | | - def Nup(self) -> int: ... |
766 | | - @property |
767 | | - def PanningWidth(self) -> int: ... |
768 | | - @property |
769 | | - def PanningHeight(self) -> int: ... |
770 | | - @property |
771 | | - def DeviceName(self) -> str: ... |
772 | | - @property |
773 | | - def FormName(self) -> str: ... |
774 | | - @property |
775 | | - def DriverData(self) -> Incomplete | None: ... |
776 | | - def Clear(self) -> None: ... |
777 | | - |
| 892 | +@disjoint_base |
778 | 893 | class PyDEVMODEW: |
779 | | - def __init__(self, DriverExtra: int = ...) -> None: ... |
| 894 | + def __new__(self, DriverExtra: int = 0) -> Self: ... |
| 895 | + def Clear(self) -> None: ... |
780 | 896 | SpecVersion: int |
781 | 897 | DriverVersion: int |
782 | 898 | @property |
@@ -920,12 +1036,15 @@ class PyGROUP_USERS_INFO_1: |
920 | 1036 | class PyGdiHANDLE: ... |
921 | 1037 | class PyGetSignerCertificate: ... |
922 | 1038 |
|
923 | | -class PyHANDLE: |
| 1039 | +@disjoint_base |
| 1040 | +class PyHANDLE: # type: ignore[type-var] |
| 1041 | + def __new__(cls, *args: Never) -> NoReturn: ... |
924 | 1042 | @property |
925 | 1043 | def handle(self) -> int: ... |
926 | 1044 | def Close(self) -> None: ... |
927 | 1045 | def close(self) -> None: ... |
928 | 1046 | def Detach(self) -> Self: ... |
| 1047 | + def __int__(self) -> int: ... |
929 | 1048 |
|
930 | 1049 | @final |
931 | 1050 | class PyHDESK: |
@@ -1258,7 +1377,7 @@ class PyPROFILEINFO: |
1258 | 1377 | class PyPerfMonManager: |
1259 | 1378 | def Close(self) -> None: ... |
1260 | 1379 |
|
1261 | | -class PyPrinterHANDLE: ... |
| 1380 | +class PyPrinterHANDLE(PyHANDLE): ... |
1262 | 1381 | class PyRECT: ... |
1263 | 1382 | class PyResourceId: ... |
1264 | 1383 | class PySCROLLINFO: ... |
|
0 commit comments