clang-format
This commit is contained in:
parent
11740072a5
commit
d4df311d24
5 changed files with 60 additions and 10 deletions
45
.clang-format
Normal file
45
.clang-format
Normal file
|
@ -0,0 +1,45 @@
|
|||
---
|
||||
Language: Cpp
|
||||
AlignAfterOpenBracket: AlwaysBreak
|
||||
AlignConsecutiveAssignments: true
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: false
|
||||
AlignTrailingComments: false
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: AllDefinitions
|
||||
AlwaysBreakBeforeMultilineStrings: true
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Linux
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 80
|
||||
ContinuationIndentWidth: 4
|
||||
IncludeBlocks: Preserve
|
||||
IndentCaseLabels: false
|
||||
IndentPPDirectives: AfterHash
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MaxEmptyLinesToKeep: 1
|
||||
PointerAlignment: Right
|
||||
ReflowComments: false
|
||||
SortIncludes: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
UseTab: Never
|
||||
...
|
|
@ -21,6 +21,7 @@ struct kiwmi_output {
|
|||
struct wl_listener destroy;
|
||||
};
|
||||
|
||||
struct kiwmi_output *output_create(struct wlr_output *wlr_output, struct kiwmi_server *server);
|
||||
struct kiwmi_output *
|
||||
output_create(struct wlr_output *wlr_output, struct kiwmi_server *server);
|
||||
|
||||
#endif /* KIWMI_OUTPUT_H */
|
||||
|
|
|
@ -23,7 +23,8 @@ new_output_notify(struct wl_listener *listener, void *data)
|
|||
wlr_log(WLR_DEBUG, "New output %p: %s", wlr_output, wlr_output->name);
|
||||
|
||||
if (!wl_list_empty(&wlr_output->modes)) {
|
||||
struct wlr_output_mode *mode = wl_container_of(wlr_output->modes.prev, mode, link);
|
||||
struct wlr_output_mode *mode =
|
||||
wl_container_of(wlr_output->modes.prev, mode, link);
|
||||
wlr_output_set_mode(wlr_output, mode);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#include <wayland-server.h>
|
||||
#include <wlr/types/wlr_output.h>
|
||||
#include <wlr/render/wlr_renderer.h>
|
||||
#include <wlr/types/wlr_output.h>
|
||||
|
||||
#include "kiwmi/server.h"
|
||||
|
||||
|
@ -27,7 +27,7 @@ output_create(struct wlr_output *wlr_output, struct kiwmi_server *server)
|
|||
}
|
||||
|
||||
output->wlr_output = wlr_output;
|
||||
output->server = server;
|
||||
output->server = server;
|
||||
|
||||
output->frame.notify = output_frame_notify;
|
||||
wl_signal_add(&wlr_output->events.frame, &output->frame);
|
||||
|
@ -41,9 +41,10 @@ output_create(struct wlr_output *wlr_output, struct kiwmi_server *server)
|
|||
static void
|
||||
output_frame_notify(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct kiwmi_output *output = wl_container_of(listener, output, frame);
|
||||
struct kiwmi_output *output = wl_container_of(listener, output, frame);
|
||||
struct wlr_output *wlr_output = data;
|
||||
struct wlr_renderer *renderer = wlr_backend_get_renderer(wlr_output->backend);
|
||||
struct wlr_renderer *renderer =
|
||||
wlr_backend_get_renderer(wlr_output->backend);
|
||||
|
||||
wlr_output_make_current(wlr_output, NULL);
|
||||
wlr_renderer_begin(renderer, wlr_output->width, wlr_output->height);
|
||||
|
|
|
@ -25,7 +25,7 @@ server_init(struct kiwmi_server *server)
|
|||
wlr_log(WLR_DEBUG, "Initializing Wayland server");
|
||||
|
||||
server->wl_display = wl_display_create();
|
||||
server->backend = wlr_backend_autocreate(server->wl_display, NULL);
|
||||
server->backend = wlr_backend_autocreate(server->wl_display, NULL);
|
||||
if (!server->backend) {
|
||||
wlr_log(WLR_ERROR, "Failed to create backend");
|
||||
wl_display_destroy(server->wl_display);
|
||||
|
@ -36,7 +36,8 @@ server_init(struct kiwmi_server *server)
|
|||
wlr_renderer_init_wl_display(renderer, server->wl_display);
|
||||
|
||||
server->compositor = wlr_compositor_create(server->wl_display, renderer);
|
||||
server->data_device_manager = wlr_data_device_manager_create(server->wl_display);
|
||||
server->data_device_manager =
|
||||
wlr_data_device_manager_create(server->wl_display);
|
||||
|
||||
server->output_layout = wlr_output_layout_create();
|
||||
|
||||
|
@ -51,7 +52,8 @@ server_init(struct kiwmi_server *server)
|
|||
bool
|
||||
server_run(struct kiwmi_server *server)
|
||||
{
|
||||
wlr_log(WLR_DEBUG, "Running Wayland server on display '%s'", server->socket);
|
||||
wlr_log(
|
||||
WLR_DEBUG, "Running Wayland server on display '%s'", server->socket);
|
||||
|
||||
server->socket = wl_display_add_socket_auto(server->wl_display);
|
||||
if (!server->socket) {
|
||||
|
|
Loading…
Reference in a new issue