Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: ui/base/x/x11_util.h

Issue 10919135: Move ash specific cursor code to CursorManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/base/x/x11_util.h
diff --git a/ui/base/x/x11_util.h b/ui/base/x/x11_util.h
index d60b4d2a82d231285fa76706d6827ab5dd336acf..795a6996292150ac3399ffc9ac0afc95b85b60ea 100644
--- a/ui/base/x/x11_util.h
+++ b/ui/base/x/x11_util.h
@@ -97,6 +97,12 @@ UI_EXPORT XcursorImage* SkBitmapToXcursorImage(const SkBitmap* bitmap,
const gfx::Point& hotspot);
#endif
+// Hides the host cursor.
+UI_EXPORT void HideHostCursor();
+
+// Returns an invisible cursor.
+UI_EXPORT ::Cursor GetInvisibleCursor();
+
// These functions do not cache their results --------------------------
// Get the X window id for the default root window
@@ -316,6 +322,24 @@ class UI_EXPORT XScopedString {
DISALLOW_COPY_AND_ASSIGN(XScopedString);
};
+// Keeps track of a cursor returned by an X function and makes sure it's
+// XFreeCursor'd.
+class UI_EXPORT XScopedCursor {
+ public:
+ // Keeps track of |cursor| created with |display|.
+ XScopedCursor(::Cursor cursor, Display* display);
+ ~XScopedCursor();
+
+ ::Cursor get() const;
+ void reset(::Cursor cursor);
+
+ private:
+ ::Cursor cursor_;
+ Display* display_;
+
+ DISALLOW_COPY_AND_ASSIGN(XScopedCursor);
+};
+
} // namespace ui
#endif // UI_BASE_X_X11_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698