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