summaryrefslogtreecommitdiffstats
path: root/ui/base/gtk/gtk_screen_util.h
blob: b916cf238afd24cfea6e7c2fbdcfc7193a0ce1a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_BASE_GTK_GTK_SCREEN_UTILS_H_
#define UI_BASE_GTK_GTK_SCREEN_UTILS_H_

#include <gtk/gtk.h>

#include "ui/base/ui_export.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/vector2d.h"

namespace ui {

// Returns true if the screen is composited, false otherwise.
UI_EXPORT bool IsScreenComposited();

// Get the current location of the mouse cursor relative to the screen.
UI_EXPORT gfx::Point ScreenPoint(GtkWidget* widget);

// Get the current location of the mouse cursor relative to the widget.
UI_EXPORT gfx::Point ClientPoint(GtkWidget* widget);

// Gets the offset of a gtk widget from the origin in screen coordinates.
UI_EXPORT gfx::Vector2d GetWidgetScreenOffset(GtkWidget* widget);

// Returns the bounds of the specified widget in screen coordinates.
UI_EXPORT gfx::Rect GetWidgetScreenBounds(GtkWidget* widget);

}  // namespace ui

#endif  // UI_BASE_GTK_GTK_SCREEN_UTILS_H_