clang-format
This commit is contained in:
parent
be2df57702
commit
16ea643f90
9
.clang-format
Normal file
9
.clang-format
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
BasedOnStyle: LLVM
|
||||
UseTab: Always
|
||||
TabWidth: 4
|
||||
IndentWidth: 4
|
||||
AccessModifierOffset: -4
|
||||
IndentCaseLabels: false
|
||||
ColumnLimit: 0
|
||||
PointerAlignment: Left
|
||||
PackConstructorInitializers: Never
|
||||
|
|
@ -1,25 +1,24 @@
|
|||
#include "api.hxx"
|
||||
|
||||
#include <utility>
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
|
||||
namespace ffi {
|
||||
extern "C" Core* rt4_viewport_create(xcb_connection_t* connection, std::uint32_t window);
|
||||
extern "C" void rt4_viewport_destroy(Core* viewport);
|
||||
extern "C" void rt4_viewport_configure(Core* viewport, std::uint32_t width, std::uint32_t height);
|
||||
extern "C" void rt4_viewport_redraw(Core* viewport);
|
||||
}
|
||||
} // namespace ffi
|
||||
|
||||
BoxCore::BoxCore(BoxCore&& b)
|
||||
: ptr(std::exchange(b.ptr, {}))
|
||||
{
|
||||
: ptr(std::exchange(b.ptr, {})) {
|
||||
}
|
||||
|
||||
BoxCore::~BoxCore() {
|
||||
reset();
|
||||
}
|
||||
|
||||
BoxCore& BoxCore::operator= (BoxCore&& b) {
|
||||
BoxCore& BoxCore::operator=(BoxCore&& b) {
|
||||
if (&b == this)
|
||||
return *this;
|
||||
std::swap(ptr, b.ptr);
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ public:
|
|||
BoxCore() = default;
|
||||
BoxCore(const BoxCore&) = delete;
|
||||
BoxCore(BoxCore&&);
|
||||
BoxCore& operator= (const BoxCore&) = delete;
|
||||
BoxCore& operator= (BoxCore&&);
|
||||
BoxCore& operator=(const BoxCore&) = delete;
|
||||
BoxCore& operator=(BoxCore&&);
|
||||
~BoxCore();
|
||||
|
||||
explicit operator bool() const { return !!ptr; }
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int main(int argc, char* argv[]) {
|
||||
QApplication app(argc, argv);
|
||||
|
||||
auto w = new PhotonLight;
|
||||
|
|
|
|||
|
|
@ -2,10 +2,9 @@
|
|||
|
||||
#include "ui_main_window.h"
|
||||
|
||||
PhotonLight::PhotonLight(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
, m_ui(new Ui::MainWindow)
|
||||
{
|
||||
PhotonLight::PhotonLight(QWidget* parent)
|
||||
: QMainWindow(parent),
|
||||
m_ui(new Ui::MainWindow) {
|
||||
m_ui->setupUi(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,11 @@ namespace Ui {
|
|||
class MainWindow;
|
||||
}
|
||||
|
||||
class PhotonLight : public QMainWindow
|
||||
{
|
||||
class PhotonLight : public QMainWindow {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit PhotonLight(QWidget *parent = nullptr);
|
||||
explicit PhotonLight(QWidget* parent = nullptr);
|
||||
~PhotonLight() override;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@
|
|||
#include <QEvent>
|
||||
#include <QGuiApplication>
|
||||
|
||||
Viewport::Viewport(QWidget* parent, Qt::WindowFlags f) : QWidget(parent, f) {
|
||||
Viewport::Viewport(QWidget* parent, Qt::WindowFlags f)
|
||||
: QWidget(parent, f) {
|
||||
setAttribute(Qt::WA_DontCreateNativeAncestors);
|
||||
setAttribute(Qt::WA_NativeWindow);
|
||||
setAttribute(Qt::WA_PaintOnScreen);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#include "api.hxx"
|
||||
|
||||
class Viewport: public QWidget {
|
||||
class Viewport : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user