Stub the parts of PyObjC I'm using (whee)
This commit is contained in:
parent
5a3ddd570d
commit
73972cd17e
3 changed files with 106 additions and 0 deletions
33
stubs/AppKit/__init__.pyi
Normal file
33
stubs/AppKit/__init__.pyi
Normal file
|
@ -0,0 +1,33 @@
|
|||
from typing import Final, Literal
|
||||
|
||||
from Foundation import CGSize
|
||||
|
||||
# There are many other operations available but we only actually use copy, so we don't need all of them here.
|
||||
NSCompositingOperationClear: Final = 0
|
||||
NSCompositingOperationCopy: Final = 1
|
||||
NSCompositingOperation = Literal[0, 1]
|
||||
|
||||
class NSRect:
|
||||
pass
|
||||
|
||||
def NSMakeRect(x: float, y: float, w: float, h: float) -> NSRect: ...
|
||||
|
||||
class NSImage:
|
||||
@staticmethod
|
||||
def alloc() -> type[NSImage]: ...
|
||||
|
||||
@staticmethod
|
||||
def initByReferencingFile_(file: str) -> NSImage: ...
|
||||
|
||||
@staticmethod
|
||||
def initWithData_(data: bytes) -> NSImage: ...
|
||||
|
||||
@staticmethod
|
||||
def initWithSize_(size: CGSize) -> NSImage: ...
|
||||
|
||||
def size(self) -> CGSize: ...
|
||||
|
||||
def lockFocus(self) -> None: ...
|
||||
def unlockFocus(self) -> None: ...
|
||||
|
||||
def drawInRect_fromRect_operation_fraction_(self, inRect: NSRect, fromRect: NSRect, operation: NSCompositingOperation, fraction: float) -> None: ...
|
Loading…
Add table
Add a link
Reference in a new issue