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 "api.hxx"
|
||||||
|
|
||||||
#include <utility>
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <utility>
|
||||||
|
|
||||||
namespace ffi {
|
namespace ffi {
|
||||||
extern "C" Core* rt4_viewport_create(xcb_connection_t* connection, std::uint32_t window);
|
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_destroy(Core* viewport);
|
||||||
extern "C" void rt4_viewport_configure(Core* viewport, std::uint32_t width, std::uint32_t height);
|
extern "C" void rt4_viewport_configure(Core* viewport, std::uint32_t width, std::uint32_t height);
|
||||||
extern "C" void rt4_viewport_redraw(Core* viewport);
|
extern "C" void rt4_viewport_redraw(Core* viewport);
|
||||||
}
|
} // namespace ffi
|
||||||
|
|
||||||
BoxCore::BoxCore(BoxCore&& b)
|
BoxCore::BoxCore(BoxCore&& b)
|
||||||
: ptr(std::exchange(b.ptr, {}))
|
: ptr(std::exchange(b.ptr, {})) {
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BoxCore::~BoxCore() {
|
BoxCore::~BoxCore() {
|
||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
BoxCore& BoxCore::operator= (BoxCore&& b) {
|
BoxCore& BoxCore::operator=(BoxCore&& b) {
|
||||||
if (&b == this)
|
if (&b == this)
|
||||||
return *this;
|
return *this;
|
||||||
std::swap(ptr, b.ptr);
|
std::swap(ptr, b.ptr);
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,8 @@ public:
|
||||||
BoxCore() = default;
|
BoxCore() = default;
|
||||||
BoxCore(const BoxCore&) = delete;
|
BoxCore(const BoxCore&) = delete;
|
||||||
BoxCore(BoxCore&&);
|
BoxCore(BoxCore&&);
|
||||||
BoxCore& operator= (const BoxCore&) = delete;
|
BoxCore& operator=(const BoxCore&) = delete;
|
||||||
BoxCore& operator= (BoxCore&&);
|
BoxCore& operator=(BoxCore&&);
|
||||||
~BoxCore();
|
~BoxCore();
|
||||||
|
|
||||||
explicit operator bool() const { return !!ptr; }
|
explicit operator bool() const { return !!ptr; }
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char* argv[]) {
|
||||||
{
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
auto w = new PhotonLight;
|
auto w = new PhotonLight;
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
#include "ui_main_window.h"
|
#include "ui_main_window.h"
|
||||||
|
|
||||||
PhotonLight::PhotonLight(QWidget *parent)
|
PhotonLight::PhotonLight(QWidget* parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent),
|
||||||
, m_ui(new Ui::MainWindow)
|
m_ui(new Ui::MainWindow) {
|
||||||
{
|
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,11 @@ namespace Ui {
|
||||||
class MainWindow;
|
class MainWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PhotonLight : public QMainWindow
|
class PhotonLight : public QMainWindow {
|
||||||
{
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PhotonLight(QWidget *parent = nullptr);
|
explicit PhotonLight(QWidget* parent = nullptr);
|
||||||
~PhotonLight() override;
|
~PhotonLight() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,8 @@
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QGuiApplication>
|
#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_DontCreateNativeAncestors);
|
||||||
setAttribute(Qt::WA_NativeWindow);
|
setAttribute(Qt::WA_NativeWindow);
|
||||||
setAttribute(Qt::WA_PaintOnScreen);
|
setAttribute(Qt::WA_PaintOnScreen);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include "api.hxx"
|
#include "api.hxx"
|
||||||
|
|
||||||
class Viewport: public QWidget {
|
class Viewport : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user