hexagram/py/hexagram/window.pxd
XANTRONIX Development 066312e843 Don't need that
2024-01-08 22:01:59 -05:00

52 lines
1.4 KiB
Cython

from cpython.ref cimport PyObject, PyTypeObject, Py_INCREF
cdef extern from "X11/Xlib.h":
ctypedef struct Display:
pass
ctypedef struct XEvent:
int type
long pad[24]
int XPending(Display *display)
int XNextEvent(Display *display, XEvent *event_return)
cdef extern from "cairo.h":
ctypedef struct cairo_t:
pass
cdef extern from "py3cairo.h":
cdef PyObject *PycairoContext_FromContext(cairo_t *ctx, PyTypeObject *type, PyObject *base)
cdef extern from *:
"""
#define ctx_type() (Pycairo_CAPI->Context_Type)
"""
cdef int import_cairo()
cdef PyTypeObject *ctx_type()
cdef extern from "hexagram/window.h":
ctypedef struct hexagram_window:
pass
hexagram_window *hexagram_window_new_x11(const char *display,
int width,
int height)
void hexagram_window_destroy(hexagram_window *window)
Display *hexagram_window_display(hexagram_window *window)
int hexagram_window_display_fd(hexagram_window *window)
int hexagram_window_show(hexagram_window *window)
int hexagram_window_refresh_bg(hexagram_window *window)
int hexagram_window_swap_buffer(hexagram_window *window)
cairo_t *hexagram_window_get_bg_context(hexagram_window *window)
cairo_t *hexagram_window_get_fg_context(hexagram_window *window)