odk/examples/python/Miscellaneous/InputEvents.py |   21 +--------------------
 1 file changed, 1 insertion(+), 20 deletions(-)

New commits:
commit e00ddac69b81fcb53616c258e6a7cef942dab886
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon May 26 11:32:32 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed May 28 18:03:04 2025 +0200

    odk: Drop a11y UNO API use from InputEvents example
    
    The UNO a11y API is unpublished and has no stability
    guarantuee whatsoever and is not meant to be used by external
    users, so don't use it in the InputEvents example.
    
    Change-Id: Ie98dc344b0459946976d881134f6fac9b7e1452a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185847
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/odk/examples/python/Miscellaneous/InputEvents.py 
b/odk/examples/python/Miscellaneous/InputEvents.py
index af5e63917a9f..5c0220f2583c 100644
--- a/odk/examples/python/Miscellaneous/InputEvents.py
+++ b/odk/examples/python/Miscellaneous/InputEvents.py
@@ -15,7 +15,6 @@ from com.sun.star.awt import XMouseClickHandler
 from com.sun.star.awt import XMouseMotionHandler
 from com.sun.star.awt import XMouseListener
 from com.sun.star.awt import XMouseMotionListener
-from com.sun.star.accessibility import AccessibleRole
 
 
 """
@@ -70,7 +69,7 @@ def demo():
 
 
 def recursive_windows(path, xWindow, func):
-    print("recursive_windows: " + path + 
find_accessible_role(xWindow.getAccessibleContext().getAccessibleRole()))
+    print("recursive_windows: " + path)
     func(xWindow)
     try:
         windows = xWindow.getWindows()  # XVclContainer.getWindows()
@@ -81,12 +80,6 @@ def recursive_windows(path, xWindow, func):
         recursive_windows(path+str(i)+": ", subXWindow, func)
 
 
-def find_accessible_role(role_int):
-    for role_name in dir(AccessibleRole):
-        if role_int == eval("AccessibleRole." + role_name):
-            return role_name
-
-
 class MyXKeyMouseClickMotionHandler(unohelper.Base, XKeyHandler, XKeyListener, 
XMouseClickHandler, XMouseMotionHandler, XMouseListener, XMouseMotionListener):
     def __init__(self, name):  # XKeyHandler, XKeyListener
         self.name = name
commit 24c86762b1af48c814d47b2a4b6c43e6cd31d373
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon May 26 11:29:38 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Wed May 28 18:02:53 2025 +0200

    odk examples: Drop unused recursive_acc_ctx
    
    The only uses are commented ever since this
    example was added in
    
        commit 2e52ac48e58efa5f1204ac61eec820eb3fb561ba
        Date:   Thu Jun 27 00:17:31 2024 +0200
    
            Added pyuno demo for key and mouse handlers and listeners.
    
    and the UNO a11y API is unpublished, i.e. not meant
    to be used in external code.
    
    Change-Id: I39f50cdfca938bd260ee6c558c23e13776583565
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185846
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/odk/examples/python/Miscellaneous/InputEvents.py 
b/odk/examples/python/Miscellaneous/InputEvents.py
index 8dc443e2f6d2..af5e63917a9f 100644
--- a/odk/examples/python/Miscellaneous/InputEvents.py
+++ b/odk/examples/python/Miscellaneous/InputEvents.py
@@ -66,21 +66,9 @@ def demo():
                 #subXWindow.addMouseMotionListener(listener),  # very much 
events
             ))
 
-        # Maybe the event handlers can also be registered via one of the 
objects
-        # this function iterates through. But currently this function just
-        # prints the accessible roles of the objects.
-        #recursive_acc_ctx("", xWindow.AccessibleContext.AccessibleParent);
-        #recursive_acc_ctx("", xWindow);
-
         input("Waiting for events. Press Enter to quit...
")
 
 
-def recursive_acc_ctx(path, obj):
-    print("recursive_acc_ctx: " + path + 
find_accessible_role(obj.getAccessibleContext().getAccessibleRole()))
-    for i in range(obj.getAccessibleContext().AccessibleChildCount):
-        recursive_acc_ctx(path+str(i)+": ", 
obj.getAccessibleContext().getAccessibleChild(i))
-
-
 def recursive_windows(path, xWindow, func):
     print("recursive_windows: " + path + 
find_accessible_role(xWindow.getAccessibleContext().getAccessibleRole()))
     func(xWindow)

Reply via email to