| Index: ui/base/x/x11_util.h
|
| diff --git a/ui/base/x/x11_util.h b/ui/base/x/x11_util.h
|
| index 24a44183dd6e58e33673baa0e7fcfcbfd06cea2c..c528e908900f1837a67b82908c7df6ade37342f5 100644
|
| --- a/ui/base/x/x11_util.h
|
| +++ b/ui/base/x/x11_util.h
|
| @@ -21,16 +21,13 @@
|
| #include "ui/events/event_constants.h"
|
| #include "ui/events/keycodes/keyboard_codes.h"
|
| #include "ui/gfx/point.h"
|
| +#include "ui/gfx/x/x11_types.h"
|
|
|
| typedef unsigned long Atom;
|
| -typedef unsigned long XID;
|
| typedef unsigned long XSharedMemoryId; // ShmSeg in the X headers.
|
| -typedef struct _XDisplay Display;
|
| typedef unsigned long Cursor;
|
| typedef struct _XcursorImage XcursorImage;
|
| typedef union _XEvent XEvent;
|
| -typedef struct _XImage XImage;
|
| -typedef struct _XGC *GC;
|
|
|
| #if defined(TOOLKIT_GTK)
|
| typedef struct _GdkDrawable GdkWindow;
|
| @@ -56,11 +53,6 @@ namespace ui {
|
| UI_EXPORT bool XDisplayExists();
|
| // Return an X11 connection for the current, primary display.
|
|
|
| -// TODO(oshima|evan): This assume there is one display and dosn't work
|
| -// undef mutiple displays/monitor environment. Remove this and change the
|
| -// chrome codebase to get the display from window.
|
| -UI_EXPORT Display* GetXDisplay();
|
| -
|
| // X shared memory comes in three flavors:
|
| // 1) No SHM support,
|
| // 2) SHM putimage,
|
| @@ -71,13 +63,13 @@ enum SharedMemorySupport {
|
| SHARED_MEMORY_PIXMAP
|
| };
|
| // Return the shared memory type of our X connection.
|
| -UI_EXPORT SharedMemorySupport QuerySharedMemorySupport(Display* dpy);
|
| +UI_EXPORT SharedMemorySupport QuerySharedMemorySupport(XDisplay* dpy);
|
|
|
| // Return true iff the display supports Xrender
|
| -UI_EXPORT bool QueryRenderSupport(Display* dpy);
|
| +UI_EXPORT bool QueryRenderSupport(XDisplay* dpy);
|
|
|
| // Return the default screen number for the display
|
| -int GetDefaultScreen(Display* display);
|
| +int GetDefaultScreen(XDisplay* display);
|
|
|
| // Returns an X11 Cursor, sharable across the process.
|
| // |cursor_shape| is an X font cursor shape, see XCreateFontCursor().
|
| @@ -153,7 +145,7 @@ UI_EXPORT void SetHideTitlebarWhenMaximizedProperty(
|
| UI_EXPORT void ClearX11DefaultRootWindow();
|
|
|
| // Return the number of bits-per-pixel for a pixmap of the given depth
|
| -UI_EXPORT int BitsPerPixelForPixmapDepth(Display* display, int depth);
|
| +UI_EXPORT int BitsPerPixelForPixmapDepth(XDisplay* display, int depth);
|
|
|
| // Returns true if |window| is visible.
|
| UI_EXPORT bool IsWindowVisible(XID window);
|
| @@ -212,7 +204,7 @@ UI_EXPORT bool SetAtomArrayProperty(XID window,
|
| Atom GetAtom(const char* atom_name);
|
|
|
| // Sets the WM_CLASS attribute for a given X11 window.
|
| -UI_EXPORT void SetWindowClassHint(Display* display,
|
| +UI_EXPORT void SetWindowClassHint(XDisplay* display,
|
| XID window,
|
| std::string res_name,
|
| std::string res_class);
|
| @@ -229,7 +221,7 @@ static const int kAllDesktops = -1;
|
| bool GetWindowDesktop(XID window, int* desktop);
|
|
|
| // Translates an X11 error code into a printable string.
|
| -UI_EXPORT std::string GetX11ErrorString(Display* display, int err);
|
| +UI_EXPORT std::string GetX11ErrorString(XDisplay* display, int err);
|
|
|
| // Implementers of this interface receive a notification for every X window of
|
| // the main display.
|
| @@ -263,9 +255,9 @@ void RestackWindow(XID window, XID sibling, bool above);
|
|
|
| // Return a handle to a X ShmSeg. |shared_memory_key| is a SysV
|
| // IPC key. The shared memory region must contain 32-bit pixels.
|
| -UI_EXPORT XSharedMemoryId AttachSharedMemory(Display* display,
|
| +UI_EXPORT XSharedMemoryId AttachSharedMemory(XDisplay* display,
|
| int shared_memory_support);
|
| -UI_EXPORT void DetachSharedMemory(Display* display, XSharedMemoryId shmseg);
|
| +UI_EXPORT void DetachSharedMemory(XDisplay* display, XSharedMemoryId shmseg);
|
|
|
| // Copies |source_bounds| from |drawable| to |canvas| at offset |dest_offset|.
|
| // |source_bounds| is in physical pixels, while |dest_offset| is relative to
|
| @@ -279,13 +271,13 @@ UI_EXPORT bool CopyAreaToCanvas(XID drawable,
|
|
|
| // Return a handle to an XRender picture where |pixmap| is a handle to a
|
| // pixmap containing Skia ARGB data.
|
| -UI_EXPORT XID CreatePictureFromSkiaPixmap(Display* display, XID pixmap);
|
| +UI_EXPORT XID CreatePictureFromSkiaPixmap(XDisplay* display, XID pixmap);
|
|
|
| // Draws ARGB data on the given pixmap using the given GC, converting to the
|
| // server side visual depth as needed. Destination is assumed to be the same
|
| // dimensions as |data| or larger. |data| is also assumed to be in row order
|
| // with each line being exactly |width| * 4 bytes long.
|
| -UI_EXPORT void PutARGBImage(Display* display,
|
| +UI_EXPORT void PutARGBImage(XDisplay* display,
|
| void* visual, int depth,
|
| XID pixmap, void* pixmap_gc,
|
| const uint8* data,
|
| @@ -295,7 +287,7 @@ UI_EXPORT void PutARGBImage(Display* display,
|
| // - |data_width| and |data_height| refer to the data image
|
| // - |src_x|, |src_y|, |copy_width| and |copy_height| define source region
|
| // - |dst_x|, |dst_y|, |copy_width| and |copy_height| define destination region
|
| -UI_EXPORT void PutARGBImage(Display* display,
|
| +UI_EXPORT void PutARGBImage(XDisplay* display,
|
| void* visual, int depth,
|
| XID pixmap, void* pixmap_gc,
|
| const uint8* data,
|
| @@ -304,8 +296,8 @@ UI_EXPORT void PutARGBImage(Display* display,
|
| int dst_x, int dst_y,
|
| int copy_width, int copy_height);
|
|
|
| -void FreePicture(Display* display, XID picture);
|
| -void FreePixmap(Display* display, XID pixmap);
|
| +void FreePicture(XDisplay* display, XID picture);
|
| +void FreePixmap(XDisplay* display, XID pixmap);
|
|
|
| enum WindowManagerName {
|
| WM_UNKNOWN,
|
| @@ -419,7 +411,7 @@ class UI_EXPORT XScopedImage {
|
| class UI_EXPORT XScopedCursor {
|
| public:
|
| // Keeps track of |cursor| created with |display|.
|
| - XScopedCursor(::Cursor cursor, Display* display);
|
| + XScopedCursor(::Cursor cursor, XDisplay* display);
|
| ~XScopedCursor();
|
|
|
| ::Cursor get() const;
|
| @@ -427,7 +419,7 @@ class UI_EXPORT XScopedCursor {
|
|
|
| private:
|
| ::Cursor cursor_;
|
| - Display* display_;
|
| + XDisplay* display_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(XScopedCursor);
|
| };
|
|
|