Skip to content

Commit

Permalink
Improve formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Slackadays committed Nov 4, 2024
1 parent 6905b05 commit e4cf83c
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/.clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortEnumsOnASingleLine: true
AllowShortEnumsOnASingleLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
Expand Down
52 changes: 47 additions & 5 deletions src/cb/src/clipboard.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,13 @@ struct Constants {
};
constexpr Constants constants;

enum class CopyPolicy { ReplaceAll, ReplaceOnce, SkipOnce, SkipAll, Unknown };
enum class CopyPolicy {
ReplaceAll,
ReplaceOnce,
SkipOnce,
SkipAll,
Unknown
};

struct Copying {
bool use_safe_copy = true;
Expand Down Expand Up @@ -171,8 +177,16 @@ extern bool secret_selection;
extern std::string preferred_mime;
extern std::vector<std::string> available_mimes;

enum class ClipboardState : int { Setup, Action, Error };
enum class IndicatorState : int { Done, Active, Cancel };
enum class ClipboardState : int {
Setup,
Action,
Error
};
enum class IndicatorState : int {
Done,
Active,
Cancel
};

extern std::condition_variable cv;
extern std::mutex m;
Expand Down Expand Up @@ -202,11 +216,39 @@ struct IsTTY {
};
extern IsTTY is_tty;

enum class Action : unsigned int { Cut, Copy, Paste, Clear, Show, Edit, Add, Remove, Note, Swap, Status, Info, Load, Import, Export, History, Ignore, Search, Undo, Redo, Config, Script, Share };
enum class Action : unsigned int {
Cut,
Copy,
Paste,
Clear,
Show,
Edit,
Add,
Remove,
Note,
Swap,
Status,
Info,
Load,
Import,
Export,
History,
Ignore,
Search,
Undo,
Redo,
Config,
Script,
Share
};

extern Action action;

enum class IOType : unsigned int { File, Pipe, Text };
enum class IOType : unsigned int {
File,
Pipe,
Text
};

extern IOType io_type;

Expand Down
12 changes: 10 additions & 2 deletions src/cbx11/src/x11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ class X11PropertyFormat {
using format16_t = std::uint16_t;
using format32_t = std::conditional<sizeof(void*) == sizeof(std::uint64_t), std::uint64_t, std::uint32_t>::type;

enum Value : std::size_t { Format8 = 8, Format16 = 16, Format32 = 32 };
enum Value : std::size_t {
Format8 = 8,
Format16 = 16,
Format32 = 32
};

constexpr X11PropertyFormat(Value value) : X11PropertyFormat(static_cast<std::size_t>(value), value == Format8 ? sizeof(format8_t) : value == Format16 ? sizeof(format16_t) : sizeof(format32_t)) {}

Expand All @@ -175,7 +179,11 @@ class X11PropertyFormat {
constexpr static inline X11PropertyFormat fromSize();
};

enum class X11PropertyMode : int { Replace = PropModeReplace, Append = PropModeAppend, Prepend = PropModePrepend };
enum class X11PropertyMode : int {
Replace = PropModeReplace,
Append = PropModeAppend,
Prepend = PropModePrepend
};

class X11Property {
private:
Expand Down
12 changes: 10 additions & 2 deletions src/gui/include/all/clipboard/gui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@

namespace fs = std::filesystem;

enum class ClipboardPathsAction { Copy, Cut };
enum class ClipboardPathsAction {
Copy,
Cut
};

std::ostream& operator<<(std::ostream&, const ClipboardPathsAction&);

Expand All @@ -41,7 +44,12 @@ class ClipboardPaths {
[[nodiscard]] inline const std::vector<fs::path>& paths() const { return m_paths; }
};

enum class ClipboardContentType { Empty, Text, Paths, Binary };
enum class ClipboardContentType {
Empty,
Text,
Paths,
Binary
};

class ClipboardContent {
private:
Expand Down

0 comments on commit e4cf83c

Please sign in to comment.