mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 15:10:19 +00:00
Meta: Tweak .clang-format to not wrap braces after enums.
This commit is contained in:
parent
9145917bf0
commit
39d1a9ae66
Notes:
sideshowbarker
2024-07-19 13:41:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/39d1a9ae668
97 changed files with 186 additions and 312 deletions
|
@ -10,4 +10,3 @@ IndentPPDirectives: AfterHash
|
|||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterFunction: true
|
||||
AfterEnum: true
|
||||
|
|
|
@ -84,8 +84,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
enum class CaseSensitivity
|
||||
{
|
||||
enum class CaseSensitivity {
|
||||
CaseInsensitive,
|
||||
CaseSensitive,
|
||||
};
|
||||
|
|
|
@ -60,8 +60,7 @@ public:
|
|||
void grow(int size);
|
||||
|
||||
private:
|
||||
enum ConstructionMode
|
||||
{
|
||||
enum ConstructionMode {
|
||||
Uninitialized,
|
||||
Copy,
|
||||
Wrap,
|
||||
|
|
|
@ -8,8 +8,7 @@ namespace AK {
|
|||
template<typename T>
|
||||
class RetainPtr {
|
||||
public:
|
||||
enum AdoptTag
|
||||
{
|
||||
enum AdoptTag {
|
||||
Adopt
|
||||
};
|
||||
|
||||
|
|
|
@ -34,8 +34,7 @@ inline void release_if_not_null(T* ptr)
|
|||
template<typename T>
|
||||
class CONSUMABLE(unconsumed) Retained {
|
||||
public:
|
||||
enum AdoptTag
|
||||
{
|
||||
enum AdoptTag {
|
||||
Adopt
|
||||
};
|
||||
|
||||
|
|
|
@ -271,16 +271,14 @@ struct RemovePointer<T* const volatile> {
|
|||
|
||||
template<typename T, typename U>
|
||||
struct IsSame {
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
value = 0
|
||||
};
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct IsSame<T, T> {
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
value = 1
|
||||
};
|
||||
};
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
|
||||
namespace AK {
|
||||
|
||||
enum ShouldChomp
|
||||
{
|
||||
enum ShouldChomp {
|
||||
NoChomp,
|
||||
Chomp
|
||||
};
|
||||
|
@ -40,8 +39,7 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
enum ConstructTheEmptyStringImplTag
|
||||
{
|
||||
enum ConstructTheEmptyStringImplTag {
|
||||
ConstructTheEmptyStringImpl
|
||||
};
|
||||
explicit StringImpl(ConstructTheEmptyStringImplTag)
|
||||
|
@ -49,8 +47,7 @@ private:
|
|||
{
|
||||
}
|
||||
|
||||
enum ConstructWithInlineBufferTag
|
||||
{
|
||||
enum ConstructWithInlineBufferTag {
|
||||
ConstructWithInlineBuffer
|
||||
};
|
||||
StringImpl(ConstructWithInlineBufferTag, ssize_t length);
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/IterationDecision.h>
|
||||
|
||||
#ifdef __serenity__
|
||||
typedef unsigned char byte;
|
||||
typedef unsigned short word;
|
||||
|
@ -48,12 +50,6 @@ constexpr unsigned KB = 1024;
|
|||
constexpr unsigned MB = KB * KB;
|
||||
constexpr unsigned GB = KB * KB * KB;
|
||||
|
||||
enum class IterationDecision
|
||||
{
|
||||
Continue,
|
||||
Abort
|
||||
};
|
||||
|
||||
namespace std {
|
||||
typedef decltype(nullptr) nullptr_t;
|
||||
}
|
||||
|
|
|
@ -26,8 +26,7 @@ public:
|
|||
Function<void(const StringView&)> on_status_message;
|
||||
Function<void(int done, int total)> on_thumbnail_progress;
|
||||
|
||||
enum ViewMode
|
||||
{
|
||||
enum ViewMode {
|
||||
Invalid,
|
||||
List,
|
||||
Icon
|
||||
|
|
|
@ -7,8 +7,7 @@ class IRCChannel;
|
|||
|
||||
class IRCChannelMemberListModel final : public GModel {
|
||||
public:
|
||||
enum Column
|
||||
{
|
||||
enum Column {
|
||||
Name
|
||||
};
|
||||
static Retained<IRCChannelMemberListModel> create(IRCChannel& channel) { return adopt(*new IRCChannelMemberListModel(channel)); }
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
|
||||
#define IRC_DEBUG
|
||||
|
||||
enum IRCNumeric
|
||||
{
|
||||
enum IRCNumeric {
|
||||
RPL_WHOISUSER = 311,
|
||||
RPL_WHOISSERVER = 312,
|
||||
RPL_WHOISOPERATOR = 313,
|
||||
|
@ -106,8 +105,7 @@ void IRCClient::process_line(ByteBuffer&& line)
|
|||
Vector<char, 32> prefix;
|
||||
Vector<char, 32> command;
|
||||
Vector<char, 256> current_parameter;
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
Start,
|
||||
InPrefix,
|
||||
InCommand,
|
||||
|
|
|
@ -6,8 +6,7 @@ class IRCLogBuffer;
|
|||
|
||||
class IRCLogBufferModel final : public GModel {
|
||||
public:
|
||||
enum Column
|
||||
{
|
||||
enum Column {
|
||||
Timestamp = 0,
|
||||
Name,
|
||||
Text,
|
||||
|
|
|
@ -11,8 +11,7 @@ class GTextEditor;
|
|||
|
||||
class IRCWindow : public GWidget {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Server,
|
||||
Channel,
|
||||
Query,
|
||||
|
|
|
@ -8,8 +8,7 @@ class IRCWindow;
|
|||
|
||||
class IRCWindowListModel final : public GModel {
|
||||
public:
|
||||
enum Column
|
||||
{
|
||||
enum Column {
|
||||
Name,
|
||||
};
|
||||
|
||||
|
|
|
@ -11,8 +11,7 @@ class GraphWidget;
|
|||
|
||||
class ProcessModel final : public GModel {
|
||||
public:
|
||||
enum Column
|
||||
{
|
||||
enum Column {
|
||||
Icon = 0,
|
||||
Name,
|
||||
CPU,
|
||||
|
|
|
@ -98,8 +98,7 @@ private:
|
|||
byte foreground_color;
|
||||
byte background_color;
|
||||
|
||||
enum Flags
|
||||
{
|
||||
enum Flags {
|
||||
NoAttributes = 0x00,
|
||||
Bold = 0x01,
|
||||
Italic = 0x02,
|
||||
|
@ -160,8 +159,7 @@ private:
|
|||
void execute_escape_sequence(byte final);
|
||||
void execute_xterm_command();
|
||||
|
||||
enum EscapeState
|
||||
{
|
||||
enum EscapeState {
|
||||
Normal,
|
||||
ExpectBracket,
|
||||
ExpectParameter,
|
||||
|
|
|
@ -15,8 +15,7 @@ class VBForm;
|
|||
class VBProperty;
|
||||
class VBWidgetPropertyModel;
|
||||
|
||||
enum class Direction
|
||||
{
|
||||
enum class Direction {
|
||||
None,
|
||||
Left,
|
||||
UpLeft,
|
||||
|
|
|
@ -7,8 +7,7 @@ class VBProperty;
|
|||
|
||||
class VBWidgetPropertyModel : public GModel {
|
||||
public:
|
||||
enum Column
|
||||
{
|
||||
enum Column {
|
||||
Name = 0,
|
||||
Value,
|
||||
__Count
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
enum class VBWidgetType
|
||||
{
|
||||
enum class VBWidgetType {
|
||||
None = 0,
|
||||
GWidget,
|
||||
GButton,
|
||||
|
|
|
@ -71,8 +71,7 @@ private:
|
|||
template<typename Callback>
|
||||
void for_each_square(Callback);
|
||||
|
||||
enum class Face
|
||||
{
|
||||
enum class Face {
|
||||
Default,
|
||||
Good,
|
||||
Bad
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
#include <AK/Retained.h>
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/KResult.h>
|
||||
#include <Kernel/VirtualAddress.h>
|
||||
#include <Kernel/UnixTypes.h>
|
||||
#include <Kernel/VirtualAddress.h>
|
||||
|
||||
class FileDescription;
|
||||
class Process;
|
||||
|
|
|
@ -8,8 +8,7 @@ class FileDescription;
|
|||
|
||||
class FIFO final : public File {
|
||||
public:
|
||||
enum class Direction : byte
|
||||
{
|
||||
enum class Direction : byte {
|
||||
Neither,
|
||||
Reader,
|
||||
Writer
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
#include <Kernel/FileSystem/Inode.h>
|
||||
#include <Kernel/FileSystem/InodeMetadata.h>
|
||||
#include <Kernel/FileSystem/VirtualFileSystem.h>
|
||||
#include <Kernel/VirtualAddress.h>
|
||||
#include <Kernel/Net/Socket.h>
|
||||
#include <Kernel/VirtualAddress.h>
|
||||
|
||||
class File;
|
||||
class TTY;
|
||||
|
|
|
@ -14,8 +14,7 @@
|
|||
#include <Kernel/kmalloc.h>
|
||||
#include <LibC/errno_numbers.h>
|
||||
|
||||
enum ProcParentDirectory
|
||||
{
|
||||
enum ProcParentDirectory {
|
||||
PDI_AbstractRoot = 0,
|
||||
PDI_Root,
|
||||
PDI_Root_sys,
|
||||
|
@ -23,8 +22,7 @@ enum ProcParentDirectory
|
|||
PDI_PID_fd,
|
||||
};
|
||||
|
||||
enum ProcFileType
|
||||
{
|
||||
enum ProcFileType {
|
||||
FI_Invalid = 0,
|
||||
|
||||
FI_Root = 1, // directory
|
||||
|
@ -601,8 +599,7 @@ ByteBuffer procfs$inodes(InodeIdentifier)
|
|||
struct SysVariableData final : public ProcFSInodeCustomData {
|
||||
virtual ~SysVariableData() override {}
|
||||
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Invalid,
|
||||
Boolean,
|
||||
String,
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
#include <AK/Assertions.h>
|
||||
#include <LibC/errno_numbers.h>
|
||||
|
||||
enum KSuccessTag
|
||||
{
|
||||
enum KSuccessTag {
|
||||
KSuccess
|
||||
};
|
||||
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
#include <AK/Types.h>
|
||||
|
||||
enum KeyCode : byte
|
||||
{
|
||||
enum KeyCode : byte {
|
||||
Key_Invalid = 0,
|
||||
Key_Escape,
|
||||
Key_Tab,
|
||||
|
@ -114,8 +113,7 @@ enum KeyCode : byte
|
|||
Key_Shift = Key_LeftShift,
|
||||
};
|
||||
|
||||
enum KeyModifier
|
||||
{
|
||||
enum KeyModifier {
|
||||
Mod_None = 0x00,
|
||||
Mod_Alt = 0x01,
|
||||
Mod_Ctrl = 0x02,
|
||||
|
|
|
@ -5,16 +5,14 @@
|
|||
#include <Kernel/Net/MACAddress.h>
|
||||
|
||||
struct ARPOperation {
|
||||
enum : word
|
||||
{
|
||||
enum : word {
|
||||
Request = 1,
|
||||
Response = 2,
|
||||
};
|
||||
};
|
||||
|
||||
struct ARPHardwareType {
|
||||
enum : word
|
||||
{
|
||||
enum : word {
|
||||
Ethernet = 1,
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
#include <AK/Types.h>
|
||||
|
||||
struct EtherType {
|
||||
enum : word
|
||||
{
|
||||
enum : word {
|
||||
ARP = 0x0806,
|
||||
IPv4 = 0x0800,
|
||||
};
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
#include <Kernel/Net/MACAddress.h>
|
||||
|
||||
struct ICMPType {
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
EchoReply = 0,
|
||||
EchoRequest = 8,
|
||||
};
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
#include <AK/NetworkOrdered.h>
|
||||
#include <AK/Types.h>
|
||||
|
||||
enum class IPv4Protocol : word
|
||||
{
|
||||
enum class IPv4Protocol : word {
|
||||
ICMP = 1,
|
||||
TCP = 6,
|
||||
UDP = 17,
|
||||
|
|
|
@ -9,16 +9,14 @@
|
|||
#include <Kernel/Lock.h>
|
||||
#include <Kernel/UnixTypes.h>
|
||||
|
||||
enum class SocketRole : byte
|
||||
{
|
||||
enum class SocketRole : byte {
|
||||
None,
|
||||
Listener,
|
||||
Accepted,
|
||||
Connected,
|
||||
Connecting
|
||||
};
|
||||
enum class ShouldBlock
|
||||
{
|
||||
enum class ShouldBlock {
|
||||
No = 0,
|
||||
Yes = 1
|
||||
};
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
#include <Kernel/Net/IPv4.h>
|
||||
|
||||
struct TCPFlags {
|
||||
enum : word
|
||||
{
|
||||
enum : word {
|
||||
FIN = 0x01,
|
||||
SYN = 0x02,
|
||||
RST = 0x04,
|
||||
|
|
|
@ -7,8 +7,7 @@ public:
|
|||
static Retained<TCPSocket> create(int protocol);
|
||||
virtual ~TCPSocket() override;
|
||||
|
||||
enum class State
|
||||
{
|
||||
enum class State {
|
||||
Disconnected,
|
||||
Connecting,
|
||||
Connected,
|
||||
|
|
|
@ -1441,8 +1441,7 @@ pid_t Process::sys$waitpid(pid_t waitee, int* wstatus, int options)
|
|||
return current->m_waitee_pid;
|
||||
}
|
||||
|
||||
enum class KernelMemoryCheckResult
|
||||
{
|
||||
enum class KernelMemoryCheckResult {
|
||||
NotInsideKernelMemory,
|
||||
AccessGranted,
|
||||
AccessDenied
|
||||
|
@ -2654,7 +2653,7 @@ int Process::sys$donate(int tid)
|
|||
for_each_thread([&](Thread& thread) {
|
||||
if (thread.tid() == tid) {
|
||||
beneficiary = &thread;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
|
|
@ -38,8 +38,7 @@ public:
|
|||
static Vector<pid_t> all_pids();
|
||||
static Vector<Process*> all_processes();
|
||||
|
||||
enum Priority
|
||||
{
|
||||
enum Priority {
|
||||
IdlePriority,
|
||||
FirstPriority = IdlePriority,
|
||||
LowPriority,
|
||||
|
@ -48,8 +47,7 @@ public:
|
|||
LastPriority = HighPriority,
|
||||
};
|
||||
|
||||
enum RingLevel
|
||||
{
|
||||
enum RingLevel {
|
||||
Ring0 = 0,
|
||||
Ring3 = 3,
|
||||
};
|
||||
|
@ -398,7 +396,7 @@ inline void Process::for_each(Callback callback)
|
|||
ASSERT_INTERRUPTS_DISABLED();
|
||||
for (auto* process = g_processes->head(); process;) {
|
||||
auto* next_process = process->next();
|
||||
if (callback(*process) == IterationDecision::Abort)
|
||||
if (callback(*process) == IterationDecision::Break)
|
||||
break;
|
||||
process = next_process;
|
||||
}
|
||||
|
@ -427,7 +425,7 @@ inline void Process::for_each_thread(Callback callback) const
|
|||
for (auto* thread = g_runnable_threads->head(); thread;) {
|
||||
auto* next_thread = thread->next();
|
||||
if (thread->pid() == my_pid) {
|
||||
if (callback(*thread) == IterationDecision::Abort)
|
||||
if (callback(*thread) == IterationDecision::Break)
|
||||
break;
|
||||
}
|
||||
thread = next_thread;
|
||||
|
@ -435,7 +433,7 @@ inline void Process::for_each_thread(Callback callback) const
|
|||
for (auto* thread = g_nonrunnable_threads->head(); thread;) {
|
||||
auto* next_thread = thread->next();
|
||||
if (thread->pid() == my_pid) {
|
||||
if (callback(*thread) == IterationDecision::Abort)
|
||||
if (callback(*thread) == IterationDecision::Break)
|
||||
break;
|
||||
}
|
||||
thread = next_thread;
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
#include <AK/Types.h>
|
||||
#include <LibC/fd_set.h>
|
||||
|
||||
extern "C" { struct timeval; }
|
||||
extern "C" {
|
||||
struct timeval;
|
||||
}
|
||||
|
||||
#define ENUMERATE_SYSCALLS \
|
||||
__ENUMERATE_SYSCALL(sleep) \
|
||||
|
@ -114,8 +116,7 @@ extern "C" { struct timeval; }
|
|||
|
||||
namespace Syscall {
|
||||
|
||||
enum Function
|
||||
{
|
||||
enum Function {
|
||||
#undef __ENUMERATE_SYSCALL
|
||||
#define __ENUMERATE_SYSCALL(x) SC_##x,
|
||||
ENUMERATE_SYSCALLS
|
||||
|
|
|
@ -128,8 +128,7 @@ inline bool is_valid_final_character(byte ch)
|
|||
return ch >= 0x40 && ch <= 0x7e;
|
||||
}
|
||||
|
||||
enum class VGAColor : byte
|
||||
{
|
||||
enum class VGAColor : byte {
|
||||
Black = 0,
|
||||
Blue,
|
||||
Green,
|
||||
|
@ -148,8 +147,7 @@ enum class VGAColor : byte
|
|||
White,
|
||||
};
|
||||
|
||||
enum class ANSIColor : byte
|
||||
{
|
||||
enum class ANSIColor : byte {
|
||||
Black = 0,
|
||||
Red,
|
||||
Green,
|
||||
|
|
|
@ -9,8 +9,7 @@ class VirtualConsole final : public TTY
|
|||
, public ConsoleImplementation {
|
||||
AK_MAKE_ETERNAL
|
||||
public:
|
||||
enum InitialContents
|
||||
{
|
||||
enum InitialContents {
|
||||
Cleared,
|
||||
AdoptCurrentVGABuffer
|
||||
};
|
||||
|
@ -73,8 +72,7 @@ private:
|
|||
|
||||
void execute_escape_sequence(byte final);
|
||||
|
||||
enum EscapeState
|
||||
{
|
||||
enum EscapeState {
|
||||
Normal,
|
||||
ExpectBracket,
|
||||
ExpectParameter,
|
||||
|
|
|
@ -254,8 +254,7 @@ ShouldUnblockThread Thread::dispatch_one_pending_signal()
|
|||
return dispatch_signal(signal);
|
||||
}
|
||||
|
||||
enum class DefaultSignalAction
|
||||
{
|
||||
enum class DefaultSignalAction {
|
||||
Terminate,
|
||||
Ignore,
|
||||
DumpCore,
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
#include <AK/RetainPtr.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <Kernel/KResult.h>
|
||||
#include <Kernel/VirtualAddress.h>
|
||||
#include <Kernel/UnixTypes.h>
|
||||
#include <Kernel/VM/Region.h>
|
||||
#include <Kernel/VirtualAddress.h>
|
||||
#include <Kernel/i386.h>
|
||||
|
||||
class Alarm;
|
||||
|
@ -17,8 +17,7 @@ class Process;
|
|||
class Region;
|
||||
class Thread;
|
||||
|
||||
enum class ShouldUnblockThread
|
||||
{
|
||||
enum class ShouldUnblockThread {
|
||||
No = 0,
|
||||
Yes
|
||||
};
|
||||
|
@ -54,8 +53,7 @@ public:
|
|||
|
||||
void finalize();
|
||||
|
||||
enum State : byte
|
||||
{
|
||||
enum State : byte {
|
||||
Invalid = 0,
|
||||
Runnable,
|
||||
Running,
|
||||
|
@ -245,7 +243,7 @@ inline void Thread::for_each_runnable(Callback callback)
|
|||
ASSERT_INTERRUPTS_DISABLED();
|
||||
for (auto* thread = g_runnable_threads->head(); thread;) {
|
||||
auto* next_thread = thread->next();
|
||||
if (callback(*thread) == IterationDecision::Abort)
|
||||
if (callback(*thread) == IterationDecision::Break)
|
||||
return;
|
||||
thread = next_thread;
|
||||
}
|
||||
|
@ -257,7 +255,7 @@ inline void Thread::for_each_nonrunnable(Callback callback)
|
|||
ASSERT_INTERRUPTS_DISABLED();
|
||||
for (auto* thread = g_nonrunnable_threads->head(); thread;) {
|
||||
auto* next_thread = thread->next();
|
||||
if (callback(*thread) == IterationDecision::Abort)
|
||||
if (callback(*thread) == IterationDecision::Break)
|
||||
return;
|
||||
thread = next_thread;
|
||||
}
|
||||
|
|
|
@ -12,17 +12,16 @@
|
|||
#include <AK/Vector.h>
|
||||
#include <AK/Weakable.h>
|
||||
#include <Kernel/FileSystem/InodeIdentifier.h>
|
||||
#include <Kernel/VirtualAddress.h>
|
||||
#include <Kernel/VM/PhysicalPage.h>
|
||||
#include <Kernel/VM/Region.h>
|
||||
#include <Kernel/VM/VMObject.h>
|
||||
#include <Kernel/VirtualAddress.h>
|
||||
|
||||
#define PAGE_ROUND_UP(x) ((((dword)(x)) + PAGE_SIZE - 1) & (~(PAGE_SIZE - 1)))
|
||||
|
||||
class SynthFSInode;
|
||||
|
||||
enum class PageFaultResponse
|
||||
{
|
||||
enum class PageFaultResponse {
|
||||
ShouldCrash,
|
||||
Continue,
|
||||
};
|
||||
|
@ -55,8 +54,7 @@ public:
|
|||
bool validate_user_read(const Process&, VirtualAddress) const;
|
||||
bool validate_user_write(const Process&, VirtualAddress) const;
|
||||
|
||||
enum class ShouldZeroFill
|
||||
{
|
||||
enum class ShouldZeroFill {
|
||||
No,
|
||||
Yes
|
||||
};
|
||||
|
@ -126,8 +124,7 @@ private:
|
|||
dword raw() const { return *m_pde; }
|
||||
dword* ptr() { return m_pde; }
|
||||
|
||||
enum Flags
|
||||
{
|
||||
enum Flags {
|
||||
Present = 1 << 0,
|
||||
ReadWrite = 1 << 1,
|
||||
UserSupervisor = 1 << 2,
|
||||
|
@ -177,8 +174,7 @@ private:
|
|||
dword raw() const { return *m_pte; }
|
||||
dword* ptr() { return m_pte; }
|
||||
|
||||
enum Flags
|
||||
{
|
||||
enum Flags {
|
||||
Present = 1 << 0,
|
||||
ReadWrite = 1 << 1,
|
||||
UserSupervisor = 1 << 2,
|
||||
|
|
|
@ -12,8 +12,7 @@ class Region : public Retainable<Region> {
|
|||
friend class MemoryManager;
|
||||
|
||||
public:
|
||||
enum Access
|
||||
{
|
||||
enum Access {
|
||||
Read = 1,
|
||||
Write = 2,
|
||||
Execute = 4,
|
||||
|
|
|
@ -49,8 +49,7 @@ union [[gnu::packed]] Descriptor
|
|||
dword high;
|
||||
};
|
||||
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Invalid = 0,
|
||||
AvailableTSS_16bit = 0x1,
|
||||
LDT = 0x2,
|
||||
|
@ -180,8 +179,7 @@ private:
|
|||
#define IRQ_VECTOR_BASE 0x50
|
||||
|
||||
struct PageFaultFlags {
|
||||
enum Flags
|
||||
{
|
||||
enum Flags {
|
||||
NotPresent = 0x00,
|
||||
ProtectionViolation = 0x01,
|
||||
Read = 0x00,
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
__BEGIN_DECLS
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
LC_ALL,
|
||||
LC_NUMERIC,
|
||||
LC_CTYPE,
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
enum IOCtlNumber
|
||||
{
|
||||
enum IOCtlNumber {
|
||||
TIOCGPGRP,
|
||||
TIOCSPGRP,
|
||||
TCGETS,
|
||||
|
|
|
@ -91,8 +91,7 @@ int chown(const char* pathname, uid_t, gid_t);
|
|||
int fchown(int fd, uid_t, gid_t);
|
||||
int ftruncate(int fd, off_t length);
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
_PC_NAME_MAX,
|
||||
};
|
||||
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
|
||||
class CDirIterator {
|
||||
public:
|
||||
enum Flags
|
||||
{
|
||||
enum Flags {
|
||||
NoFlags = 0x0,
|
||||
SkipDots = 0x1,
|
||||
};
|
||||
|
|
|
@ -9,8 +9,7 @@ class CObject;
|
|||
|
||||
class CEvent {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Invalid = 0,
|
||||
Quit,
|
||||
Timer,
|
||||
|
|
|
@ -21,8 +21,7 @@ public:
|
|||
|
||||
int exec();
|
||||
|
||||
enum class WaitMode
|
||||
{
|
||||
enum class WaitMode {
|
||||
WaitForEvents,
|
||||
PollForEvents,
|
||||
};
|
||||
|
|
|
@ -14,8 +14,7 @@ public:
|
|||
|
||||
virtual bool open(CIODevice::OpenMode) override;
|
||||
|
||||
enum class ShouldCloseFileDescription
|
||||
{
|
||||
enum class ShouldCloseFileDescription {
|
||||
No = 0,
|
||||
Yes
|
||||
};
|
||||
|
|
|
@ -18,8 +18,7 @@ public:
|
|||
private:
|
||||
void on_socket_connected();
|
||||
|
||||
enum class State
|
||||
{
|
||||
enum class State {
|
||||
InStatus,
|
||||
InHeaders,
|
||||
InBody,
|
||||
|
|
|
@ -6,8 +6,7 @@ class CNetworkJob;
|
|||
|
||||
class CHttpRequest {
|
||||
public:
|
||||
enum Method
|
||||
{
|
||||
enum Method {
|
||||
Invalid,
|
||||
HEAD,
|
||||
GET,
|
||||
|
|
|
@ -6,8 +6,7 @@
|
|||
|
||||
class CIODevice : public CObject {
|
||||
public:
|
||||
enum OpenMode
|
||||
{
|
||||
enum OpenMode {
|
||||
NotOpen = 0,
|
||||
ReadOnly = 1,
|
||||
WriteOnly = 2,
|
||||
|
@ -40,8 +39,7 @@ public:
|
|||
|
||||
bool can_read() const;
|
||||
|
||||
enum class SeekMode
|
||||
{
|
||||
enum class SeekMode {
|
||||
SetPosition,
|
||||
FromCurrentPosition,
|
||||
FromEndPosition,
|
||||
|
|
|
@ -7,8 +7,7 @@ class CNetworkResponse;
|
|||
|
||||
class CNetworkJob : public CObject {
|
||||
public:
|
||||
enum class Error
|
||||
{
|
||||
enum class Error {
|
||||
None,
|
||||
ConnectionFailed,
|
||||
TransmissionFailed,
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
class CNotifier {
|
||||
public:
|
||||
enum Event
|
||||
{
|
||||
enum Event {
|
||||
None = 0,
|
||||
Read = 1,
|
||||
Write = 2,
|
||||
|
|
|
@ -25,7 +25,7 @@ public:
|
|||
void for_each_child(Callback callback)
|
||||
{
|
||||
for (auto* child : m_children) {
|
||||
if (callback(*child) == IterationDecision::Abort)
|
||||
if (callback(*child) == IterationDecision::Break)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,8 +7,7 @@ class CNotifier;
|
|||
|
||||
class CSocket : public CIODevice {
|
||||
public:
|
||||
enum class Type
|
||||
{
|
||||
enum class Type {
|
||||
Invalid,
|
||||
TCP,
|
||||
UDP
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
class CSocketAddress {
|
||||
public:
|
||||
enum class Type
|
||||
{
|
||||
enum class Type {
|
||||
Invalid,
|
||||
IPv4,
|
||||
Local
|
||||
|
|
|
@ -18,8 +18,7 @@ class GWidget;
|
|||
class GAction : public Retainable<GAction>
|
||||
, public Weakable<GAction> {
|
||||
public:
|
||||
enum class ShortcutScope
|
||||
{
|
||||
enum class ShortcutScope {
|
||||
None,
|
||||
ApplicationGlobal,
|
||||
WidgetLocal,
|
||||
|
|
|
@ -5,8 +5,7 @@
|
|||
|
||||
class GDialog : public GWindow {
|
||||
public:
|
||||
enum ExecResult
|
||||
{
|
||||
enum ExecResult {
|
||||
ExecOK = 0,
|
||||
ExecCancel = 1,
|
||||
ExecAborted = 2
|
||||
|
|
|
@ -11,8 +11,7 @@ public:
|
|||
static Retained<GDirectoryModel> create() { return adopt(*new GDirectoryModel); }
|
||||
virtual ~GDirectoryModel() override;
|
||||
|
||||
enum Column
|
||||
{
|
||||
enum Column {
|
||||
Icon = 0,
|
||||
Name,
|
||||
Size,
|
||||
|
|
|
@ -10,8 +10,7 @@ class CObject;
|
|||
|
||||
class GEvent : public CEvent {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Show = 1000,
|
||||
Hide,
|
||||
Paint,
|
||||
|
@ -218,8 +217,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
enum GMouseButton : byte
|
||||
{
|
||||
enum GMouseButton : byte {
|
||||
None = 0,
|
||||
Left = 1,
|
||||
Right = 2,
|
||||
|
|
|
@ -11,8 +11,7 @@ struct GFileSystemModel::Node {
|
|||
String name;
|
||||
Node* parent { nullptr };
|
||||
Vector<Node*> children;
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Unknown,
|
||||
Directory,
|
||||
File
|
||||
|
|
|
@ -6,8 +6,7 @@ class GFileSystemModel : public GModel {
|
|||
friend class Node;
|
||||
|
||||
public:
|
||||
enum Mode
|
||||
{
|
||||
enum Mode {
|
||||
Invalid,
|
||||
DirectoriesOnly,
|
||||
FilesAndDirectories
|
||||
|
|
|
@ -32,8 +32,7 @@ public:
|
|||
|
||||
protected:
|
||||
struct Entry {
|
||||
enum class Type
|
||||
{
|
||||
enum class Type {
|
||||
Invalid = 0,
|
||||
Widget,
|
||||
Layout,
|
||||
|
|
|
@ -8,8 +8,7 @@ class GMenu;
|
|||
|
||||
class GMenuItem {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Invalid,
|
||||
Action,
|
||||
Separator
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
|
||||
class GMessageBox : public GDialog {
|
||||
public:
|
||||
enum class Type
|
||||
{
|
||||
enum class Type {
|
||||
None,
|
||||
Information,
|
||||
Warning,
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
class Font;
|
||||
class GAbstractView;
|
||||
|
||||
enum class GSortOrder
|
||||
{
|
||||
enum class GSortOrder {
|
||||
None,
|
||||
Ascending,
|
||||
Descending
|
||||
|
@ -21,8 +20,7 @@ enum class GSortOrder
|
|||
|
||||
class GModelNotification {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Invalid = 0,
|
||||
ModelUpdated,
|
||||
};
|
||||
|
@ -49,8 +47,7 @@ public:
|
|||
const Font* font { nullptr };
|
||||
};
|
||||
|
||||
enum class Role
|
||||
{
|
||||
enum class Role {
|
||||
Display,
|
||||
Sort,
|
||||
Custom,
|
||||
|
|
|
@ -19,8 +19,7 @@ public:
|
|||
String caption() const { return m_caption; }
|
||||
void set_caption(const StringView& caption) { m_caption = caption; }
|
||||
|
||||
enum Format
|
||||
{
|
||||
enum Format {
|
||||
NoText,
|
||||
Percentage,
|
||||
ValueSlashMax
|
||||
|
|
|
@ -29,8 +29,7 @@ public:
|
|||
|
||||
virtual const char* class_name() const override { return "GScrollBar"; }
|
||||
|
||||
enum Component
|
||||
{
|
||||
enum Component {
|
||||
Invalid,
|
||||
DecrementButton,
|
||||
IncrementButton,
|
||||
|
@ -72,8 +71,7 @@ private:
|
|||
Orientation m_orientation { Orientation::Vertical };
|
||||
Component m_hovered_component { Component::Invalid };
|
||||
|
||||
enum class AutomaticScrollingDirection
|
||||
{
|
||||
enum class AutomaticScrollingDirection {
|
||||
None = 0,
|
||||
Decrement,
|
||||
Increment,
|
||||
|
|
|
@ -46,7 +46,7 @@ void GStackWidget::child_event(CChildEvent& event)
|
|||
GWidget* new_active_widget = nullptr;
|
||||
for_each_child_widget([&](auto& new_child) {
|
||||
new_active_widget = &new_child;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
});
|
||||
set_active_widget(new_active_widget);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ void GTabWidget::child_event(CChildEvent& event)
|
|||
GWidget* new_active_widget = nullptr;
|
||||
for_each_child_widget([&](auto& new_child) {
|
||||
new_active_widget = &new_child;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
});
|
||||
set_active_widget(new_active_widget);
|
||||
}
|
||||
|
|
|
@ -78,8 +78,7 @@ private:
|
|||
|
||||
class GTextEditor : public GScrollableWidget {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
MultiLine,
|
||||
SingleLine
|
||||
};
|
||||
|
|
|
@ -21,8 +21,7 @@ private:
|
|||
virtual void paint_event(GPaintEvent&) override;
|
||||
|
||||
struct Item {
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Invalid,
|
||||
Separator,
|
||||
Action
|
||||
|
|
|
@ -44,12 +44,12 @@ GModelIndex GTreeView::index_at_content_position(const Point& position, bool& is
|
|||
traverse_in_paint_order([&](const GModelIndex& index, const Rect& rect, const Rect& toggle_rect, int) {
|
||||
if (rect.contains(position)) {
|
||||
result = index;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
if (toggle_rect.contains(position)) {
|
||||
result = index;
|
||||
is_toggle = true;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
@ -104,8 +104,8 @@ void GTreeView::traverse_in_paint_order(Callback callback) const
|
|||
toggle_rect = { toggle_x, rect.y(), toggle_size(), toggle_size() };
|
||||
toggle_rect.center_vertically_within(rect);
|
||||
}
|
||||
if (callback(index, rect, toggle_rect, indent_level) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (callback(index, rect, toggle_rect, indent_level) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
y_offset += item_height();
|
||||
// NOTE: Skip traversing children if this index is closed!
|
||||
if (!metadata.open)
|
||||
|
@ -115,8 +115,8 @@ void GTreeView::traverse_in_paint_order(Callback callback) const
|
|||
++indent_level;
|
||||
int row_count = model.row_count(index);
|
||||
for (int i = 0; i < row_count; ++i) {
|
||||
if (traverse_index(model.index(i, 0, index)) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (traverse_index(model.index(i, 0, index)) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
--indent_level;
|
||||
return IterationDecision::Continue;
|
||||
|
@ -205,7 +205,7 @@ void GTreeView::scroll_into_view(const GModelIndex& a_index, Orientation orienta
|
|||
traverse_in_paint_order([&](const GModelIndex& index, const Rect& rect, const Rect&, int) {
|
||||
if (index == a_index) {
|
||||
found_rect = rect;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
@ -270,7 +270,7 @@ void GTreeView::keydown_event(GKeyEvent& event)
|
|||
traverse_in_paint_order([&](const GModelIndex& index, const Rect&, const Rect&, int) {
|
||||
if (index == cursor_index) {
|
||||
found_index = previous_index;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
previous_index = index;
|
||||
return IterationDecision::Continue;
|
||||
|
@ -287,7 +287,7 @@ void GTreeView::keydown_event(GKeyEvent& event)
|
|||
traverse_in_paint_order([&](const GModelIndex& index, const Rect&, const Rect&, int) {
|
||||
if (previous_index == cursor_index) {
|
||||
found_index = index;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
previous_index = index;
|
||||
return IterationDecision::Continue;
|
||||
|
|
|
@ -27,8 +27,7 @@ public:
|
|||
void clear();
|
||||
~GVariant();
|
||||
|
||||
enum class Type
|
||||
{
|
||||
enum class Type {
|
||||
Invalid,
|
||||
Bool,
|
||||
Int,
|
||||
|
|
|
@ -17,23 +17,19 @@ class GLayout;
|
|||
class GMenu;
|
||||
class GWindow;
|
||||
|
||||
enum class SizePolicy
|
||||
{
|
||||
enum class SizePolicy {
|
||||
Fixed,
|
||||
Fill
|
||||
};
|
||||
enum class Orientation
|
||||
{
|
||||
enum class Orientation {
|
||||
Horizontal,
|
||||
Vertical
|
||||
};
|
||||
enum class HorizontalDirection
|
||||
{
|
||||
enum class HorizontalDirection {
|
||||
Left,
|
||||
Right
|
||||
};
|
||||
enum class VerticalDirection
|
||||
{
|
||||
enum class VerticalDirection {
|
||||
Up,
|
||||
Down
|
||||
};
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
class GWidget;
|
||||
class GWMEvent;
|
||||
|
||||
enum class GStandardCursor
|
||||
{
|
||||
enum class GStandardCursor {
|
||||
None = 0,
|
||||
Arrow,
|
||||
IBeam,
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
enum class GWindowType
|
||||
{
|
||||
enum class GWindowType {
|
||||
Invalid = 0,
|
||||
Normal,
|
||||
Menu,
|
||||
|
|
|
@ -20,8 +20,7 @@ struct WSAPI_Rect {
|
|||
WSAPI_Size size;
|
||||
};
|
||||
|
||||
enum WSAPI_WindowType
|
||||
{
|
||||
enum WSAPI_WindowType {
|
||||
Invalid = 0,
|
||||
Normal,
|
||||
Menu,
|
||||
|
@ -37,8 +36,7 @@ struct WSAPI_WindowBackingStoreInfo {
|
|||
RGBA32* pixels;
|
||||
};
|
||||
|
||||
enum class WSAPI_MouseButton : unsigned char
|
||||
{
|
||||
enum class WSAPI_MouseButton : unsigned char {
|
||||
NoButton = 0,
|
||||
Left = 1,
|
||||
Right = 2,
|
||||
|
@ -46,16 +44,14 @@ enum class WSAPI_MouseButton : unsigned char
|
|||
};
|
||||
|
||||
struct WSAPI_KeyModifiers {
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
Shift = 1 << 0,
|
||||
Alt = 1 << 1,
|
||||
Ctrl = 1 << 2,
|
||||
};
|
||||
};
|
||||
|
||||
enum class WSAPI_StandardCursor : unsigned char
|
||||
{
|
||||
enum class WSAPI_StandardCursor : unsigned char {
|
||||
None = 0,
|
||||
Arrow,
|
||||
IBeam,
|
||||
|
@ -65,8 +61,7 @@ enum class WSAPI_StandardCursor : unsigned char
|
|||
ResizeDiagonalBLTR,
|
||||
};
|
||||
|
||||
enum WSAPI_WMEventMask : unsigned
|
||||
{
|
||||
enum WSAPI_WMEventMask : unsigned {
|
||||
WindowRectChanges = 1 << 0,
|
||||
WindowStateChanges = 1 << 1,
|
||||
WindowIconChanges = 1 << 2,
|
||||
|
@ -74,8 +69,7 @@ enum WSAPI_WMEventMask : unsigned
|
|||
};
|
||||
|
||||
struct WSAPI_ServerMessage {
|
||||
enum Type : unsigned
|
||||
{
|
||||
enum Type : unsigned {
|
||||
Invalid,
|
||||
Error,
|
||||
Paint,
|
||||
|
@ -195,8 +189,7 @@ struct WSAPI_ServerMessage {
|
|||
};
|
||||
|
||||
struct WSAPI_ClientMessage {
|
||||
enum Type : unsigned
|
||||
{
|
||||
enum Type : unsigned {
|
||||
Invalid,
|
||||
CreateMenubar,
|
||||
DestroyMenubar,
|
||||
|
|
|
@ -105,7 +105,7 @@ void WSClientConnection::for_each_window_matching(Matching matching, Callback ca
|
|||
{
|
||||
for (auto& it : m_windows) {
|
||||
if (matching(*it.value)) {
|
||||
if (callback(*it.value) == IterationDecision::Abort)
|
||||
if (callback(*it.value) == IterationDecision::Break)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ template<typename Callback>
|
|||
void WSClientConnection::for_each_window(Callback callback)
|
||||
{
|
||||
for (auto& it : m_windows) {
|
||||
if (callback(*it.value) == IterationDecision::Abort)
|
||||
if (callback(*it.value) == IterationDecision::Break)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
class Painter;
|
||||
class WSCursor;
|
||||
|
||||
enum class WallpaperMode
|
||||
{
|
||||
enum class WallpaperMode {
|
||||
Simple,
|
||||
Tile,
|
||||
Center,
|
||||
|
|
|
@ -2,8 +2,7 @@
|
|||
|
||||
#include <SharedGraphics/GraphicsBitmap.h>
|
||||
|
||||
enum class WSStandardCursor
|
||||
{
|
||||
enum class WSStandardCursor {
|
||||
None = 0,
|
||||
Arrow,
|
||||
IBeam,
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
|
||||
class WSEvent : public CEvent {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Invalid = 2000,
|
||||
WM_DeferredCompose,
|
||||
WM_ClientDisconnected,
|
||||
|
@ -706,8 +705,7 @@ private:
|
|||
Vector<Rect, 32> m_rects;
|
||||
};
|
||||
|
||||
enum class MouseButton : byte
|
||||
{
|
||||
enum class MouseButton : byte {
|
||||
None = 0,
|
||||
Left = 1,
|
||||
Right = 2,
|
||||
|
|
|
@ -8,8 +8,7 @@ class WSMenu;
|
|||
|
||||
class WSMenuItem {
|
||||
public:
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
None,
|
||||
Text,
|
||||
Separator,
|
||||
|
|
|
@ -389,7 +389,7 @@ void WSWindowManager::pick_new_active_window()
|
|||
{
|
||||
for_each_visible_window_of_type_from_front_to_back(WSWindowType::Normal, [&](WSWindow& candidate) {
|
||||
set_active_window(&candidate);
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -760,12 +760,12 @@ void WSWindowManager::process_mouse_event(WSMouseEvent& event, WSWindow*& hovere
|
|||
if (!window.is_fullscreen() && m_keyboard_modifiers == Mod_Logo && event.type() == WSEvent::MouseDown && event.button() == MouseButton::Left) {
|
||||
hovered_window = &window;
|
||||
start_window_drag(window, event);
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
if (window.is_resizable() && m_keyboard_modifiers == Mod_Logo && event.type() == WSEvent::MouseDown && event.button() == MouseButton::Right && !window.is_blocked_by_modal_window()) {
|
||||
hovered_window = &window;
|
||||
start_window_resize(window, event);
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
}
|
||||
// Well okay, let's see if we're hitting the frame or the window inside the frame.
|
||||
|
@ -778,13 +778,13 @@ void WSWindowManager::process_mouse_event(WSMouseEvent& event, WSWindow*& hovere
|
|||
auto translated_event = event.translated(-window.position());
|
||||
deliver_mouse_event(window, translated_event);
|
||||
}
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
|
||||
// We are hitting the frame, pass the event along to WSWindowFrame.
|
||||
window.frame().on_mouse_event(event.translated(-window_frame_rect.location()));
|
||||
event_window_with_frame = &window;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
});
|
||||
|
||||
if (event_window_with_frame != m_resize_candidate.ptr())
|
||||
|
@ -815,7 +815,7 @@ bool WSWindowManager::any_opaque_window_contains_rect(const Rect& rect)
|
|||
}
|
||||
if (window.frame().rect().contains(rect)) {
|
||||
found_containing_window = true;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
@ -843,7 +843,7 @@ bool WSWindowManager::any_opaque_window_above_this_one_contains_rect(const WSWin
|
|||
return IterationDecision::Continue;
|
||||
if (window.frame().rect().contains(rect)) {
|
||||
found_containing_window = true;
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
@ -1056,7 +1056,7 @@ Rect WSWindowManager::maximized_window_rect(const WSWindow& window) const
|
|||
// Subtract taskbar window height if present
|
||||
const_cast<WSWindowManager*>(this)->for_each_visible_window_of_type_from_back_to_front(WSWindowType::Taskbar, [&rect](WSWindow& taskbar_window) {
|
||||
rect.set_height(rect.height() - taskbar_window.height());
|
||||
return IterationDecision::Abort;
|
||||
return IterationDecision::Break;
|
||||
});
|
||||
|
||||
return rect;
|
||||
|
|
|
@ -29,8 +29,7 @@ class WSWindowSwitcher;
|
|||
class GraphicsBitmap;
|
||||
class WSButton;
|
||||
|
||||
enum class ResizeDirection
|
||||
{
|
||||
enum class ResizeDirection {
|
||||
None,
|
||||
Left,
|
||||
UpLeft,
|
||||
|
@ -268,12 +267,12 @@ IterationDecision WSWindowManager::for_each_visible_window_of_type_from_back_to_
|
|||
do_highlight_window_at_end = true;
|
||||
continue;
|
||||
}
|
||||
if (callback(*window) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (callback(*window) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
if (do_highlight_window_at_end) {
|
||||
if (callback(*m_highlight_window) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (callback(*m_highlight_window) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
}
|
||||
|
@ -281,14 +280,14 @@ IterationDecision WSWindowManager::for_each_visible_window_of_type_from_back_to_
|
|||
template<typename Callback>
|
||||
IterationDecision WSWindowManager::for_each_visible_window_from_back_to_front(Callback callback)
|
||||
{
|
||||
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Normal, callback) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Taskbar, callback) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Tooltip, callback) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Menu, callback) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Normal, callback) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Taskbar, callback) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Tooltip, callback) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
if (for_each_visible_window_of_type_from_back_to_front(WSWindowType::Menu, callback) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
return for_each_visible_window_of_type_from_back_to_front(WSWindowType::WindowSwitcher, callback);
|
||||
}
|
||||
|
||||
|
@ -296,8 +295,8 @@ template<typename Callback>
|
|||
IterationDecision WSWindowManager::for_each_visible_window_of_type_from_front_to_back(WSWindowType type, Callback callback, bool ignore_highlight)
|
||||
{
|
||||
if (!ignore_highlight && m_highlight_window && m_highlight_window->type() == type && m_highlight_window->is_visible()) {
|
||||
if (callback(*m_highlight_window) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (callback(*m_highlight_window) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
|
||||
for (auto* window = m_windows_in_order.tail(); window; window = window->prev()) {
|
||||
|
@ -309,8 +308,8 @@ IterationDecision WSWindowManager::for_each_visible_window_of_type_from_front_to
|
|||
continue;
|
||||
if (!ignore_highlight && window == m_highlight_window)
|
||||
continue;
|
||||
if (callback(*window) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (callback(*window) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
return IterationDecision::Continue;
|
||||
}
|
||||
|
@ -318,14 +317,14 @@ IterationDecision WSWindowManager::for_each_visible_window_of_type_from_front_to
|
|||
template<typename Callback>
|
||||
IterationDecision WSWindowManager::for_each_visible_window_from_front_to_back(Callback callback)
|
||||
{
|
||||
if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::WindowSwitcher, callback) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Menu, callback) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Taskbar, callback) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Tooltip, callback) == IterationDecision::Abort)
|
||||
return IterationDecision::Abort;
|
||||
if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::WindowSwitcher, callback) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Menu, callback) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Taskbar, callback) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
if (for_each_visible_window_of_type_from_front_to_back(WSWindowType::Tooltip, callback) == IterationDecision::Break)
|
||||
return IterationDecision::Break;
|
||||
return for_each_visible_window_of_type_from_front_to_back(WSWindowType::Normal, callback);
|
||||
}
|
||||
|
||||
|
@ -335,7 +334,7 @@ void WSWindowManager::for_each_window_listening_to_wm_events(Callback callback)
|
|||
for (auto* window = m_windows_in_order.tail(); window; window = window->prev()) {
|
||||
if (!window->listens_to_wm_events())
|
||||
continue;
|
||||
if (callback(*window) == IterationDecision::Abort)
|
||||
if (callback(*window) == IterationDecision::Break)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -344,7 +343,7 @@ template<typename Callback>
|
|||
void WSWindowManager::for_each_window(Callback callback)
|
||||
{
|
||||
for (auto* window = m_windows_in_order.tail(); window; window = window->prev()) {
|
||||
if (callback(*window) == IterationDecision::Abort)
|
||||
if (callback(*window) == IterationDecision::Break)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
enum class WSWindowType
|
||||
{
|
||||
enum class WSWindowType {
|
||||
Invalid = 0,
|
||||
Normal,
|
||||
Menu,
|
||||
|
|
|
@ -12,8 +12,7 @@ inline constexpr dword make_rgb(byte r, byte g, byte b)
|
|||
|
||||
class Color {
|
||||
public:
|
||||
enum NamedColor
|
||||
{
|
||||
enum NamedColor {
|
||||
Black,
|
||||
White,
|
||||
Red,
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
|
||||
class GraphicsBitmap : public Retainable<GraphicsBitmap> {
|
||||
public:
|
||||
enum class Format
|
||||
{
|
||||
enum class Format {
|
||||
Invalid,
|
||||
RGB32,
|
||||
RGBA32,
|
||||
|
|
|
@ -38,8 +38,7 @@ public:
|
|||
const Font& font() const { return *state().font; }
|
||||
void set_font(const Font& font) { state().font = &font; }
|
||||
|
||||
enum class DrawOp
|
||||
{
|
||||
enum class DrawOp {
|
||||
Copy,
|
||||
Xor
|
||||
};
|
||||
|
|
|
@ -3,19 +3,16 @@
|
|||
class Painter;
|
||||
class Rect;
|
||||
|
||||
enum class ButtonStyle
|
||||
{
|
||||
enum class ButtonStyle {
|
||||
Normal,
|
||||
CoolBar
|
||||
};
|
||||
enum class FrameShadow
|
||||
{
|
||||
enum class FrameShadow {
|
||||
Plain,
|
||||
Raised,
|
||||
Sunken
|
||||
};
|
||||
enum class FrameShape
|
||||
{
|
||||
enum class FrameShape {
|
||||
NoFrame,
|
||||
Box,
|
||||
Container,
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
enum class TextAlignment
|
||||
{
|
||||
enum class TextAlignment {
|
||||
TopLeft,
|
||||
CenterLeft,
|
||||
Center,
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
enum class TextElision
|
||||
{
|
||||
enum class TextElision {
|
||||
None,
|
||||
Right,
|
||||
};
|
||||
|
|
|
@ -28,8 +28,7 @@ private:
|
|||
int m_history_cursor { 0 };
|
||||
int m_history_capacity { 100 };
|
||||
|
||||
enum class InputState
|
||||
{
|
||||
enum class InputState {
|
||||
Free,
|
||||
ExpectBracket,
|
||||
ExpectFinal,
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
#include <AK/Vector.h>
|
||||
|
||||
struct Redirection {
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Pipe,
|
||||
FileWrite,
|
||||
FileWriteAppend,
|
||||
|
@ -44,8 +43,7 @@ private:
|
|||
void begin_redirect_read(int fd);
|
||||
void begin_redirect_write(int fd);
|
||||
|
||||
enum State
|
||||
{
|
||||
enum State {
|
||||
Free,
|
||||
InSingleQuotes,
|
||||
InDoubleQuotes,
|
||||
|
|
|
@ -10,8 +10,7 @@ static void print_usage_and_exit()
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
enum Mode
|
||||
{
|
||||
enum Mode {
|
||||
SegmentationViolation,
|
||||
DivisionByZero,
|
||||
IllegalInstruction,
|
||||
|
|
Loading…
Reference in a new issue