OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 // This file declares utility functions for X11 (Linux only). | 9 // This file declares utility functions for X11 (Linux only). |
10 // | 10 // |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 UI_EXPORT void DetachSharedMemory(Display* display, XSharedMemoryId shmseg); | 171 UI_EXPORT void DetachSharedMemory(Display* display, XSharedMemoryId shmseg); |
172 | 172 |
173 // Return a handle to an XRender picture where |pixmap| is a handle to a | 173 // Return a handle to an XRender picture where |pixmap| is a handle to a |
174 // pixmap containing Skia ARGB data. | 174 // pixmap containing Skia ARGB data. |
175 UI_EXPORT XID CreatePictureFromSkiaPixmap(Display* display, XID pixmap); | 175 UI_EXPORT XID CreatePictureFromSkiaPixmap(Display* display, XID pixmap); |
176 | 176 |
177 // Draws ARGB data on the given pixmap using the given GC, converting to the | 177 // Draws ARGB data on the given pixmap using the given GC, converting to the |
178 // server side visual depth as needed. Destination is assumed to be the same | 178 // server side visual depth as needed. Destination is assumed to be the same |
179 // dimensions as |data| or larger. |data| is also assumed to be in row order | 179 // dimensions as |data| or larger. |data| is also assumed to be in row order |
180 // with each line being exactly |width| * 4 bytes long. | 180 // with each line being exactly |width| * 4 bytes long. |
181 UI_EXPORT void PutARGBImage(Display* display, void* visual, int depth, | 181 UI_EXPORT void PutARGBImage(Display* display, |
182 XID pixmap, void* pixmap_gc, const uint8* data, | 182 void* visual, int depth, |
| 183 XID pixmap, void* pixmap_gc, |
| 184 const uint8* data, |
183 int width, int height); | 185 int width, int height); |
184 | 186 |
| 187 // Same as above only more general: |
| 188 // - |data_width| and |data_height| refer to the data image |
| 189 // - |src_x|, |src_y|, |copy_width| and |copy_height| define source region |
| 190 // - |dst_x|, |dst_y|, |copy_width| and |copy_height| define destination region |
| 191 UI_EXPORT void PutARGBImage(Display* display, |
| 192 void* visual, int depth, |
| 193 XID pixmap, void* pixmap_gc, |
| 194 const uint8* data, |
| 195 int data_width, int data_height, |
| 196 int src_x, int src_y, |
| 197 int dst_x, int dst_y, |
| 198 int copy_width, int copy_height); |
| 199 |
185 void FreePicture(Display* display, XID picture); | 200 void FreePicture(Display* display, XID picture); |
186 void FreePixmap(Display* display, XID pixmap); | 201 void FreePixmap(Display* display, XID pixmap); |
187 | 202 |
188 enum WindowManagerName { | 203 enum WindowManagerName { |
189 WM_UNKNOWN, | 204 WM_UNKNOWN, |
190 WM_BLACKBOX, | 205 WM_BLACKBOX, |
191 WM_CHROME_OS, | 206 WM_CHROME_OS, |
192 WM_COMPIZ, | 207 WM_COMPIZ, |
193 WM_ENLIGHTENMENT, | 208 WM_ENLIGHTENMENT, |
194 WM_ICE_WM, | 209 WM_ICE_WM, |
(...skipping 14 matching lines...) Expand all Loading... |
209 // the process if called. Use SetX11ErrorHandlers() from x11_util_internal.h | 224 // the process if called. Use SetX11ErrorHandlers() from x11_util_internal.h |
210 // to set your own error handlers. | 225 // to set your own error handlers. |
211 UI_EXPORT void SetDefaultX11ErrorHandlers(); | 226 UI_EXPORT void SetDefaultX11ErrorHandlers(); |
212 | 227 |
213 // Return true if a given window is in full-screen mode. | 228 // Return true if a given window is in full-screen mode. |
214 UI_EXPORT bool IsX11WindowFullScreen(XID window); | 229 UI_EXPORT bool IsX11WindowFullScreen(XID window); |
215 | 230 |
216 } // namespace ui | 231 } // namespace ui |
217 | 232 |
218 #endif // UI_BASE_X_X11_UTIL_H_ | 233 #endif // UI_BASE_X_X11_UTIL_H_ |
OLD | NEW |