<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
B
    YI~dk                 @   sl   d dl Z d dlZd dlZG dd deZG dd dZdd Zdd	 Zed
krhd dl	m
Z
 e
dddd dS )    Nc               @   s   e Zd ZdS )WmInfoGatheringErrorN)__name__
__module____qualname__ r   r   7/opt/alt/python37/lib64/python3.7/idlelib/zoomheight.pyr      s   r   c               @   s2   e Zd Zi Zdd Zd
ddZdd Zdd	 ZdS )
ZoomHeightc             C   s   || _ | j j| _d S )N)editwintop)selfr	   r   r   r   __init__   s    zZoomHeight.__init__Nc             C   sD   |   }|d kr| j  n$|r$dnd}| jjdd| dd dS )NZRestoreZZoomoptionsz* Heightz Height)ZmenuindexZlabelbreak)zoom_heightr
   Zbellr	   Zupdate_menu_label)r   ZeventzoomedZmenu_statusr   r   r   zoom_height_event   s    
zZoomHeight.zoom_height_eventc             C   s|   | j }t|\}}}}| dkr&d S y|  \}}W n tk
rJ   d S X ||krjt|||||f dS |d dS d S )NnormalT F)r
   get_window_geometrywm_stateget_max_height_and_y_coordr   set_window_geometrywm_geometry)r   r
   widthZheightxy	maxheightmaxyr   r   r   r   !   s    
zZoomHeight.zoom_heightc             C   s  | j }| | f}|| jkr| }y|d W n tjk
rT   tdY nX |  t	|\}}}}t
jdkr|d}| }|d |  t	|}	|	d d |f }
t||
 |  | }||| 7 }||f| j|< t||	 || | j| S )Nr   z_Failed getting geometry of maximized windows, because the "zoomed" window state is unavailable.win32r   r      )r
   Zwinfo_screenwidthZwinfo_screenheight_max_height_and_y_coordsr   tkinterZTclErrorr   updater   sysplatformZwinfo_rootyr   )r   r
   Zscreen_dimensionsZ
orig_stateZmaxwidthr   Zmaxxr   ZmaxrootyZ	orig_geomZ
max_y_geomZmax_y_geom_rootyr   r   r   r   <   s6    






z%ZoomHeight.get_max_height_and_y_coord)N)r   r   r   r!   r   r   r   r   r   r   r   r   r      s
   
r   c             C   s&   |   }td|}ttt| S )Nz(\d+)x(\d+)\+(-?\d+)\+(-?\d+))r   rematchtuplemapintgroups)r
   Zgeommr   r   r   r   n   s    r   c             C   s   |  dj|  d S )Nz{:d}x{:d}+{:d}+{:d})r   format)r
   Zgeometryr   r   r   r   t   s    r   __main__)mainz!idlelib.idle_test.test_zoomheight   F)	verbosityexit)r&   r$   r"   	Exceptionr   r   r   r   r   Zunittestr/   r   r   r   r   <module>   s   b