1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2  *
3  * This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 #ifndef _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_X11_H
8 #define _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_X11_H
9 
10 #ifdef MOZ_X11
11 
12 #  include "mozilla/widget/WindowSurface.h"
13 #  include "mozilla/gfx/Types.h"
14 
15 #  include <X11/Xlib.h>
16 
17 namespace mozilla {
18 namespace widget {
19 
20 class WindowSurfaceX11 : public WindowSurface {
21  public:
22   WindowSurfaceX11(Display* aDisplay, Window aWindow, Visual* aVisual,
23                    unsigned int aDepth);
24 
25  protected:
26   static gfx::SurfaceFormat GetVisualFormat(const Visual* aVisual,
27                                             unsigned int aDepth);
28 
29   Display* const mDisplay;
30   const Window mWindow;
31   Visual* const mVisual;
32   const unsigned int mDepth;
33   const gfx::SurfaceFormat mFormat;
34 };
35 
36 }  // namespace widget
37 }  // namespace mozilla
38 
39 #endif  // MOZ_X11
40 #endif  // _MOZILLA_WIDGET_GTK_WINDOW_SURFACE_X11_H
41