OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_BASE_X_X11_UTIL_H_ | 5 #ifndef UI_BASE_X_X11_UTIL_H_ |
6 #define UI_BASE_X_X11_UTIL_H_ | 6 #define UI_BASE_X_X11_UTIL_H_ |
7 | 7 |
8 // This file declares utility functions for X11 (Linux only). | 8 // This file declares utility functions for X11 (Linux only). |
9 // | 9 // |
10 // These functions do not require the Xlib headers to be included (which is why | 10 // These functions do not require the Xlib headers to be included (which is why |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 // the process if called. Use SetX11ErrorHandlers() from x11_util_internal.h | 298 // the process if called. Use SetX11ErrorHandlers() from x11_util_internal.h |
299 // to set your own error handlers. | 299 // to set your own error handlers. |
300 UI_EXPORT void SetDefaultX11ErrorHandlers(); | 300 UI_EXPORT void SetDefaultX11ErrorHandlers(); |
301 | 301 |
302 // Return true if a given window is in full-screen mode. | 302 // Return true if a given window is in full-screen mode. |
303 UI_EXPORT bool IsX11WindowFullScreen(XID window); | 303 UI_EXPORT bool IsX11WindowFullScreen(XID window); |
304 | 304 |
305 // Return true if event type is MotionNotify. | 305 // Return true if event type is MotionNotify. |
306 UI_EXPORT bool IsMotionEvent(XEvent* event); | 306 UI_EXPORT bool IsMotionEvent(XEvent* event); |
307 | 307 |
308 // Coalesce all pending motion events (touch or mouse) that are at the top of | |
309 // the queue, and return the number eliminated, storing the last one in | |
310 // |last_event|. | |
311 UI_EXPORT int CoalescePendingMotionEvents(const XEvent* xev, | |
312 XEvent* last_event); | |
313 | |
314 // Returns the mapped button. | 308 // Returns the mapped button. |
315 int GetMappedButton(int button); | 309 int GetMappedButton(int button); |
316 | 310 |
317 // Updates button mapping. This is usually called when a MappingNotify event is | 311 // Updates button mapping. This is usually called when a MappingNotify event is |
318 // received. | 312 // received. |
319 UI_EXPORT void UpdateButtonMap(); | 313 UI_EXPORT void UpdateButtonMap(); |
320 | 314 |
321 // Initializes a XEvent that holds XKeyEvent for testing. Note that ui::EF_ | 315 // Initializes a XEvent that holds XKeyEvent for testing. Note that ui::EF_ |
322 // flags should be passed as |flags|, not the native ones in <X11/X.h>. | 316 // flags should be passed as |flags|, not the native ones in <X11/X.h>. |
323 UI_EXPORT void InitXKeyEventForTesting(EventType type, | 317 UI_EXPORT void InitXKeyEventForTesting(EventType type, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 private: | 371 private: |
378 ::Cursor cursor_; | 372 ::Cursor cursor_; |
379 Display* display_; | 373 Display* display_; |
380 | 374 |
381 DISALLOW_COPY_AND_ASSIGN(XScopedCursor); | 375 DISALLOW_COPY_AND_ASSIGN(XScopedCursor); |
382 }; | 376 }; |
383 | 377 |
384 } // namespace ui | 378 } // namespace ui |
385 | 379 |
386 #endif // UI_BASE_X_X11_UTIL_H_ | 380 #endif // UI_BASE_X_X11_UTIL_H_ |
OLD | NEW |