From 86c1235598c4fd263072744410b8b6f4831a03a3 Mon Sep 17 00:00:00 2001 From: Ali Hatami Tajik Date: Sat, 4 Mar 2023 14:23:29 +0330 Subject: [PATCH] Add rotation and reflection enums reflection and rotation are added from man page --- src/scripts/python/xutil/randr.py | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/scripts/python/xutil/randr.py b/src/scripts/python/xutil/randr.py index 1d2637f..b508a5b 100644 --- a/src/scripts/python/xutil/randr.py +++ b/src/scripts/python/xutil/randr.py @@ -24,6 +24,11 @@ from enum import Enum from dataclasses import dataclass +# TODO: Option class which can be applied by get_args method +# TODO: Screen-related option class ~ +# TODO: abs position + + class Pos(Enum): """Position types in xrandr @@ -34,3 +39,35 @@ class Pos(Enum): ABOVE = 2, BELOW = 3, SAME_AS = 4 + + +class RotationDir(Enum): + """Rotation direction + + This causes the output contents to be rotated in the specified direction. + """ + NORMAL = 0, + LEFT = 1, + RIGHT = 2, + INVERTED = 3 + + +class ReflectDir(Enum): + """Reflection direction + + This causes the output contents to be reflected across the specified axes. + """ + NORMAL = 0, + X = 1, + Y = 2, + XY = 3 + + +@dataclass +class Setting: + resolution = None, + is_primary = False, + is_enabeled = True, + rotation = None + position = None + reflection = None