1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/// C++ type: <span style='color: green;'>```QSurface```</span>
///
/// <a href="http://doc.qt.io/qt-5/qsurface.html">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>The <a href="http://doc.qt.io/qt-5/qsurface.html">QSurface</a> class is an abstraction of renderable surfaces in Qt.</p>
/// <p>The size of the surface is accessible with the <a href="http://doc.qt.io/qt-5/qsurface.html#size">size</a>() function. The rendering specific attributes of the surface are accessible through the <a href="http://doc.qt.io/qt-5/qsurface.html#format">format</a>() function.</p></div>
#[repr(C)]
pub struct Surface(u8);

impl Surface {
  /// C++ method: <span style='color: green;'>```pure virtual QSurfaceFormat QSurface::format() const```</span>
  ///
  /// <a href="http://doc.qt.io/qt-5/qsurface.html#format">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the format of the surface.</p></div>
  pub fn format(&self) -> ::surface_format::SurfaceFormat {
    {
      let mut object: ::surface_format::SurfaceFormat =
        unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
      unsafe {
        ::ffi::qt_gui_c_QSurface_format_to_output(self as *const ::surface::Surface, &mut object);
      }
      object
    }
  }

  /// C++ method: <span style='color: green;'>```pure virtual QSize QSurface::size() const```</span>
  ///
  /// <a href="http://doc.qt.io/qt-5/qsurface.html#size">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the size of the surface in pixels.</p></div>
  pub fn size(&self) -> ::qt_core::size::Size {
    {
      let mut object: ::qt_core::size::Size =
        unsafe { ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized() };
      unsafe {
        ::ffi::qt_gui_c_QSurface_size_to_output(self as *const ::surface::Surface, &mut object);
      }
      object
    }
  }

  /// C++ method: <span style='color: green;'>```bool QSurface::supportsOpenGL() const```</span>
  ///
  /// <a href="http://doc.qt.io/qt-5/qsurface.html#supportsOpenGL">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns true if the surface is OpenGL compatible and can be used in conjunction with <a href="http://doc.qt.io/qt-5/qopenglcontext.html">QOpenGLContext</a>; otherwise returns false.</p>
  /// <p>This function was introduced in  Qt 5.3.</p></div>
  pub fn supports_opengl(&self) -> bool {
    unsafe { ::ffi::qt_gui_c_QSurface_supportsOpenGL(self as *const ::surface::Surface) }
  }

  /// C++ method: <span style='color: green;'>```QSurface::SurfaceClass QSurface::surfaceClass() const```</span>
  ///
  /// <a href="http://doc.qt.io/qt-5/qsurface.html#surfaceClass">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the surface class of this surface.</p></div>
  pub fn surface_class(&self) -> ::surface::SurfaceClass {
    unsafe { ::ffi::qt_gui_c_QSurface_surfaceClass(self as *const ::surface::Surface) }
  }

  /// C++ method: <span style='color: green;'>```pure virtual QSurface::SurfaceType QSurface::surfaceType() const```</span>
  ///
  /// <a href="http://doc.qt.io/qt-5/qsurface.html#surfaceType">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the type of the surface.</p></div>
  pub fn surface_type(&self) -> ::surface::SurfaceType {
    unsafe { ::ffi::qt_gui_c_QSurface_surfaceType(self as *const ::surface::Surface) }
  }
}

impl ::cpp_utils::CppDeletable for ::surface::Surface {
  fn deleter() -> ::cpp_utils::Deleter<Self> {
    ::ffi::qt_gui_c_QSurface_delete
  }
}

/// C++ type: <span style='color: green;'>```QSurface::SurfaceClass```</span>
///
/// <a href="http://doc.qt.io/qt-5/qsurface.html#SurfaceClass-enum">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>The SurfaceClass enum describes the actual subclass of the surface.</p></div>
#[derive(Debug, PartialEq, Eq, Clone)]
#[repr(C)]
pub enum SurfaceClass {
  /// The surface is an instance of <a href="http://doc.qt.io/qt-5/qwindow.html">QWindow</a>. (C++ enum variant: <span style='color: green;'>```Window = 0```</span>)
  Window = 0,
  /// The surface is an instance of <a href="http://doc.qt.io/qt-5/qoffscreensurface.html">QOffscreenSurface</a>. (C++ enum variant: <span style='color: green;'>```Offscreen = 1```</span>)
  Offscreen = 1,
}

/// C++ type: <span style='color: green;'>```QSurface::SurfaceType```</span>
///
/// <a href="http://doc.qt.io/qt-5/qsurface.html#SurfaceType-enum">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>The SurfaceType enum describes what type of surface this is.</p></div>
#[derive(Debug, PartialEq, Eq, Clone)]
#[repr(C)]
pub enum SurfaceType {
  /// The surface is is composed of pixels and can be rendered to using a software rasterizer like Qt's raster paint engine. (C++ enum variant: <span style='color: green;'>```RasterSurface = 0```</span>)
  Raster = 0,
  /// The surface is an OpenGL compatible surface and can be used in conjunction with <a href="http://doc.qt.io/qt-5/qopenglcontext.html">QOpenGLContext</a>. (C++ enum variant: <span style='color: green;'>```OpenGLSurface = 1```</span>)
  OpenGL = 1,
  /// The surface can be rendered to using a software rasterizer, and also supports OpenGL. This surface type is intended for internal Qt use, and requires the use of private API. (C++ enum variant: <span style='color: green;'>```RasterGLSurface = 2```</span>)
  RasterGL = 2,
}