Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-xcffib for openSUSE:Factory checked in at 2023-10-22 21:01:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-xcffib (Old) and /work/SRC/openSUSE:Factory/.python-xcffib.new.1945 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-xcffib" Sun Oct 22 21:01:15 2023 rev:15 rq:1118908 version:1.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-xcffib/python-xcffib.changes 2023-05-11 12:31:40.206167539 +0200 +++ /work/SRC/openSUSE:Factory/.python-xcffib.new.1945/python-xcffib.changes 2023-10-22 21:01:28.684457330 +0200 @@ -1,0 +2,10 @@ +Wed Oct 18 15:09:53 UTC 2023 - Soc Virnyl Estela <cont...@uncomfyhalomacro.pl> + +- update to 1.5.0: + * build against xcb-proto 1.16.0 (Tycho Andersen) + * add an automatic-github-releaser script + * use cffi's in-line mode + * build against xcb-proto 1.16.0 +- remove python-xcffib-ffi-import.patch + +------------------------------------------------------------------- Old: ---- python-xcffib-ffi-import.patch xcffib-1.3.0.tar.gz New: ---- xcffib-1.5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-xcffib.spec ++++++ --- /var/tmp/diff_new_pack.81cAQ1/_old 2023-10-22 21:01:29.276478857 +0200 +++ /var/tmp/diff_new_pack.81cAQ1/_new 2023-10-22 21:01:29.276478857 +0200 @@ -27,15 +27,13 @@ %{?sle15_python_module_pythons} Name: python-xcffib%{?psuffix} -Version: 1.3.0 +Version: 1.5.0 Release: 0 Summary: A drop in replacement for xpyb, an XCB python binding License: Apache-2.0 Group: Development/Languages/Python URL: https://github.com/tych0/xcffib Source: https://files.pythonhosted.org/packages/source/x/xcffib/xcffib-%{version}.tar.gz -# fix ffi import [bsc#1209570c4] -Patch1: python-xcffib-ffi-import.patch BuildRequires: %{python_module cffi >= 1.1.0} BuildRequires: %{python_module setuptools} %if %{with test} ++++++ xcffib-1.3.0.tar.gz -> xcffib-1.5.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/PKG-INFO new/xcffib-1.5.0/PKG-INFO --- old/xcffib-1.3.0/PKG-INFO 2023-04-14 19:30:19.797498000 +0200 +++ new/xcffib-1.5.0/PKG-INFO 2023-08-19 20:57:03.088571800 +0200 @@ -1,13 +1,12 @@ Metadata-Version: 2.1 Name: xcffib -Version: 1.3.0 +Version: 1.5.0 Summary: A drop in replacement for xpyb, an XCB python binding Home-page: http://github.com/tych0/xcffib Author: Tycho Andersen Author-email: tycho@tycho.pizza License: Apache License 2.0 Keywords: xcb xpyb cffi x11 x windows -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python :: 3 @@ -19,6 +18,3 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Software Development :: Libraries License-File: LICENSE - -UNKNOWN - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/README.md new/xcffib-1.5.0/README.md --- old/xcffib-1.3.0/README.md 2023-01-08 22:27:05.000000000 +0100 +++ new/xcffib-1.5.0/README.md 2023-06-02 01:04:23.000000000 +0200 @@ -1,11 +1,6 @@ # xcffib [](https://github.com/tych0/xcffib/actions) -`xcffib` is intended to be a (mostly) drop-in replacement for `xpyb`. `xpyb` -has an inactive upstream, several memory leaks, is python2 only and doesn't -have pypy support. `xcffib` is a binding which uses -[cffi](https://cffi.readthedocs.org/), which mitigates some of the issues -described above. `xcffib` also builds bindings for 27 of the 29 (xprint and xkb -are missing) X extensions in 1.10. +`xcffib` is intended to be a (mostly) drop-in replacement for `xpyb`, the original python binding for `xcb`. ## Installation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/setup.py new/xcffib-1.5.0/setup.py --- old/xcffib-1.3.0/setup.py 2023-04-14 19:30:16.000000000 +0200 +++ new/xcffib-1.5.0/setup.py 2023-08-19 20:56:39.000000000 +0200 @@ -50,11 +50,7 @@ else: requires_cffi = "cffi>=1.1.0" -cffi_args = dict( - cffi_modules=["xcffib/ffi_build.py:ffi"] -) - -version = "1.3.0" +version = "1.5.0" dependencies = [requires_cffi] setup( @@ -87,5 +83,4 @@ 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development :: Libraries' ], - **cffi_args ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/test/test_python_code.py new/xcffib-1.5.0/test/test_python_code.py --- old/xcffib-1.3.0/test/test_python_code.py 2023-04-02 17:30:16.000000000 +0200 +++ new/xcffib-1.5.0/test/test_python_code.py 2023-06-03 01:59:43.000000000 +0200 @@ -20,7 +20,7 @@ import os import struct import sys -from xcffib._ffi import ffi +from xcffib.ffi import ffi from xcffib.xproto import EventMask from .conftest import XcffibTest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/xcffib/__init__.py new/xcffib-1.5.0/xcffib/__init__.py --- old/xcffib-1.3.0/xcffib/__init__.py 2023-04-14 19:30:16.000000000 +0200 +++ new/xcffib-1.5.0/xcffib/__init__.py 2023-08-19 20:56:39.000000000 +0200 @@ -22,10 +22,7 @@ import struct import weakref -try: - from xcffib._ffi import ffi -except ImportError: - from xcffib.ffi_build import ffi +from .ffi import ffi if platform.system() == "Darwin": soname = "libxcb.dylib" @@ -37,8 +34,8 @@ soname = "libxcb.so" lib = ffi.dlopen(soname) -__xcb_proto_version__ = "1.15.2" -__version__ = "1.3.0" +__xcb_proto_version__ = "1.16.0" +__version__ = "1.5.0" X_PROTOCOL = lib.X_PROTOCOL X_PROTOCOL_REVISION = lib.X_PROTOCOL_REVISION diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/xcffib/dpms.py new/xcffib-1.5.0/xcffib/dpms.py --- old/xcffib-1.3.0/xcffib/dpms.py 2023-04-14 19:30:16.000000000 +0200 +++ new/xcffib-1.5.0/xcffib/dpms.py 2023-08-19 20:56:39.000000000 +0200 @@ -1,11 +1,12 @@ import xcffib import struct import io -MAJOR_VERSION = 0 -MINOR_VERSION = 0 +MAJOR_VERSION = 1 +MINOR_VERSION = 2 key = xcffib.ExtensionKey("DPMS") _events = {} _errors = {} +from . import xproto class GetVersionReply(xcffib.Reply): xge = False def __init__(self, unpacker): @@ -55,6 +56,33 @@ self.bufsize = unpacker.offset - base class InfoCookie(xcffib.Cookie): reply_type = InfoReply +class EventMask: + InfoNotify = 1 << 0 +class InfoNotifyEvent(xcffib.Event): + xge = True + def __init__(self, unpacker): + if isinstance(unpacker, xcffib.Protobj): + unpacker = xcffib.MemoryUnpacker(unpacker.pack()) + xcffib.Event.__init__(self, unpacker) + base = unpacker.offset + self.timestamp, self.power_level, self.state = unpacker.unpack("xx2x2xIHB21x") + self.bufsize = unpacker.offset - base + def pack(self): + buf = io.BytesIO() + buf.write(struct.pack("=B", 0)) + buf.write(struct.pack("=x2x2xIHB21x", self.timestamp, self.power_level, self.state)) + buf_len = len(buf.getvalue()) + if buf_len < 32: + buf.write(struct.pack("x" * (32 - buf_len))) + return buf.getvalue() + @classmethod + def synthetic(cls, timestamp, power_level, state): + self = cls.__new__(cls) + self.timestamp = timestamp + self.power_level = power_level + self.state = state + return self +_events[0] = InfoNotifyEvent class dpmsExtension(xcffib.Extension): def GetVersion(self, client_major_version, client_minor_version, is_checked=True): buf = io.BytesIO() @@ -88,4 +116,8 @@ buf = io.BytesIO() buf.write(struct.pack("=xx2x")) return self.send_request(7, buf, InfoCookie, is_checked=is_checked) + def SelectInput(self, event_mask, is_checked=False): + buf = io.BytesIO() + buf.write(struct.pack("=xx2xI", event_mask)) + return self.send_request(8, buf, is_checked=is_checked) xcffib._add_ext(key, dpmsExtension, _events, _errors) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/xcffib/ffi.py new/xcffib-1.5.0/xcffib/ffi.py --- old/xcffib-1.3.0/xcffib/ffi.py 1970-01-01 01:00:00.000000000 +0100 +++ new/xcffib-1.5.0/xcffib/ffi.py 2023-08-19 20:56:39.000000000 +0200 @@ -0,0 +1,246 @@ +# Copyright 2014 Tycho Andersen +# Copyright 2014 Sean Vig +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from cffi import FFI + +CONSTANTS = [ + ("X_PROTOCOL", 11), + ("X_PROTOCOL_REVISION", 0), + ("X_TCP_PORT", 6000), + + ("XCB_NONE", 0), + ("XCB_COPY_FROM_PARENT", 0), + ("XCB_CURRENT_TIME", 0), + ("XCB_NO_SYMBOL", 0), + + ("XCB_CONN_ERROR", 1), + ("XCB_CONN_CLOSED_EXT_NOTSUPPORTED", 2), + ("XCB_CONN_CLOSED_MEM_INSUFFICIENT", 3), + ("XCB_CONN_CLOSED_REQ_LEN_EXCEED", 4), + ("XCB_CONN_CLOSED_PARSE_ERR", 5), + ("XCB_CONN_CLOSED_INVALID_SCREEN", 6), + ("XCB_CONN_CLOSED_FDPASSING_FAILED", 7), + + ("XCB_REQUEST_CHECKED", 1 << 0) +] + + +# constants +CDEF = '\n'.join("#define %s %d" % (c, v) for c, v in CONSTANTS) + +# types +CDEF += """ + // xcb.h + typedef struct { + uint8_t response_type; /**< Type of the response */ + uint8_t pad0; /**< Padding */ + uint16_t sequence; /**< Sequence number */ + uint32_t length; /**< Length of the response */ + } xcb_generic_reply_t; + + typedef struct { + uint8_t response_type; /**< Type of the response */ + uint8_t pad0; /**< Padding */ + uint16_t sequence; /**< Sequence number */ + uint32_t pad[7]; /**< Padding */ + uint32_t full_sequence; /**< full sequence */ + } xcb_generic_event_t; + + typedef struct { + uint8_t response_type; /**< Type of the response */ + uint8_t error_code; /**< Error code */ + uint16_t sequence; /**< Sequence number */ + uint32_t resource_id; /** < Resource ID for requests with side effects only */ + uint16_t minor_code; /** < Minor opcode of the failed request */ + uint8_t major_code; /** < Major opcode of the failed request */ + uint8_t pad0; + uint32_t pad[5]; /**< Padding */ + uint32_t full_sequence; /**< full sequence */ + } xcb_generic_error_t; + + typedef struct { + unsigned int sequence; /**< Sequence number */ + } xcb_void_cookie_t; + + typedef struct xcb_auth_info_t { + int namelen; + char *name; + int datalen; + char *data; + } xcb_auth_info_t; + + typedef ... xcb_connection_t; + + // xproto.h + typedef uint32_t xcb_colormap_t; + typedef uint32_t xcb_drawable_t; + typedef uint32_t xcb_pixmap_t; + typedef uint32_t xcb_visualid_t; + typedef uint32_t xcb_window_t; + + typedef struct xcb_query_extension_reply_t { + uint8_t response_type; + uint8_t pad0; + uint16_t sequence; + uint32_t length; + uint8_t present; + uint8_t major_opcode; + uint8_t first_event; + uint8_t first_error; + } xcb_query_extension_reply_t; + + typedef struct xcb_setup_t { + uint8_t status; /**< */ + uint8_t pad0; /**< */ + uint16_t protocol_major_version; /**< */ + uint16_t protocol_minor_version; /**< */ + uint16_t length; /**< */ + uint32_t release_number; /**< */ + uint32_t resource_id_base; /**< */ + uint32_t resource_id_mask; /**< */ + uint32_t motion_buffer_size; /**< */ + uint16_t vendor_len; /**< */ + uint16_t maximum_request_length; /**< */ + uint8_t roots_len; /**< */ + uint8_t pixmap_formats_len; /**< */ + uint8_t image_byte_order; /**< */ + uint8_t bitmap_format_bit_order; /**< */ + uint8_t bitmap_format_scanline_unit; /**< */ + uint8_t bitmap_format_scanline_pad; /**< */ + uint8_t min_keycode; /**< */ + uint8_t max_keycode; /**< */ + uint8_t pad1[4]; /**< */ + } xcb_setup_t; + + typedef struct xcb_visualtype_t { + xcb_visualid_t visual_id; /**< */ + uint8_t _class; /**< */ + uint8_t bits_per_rgb_value; /**< */ + uint16_t colormap_entries; /**< */ + uint32_t red_mask; /**< */ + uint32_t green_mask; /**< */ + uint32_t blue_mask; /**< */ + uint8_t pad0[4]; /**< */ + } xcb_visualtype_t; + + typedef struct xcb_screen_t { + xcb_window_t root; /**< */ + xcb_colormap_t default_colormap; /**< */ + uint32_t white_pixel; /**< */ + uint32_t black_pixel; /**< */ + uint32_t current_input_masks; /**< */ + uint16_t width_in_pixels; /**< */ + uint16_t height_in_pixels; /**< */ + uint16_t width_in_millimeters; /**< */ + uint16_t height_in_millimeters; /**< */ + uint16_t min_installed_maps; /**< */ + uint16_t max_installed_maps; /**< */ + xcb_visualid_t root_visual; /**< */ + uint8_t backing_stores; /**< */ + uint8_t save_unders; /**< */ + uint8_t root_depth; /**< */ + uint8_t allowed_depths_len; /**< */ + } xcb_screen_t; + + typedef struct xcb_screen_iterator_t { + xcb_screen_t *data; /**< */ + int rem; /**< */ + int index; /**< */ + } xcb_screen_iterator_t; + + xcb_screen_iterator_t + xcb_setup_roots_iterator (const xcb_setup_t *R /**< */); + + void + xcb_screen_next (xcb_screen_iterator_t *i /**< */); + + // render.h + typedef uint32_t xcb_render_pictformat_t; + + typedef struct xcb_render_directformat_t { + uint16_t red_shift; /**< */ + uint16_t red_mask; /**< */ + uint16_t green_shift; /**< */ + uint16_t green_mask; /**< */ + uint16_t blue_shift; /**< */ + uint16_t blue_mask; /**< */ + uint16_t alpha_shift; /**< */ + uint16_t alpha_mask; /**< */ + } xcb_render_directformat_t; + + typedef struct xcb_render_pictforminfo_t { + xcb_render_pictformat_t id; /**< */ + uint8_t type; /**< */ + uint8_t depth; /**< */ + uint8_t pad0[2]; /**< */ + xcb_render_directformat_t direct; /**< */ + xcb_colormap_t colormap; /**< */ + } xcb_render_pictforminfo_t; + + // xcbext.h + typedef struct xcb_extension_t { + const char *name; + int global_id; + } xcb_extension_t; + + typedef struct { + size_t count; + xcb_extension_t *ext; + uint8_t opcode; + uint8_t isvoid; + } xcb_protocol_request_t; + + // sys/uio.h + struct iovec + { + void *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ + size_t iov_len; /* Must be size_t (1003.1g) */ + }; + + // need to manually free some things that XCB allocates + void free(void *ptr); +""" + +# connection manipulation, mostly generated with: +# grep -v '^[ \/\}#]' xcb.h | grep -v '^typedef' | grep -v '^extern' +CDEF += """ + int xcb_flush(xcb_connection_t *c); + uint32_t xcb_get_maximum_request_length(xcb_connection_t *c); + void xcb_prefetch_maximum_request_length(xcb_connection_t *c); + xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c); + xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c); + const xcb_query_extension_reply_t *xcb_get_extension_data(xcb_connection_t *c, xcb_extension_t *ext); + const xcb_setup_t *xcb_get_setup(xcb_connection_t *c); + int xcb_get_file_descriptor(xcb_connection_t *c); + int xcb_connection_has_error(xcb_connection_t *c); + xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info); + void xcb_disconnect(xcb_connection_t *c); + int xcb_parse_display(const char *name, char **host, int *display, int *screen); + xcb_connection_t *xcb_connect(const char *displayname, int *screenp); + xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *display, xcb_auth_info_t *auth, int *screen); + uint32_t xcb_generate_id(xcb_connection_t *c); + xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie); +""" + +CDEF += """ + unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vector, const xcb_protocol_request_t *request); + void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_error_t **e); + int xcb_poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply, xcb_generic_error_t **error); + void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence); +""" + + +ffi = FFI() +ffi.cdef(CDEF) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/xcffib/ffi_build.py new/xcffib-1.5.0/xcffib/ffi_build.py --- old/xcffib-1.3.0/xcffib/ffi_build.py 2023-04-14 19:30:16.000000000 +0200 +++ new/xcffib-1.5.0/xcffib/ffi_build.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,255 +0,0 @@ -# Copyright 2014 Tycho Andersen -# Copyright 2014 Sean Vig -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from cffi import FFI - -CONSTANTS = [ - ("X_PROTOCOL", 11), - ("X_PROTOCOL_REVISION", 0), - ("X_TCP_PORT", 6000), - - ("XCB_NONE", 0), - ("XCB_COPY_FROM_PARENT", 0), - ("XCB_CURRENT_TIME", 0), - ("XCB_NO_SYMBOL", 0), - - ("XCB_CONN_ERROR", 1), - ("XCB_CONN_CLOSED_EXT_NOTSUPPORTED", 2), - ("XCB_CONN_CLOSED_MEM_INSUFFICIENT", 3), - ("XCB_CONN_CLOSED_REQ_LEN_EXCEED", 4), - ("XCB_CONN_CLOSED_PARSE_ERR", 5), - ("XCB_CONN_CLOSED_INVALID_SCREEN", 6), - ("XCB_CONN_CLOSED_FDPASSING_FAILED", 7), - - ("XCB_REQUEST_CHECKED", 1 << 0) -] - - -# constants -CDEF = '\n'.join("#define %s %d" % (c, v) for c, v in CONSTANTS) - -# types -CDEF += """ - // xcb.h - typedef struct { - uint8_t response_type; /**< Type of the response */ - uint8_t pad0; /**< Padding */ - uint16_t sequence; /**< Sequence number */ - uint32_t length; /**< Length of the response */ - } xcb_generic_reply_t; - - typedef struct { - uint8_t response_type; /**< Type of the response */ - uint8_t pad0; /**< Padding */ - uint16_t sequence; /**< Sequence number */ - uint32_t pad[7]; /**< Padding */ - uint32_t full_sequence; /**< full sequence */ - } xcb_generic_event_t; - - typedef struct { - uint8_t response_type; /**< Type of the response */ - uint8_t error_code; /**< Error code */ - uint16_t sequence; /**< Sequence number */ - uint32_t resource_id; /** < Resource ID for requests with side effects only */ - uint16_t minor_code; /** < Minor opcode of the failed request */ - uint8_t major_code; /** < Major opcode of the failed request */ - uint8_t pad0; - uint32_t pad[5]; /**< Padding */ - uint32_t full_sequence; /**< full sequence */ - } xcb_generic_error_t; - - typedef struct { - unsigned int sequence; /**< Sequence number */ - } xcb_void_cookie_t; - - typedef struct xcb_auth_info_t { - int namelen; - char *name; - int datalen; - char *data; - } xcb_auth_info_t; - - typedef ... xcb_connection_t; - - // xproto.h - typedef uint32_t xcb_colormap_t; - typedef uint32_t xcb_drawable_t; - typedef uint32_t xcb_pixmap_t; - typedef uint32_t xcb_visualid_t; - typedef uint32_t xcb_window_t; - - typedef struct xcb_query_extension_reply_t { - uint8_t response_type; - uint8_t pad0; - uint16_t sequence; - uint32_t length; - uint8_t present; - uint8_t major_opcode; - uint8_t first_event; - uint8_t first_error; - } xcb_query_extension_reply_t; - - typedef struct xcb_setup_t { - uint8_t status; /**< */ - uint8_t pad0; /**< */ - uint16_t protocol_major_version; /**< */ - uint16_t protocol_minor_version; /**< */ - uint16_t length; /**< */ - uint32_t release_number; /**< */ - uint32_t resource_id_base; /**< */ - uint32_t resource_id_mask; /**< */ - uint32_t motion_buffer_size; /**< */ - uint16_t vendor_len; /**< */ - uint16_t maximum_request_length; /**< */ - uint8_t roots_len; /**< */ - uint8_t pixmap_formats_len; /**< */ - uint8_t image_byte_order; /**< */ - uint8_t bitmap_format_bit_order; /**< */ - uint8_t bitmap_format_scanline_unit; /**< */ - uint8_t bitmap_format_scanline_pad; /**< */ - uint8_t min_keycode; /**< */ - uint8_t max_keycode; /**< */ - uint8_t pad1[4]; /**< */ - } xcb_setup_t; - - typedef struct xcb_visualtype_t { - xcb_visualid_t visual_id; /**< */ - uint8_t _class; /**< */ - uint8_t bits_per_rgb_value; /**< */ - uint16_t colormap_entries; /**< */ - uint32_t red_mask; /**< */ - uint32_t green_mask; /**< */ - uint32_t blue_mask; /**< */ - uint8_t pad0[4]; /**< */ - } xcb_visualtype_t; - - typedef struct xcb_screen_t { - xcb_window_t root; /**< */ - xcb_colormap_t default_colormap; /**< */ - uint32_t white_pixel; /**< */ - uint32_t black_pixel; /**< */ - uint32_t current_input_masks; /**< */ - uint16_t width_in_pixels; /**< */ - uint16_t height_in_pixels; /**< */ - uint16_t width_in_millimeters; /**< */ - uint16_t height_in_millimeters; /**< */ - uint16_t min_installed_maps; /**< */ - uint16_t max_installed_maps; /**< */ - xcb_visualid_t root_visual; /**< */ - uint8_t backing_stores; /**< */ - uint8_t save_unders; /**< */ - uint8_t root_depth; /**< */ - uint8_t allowed_depths_len; /**< */ - } xcb_screen_t; - - typedef struct xcb_screen_iterator_t { - xcb_screen_t *data; /**< */ - int rem; /**< */ - int index; /**< */ - } xcb_screen_iterator_t; - - xcb_screen_iterator_t - xcb_setup_roots_iterator (const xcb_setup_t *R /**< */); - - void - xcb_screen_next (xcb_screen_iterator_t *i /**< */); - - // render.h - typedef uint32_t xcb_render_pictformat_t; - - typedef struct xcb_render_directformat_t { - uint16_t red_shift; /**< */ - uint16_t red_mask; /**< */ - uint16_t green_shift; /**< */ - uint16_t green_mask; /**< */ - uint16_t blue_shift; /**< */ - uint16_t blue_mask; /**< */ - uint16_t alpha_shift; /**< */ - uint16_t alpha_mask; /**< */ - } xcb_render_directformat_t; - - typedef struct xcb_render_pictforminfo_t { - xcb_render_pictformat_t id; /**< */ - uint8_t type; /**< */ - uint8_t depth; /**< */ - uint8_t pad0[2]; /**< */ - xcb_render_directformat_t direct; /**< */ - xcb_colormap_t colormap; /**< */ - } xcb_render_pictforminfo_t; - - // xcbext.h - typedef struct xcb_extension_t { - const char *name; - int global_id; - } xcb_extension_t; - - typedef struct { - size_t count; - xcb_extension_t *ext; - uint8_t opcode; - uint8_t isvoid; - } xcb_protocol_request_t; - - // sys/uio.h - struct iovec - { - void *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ - size_t iov_len; /* Must be size_t (1003.1g) */ - }; - - // need to manually free some things that XCB allocates - void free(void *ptr); -""" - -# connection manipulation, mostly generated with: -# grep -v '^[ \/\}#]' xcb.h | grep -v '^typedef' | grep -v '^extern' -CDEF += """ - int xcb_flush(xcb_connection_t *c); - uint32_t xcb_get_maximum_request_length(xcb_connection_t *c); - void xcb_prefetch_maximum_request_length(xcb_connection_t *c); - xcb_generic_event_t *xcb_wait_for_event(xcb_connection_t *c); - xcb_generic_event_t *xcb_poll_for_event(xcb_connection_t *c); - const xcb_query_extension_reply_t *xcb_get_extension_data(xcb_connection_t *c, xcb_extension_t *ext); - const xcb_setup_t *xcb_get_setup(xcb_connection_t *c); - int xcb_get_file_descriptor(xcb_connection_t *c); - int xcb_connection_has_error(xcb_connection_t *c); - xcb_connection_t *xcb_connect_to_fd(int fd, xcb_auth_info_t *auth_info); - void xcb_disconnect(xcb_connection_t *c); - int xcb_parse_display(const char *name, char **host, int *display, int *screen); - xcb_connection_t *xcb_connect(const char *displayname, int *screenp); - xcb_connection_t *xcb_connect_to_display_with_auth_info(const char *display, xcb_auth_info_t *auth, int *screen); - uint32_t xcb_generate_id(xcb_connection_t *c); - xcb_generic_error_t *xcb_request_check(xcb_connection_t *c, xcb_void_cookie_t cookie); -""" - -CDEF += """ - unsigned int xcb_send_request(xcb_connection_t *c, int flags, struct iovec *vector, const xcb_protocol_request_t *request); - void *xcb_wait_for_reply(xcb_connection_t *c, unsigned int request, xcb_generic_error_t **e); - int xcb_poll_for_reply(xcb_connection_t *c, unsigned int request, void **reply, xcb_generic_error_t **error); - void xcb_discard_reply(xcb_connection_t *c, unsigned int sequence); -""" - - -ffi = FFI() -if hasattr(ffi, 'set_source'): # PyPy < 2.6 compatibility hack - ffi.set_source("xcffib._ffi", None, libraries=['xcb']) - do_compile = True -else: - do_compile = False -ffi.cdef(CDEF) - - -if __name__ == "__main__" and do_compile: - ffi.compile() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/xcffib/present.py new/xcffib-1.5.0/xcffib/present.py --- old/xcffib-1.3.0/xcffib/present.py 2023-04-14 19:30:16.000000000 +0200 +++ new/xcffib-1.5.0/xcffib/present.py 2023-08-19 20:56:39.000000000 +0200 @@ -2,7 +2,7 @@ import struct import io MAJOR_VERSION = 1 -MINOR_VERSION = 2 +MINOR_VERSION = 3 key = xcffib.ExtensionKey("Present") _events = {} _errors = {} @@ -27,11 +27,13 @@ Copy = 1 << 1 UST = 1 << 2 Suboptimal = 1 << 3 + AsyncMayTear = 1 << 4 class Capability: _None = 0 Async = 1 << 0 Fence = 1 << 1 UST = 1 << 2 + AsyncMayTear = 1 << 3 class CompleteKind: Pixmap = 0 NotifyMSC = 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/xcffib/screensaver.py new/xcffib-1.5.0/xcffib/screensaver.py --- old/xcffib-1.3.0/xcffib/screensaver.py 2023-04-14 19:30:16.000000000 +0200 +++ new/xcffib-1.5.0/xcffib/screensaver.py 2023-08-19 20:56:39.000000000 +0200 @@ -85,49 +85,49 @@ def SetAttributes(self, drawable, x, y, width, height, border_width, _class, depth, visual, value_mask, value_list, is_checked=False): buf = io.BytesIO() buf.write(struct.pack("=xx2xIhhHHHBBII", drawable, x, y, width, height, border_width, _class, depth, visual, value_mask)) - if value_mask & CW.BackPixmap: + if value_mask & xproto.CW: background_pixmap = value_list.pop(0) buf.write(struct.pack("=I", background_pixmap)) - if value_mask & CW.BackPixel: + if value_mask & xproto.CW: background_pixel = value_list.pop(0) buf.write(struct.pack("=I", background_pixel)) - if value_mask & CW.BorderPixmap: + if value_mask & xproto.CW: border_pixmap = value_list.pop(0) buf.write(struct.pack("=I", border_pixmap)) - if value_mask & CW.BorderPixel: + if value_mask & xproto.CW: border_pixel = value_list.pop(0) buf.write(struct.pack("=I", border_pixel)) - if value_mask & CW.BitGravity: + if value_mask & xproto.CW: bit_gravity = value_list.pop(0) buf.write(struct.pack("=I", bit_gravity)) - if value_mask & CW.WinGravity: + if value_mask & xproto.CW: win_gravity = value_list.pop(0) buf.write(struct.pack("=I", win_gravity)) - if value_mask & CW.BackingStore: + if value_mask & xproto.CW: backing_store = value_list.pop(0) buf.write(struct.pack("=I", backing_store)) - if value_mask & CW.BackingPlanes: + if value_mask & xproto.CW: backing_planes = value_list.pop(0) buf.write(struct.pack("=I", backing_planes)) - if value_mask & CW.BackingPixel: + if value_mask & xproto.CW: backing_pixel = value_list.pop(0) buf.write(struct.pack("=I", backing_pixel)) - if value_mask & CW.OverrideRedirect: + if value_mask & xproto.CW: override_redirect = value_list.pop(0) buf.write(struct.pack("=I", override_redirect)) - if value_mask & CW.SaveUnder: + if value_mask & xproto.CW: save_under = value_list.pop(0) buf.write(struct.pack("=I", save_under)) - if value_mask & CW.EventMask: + if value_mask & xproto.CW: event_mask = value_list.pop(0) buf.write(struct.pack("=I", event_mask)) - if value_mask & CW.DontPropagate: + if value_mask & xproto.CW: do_not_propogate_mask = value_list.pop(0) buf.write(struct.pack("=I", do_not_propogate_mask)) - if value_mask & CW.Colormap: + if value_mask & xproto.CW: colormap = value_list.pop(0) buf.write(struct.pack("=I", colormap)) - if value_mask & CW.Cursor: + if value_mask & xproto.CW: cursor = value_list.pop(0) buf.write(struct.pack("=I", cursor)) return self.send_request(3, buf, is_checked=is_checked) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/xcffib.egg-info/PKG-INFO new/xcffib-1.5.0/xcffib.egg-info/PKG-INFO --- old/xcffib-1.3.0/xcffib.egg-info/PKG-INFO 2023-04-14 19:30:19.000000000 +0200 +++ new/xcffib-1.5.0/xcffib.egg-info/PKG-INFO 2023-08-19 20:57:03.000000000 +0200 @@ -1,13 +1,12 @@ Metadata-Version: 2.1 Name: xcffib -Version: 1.3.0 +Version: 1.5.0 Summary: A drop in replacement for xpyb, an XCB python binding Home-page: http://github.com/tych0/xcffib Author: Tycho Andersen Author-email: tycho@tycho.pizza License: Apache License 2.0 Keywords: xcb xpyb cffi x11 x windows -Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python :: 3 @@ -19,6 +18,3 @@ Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Software Development :: Libraries License-File: LICENSE - -UNKNOWN - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xcffib-1.3.0/xcffib.egg-info/SOURCES.txt new/xcffib-1.5.0/xcffib.egg-info/SOURCES.txt --- old/xcffib-1.3.0/xcffib.egg-info/SOURCES.txt 2023-04-14 19:30:19.000000000 +0200 +++ new/xcffib-1.5.0/xcffib.egg-info/SOURCES.txt 2023-08-19 20:57:03.000000000 +0200 @@ -17,7 +17,7 @@ xcffib/dpms.py xcffib/dri2.py xcffib/dri3.py -xcffib/ffi_build.py +xcffib/ffi.py xcffib/ge.py xcffib/glx.py xcffib/present.py