Hello community, here is the log from the commit of package python-python-xlib for openSUSE:Factory checked in at 2020-01-16 18:14:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-python-xlib (Old) and /work/SRC/openSUSE:Factory/.python-python-xlib.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-python-xlib" Thu Jan 16 18:14:19 2020 rev:5 rq:763806 version:0.26 Changes: -------- --- /work/SRC/openSUSE:Factory/python-python-xlib/python-python-xlib.changes 2019-11-04 17:07:48.516351008 +0100 +++ /work/SRC/openSUSE:Factory/.python-python-xlib.new.26092/python-python-xlib.changes 2020-01-16 18:14:24.680743022 +0100 @@ -1,0 +2,11 @@ +Mon Jan 13 04:42:33 UTC 2020 - Dead Mozay <[email protected]> + +- version update to 0.26 + * enrich XFixes extension with XFixesSelectionNotify events (by @acrisci) + * add example xfixes-selection-notify.py (by @acrisci) + * fix two issues in NV-CONTROL extension (by @leinardi) + * add method get_clock_info into NV-CONTROL extension (by @leinardi) + * add default client version into Composite extension (by @jakogut) + * add Damage extension with the example (by @mgarg1 and @jakogut) + +------------------------------------------------------------------- Old: ---- python-xlib-0.25.tar.bz2 New: ---- python-xlib-0.26.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-python-xlib.spec ++++++ --- /var/tmp/diff_new_pack.SQLXs1/_old 2020-01-16 18:14:25.824743669 +0100 +++ /var/tmp/diff_new_pack.SQLXs1/_new 2020-01-16 18:14:25.824743669 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-python-xlib # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,24 +19,23 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-python-xlib -Version: 0.25 +Version: 0.26 Release: 0 Summary: Python X11 interface License: LGPL-2.1-or-later Group: Development/Libraries/Python URL: https://github.com/python-xlib/python-xlib Source: https://files.pythonhosted.org/packages/source/p/python-xlib/python-xlib-%{version}.tar.bz2 + BuildRequires: %{python_module mock} BuildRequires: %{python_module nose} BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six >= 1.10.0} -BuildRequires: dos2unix BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: xvfb-run Requires: python-six >= 1.10.0 -Requires: xorg-x11-server BuildArch: noarch %ifpython2 Provides: %{oldpython}-xlib = %{version} @@ -53,9 +52,7 @@ library for Python programs. %prep -%setup -q -n python-xlib-%{version} -rm Xlib/ChangeLog -dos2unix CHANGELOG.md README.rst TODO examples/*.py +%autosetup -n python-xlib-%{version} -p1 %build %python_build @@ -69,7 +66,7 @@ %files %{python_files} %license LICENSE -%doc CHANGELOG.md README.rst TODO examples/ +%doc CHANGELOG.md README.rst TODO %{python_sitelib}/Xlib/ %{python_sitelib}/python_xlib-* ++++++ python-xlib-0.25.tar.bz2 -> python-xlib-0.26.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/.travis.yml new/python-xlib-0.26/.travis.yml --- old/python-xlib-0.25/.travis.yml 2019-02-03 22:05:24.000000000 +0100 +++ new/python-xlib-0.26/.travis.yml 2019-12-08 12:17:04.000000000 +0100 @@ -2,10 +2,11 @@ python: - "2.7" - - "3.3" - "3.4" - "3.5" - "3.6" + - "3.7" + - "3.8" # command to install dependencies install: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/CHANGELOG.md new/python-xlib-0.26/CHANGELOG.md --- old/python-xlib-0.25/CHANGELOG.md 2019-02-03 22:05:24.000000000 +0100 +++ new/python-xlib-0.26/CHANGELOG.md 2019-12-08 13:01:55.000000000 +0100 @@ -1,5 +1,24 @@ NEWS for Python X Library +Version 0.26 +============ + +Bug Fixes +--------- + +- support legacy X servers like RealVNC's one (by @Gerardwx) + +Extensions +-------------------- + +- enrich XFixes extension with XFixesSelectionNotify events (by @acrisci) +- add example xfixes-selection-notify.py (by @acrisci) +- fix two issues in NV-CONTROL extension (by @leinardi) +- add method get_clock_info into NV-CONTROL extension (by @leinardi) +- add default client version into Composite extension (by @jakogut) +- add Damage extension with the example (by @mgarg1 and @jakogut) + +--- Version 0.25 ============ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/PKG-INFO new/python-xlib-0.26/PKG-INFO --- old/python-xlib-0.25/PKG-INFO 2019-02-03 22:09:27.000000000 +0100 +++ new/python-xlib-0.26/PKG-INFO 2019-12-08 13:05:43.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-xlib -Version: 0.25 +Version: 0.26 Summary: Python X Library Home-page: https://github.com/python-xlib/python-xlib Author: Peter Liljenberg @@ -143,6 +143,8 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Software Development :: Libraries diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/Xlib/__init__.py new/python-xlib-0.26/Xlib/__init__.py --- old/python-xlib-0.25/Xlib/__init__.py 2019-02-03 22:05:24.000000000 +0100 +++ new/python-xlib-0.26/Xlib/__init__.py 2019-12-08 13:01:55.000000000 +0100 @@ -19,7 +19,7 @@ # Suite 330, # Boston, MA 02111-1307 USA -__version__ = (0, 25) +__version__ = (0, 26) __version_extra__ = '' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/Xlib/ext/__init__.py new/python-xlib-0.26/Xlib/ext/__init__.py --- old/python-xlib-0.25/Xlib/ext/__init__.py 2019-02-03 22:05:24.000000000 +0100 +++ new/python-xlib-0.26/Xlib/ext/__init__.py 2019-12-08 12:17:04.000000000 +0100 @@ -37,6 +37,7 @@ ('SECURITY', 'security'), ('XInputExtension', 'xinput'), ('NV-CONTROL', 'nvcontrol'), + ('DAMAGE', 'damage'), ] __all__ = map(lambda x: x[1], __extensions__) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/Xlib/ext/composite.py new/python-xlib-0.26/Xlib/ext/composite.py --- old/python-xlib-0.25/Xlib/ext/composite.py 2019-02-03 22:05:24.000000000 +0100 +++ new/python-xlib-0.26/Xlib/ext/composite.py 2019-12-08 12:17:04.000000000 +0100 @@ -65,6 +65,8 @@ return QueryVersion( display = self.display, opcode = self.display.get_extension_major(extname), + major_version=0, + minor_version=4 ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/Xlib/ext/damage.py new/python-xlib-0.26/Xlib/ext/damage.py --- old/python-xlib-0.25/Xlib/ext/damage.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python-xlib-0.26/Xlib/ext/damage.py 2019-12-08 12:17:04.000000000 +0100 @@ -0,0 +1,182 @@ +# Xlib.ext.damage -- DAMAGE extension module +# +# Copyright (C) 2018 Joseph Kogut <[email protected]> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public License +# as published by the Free Software Foundation; either version 2.1 +# of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., +# 59 Temple Place, +# Suite 330, +# Boston, MA 02111-1307 USA + + +from Xlib import X +from Xlib.protocol import rq, structs +from Xlib.xobject import resource +from Xlib.error import XError + +extname = 'DAMAGE' + +# Event codes # +DamageNotifyCode = 0 + +# Error codes # +BadDamageCode = 0 + +class BadDamageError(XError): + pass + +# DamageReportLevel options +DamageReportRawRectangles = 0 +DamageReportDeltaRectangles = 1 +DamageReportBoundingBox = 2 +DamageReportNonEmpty = 3 + +DamageReportLevel = ( + DamageReportRawRectangles, + DamageReportDeltaRectangles, + DamageReportBoundingBox, + DamageReportNonEmpty, +) + +DAMAGE = rq.Card32 + +# Methods + +class QueryVersion(rq.ReplyRequest): + _request = rq.Struct(rq.Card8('opcode'), + rq.Opcode(0), + rq.RequestLength(), + rq.Card32('major_version'), + rq.Card32('minor_version'), + ) + + _reply = rq.Struct(rq.ReplyCode(), + rq.Pad(1), + rq.Card16('sequence_number'), + rq.ReplyLength(), + rq.Card32('major_version'), + rq.Card32('minor_version'), + rq.Pad(16), + ) + +def query_version(self): + return QueryVersion(display=self.display, + opcode=self.display.get_extension_major(extname), + major_version=1, + minor_version=1) + +class DamageCreate(rq.Request): + _request = rq.Struct(rq.Card8('opcode'), + rq.Opcode(1), + rq.RequestLength(), + DAMAGE('damage'), + rq.Drawable('drawable'), + rq.Set('level', 1, DamageReportLevel), + rq.Pad(3), + ) + +def damage_create(self, level): + did = self.display.allocate_resource_id() + DamageCreate(display=self.display, + opcode=self.display.get_extension_major(extname), + damage=did, + drawable=self.id, + level=level, + ) + return did + +class DamageDestroy(rq.Request): + _request = rq.Struct(rq.Card8('opcode'), + rq.Opcode(2), + rq.RequestLength(), + DAMAGE('damage') + ) + +def damage_destroy(self, damage): + DamageDestroy(display=self.display, + opcode=self.display.get_extension_major(extname), + damage=damage, + ) + + self.display.free_resource_id(damage) + +class DamageSubtract(rq.Request): + _request = rq.Struct(rq.Card8('opcode'), + rq.Opcode(3), + rq.RequestLength(), + DAMAGE('damage'), + rq.Card32('repair'), + rq.Card32('parts') + ) + +def damage_subtract(self, damage, repair=X.NONE, parts=X.NONE): + DamageSubtract(display=self.display, + opcode=self.display.get_extension_major(extname), + damage=damage, + repair=repair, + parts=parts) + +class DamageAdd(rq.Request): + _request = rq.Struct(rq.Card8('opcode'), + rq.Opcode(4), + rq.RequestLength(), + rq.Card32('repair'), + rq.Card32('parts'), + ) + +def damage_add(self, repair, parts): + DamageAdd(display=self.display, + opcode=self.display.get_extension_major(extname), + repair=repair, + parts=parts) + +# Events # + +class DamageNotify(rq.Event): + _code = None + _fields = rq.Struct( + rq.Card8('type'), + rq.Card8('level'), + rq.Card16('sequence_number'), + rq.Drawable('drawable'), + DAMAGE('damage'), + rq.Card32('timestamp'), + rq.Object('area', structs.Rectangle), + rq.Object('drawable_geometry', structs.Rectangle) + ) + +def init(disp, info): + disp.extension_add_method('display', + 'damage_query_version', + query_version) + + disp.extension_add_method('drawable', + 'damage_create', + damage_create) + + disp.extension_add_method('display', + 'damage_destroy', + damage_destroy) + + disp.extension_add_method('display', + 'damage_subtract', + damage_subtract) + + disp.extension_add_method('drawable', + 'damage_add', + damage_add) + + disp.extension_add_event(info.first_event + DamageNotifyCode, DamageNotify) + + disp.add_extension_error(code=BadDamageCode, err=BadDamageError) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/Xlib/ext/nvcontrol.py new/python-xlib-0.26/Xlib/ext/nvcontrol.py --- old/python-xlib-0.25/Xlib/ext/nvcontrol.py 2019-02-03 22:05:24.000000000 +0100 +++ new/python-xlib-0.26/Xlib/ext/nvcontrol.py 2019-12-08 12:17:04.000000000 +0100 @@ -139,7 +139,7 @@ return query_string_attribute(self, target, 0, NV_CTRL_STRING_GPU_UUID) -def get_gpu_utilization(self, target): +def get_utilization_rates(self, target): string = query_string_attribute(self, target, 0, NV_CTRL_STRING_GPU_UTILIZATION) result = {} if string is not None and string != '': @@ -162,6 +162,16 @@ return result +def get_clock_info(self, target): + string = query_string_attribute(self, target, 0, NV_CTRL_STRING_GPU_CURRENT_CLOCK_FREQS) + result = {} + if string is not None and string != '': + for line in string.split(','): + [key, value] = line.split('=')[:2] + result[key.strip()] = int(value) if value.isdigit() else value + return result + + def get_vram(self, target): return query_int_attribute(self, target, 0, NV_CTRL_VIDEO_RAM) @@ -231,23 +241,23 @@ return query_int_attribute(self, target, 0, NV_CTRL_USED_DEDICATED_GPU_MEMORY) -def get_pcie_current_link_width(self, target): +def get_curr_pcie_link_width(self, target): return query_int_attribute(self, target, 0, NV_CTRL_GPU_PCIE_CURRENT_LINK_WIDTH) -def get_pcie_max_link_width(self, target): +def get_max_pcie_link_width(self, target): return query_int_attribute(self, target, 0, NV_CTRL_GPU_PCIE_MAX_LINK_WIDTH) -def get_pcie_generation(self, target): +def get_curr_pcie_link_generation(self, target): return query_int_attribute(self, target, 0, NV_CTRL_GPU_PCIE_GENERATION) -def get_video_encoder_utilization(self, target): +def get_encoder_utilization(self, target): return query_int_attribute(self, target, 0, NV_CTRL_VIDEO_ENCODER_UTILIZATION) -def get_video_decoder_utilization(self, target): +def get_decoder_utilization(self, target): return query_int_attribute(self, target, 0, NV_CTRL_VIDEO_DECODER_UTILIZATION) @@ -263,8 +273,8 @@ return set_int_attribute(self, target, perf_level, NV_CTRL_GPU_NVCLOCK_OFFSET, offset) -def get_gpu_nvclock_offset_range(self, target): - return query_valid_attr_values(self, target, 0, NV_CTRL_GPU_NVCLOCK_OFFSET) +def get_gpu_nvclock_offset_range(self, target, perf_level): + return query_valid_attr_values(self, target, perf_level, NV_CTRL_GPU_NVCLOCK_OFFSET) def get_mem_transfer_rate_offset(self, target, perf_level): @@ -275,12 +285,12 @@ return set_int_attribute(self, target, perf_level, NV_CTRL_GPU_MEM_TRANSFER_RATE_OFFSET, offset) -def get_mem_transfer_rate_offset_range(self, target): - return query_valid_attr_values(self, target, 0, NV_CTRL_GPU_MEM_TRANSFER_RATE_OFFSET) +def get_mem_transfer_rate_offset_range(self, target, perf_level): + return query_valid_attr_values(self, target, perf_level, NV_CTRL_GPU_MEM_TRANSFER_RATE_OFFSET) def get_cooler_manual_control_enabled(self, target): - return query_int_attribute(self, target, 0, NV_CTRL_GPU_COOLER_MANUAL_CONTROL) == 1 + return query_int_attribute(self, target, 0, NV_CTRL_GPU_COOLER_MANUAL_CONTROL) def set_cooler_manual_control_enabled(self, target, enabled): @@ -354,11 +364,11 @@ disp.extension_add_method('display', 'nvcontrol_get_memory_bus_width', get_memory_bus_width) disp.extension_add_method('display', 'nvcontrol_get_total_dedicated_gpu_memory', get_total_dedicated_gpu_memory) disp.extension_add_method('display', 'nvcontrol_get_used_dedicated_gpu_memory', get_used_dedicated_gpu_memory) - disp.extension_add_method('display', 'nvcontrol_get_pcie_current_link_width', get_pcie_current_link_width) - disp.extension_add_method('display', 'nvcontrol_get_pcie_max_link_width', get_pcie_max_link_width) - disp.extension_add_method('display', 'nvcontrol_get_pcie_generation', get_pcie_generation) - disp.extension_add_method('display', 'nvcontrol_get_video_encoder_utilization', get_video_encoder_utilization) - disp.extension_add_method('display', 'nvcontrol_get_video_decoder_utilization', get_video_decoder_utilization) + disp.extension_add_method('display', 'nvcontrol_get_curr_pcie_link_width', get_curr_pcie_link_width) + disp.extension_add_method('display', 'nvcontrol_get_max_pcie_link_width', get_max_pcie_link_width) + disp.extension_add_method('display', 'nvcontrol_get_curr_pcie_link_generation', get_curr_pcie_link_generation) + disp.extension_add_method('display', 'nvcontrol_get_encoder_utilization', get_encoder_utilization) + disp.extension_add_method('display', 'nvcontrol_get_decoder_utilization', get_decoder_utilization) disp.extension_add_method('display', 'nvcontrol_get_current_performance_level', get_current_performance_level) disp.extension_add_method('display', 'nvcontrol_get_gpu_nvclock_offset', get_gpu_nvclock_offset) disp.extension_add_method('display', 'nvcontrol_set_gpu_nvclock_offset', set_gpu_nvclock_offset) @@ -375,8 +385,9 @@ disp.extension_add_method('display', 'nvcontrol_get_driver_version', get_driver_version) disp.extension_add_method('display', 'nvcontrol_get_vbios_version', get_vbios_version) disp.extension_add_method('display', 'nvcontrol_get_gpu_uuid', get_gpu_uuid) - disp.extension_add_method('display', 'nvcontrol_get_gpu_utilization', get_gpu_utilization) + disp.extension_add_method('display', 'nvcontrol_get_utilization_rates', get_utilization_rates) disp.extension_add_method('display', 'nvcontrol_get_performance_modes', get_performance_modes) + disp.extension_add_method('display', 'nvcontrol_get_clock_info', get_clock_info) disp.extension_add_method('display', 'nvcontrol_set_cooler_manual_control_enabled', set_cooler_manual_control_enabled) disp.extension_add_method('display', 'nvcontrol_get_gpu_nvclock_offset_range', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/Xlib/ext/xfixes.py new/python-xlib-0.26/Xlib/ext/xfixes.py --- old/python-xlib-0.25/Xlib/ext/xfixes.py 2016-08-13 10:06:02.000000000 +0200 +++ new/python-xlib-0.26/Xlib/ext/xfixes.py 2019-12-08 12:17:04.000000000 +0100 @@ -22,13 +22,22 @@ ''' A partial implementation of the XFIXES extension. Only the HideCursor and -ShowCursor requests are provided. +ShowCursor requests and SelectionNotify events are provided. ''' from Xlib.protocol import rq extname = 'XFIXES' +XFixesSelectionNotify = 0 + +XFixesSetSelectionOwnerNotifyMask = (1 << 0) +XFixesSelectionWindowDestroyNotifyMask = (1 << 1) +XFixesSelectionClientCloseNotifyMask = (1 << 2) + +XFixesSetSelectionOwnerNotify = 0 +XFixesSelectionWindowDestroyNotify = 1 +XFixesSelectionClientCloseNotify = 2 class QueryVersion(rq.ReplyRequest): _request = rq.Struct(rq.Card8('opcode'), @@ -80,8 +89,54 @@ opcode=self.display.get_extension_major(extname), window=self) +class SelectSelectionInput(rq.Request): + _request = rq.Struct(rq.Card8('opcode'), + rq.Opcode(2), + rq.RequestLength(), + rq.Window('window'), + rq.Card32('selection'), + rq.Card32('mask') + ) + +def select_selection_input(self, window, selection, mask): + return SelectSelectionInput(opcode=self.display.get_extension_major(extname), + display=self.display, + window=window, + selection=selection, + mask=mask) + + +class SelectionNotify(rq.Event): + _code = None + _fields = rq.Struct(rq.Card8('type'), + rq.Card8('sub_code'), + rq.Card16('sequence_number'), + rq.Window('window'), + rq.Window('owner'), + rq.Card32('selection'), + rq.Card32('timestamp'), + rq.Card32('selection_timestamp'), + rq.Pad(8)) + + +class SetSelectionOwnerNotify(SelectionNotify): + pass + + +class SelectionWindowDestroyNotify(SelectionNotify): + pass + + +class SelectionClientCloseNotify(SelectionNotify): + pass + def init(disp, info): + disp.extension_add_method('display', 'xfixes_select_selection_input', select_selection_input) disp.extension_add_method('display', 'xfixes_query_version', query_version) disp.extension_add_method('window', 'xfixes_hide_cursor', hide_cursor) disp.extension_add_method('window', 'xfixes_show_cursor', show_cursor) + + disp.extension_add_subevent(info.first_event + XFixesSelectionNotify, XFixesSetSelectionOwnerNotify, SetSelectionOwnerNotify) + disp.extension_add_subevent(info.first_event + XFixesSelectionNotify, XFixesSelectionWindowDestroyNotify, SelectionWindowDestroyNotify) + disp.extension_add_subevent(info.first_event + XFixesSelectionNotify, XFixesSelectionClientCloseNotify, SelectionClientCloseNotify) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/Xlib/ext/xinput.py new/python-xlib-0.26/Xlib/ext/xinput.py --- old/python-xlib-0.25/Xlib/ext/xinput.py 2016-08-13 10:06:10.000000000 +0200 +++ new/python-xlib-0.26/Xlib/ext/xinput.py 2019-12-08 12:17:04.000000000 +0100 @@ -647,8 +647,8 @@ disp.extension_add_method('display', 'xinput_ungrab_device', ungrab_device) disp.extension_add_method('window', 'xinput_grab_keycode', grab_keycode) disp.extension_add_method('window', 'xinput_ungrab_keycode', ungrab_keycode) - - for device_event in (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion): - disp.ge_add_event_data(info.major_opcode, device_event, DeviceEventData) - disp.ge_add_event_data(info.major_opcode, DeviceChanged, DeviceEventData) - disp.ge_add_event_data(info.major_opcode, HierarchyChanged, HierarchyEventData) + if hasattr(disp,"ge_add_event_data"): + for device_event in (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion): + disp.ge_add_event_data(info.major_opcode, device_event, DeviceEventData) + disp.ge_add_event_data(info.major_opcode, DeviceChanged, DeviceEventData) + disp.ge_add_event_data(info.major_opcode, HierarchyChanged, HierarchyEventData) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/examples/nvcontrol.py new/python-xlib-0.26/examples/nvcontrol.py --- old/python-xlib-0.25/examples/nvcontrol.py 2019-02-03 22:05:24.000000000 +0100 +++ new/python-xlib-0.26/examples/nvcontrol.py 2019-12-08 12:17:04.000000000 +0100 @@ -66,11 +66,11 @@ 'get_memory_bus_width': display.nvcontrol_get_memory_bus_width(gpu), 'get_total_dedicated_gpu_memory': display.nvcontrol_get_total_dedicated_gpu_memory(gpu), 'get_used_dedicated_gpu_memory': display.nvcontrol_get_used_dedicated_gpu_memory(gpu), - 'get_pcie_current_link_width': display.nvcontrol_get_pcie_current_link_width(gpu), - 'get_pcie_max_link_width': display.nvcontrol_get_pcie_max_link_width(gpu), - 'get_pcie_generation': display.nvcontrol_get_pcie_generation(gpu), - 'get_video_encoder_utilization': display.nvcontrol_get_video_encoder_utilization(gpu), - 'get_video_decoder_utilization': display.nvcontrol_get_video_decoder_utilization(gpu), + 'get_curr_pcie_link_width': display.nvcontrol_get_curr_pcie_link_width(gpu), + 'get_max_pcie_link_width': display.nvcontrol_get_max_pcie_link_width(gpu), + 'get_curr_pcie_link_generation': display.nvcontrol_get_curr_pcie_link_generation(gpu), + 'get_encoder_utilization': display.nvcontrol_get_encoder_utilization(gpu), + 'get_decoder_utilization': display.nvcontrol_get_decoder_utilization(gpu), 'get_current_performance_level': display.nvcontrol_get_current_performance_level(gpu), 'get_gpu_nvclock_offset': display.nvcontrol_get_gpu_nvclock_offset(gpu, perf_level), 'get_mem_transfer_rate_offset': display.nvcontrol_get_mem_transfer_rate_offset(gpu, perf_level), @@ -83,10 +83,11 @@ 'get_driver_version': display.nvcontrol_get_driver_version(gpu), 'get_vbios_version': display.nvcontrol_get_vbios_version(gpu), 'get_gpu_uuid': display.nvcontrol_get_gpu_uuid(gpu), - 'get_gpu_utilization': display.nvcontrol_get_gpu_utilization(gpu), + 'get_utilization_rates': display.nvcontrol_get_utilization_rates(gpu), 'get_performance_modes': display.nvcontrol_get_performance_modes(gpu), - 'get_gpu_nvclock_offset_range': display.nvcontrol_get_gpu_nvclock_offset_range(gpu), - 'get_mem_transfer_rate_offset_range': display.nvcontrol_get_mem_transfer_rate_offset_range(gpu) + 'get_gpu_nvclock_offset_range': display.nvcontrol_get_gpu_nvclock_offset_range(gpu, perf_level), + 'get_mem_transfer_rate_offset_range': display.nvcontrol_get_mem_transfer_rate_offset_range(gpu, perf_level), + 'get_clock_info': display.nvcontrol_get_clock_info(gpu) } pprint(dic) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/examples/xdamage.py new/python-xlib-0.26/examples/xdamage.py --- old/python-xlib-0.25/examples/xdamage.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python-xlib-0.26/examples/xdamage.py 2019-12-08 12:17:04.000000000 +0100 @@ -0,0 +1,139 @@ +#!/usr/bin/python +# +# examples/xdamage.py -- demonstrate damage extension +# +# Copyright (C) 2019 Mohit Garg <[email protected]> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public License +# as published by the Free Software Foundation; either version 2.1 +# of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., +# 59 Temple Place, +# Suite 330, +# Boston, MA 02111-1307 USA + + +# Python 2/3 compatibility. +from __future__ import print_function + +import sys +import os + +# Change path so we find Xlib +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) + +from Xlib import display, X, threaded,Xutil +import time + +try: + import thread +except ModuleNotFoundError: + import _thread as thread + +from Xlib.ext import damage +from PIL import Image, ImageTk +import traceback + +def redraw(win, gc): + # win.clear_area() + win.fill_rectangle(gc, 0, 0, 60, 60) + +def blink(display, win, gc, cols): + while 1: + time.sleep(2) + print('Changing color', cols[0]) + gc.change(foreground = cols[0]) + cols = (cols[1], cols[0]) + redraw(win, gc) + display.flush() + +def get_image_from_win(win, pt_w, pt_h, pt_x=0, pt_y=0): + try: + raw = win.get_image(pt_x, pt_y, pt_w, pt_h, X.ZPixmap, 0xffffffff) + image = Image.frombytes("RGB", (pt_w, pt_h), raw.data, "raw", "BGRX") + return image + + except Exception: + traceback.print_exc() + +def check_ext(disp): + # Check for extension + if not disp.has_extension('DAMAGE'): + sys.stderr.write('server does not have the DAMAGE extension\n') + sys.stderr.write("\n".join(disp.list_extensions())) + + if disp.query_extension('DAMAGE') is None: + sys.exit(1) + else: + r = disp.damage_query_version() + print('DAMAGE version {}.{}'.format(r.major_version, r.minor_version)) + +def main(): + d = display.Display() + root = d.screen().root + + check_ext(d) + colormap = d.screen().default_colormap + + red = colormap.alloc_named_color("red").pixel + blue = colormap.alloc_named_color("blue").pixel + background = colormap.alloc_named_color("white").pixel + + window1 = root.create_window(100, 100, 250, 100, 1, + X.CopyFromParent, X.InputOutput, + X.CopyFromParent, + background_pixel = background, + event_mask = X.StructureNotifyMask | X.ExposureMask) + window1.set_wm_name('Changing Window') + window1.map() + gc = window1.create_gc(foreground = red) + + thread.start_new_thread(blink, (d, window1, gc, (blue, red))) + + window1.damage_create(damage.DamageReportRawRectangles) + window1.set_wm_normal_hints( + flags=(Xutil.PPosition | Xutil.PSize | Xutil.PMinSize), + min_width=50, + min_height=50 + ) + + window2 = root.create_window(100, 250, 250, 100, 1, + X.CopyFromParent, X.InputOutput, + X.CopyFromParent, + background_pixel = background, + event_mask = X.StructureNotifyMask | X.ExposureMask) + window2.set_wm_normal_hints( + flags=(Xutil.PPosition | Xutil.PSize | Xutil.PMinSize), + min_width=50, + min_height=50 + ) + + window2.set_wm_name('Tracking Window') + window2.map() + + while 1: + event = d.next_event() + if event.type == X.Expose: + if event.count == 0: + redraw(window1, gc) + elif event.type == d.extension_event.DamageNotify: + image = get_image_from_win(window1, event.area.width, event.area.height, event.area.x, event.area.y) + bgpm = window2.create_pixmap(image.width, image.height, d.screen().root_depth) + bggc = window2.create_gc(foreground=0, background=0) + bgpm.put_pil_image(bggc, 0, 0, image) + window2.copy_area(bggc, bgpm, 0, 0, image.width, image.height, 0, 0) + # bggc.free() + elif event.type == X.DestroyNotify: + sys.exit(0) + +if __name__ == "__main__": + main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/examples/xfixes-selection-notify.py new/python-xlib-0.26/examples/xfixes-selection-notify.py --- old/python-xlib-0.25/examples/xfixes-selection-notify.py 1970-01-01 01:00:00.000000000 +0100 +++ new/python-xlib-0.26/examples/xfixes-selection-notify.py 2019-12-08 12:17:04.000000000 +0100 @@ -0,0 +1,82 @@ +#!/usr/bin/python3 +# +# examples/xfixes-selection-notify.py -- demonstrate the XFIXES extension +# SelectionNotify event. +# +# Copyright (C) 2019 +# Tony Crisci <[email protected]> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public License +# as published by the Free Software Foundation; either version 2.1 +# of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., +# 59 Temple Place, +# Suite 330, +# Boston, MA 02111-1307 USA + +# Python 2/3 compatibility. +from __future__ import print_function + +import sys +import os +import time + +# Change path so we find Xlib +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) + +from Xlib.display import Display +from Xlib.ext import xfixes + +def main(argv): + if len(sys.argv) != 2: + sys.exit('usage: {0} SELECTION\n\n' + 'SELECTION is typically PRIMARY, SECONDARY or CLIPBOARD.\n' + .format(sys.argv[0])) + + display = Display() + + sel_name = sys.argv[1] + sel_atom = display.get_atom(sel_name) + + if not display.has_extension('XFIXES'): + if display.query_extension('XFIXES') is None: + print('XFIXES extension not supported', file=sys.stderr) + return 1 + + xfixes_version = display.xfixes_query_version() + print('Found XFIXES version %s.%s' % ( + xfixes_version.major_version, + xfixes_version.minor_version, + ), file=sys.stderr) + + screen = display.screen() + + mask = xfixes.XFixesSetSelectionOwnerNotifyMask | \ + xfixes.XFixesSelectionWindowDestroyNotifyMask | \ + xfixes.XFixesSelectionClientCloseNotifyMask + + display.xfixes_select_selection_input(screen.root, sel_atom, mask) + + while True: + e = display.next_event() + print(e) + + if (e.type, e.sub_code) == display.extension_event.SetSelectionOwnerNotify: + print('SetSelectionOwner: owner=0x{0:08x}'.format(e.owner.id)) + elif (e.type, e.sub_code) == display.extension_event.SelectionWindowDestroyNotify: + print('SelectionWindowDestroy: owner=0x{0:08x}'.format(e.owner.id)) + elif (e.type, e.sub_code) == display.extension_event.SelectionClientCloseNotify: + print('SelectionClientClose: owner=0x{0:08x}'.format(e.owner.id)) + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/python_xlib.egg-info/PKG-INFO new/python-xlib-0.26/python_xlib.egg-info/PKG-INFO --- old/python-xlib-0.25/python_xlib.egg-info/PKG-INFO 2019-02-03 22:09:27.000000000 +0100 +++ new/python-xlib-0.26/python_xlib.egg-info/PKG-INFO 2019-12-08 13:05:42.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: python-xlib -Version: 0.25 +Version: 0.26 Summary: Python X Library Home-page: https://github.com/python-xlib/python-xlib Author: Peter Liljenberg @@ -143,6 +143,8 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Software Development :: Libraries diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/python_xlib.egg-info/SOURCES.txt new/python-xlib-0.26/python_xlib.egg-info/SOURCES.txt --- old/python-xlib-0.25/python_xlib.egg-info/SOURCES.txt 2019-02-03 22:09:27.000000000 +0100 +++ new/python-xlib-0.26/python_xlib.egg-info/SOURCES.txt 2019-12-08 13:05:42.000000000 +0100 @@ -27,6 +27,7 @@ Xlib/xauth.py Xlib/ext/__init__.py Xlib/ext/composite.py +Xlib/ext/damage.py Xlib/ext/ge.py Xlib/ext/nvcontrol.py Xlib/ext/randr.py @@ -109,6 +110,8 @@ examples/security.py examples/shapewin.py examples/threadtest.py +examples/xdamage.py +examples/xfixes-selection-notify.py examples/xfixes.py examples/xinerama.py examples/xinput.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/python-xlib-0.25/setup.cfg new/python-xlib-0.26/setup.cfg --- old/python-xlib-0.25/setup.cfg 2019-02-03 22:09:27.000000000 +0100 +++ new/python-xlib-0.26/setup.cfg 2019-12-08 13:05:43.000000000 +0100 @@ -26,6 +26,8 @@ Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 Programming Language :: Python :: Implementation :: CPython Topic :: Software Development :: Libraries :: Python Modules Topic :: Software Development :: Libraries
