mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
Add clang-format file
Also run it across the whole tree to get everything using the One True Style. We don't yet run this in an automated fashion as it's a little slow, but there is a snippet to do so in makeall.sh.
This commit is contained in:
parent
c11351ac50
commit
0dc9af5f7e
286 changed files with 3244 additions and 2424 deletions
|
@ -1,11 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibGUI/GWidget.h>
|
||||
#include <AK/Vector.h>
|
||||
#include "VBWidget.h"
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGUI/GWidget.h>
|
||||
|
||||
class VBForm : public GWidget {
|
||||
friend class VBWidget;
|
||||
|
||||
public:
|
||||
explicit VBForm(const String& name, GWidget* parent = nullptr);
|
||||
virtual ~VBForm() override;
|
||||
|
@ -43,7 +44,8 @@ private:
|
|||
void add_to_selection(VBWidget&);
|
||||
void remove_from_selection(VBWidget&);
|
||||
void delete_selected_widgets();
|
||||
template<typename Callback> void for_each_selected_widget(Callback);
|
||||
template<typename Callback>
|
||||
void for_each_selected_widget(Callback);
|
||||
|
||||
VBWidget* single_selected_widget();
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ class VBWidget;
|
|||
|
||||
class VBProperty {
|
||||
friend class VBWidget;
|
||||
|
||||
public:
|
||||
VBProperty(VBWidget&, const String& name, const GVariant& value);
|
||||
VBProperty(VBWidget&, const String& name, Function<GVariant(const GWidget&)>&& getter, Function<void(GWidget&, const GVariant&)>&& setter);
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#pragma once
|
||||
|
||||
#include <SharedGraphics/Rect.h>
|
||||
#include "VBWidgetType.h"
|
||||
#include <AK/Function.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/Retainable.h>
|
||||
#include <AK/Retained.h>
|
||||
#include <AK/Weakable.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/Function.h>
|
||||
#include "VBWidgetType.h"
|
||||
#include <SharedGraphics/Rect.h>
|
||||
|
||||
class GPainter;
|
||||
class GVariant;
|
||||
|
@ -15,7 +15,18 @@ class VBForm;
|
|||
class VBProperty;
|
||||
class VBWidgetPropertyModel;
|
||||
|
||||
enum class Direction { None, Left, UpLeft, Up, UpRight, Right, DownRight, Down, DownLeft };
|
||||
enum class Direction
|
||||
{
|
||||
None,
|
||||
Left,
|
||||
UpLeft,
|
||||
Up,
|
||||
UpRight,
|
||||
Right,
|
||||
DownRight,
|
||||
Down,
|
||||
DownLeft
|
||||
};
|
||||
template<typename Callback>
|
||||
inline void for_each_direction(Callback callback)
|
||||
{
|
||||
|
@ -29,8 +40,10 @@ inline void for_each_direction(Callback callback)
|
|||
callback(Direction::DownLeft);
|
||||
}
|
||||
|
||||
class VBWidget : public Retainable<VBWidget>, public Weakable<VBWidget> {
|
||||
class VBWidget : public Retainable<VBWidget>
|
||||
, public Weakable<VBWidget> {
|
||||
friend class VBWidgetPropertyModel;
|
||||
|
||||
public:
|
||||
static Retained<VBWidget> create(VBWidgetType type, VBForm& form) { return adopt(*new VBWidget(type, form)); }
|
||||
~VBWidget();
|
||||
|
|
|
@ -7,7 +7,8 @@ class VBProperty;
|
|||
|
||||
class VBWidgetPropertyModel : public GModel {
|
||||
public:
|
||||
enum Column {
|
||||
enum Column
|
||||
{
|
||||
Name = 0,
|
||||
Value,
|
||||
__Count
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include "VBWidgetType.h"
|
||||
#include <AK/AKString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/AKString.h>
|
||||
|
||||
class GWidget;
|
||||
class VBProperty;
|
||||
|
@ -11,7 +11,8 @@ class VBWidget;
|
|||
|
||||
class VBWidgetRegistry {
|
||||
public:
|
||||
template<typename Callback> static void for_each_widget_type(Callback callback)
|
||||
template<typename Callback>
|
||||
static void for_each_widget_type(Callback callback)
|
||||
{
|
||||
for (unsigned i = 1; i < (unsigned)VBWidgetType::__Count; ++i)
|
||||
callback((VBWidgetType)i);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
enum class VBWidgetType {
|
||||
enum class VBWidgetType
|
||||
{
|
||||
None = 0,
|
||||
GWidget,
|
||||
GButton,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue