1
1
mirror of https://github.com/swaywm/sway synced 2024-11-18 00:24:17 +01:00

Normalize indentation

This commit is contained in:
Drew DeVault 2015-11-18 08:44:08 -05:00
parent 9a1e95b7da
commit 665d4baaf1
2 changed files with 57 additions and 57 deletions

@ -8,36 +8,36 @@
#include "list.h"
struct output_state {
struct wl_output *output;
uint32_t flags;
uint32_t width, height;
struct wl_output *output;
uint32_t flags;
uint32_t width, height;
};
struct buffer {
struct wl_buffer *buffer;
int fd;
cairo_surface_t *surface;
cairo_t *cairo;
PangoContext *pango;
uint32_t width, height;
bool busy;
struct wl_buffer *buffer;
int fd;
cairo_surface_t *surface;
cairo_t *cairo;
PangoContext *pango;
uint32_t width, height;
bool busy;
};
struct client_state {
struct wl_compositor *compositor;
struct wl_display *display;
struct wl_pointer *pointer;
struct wl_seat *seat;
struct wl_shell *shell;
struct wl_shm *shm;
struct buffer buffers[2];
struct buffer *buffer;
struct wl_surface *surface;
struct wl_shell_surface *shell_surface;
struct wl_callback *frame_cb;
uint32_t width, height;
cairo_t *cairo;
list_t *outputs;
struct wl_compositor *compositor;
struct wl_display *display;
struct wl_pointer *pointer;
struct wl_seat *seat;
struct wl_shell *shell;
struct wl_shm *shm;
struct buffer buffers[2];
struct buffer *buffer;
struct wl_surface *surface;
struct wl_shell_surface *shell_surface;
struct wl_callback *frame_cb;
uint32_t width, height;
cairo_t *cairo;
list_t *outputs;
};
struct client_state *client_setup(uint32_t width, uint32_t height);

@ -75,44 +75,44 @@ static struct buffer *create_buffer(struct client_state *state, struct buffer *b
}
static void destroy_buffer(struct buffer *buffer) {
if (buffer->buffer) {
wl_buffer_destroy(buffer->buffer);
}
if (buffer->cairo) {
cairo_destroy(buffer->cairo);
}
if (buffer->surface) {
cairo_surface_destroy(buffer->surface);
}
memset(buffer, 0, sizeof(struct buffer));
if (buffer->buffer) {
wl_buffer_destroy(buffer->buffer);
}
if (buffer->cairo) {
cairo_destroy(buffer->cairo);
}
if (buffer->surface) {
cairo_surface_destroy(buffer->surface);
}
memset(buffer, 0, sizeof(struct buffer));
}
struct buffer *get_next_buffer(struct client_state *state) {
struct buffer *buffer = NULL;
struct buffer *buffer = NULL;
int i;
for (i = 0; i < 2; ++i) {
if (state->buffers[i].busy) {
continue;
int i;
for (i = 0; i < 2; ++i) {
if (state->buffers[i].busy) {
continue;
}
buffer = &state->buffers[i];
}
buffer = &state->buffers[i];
}
if (!buffer) {
return NULL;
}
if (buffer->width != state->width || buffer->height != state->height) {
destroy_buffer(buffer);
}
if (!buffer->buffer) {
if (!create_buffer(state, buffer, state->width, state->height, WL_SHM_FORMAT_ARGB8888)) {
return NULL;
if (!buffer) {
return NULL;
}
}
state->cairo = buffer->cairo;
state->buffer = buffer;
return buffer;
if (buffer->width != state->width || buffer->height != state->height) {
destroy_buffer(buffer);
}
if (!buffer->buffer) {
if (!create_buffer(state, buffer, state->width, state->height, WL_SHM_FORMAT_ARGB8888)) {
return NULL;
}
}
state->cairo = buffer->cairo;
state->buffer = buffer;
return buffer;
}