1
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2
# Copyright 2012 Canonical
3
# Author: Marco Trevisan (Treviño)
5
# This program is free software: you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License version 3, as published
7
# by the Free Software Foundation.
10
from __future__ import absolute_import
13
from unity.emulators import UnityIntrospectionObject
14
logger = logging.getLogger(__name__)
17
class Screen(UnityIntrospectionObject):
18
"""The Screen class."""
22
"""Return the available windows, or None."""
23
return self.get_children_by_type(Window)
26
def scaled_windows(self):
27
"""Return the available scaled windows, or None."""
28
return self.get_children_by_type(Window, scaled=True)
31
class Window(UnityIntrospectionObject):
32
"""An individual window."""
36
"""Returns a tuple of (x,y,w,h) for the current window."""
37
return (self.x, self.y, self.width, self.height)
40
def scale_close_geometry(self):
41
"""Returns a tuple of (x,y,w,h) for the scale close button."""
42
return (self.scaled_close_x, self.scaled_close_y, self.scaled_close_width, self.scaled_close_height)