headless: fix indentation 32/207132/1
authorSung-Jin Park <sj76.park@samsung.com>
Thu, 18 Apr 2019 02:27:36 +0000 (11:27 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 30 May 2019 08:32:36 +0000 (17:32 +0900)
Change-Id: I5d524b9499048ddb8feefc434a07af4846df4724
Signed-off-by: Sung-Jin Park <sj76.park@samsung.com>
src/bin/headless/Makefile.am
src/bin/headless/headless_server.c
src/bin/headless/output/HL_UI_LED.h
src/bin/headless/output/HL_UI_LED_APA102.c
src/bin/headless/output/output_led.c
src/bin/headless/shell/shell.c

index df0c65f..3803ab0 100644 (file)
@@ -5,7 +5,7 @@ bin_PROGRAMS += headless_server
 headless_server_CFLAGS = $(HEADLESS_SERVER_CFLAGS)
 headless_server_LDADD  = $(HEADLESS_SERVER_LIBS)
 
-headless_server_SOURCES = headless_server.c    \
-                                                 output/output_led.c \
-                                                 output/HL_UI_LED_APA102.c \
-                                                 shell/shell.c
+headless_server_SOURCES = headless_server.c \
+                         output/output_led.c \
+                         output/HL_UI_LED_APA102.c \
+                         shell/shell.c
index 670f4f9..86a4c5d 100644 (file)
@@ -17,24 +17,24 @@ handle_sigint(int signal_number, void *data)
 static pepper_bool_t
 init_signal(pepper_compositor_t *compositor)
 {
-    struct wl_display *display;
-    struct wl_event_loop *loop;
-    struct wl_event_source *sigint;
+       struct wl_display *display;
+       struct wl_event_loop *loop;
+       struct wl_event_source *sigint;
 
-    display = pepper_compositor_get_display(compositor);
-    loop = wl_display_get_event_loop(display);
+       display = pepper_compositor_get_display(compositor);
+       loop = wl_display_get_event_loop(display);
        sigint = wl_event_loop_add_signal(loop, SIGINT, handle_sigint, display);
        if (!sigint)
                return PEPPER_FALSE;
 
-    return PEPPER_TRUE;
+       return PEPPER_TRUE;
 }
 
 int main(int argc, char *argv[])
 {
        const char *socket_name = NULL;
        pepper_compositor_t *compositor = NULL;
-    pepper_bool_t ret;
+       pepper_bool_t ret;
 
        socket_name = getenv("WAYLAND_DISPLAY");
 
@@ -45,23 +45,23 @@ int main(int argc, char *argv[])
        compositor = pepper_compositor_create(socket_name);
        PEPPER_CHECK(compositor, return EXIT_FAILURE, "Failed to create compositor !");
 
-    /* Init Output */
-    ret = pepper_output_led_init(compositor);
-    PEPPER_CHECK(ret, goto end, "pepper_output_led_init() failed.\n");
+       /* Init Output */
+       ret = pepper_output_led_init(compositor);
+       PEPPER_CHECK(ret, goto end, "pepper_output_led_init() failed.\n");
 
        /* Init Shell */
        ret = headless_shell_init(compositor);
        PEPPER_CHECK(ret, goto end, "headless_shell_init() failed.\n");
 
-    /* Init Signal for SIGINT */
-    init_signal(compositor);
+       /* Init Signal for SIGINT */
+       init_signal(compositor);
 
        /* run event loop */
        wl_display_run(pepper_compositor_get_display(compositor));
 
 end:
-    /* Deinit Process */
-    pepper_output_led_deinit(compositor);
+       /* Deinit Process */
+       pepper_output_led_deinit(compositor);
        pepper_compositor_destroy(compositor);
 
        return EXIT_SUCCESS;
index 9dd0c94..eafba0d 100644 (file)
 #define BITRATE 8000000
 
 typedef struct{
-    uint32_t number;
+       uint32_t number;
        peripheral_spi_h hnd_spi;
-    uint8_t  *pixels;
-    uint8_t  brightness;
+       uint8_t  *pixels;
+       uint8_t  brightness;
 }HL_UI_LED;
 
 /**
index 39072b8..c6f4ad9 100644 (file)
@@ -6,7 +6,9 @@
 #define SPI_BUS 0
 #define SPI_DEV 1
 
-HL_UI_LED *HL_UI_LED_Init(uint32_t led_num){
+HL_UI_LED *
+HL_UI_LED_Init(uint32_t led_num)
+{
        HL_UI_LED *handle;
        int count = 0;
        int ret;
@@ -16,9 +18,9 @@ HL_UI_LED *HL_UI_LED_Init(uint32_t led_num){
        {
                return NULL;
        }
-    handle->number = led_num;
-    handle->brightness = 0xFF;
-    handle->pixels = (uint8_t *)malloc(handle->number * 4);
+       handle->number = led_num;
+       handle->brightness = 0xFF;
+       handle->pixels = (uint8_t *)malloc(handle->number * 4);
        if(handle->pixels == NULL)
        {
                free(handle);
@@ -57,8 +59,8 @@ HL_UI_LED *HL_UI_LED_Init(uint32_t led_num){
        }
        if(count == SUCCESS_FLAG)
        {
-       HL_UI_LED_Clear_All(handle);
-       return handle;
+               HL_UI_LED_Clear_All(handle);
+               return handle;
        }
        else
        {
@@ -68,119 +70,138 @@ HL_UI_LED *HL_UI_LED_Init(uint32_t led_num){
        }
 }
 
-void HL_UI_LED_Change_Brightness(HL_UI_LED *handle, uint8_t brightness){
-    if (brightness > 31)
-        handle->brightness = 0xFF;
-    else
-        handle->brightness = 0xE0 | (0x1F & brightness);
-    HL_UI_LED_Refresh(handle);
+void
+HL_UI_LED_Change_Brightness(HL_UI_LED *handle, uint8_t brightness)
+{
+       if (brightness > 31)
+               handle->brightness = 0xFF;
+       else
+               handle->brightness = 0xE0 | (0x1F & brightness);
+       HL_UI_LED_Refresh(handle);
 }
 
-int HL_UI_LED_Get_Brightness(HL_UI_LED *handle){
-    return handle->brightness & 0x1F;
+int
+HL_UI_LED_Get_Brightness(HL_UI_LED *handle)
+{
+       return handle->brightness & 0x1F;
 }
 
-void HL_UI_LED_Set_Pixel_RGB(HL_UI_LED *handle, uint32_t index, uint8_t red, uint8_t green, uint8_t blue){
-    if (index < handle->number) {
-        uint8_t *ptr = &(handle->pixels[index * 4]);
-        ptr[R_OFF_SET] = red;
-        ptr[G_OFF_SET] = green;
-        ptr[B_OFF_SET] = blue;
-    }
+void
+HL_UI_LED_Set_Pixel_RGB(HL_UI_LED *handle, uint32_t index, uint8_t red, uint8_t green, uint8_t blue)
+{
+       if (index < handle->number) {
+               uint8_t *ptr = &(handle->pixels[index * 4]);
+               ptr[R_OFF_SET] = red;
+               ptr[G_OFF_SET] = green;
+               ptr[B_OFF_SET] = blue;
+       }
 }
 
-void HL_UI_LED_Get_Pixel_RGB(HL_UI_LED *handle, uint32_t index, uint8_t *red, uint8_t *green, uint8_t *blue){
-    if (index < handle->number) {
-        uint8_t *ptr = &(handle->pixels[index * 4]);
-        red = ptr + R_OFF_SET;
-        green = ptr + G_OFF_SET;
-        blue = ptr + B_OFF_SET;
-    }
+void
+HL_UI_LED_Get_Pixel_RGB(HL_UI_LED *handle, uint32_t index, uint8_t *red, uint8_t *green, uint8_t *blue)
+{
+       if (index < handle->number) {
+               uint8_t *ptr = &(handle->pixels[index * 4]);
+               red = ptr + R_OFF_SET;
+               green = ptr + G_OFF_SET;
+               blue = ptr + B_OFF_SET;
+       }
 }
 
-void HL_UI_LED_Set_Pixel_4byte(HL_UI_LED *handle, uint32_t index, uint32_t colour){
-    uint8_t  r, g, b;
-    r = colour >> 16;
-    g = colour >> 8;
-    b = colour;
-    HL_UI_LED_Set_Pixel_RGB(handle, index, r, g, b);
+void
+HL_UI_LED_Set_Pixel_4byte(HL_UI_LED *handle, uint32_t index, uint32_t colour)
+{
+       uint8_t  r, g, b;
+       r = colour >> 16;
+       g = colour >> 8;
+       b = colour;
+       HL_UI_LED_Set_Pixel_RGB(handle, index, r, g, b);
 }
 
-uint32_t HL_UI_LED_Get_Pixel_4byte(HL_UI_LED *handle, uint32_t index){
-    uint8_t r=0, g=0, b=0;
-    uint32_t colour = 0;
-    HL_UI_LED_Get_Pixel_RGB(handle, index, &r, &g, &b);
-    r <<= 16;
-    g <<= 8;
-    colour = r | g | b;
-    return colour;
+uint32_t
+HL_UI_LED_Get_Pixel_4byte(HL_UI_LED *handle, uint32_t index)
+{
+       uint8_t r=0, g=0, b=0;
+       uint32_t colour = 0;
+       HL_UI_LED_Get_Pixel_RGB(handle, index, &r, &g, &b);
+       r <<= 16;
+       g <<= 8;
+       colour = r | g | b;
+       return colour;
 }
 
-void HL_UI_LED_Clear_All(HL_UI_LED *handle){
-    uint8_t *ptr;
-    uint32_t i;
-    for(ptr = handle->pixels, i=0; i<handle->number; i++, ptr += 4) {
-        ptr[1] = 0x00;
-        ptr[2] = 0x00;
-        ptr[3] = 0x00;
-    }
-    HL_UI_LED_Refresh(handle);
+void
+HL_UI_LED_Clear_All(HL_UI_LED *handle)
+{
+       uint8_t *ptr;
+       uint32_t i;
+       for(ptr = handle->pixels, i=0; i<handle->number; i++, ptr += 4) {
+               ptr[1] = 0x00;
+               ptr[2] = 0x00;
+               ptr[3] = 0x00;
+       }
+       HL_UI_LED_Refresh(handle);
 }
 
-int HL_UI_LED_Refresh(HL_UI_LED *handle){
-    int ret;
-    uint32_t i;
-    uint32_t buf_len = 4 + 4 * handle->number + (handle->number + 15) / 16 + 1;
-    uint8_t *ptr, *qtr;
-    uint8_t *tx = (uint8_t *)malloc(buf_len);
+int
+HL_UI_LED_Refresh(HL_UI_LED *handle)
+{
+       int ret;
+       uint32_t i;
+       uint32_t buf_len = 4 + 4 * handle->number + (handle->number + 15) / 16 + 1;
+       uint8_t *ptr, *qtr;
+       uint8_t *tx = (uint8_t *)malloc(buf_len);
 
        if( tx == NULL )
        {
                return -1;
        }
        // start frame
-    for (i = 0; i < 4; i++)
-        *(tx + i) = 0x00;
+       for (i = 0; i < 4; i++)
+               *(tx + i) = 0x00;
 
        // LED data
-    qtr = tx + 4;
+       qtr = tx + 4;
 
-    for(ptr = handle->pixels, i=0; i<handle->number; i++, ptr += 4, qtr += 4) {
-        qtr[0] = handle->brightness;
-        qtr[1] = ptr[1];
-        qtr[2] = ptr[2];
-        qtr[3] = ptr[3];
-    }
+       for(ptr = handle->pixels, i=0; i<handle->number; i++, ptr += 4, qtr += 4) {
+               qtr[0] = handle->brightness;
+               qtr[1] = ptr[1];
+               qtr[2] = ptr[2];
+               qtr[3] = ptr[3];
+       }
 
        // end frame
-    for (i = handle->number * 4 + 4; i < buf_len; i++)
+       for (i = handle->number * 4 + 4; i < buf_len; i++)
        {
-        *(tx + i) = 0x00;
+               *(tx + i) = 0x00;
        }
 
        ret = peripheral_spi_write(handle->hnd_spi, tx, buf_len);
-    free(tx);
-    if (ret != 0)
+       free(tx);
+       if (ret != 0)
        {
-        fprintf(stdout, "[Error] can't send spi message\n");
+               fprintf(stdout, "[Error] can't send spi message\n");
                return -2;
        }
 
        return 0;
 }
 
-int HL_UI_LED_Show(HL_UI_LED *handle)
+int
+HL_UI_LED_Show(HL_UI_LED *handle)
 {
        return HL_UI_LED_Refresh(handle);
 }
 
-void HL_UI_LED_Close(HL_UI_LED *handle){
-    HL_UI_LED_Clear_All(handle);
-    peripheral_spi_close(handle->hnd_spi);
+void
+HL_UI_LED_Close(HL_UI_LED *handle)
+{
+       HL_UI_LED_Clear_All(handle);
+       peripheral_spi_close(handle->hnd_spi);
 
-    if (handle->pixels) {
-        free(handle->pixels);
-    }
+       if (handle->pixels) {
+               free(handle->pixels);
+       }
 
        free(handle);
 }
index d01d23f..e06d824 100644 (file)
 #define NUM_LED 12
 
 typedef struct {
-    pepper_compositor_t *compositor;
-    pepper_output_t   *output;
-    pepper_plane_t    *plane;
+       pepper_compositor_t *compositor;
+       pepper_output_t   *output;
+       pepper_plane_t    *plane;
 
-    int num_led;
-    HL_UI_LED *ui_led;
+       int num_led;
+       HL_UI_LED *ui_led;
 }led_output_t;
 
 static const int KEY_OUTPUT;
@@ -44,13 +44,13 @@ static const int KEY_OUTPUT;
 static void
 led_output_destroy(void *o)
 {
-    led_output_t *output = (led_output_t *)o;
-    PEPPER_TRACE("Output Destroy %p base %p\n", output, output->output);
+       led_output_t *output = (led_output_t *)o;
+       PEPPER_TRACE("Output Destroy %p base %p\n", output, output->output);
 
-    if (output->ui_led)
-        HL_UI_LED_Close(output->ui_led);
+       if (output->ui_led)
+               HL_UI_LED_Close(output->ui_led);
 
-    free(output);
+       free(output);
 }
 
 static int32_t
@@ -80,15 +80,15 @@ led_output_get_mode_count(void *o)
 static void
 led_output_get_mode(void *o, int index, pepper_output_mode_t *mode)
 {
-    led_output_t *output = (led_output_t *)o;
+       led_output_t *output = (led_output_t *)o;
 
-    if (index != 0)
-        return;
+       if (index != 0)
+               return;
 
-    mode->flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
-    mode->w = output->num_led;
-    mode->h = output->num_led;
-    mode->refresh = 60000;
+       mode->flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
+       mode->w = output->num_led;
+       mode->h = output->num_led;
+       mode->refresh = 60000;
 }
 
 static pepper_bool_t
@@ -105,11 +105,11 @@ led_output_assign_planes(void *o, const pepper_list_t *view_list)
 static void
 led_output_start_repaint_loop(void *o)
 {
-    led_output_t *output = (led_output_t *)o;
-    struct timespec     ts;
+       led_output_t *output = (led_output_t *)o;
+       struct timespec     ts;
 
-    pepper_compositor_get_time(output->compositor, &ts);
-    pepper_output_finish_frame(output->output, &ts);
+       pepper_compositor_get_time(output->compositor, &ts);
+       pepper_output_finish_frame(output->output, &ts);
 }
 
 static void
@@ -123,8 +123,7 @@ led_output_attach_surface(void *o, pepper_surface_t *surface, int *w, int *h)
 }
 
 static void
-led_output_flush_surface_damage(void *o, pepper_surface_t *surface,
-                                                                 pepper_bool_t *keep_buffer)
+led_output_flush_surface_damage(void *o, pepper_surface_t *surface, pepper_bool_t *keep_buffer)
 {
 }
 
@@ -149,50 +148,50 @@ struct pepper_output_backend led_output_backend = {
 pepper_bool_t
 pepper_output_led_init(pepper_compositor_t *compositor)
 {
-    led_output_t *output = (led_output_t*)calloc(sizeof(led_output_t), 1);
-
-    PEPPER_TRACE("Output Init\n");
-
-    if (!output) {
-        PEPPER_ERROR("Failed to allocate memory in %s\n", __FUNCTION__);
-        goto error;
-    }
-
-    output->num_led = NUM_LED;
-    output->ui_led = HL_UI_LED_Init(output->num_led);
-    if (!output->ui_led)
-        PEPPER_ERROR("HL_UI_LED_Init() failed.\n");
-
-    output->compositor = compositor;
-    output->output = pepper_compositor_add_output(compositor,
-                                                   &led_output_backend, "led_output",
-                                                   output,  WL_OUTPUT_TRANSFORM_NORMAL, 1);
-    PEPPER_CHECK(output->output, goto error, "pepper_compositor_add_output() failed.\n");
-
-    output->plane = pepper_output_add_plane(output->output, NULL);
-    PEPPER_CHECK(output->plane, goto error, "pepper_output_add_plane() failed.\n");
-
-    pepper_object_set_user_data((pepper_object_t *)compositor,
-                                 &KEY_OUTPUT, output, led_output_destroy);
-    PEPPER_TRACE("\t Add Output %p, base %p\n", output, output->output);
-    PEPPER_TRACE("\t Add Output %p, plane %p\n", output, output->plane);
-    PEPPER_TRACE("\t Userdata %p\n", pepper_object_get_user_data((pepper_object_t *)compositor,&KEY_OUTPUT));
-    return PEPPER_TRUE;
-
-    error:
-    if (output->ui_led)
-        HL_UI_LED_Close(output->ui_led);
-
-    if (output->output)
-      pepper_output_destroy(output->output);
-
-    if (output)
-      free(output);
-    return PEPPER_FALSE;
+       led_output_t *output = (led_output_t*)calloc(sizeof(led_output_t), 1);
+
+       PEPPER_TRACE("Output Init\n");
+
+       if (!output) {
+               PEPPER_ERROR("Failed to allocate memory in %s\n", __FUNCTION__);
+               goto error;
+       }
+
+       output->num_led = NUM_LED;
+       output->ui_led = HL_UI_LED_Init(output->num_led);
+       if (!output->ui_led)
+               PEPPER_ERROR("HL_UI_LED_Init() failed.\n");
+
+       output->compositor = compositor;
+       output->output = pepper_compositor_add_output(compositor,
+                       &led_output_backend, "led_output",
+                       output,  WL_OUTPUT_TRANSFORM_NORMAL, 1);
+       PEPPER_CHECK(output->output, goto error, "pepper_compositor_add_output() failed.\n");
+
+       output->plane = pepper_output_add_plane(output->output, NULL);
+       PEPPER_CHECK(output->plane, goto error, "pepper_output_add_plane() failed.\n");
+
+       pepper_object_set_user_data((pepper_object_t *)compositor,
+                       &KEY_OUTPUT, output, led_output_destroy);
+       PEPPER_TRACE("\t Add Output %p, base %p\n", output, output->output);
+       PEPPER_TRACE("\t Add Output %p, plane %p\n", output, output->plane);
+       PEPPER_TRACE("\t Userdata %p\n", pepper_object_get_user_data((pepper_object_t *)compositor,&KEY_OUTPUT));
+       return PEPPER_TRUE;
+
+error:
+       if (output->ui_led)
+               HL_UI_LED_Close(output->ui_led);
+
+       if (output->output)
+               pepper_output_destroy(output->output);
+
+       if (output)
+               free(output);
+       return PEPPER_FALSE;
 }
 
 void
 pepper_output_led_deinit(pepper_compositor_t *compositor)
 {
-    PEPPER_TRACE("Output Deinit ... DONE\n");
+       PEPPER_TRACE("Output Deinit ... DONE\n");
 }
index a9bfc90..6f0e405 100644 (file)
@@ -49,70 +49,70 @@ zxdg_toplevel_cb_resource_destroy(struct wl_resource *resource)
 static void
 zxdg_toplevel_cb_destroy(struct wl_client *client, struct wl_resource *resource)
 {
-   wl_resource_destroy(resource);
+       wl_resource_destroy(resource);
 }
 
 static void
 zxdg_toplevel_cb_parent_set(struct wl_client *client,
-                              struct wl_resource *resource,
-                              struct wl_resource *res_parent)
+                           struct wl_resource *resource,
+                           struct wl_resource *res_parent)
 {
 }
 
 static void
 zxdg_toplevel_cb_title_set(struct wl_client *client,
-                             struct wl_resource *resource,
-                             const char *title)
+                          struct wl_resource *resource,
+                          const char *title)
 {
 }
 
 static void
 zxdg_toplevel_cb_app_id_set(struct wl_client *client,
-                              struct wl_resource *resource,
-                              const char *app_id)
+                           struct wl_resource *resource,
+                           const char *app_id)
 {
 }
 
 static void
 zxdg_toplevel_cb_win_menu_show(struct wl_client *client,
-                                 struct wl_resource *resource,
-                                 struct wl_resource *res_seat,
-                                 uint32_t serial,
-                                 int32_t x,
-                                 int32_t y)
+                              struct wl_resource *resource,
+                              struct wl_resource *res_seat,
+                              uint32_t serial,
+                              int32_t x,
+                              int32_t y)
 {
 }
 
 static void
 zxdg_toplevel_cb_move(struct wl_client *client,
-                        struct wl_resource *resource,
-                        struct wl_resource *res_seat,
-                        uint32_t serial)
+                     struct wl_resource *resource,
+                     struct wl_resource *res_seat,
+                     uint32_t serial)
 {
 }
 
 static void
 zxdg_toplevel_cb_resize(struct wl_client *client,
-                          struct wl_resource *resource,
-                          struct wl_resource *res_seat,
-                          uint32_t serial,
-                          uint32_t edges)
+                       struct wl_resource *resource,
+                       struct wl_resource *res_seat,
+                       uint32_t serial,
+                       uint32_t edges)
 {
 }
 
 static void
 zxdg_toplevel_cb_max_size_set(struct wl_client *client,
-                                struct wl_resource *resource,
-                                int32_t w,
-                                int32_t h)
+                             struct wl_resource *resource,
+                             int32_t w,
+                             int32_t h)
 {
 }
 
 static void
 zxdg_toplevel_cb_min_size_set(struct wl_client *client,
-                                struct wl_resource *resource,
-                                int32_t w,
-                                int32_t h)
+                             struct wl_resource *resource,
+                             int32_t w,
+                             int32_t h)
 {
 }
 
@@ -128,8 +128,8 @@ zxdg_toplevel_cb_maximized_unset(struct wl_client *client, struct wl_resource *r
 
 static void
 zxdg_toplevel_cb_fullscreen_set(struct wl_client *client,
-                                  struct wl_resource *resource,
-                                  struct wl_resource *res_output)
+                               struct wl_resource *resource,
+                               struct wl_resource *res_output)
 {
 }
 
@@ -145,20 +145,20 @@ zxdg_toplevel_cb_minimized_set(struct wl_client *client, struct wl_resource *res
 
 static const struct zxdg_toplevel_v6_interface zxdg_toplevel_interface =
 {
-   zxdg_toplevel_cb_destroy,
-   zxdg_toplevel_cb_parent_set,
-   zxdg_toplevel_cb_title_set,
-   zxdg_toplevel_cb_app_id_set,
-   zxdg_toplevel_cb_win_menu_show,
-   zxdg_toplevel_cb_move,
-   zxdg_toplevel_cb_resize,
-   zxdg_toplevel_cb_max_size_set,
-   zxdg_toplevel_cb_min_size_set,
-   zxdg_toplevel_cb_maximized_set,
-   zxdg_toplevel_cb_maximized_unset,
-   zxdg_toplevel_cb_fullscreen_set,
-   zxdg_toplevel_cb_fullscreen_unset,
-   zxdg_toplevel_cb_minimized_set
+       zxdg_toplevel_cb_destroy,
+       zxdg_toplevel_cb_parent_set,
+       zxdg_toplevel_cb_title_set,
+       zxdg_toplevel_cb_app_id_set,
+       zxdg_toplevel_cb_win_menu_show,
+       zxdg_toplevel_cb_move,
+       zxdg_toplevel_cb_resize,
+       zxdg_toplevel_cb_max_size_set,
+       zxdg_toplevel_cb_min_size_set,
+       zxdg_toplevel_cb_maximized_set,
+       zxdg_toplevel_cb_maximized_unset,
+       zxdg_toplevel_cb_fullscreen_set,
+       zxdg_toplevel_cb_fullscreen_unset,
+       zxdg_toplevel_cb_minimized_set
 };
 
 static void
@@ -169,21 +169,21 @@ zxdg_popup_cb_resource_destroy(struct wl_resource *resource)
 static void
 zxdg_popup_cb_destroy(struct wl_client *client, struct wl_resource *resource)
 {
-   wl_resource_destroy(resource);
+       wl_resource_destroy(resource);
 }
 
 static void
 zxdg_popup_cb_grab(struct wl_client *client,
-                     struct wl_resource *resource,
-                     struct wl_resource *res_seat,
-                     uint32_t serial)
+                  struct wl_resource *resource,
+                  struct wl_resource *res_seat,
+                  uint32_t serial)
 {
 }
 
 static const struct zxdg_popup_v6_interface zxdg_popup_interface =
 {
-   zxdg_popup_cb_destroy,
-   zxdg_popup_cb_grab
+       zxdg_popup_cb_destroy,
+       zxdg_popup_cb_grab
 };
 
 static void
@@ -203,7 +203,7 @@ zxdg_surface_cb_resource_destroy(struct wl_resource *resource)
 static void
 zxdg_surface_cb_destroy(struct wl_client *client, struct wl_resource *resource)
 {
-   wl_resource_destroy(resource);
+       wl_resource_destroy(resource);
 }
 
 static void
@@ -218,17 +218,17 @@ zxdg_surface_cb_toplevel_get(struct wl_client *client, struct wl_resource *resou
        }
 
        wl_resource_set_implementation(new_res,
-                                 &zxdg_toplevel_interface,
-                                 NULL,
-                                 zxdg_toplevel_cb_resource_destroy);
+                       &zxdg_toplevel_interface,
+                       NULL,
+                       zxdg_toplevel_cb_resource_destroy);
 }
 
 static void
 zxdg_surface_cb_popup_get(struct wl_client *client,
-                            struct wl_resource *resource,
-                            uint32_t id,
-                            struct wl_resource *res_parent,
-                            struct wl_resource *res_pos)
+                         struct wl_resource *resource,
+               uint32_t id,
+               struct wl_resource *res_parent,
+               struct wl_resource *res_pos)
 {
        struct wl_resource *new_res;
        new_res = wl_resource_create(client, &zxdg_popup_v6_interface, 1, id);
@@ -267,11 +267,11 @@ zxdg_surface_cb_configure_ack(struct wl_client *client, struct wl_resource *reso
 
 static const struct zxdg_surface_v6_interface zxdg_surface_interface =
 {
-   zxdg_surface_cb_destroy,
-   zxdg_surface_cb_toplevel_get,
-   zxdg_surface_cb_popup_get,
-   zxdg_surface_cb_win_geometry_set,
-   zxdg_surface_cb_configure_ack
+       zxdg_surface_cb_destroy,
+       zxdg_surface_cb_toplevel_get,
+       zxdg_surface_cb_popup_get,
+       zxdg_surface_cb_win_geometry_set,
+       zxdg_surface_cb_configure_ack
 };
 
 static void
@@ -282,43 +282,43 @@ zxdg_positioner_cb_destroy(struct wl_client *client, struct wl_resource *resourc
 
 static void
 zxdg_positioner_cb_size_set(struct wl_client *client,
-                              struct wl_resource *resource,
-                              int32_t w, int32_t h)
+                           struct wl_resource *resource,
+                           int32_t w, int32_t h)
 {
 }
 
 static void
 zxdg_positioner_cb_anchor_rect_set(struct wl_client *client,
-                                     struct wl_resource *resource,
-                                     int32_t x, int32_t y, int32_t w, int32_t h)
+                                  struct wl_resource *resource,
+                                  int32_t x, int32_t y, int32_t w, int32_t h)
 {
 }
 
 static void
 zxdg_positioner_cb_anchor_set(struct wl_client *client,
-                                struct wl_resource *resource,
-                                enum zxdg_positioner_v6_anchor anchor)
+                             struct wl_resource *resource,
+                             enum zxdg_positioner_v6_anchor anchor)
 {
 }
 
 static void
 zxdg_positioner_cb_gravity_set(struct wl_client *client,
-                                 struct wl_resource *resource,
-                                 enum zxdg_positioner_v6_gravity gravity)
+                              struct wl_resource *resource,
+                              enum zxdg_positioner_v6_gravity gravity)
 {
 }
 
 static void
 zxdg_positioner_cb_constraint_adjustment_set(struct wl_client *client,
-                                               struct wl_resource *resource,
-                                               enum zxdg_positioner_v6_constraint_adjustment constraint_adjustment)
+                                            struct wl_resource *resource,
+                                            enum zxdg_positioner_v6_constraint_adjustment constraint_adjustment)
 {
 }
 
 static void
 zxdg_positioner_cb_offset_set(struct wl_client *client,
-                                struct wl_resource *resource,
-                                int32_t x, int32_t y)
+                             struct wl_resource *resource,
+                             int32_t x, int32_t y)
 {
 }
 
@@ -336,9 +336,9 @@ static const struct zxdg_positioner_v6_interface zxdg_positioner_interface =
 static void
 zxdg_shell_cb_destroy(struct wl_client *client, struct wl_resource *resource)
 {
-   PEPPER_TRACE("Destroy zxdg_shell\n");
+       PEPPER_TRACE("Destroy zxdg_shell\n");
 
-   wl_resource_destroy(resource);
+       wl_resource_destroy(resource);
 }
 
 static void
@@ -370,7 +370,7 @@ zxdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resource
        if (!hs) {
                PEPPER_ERROR("fail to get headless_shell\n");
                wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
-                                                               "failed to get headless shell");
+                               "failed to get headless shell");
                return;
        }
 
@@ -389,9 +389,9 @@ zxdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resource
        }
 
        wl_resource_set_implementation(hs_surface->zxdg_shell_surface,
-                                                                       &zxdg_surface_interface,
-                                                                       hs_surface,
-                                                                       zxdg_surface_cb_resource_destroy);
+                       &zxdg_surface_interface,
+                       hs_surface,
+                       zxdg_surface_cb_resource_destroy);
 
 
        psurface = wl_resource_get_user_data(wsurface);
@@ -407,21 +407,21 @@ zxdg_shell_cb_surface_get(struct wl_client *client, struct wl_resource *resource
        if (!pepper_view_set_surface(hs_surface->view, psurface)) {
                PEPPER_ERROR("fail to set surface\n");
                wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
-                                                          "Assign set psurface to pview");
+                               "Assign set psurface to pview");
                goto error;
        }
 
        if (!pepper_surface_set_role(psurface, "xdg_surface")) {
                PEPPER_ERROR("fail to set role\n");
                wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
-                                                          "Assign \"xdg_surface\" to wl_surface failed\n");
+                               "Assign \"xdg_surface\" to wl_surface failed\n");
                goto error;
        }
 
        PEPPER_TRACE("create zxdg_surface:%p, pview:%p, psurface:%p\n",
-                                       hs_surface->zxdg_shell_surface,
-                                       hs_surface->view,
-                                       psurface);
+                       hs_surface->zxdg_shell_surface,
+                       hs_surface->view,
+                       psurface);
        return;
 error:
        if (hs_surface) {
@@ -443,10 +443,10 @@ zxdg_shell_cb_pong(struct wl_client *client, struct wl_resource *resource, uint3
 
 static const struct zxdg_shell_v6_interface zxdg_shell_interface =
 {
-   zxdg_shell_cb_destroy,
-   zxdg_shell_cb_positioner_create,
-   zxdg_shell_cb_surface_get,
-   zxdg_shell_cb_pong
+       zxdg_shell_cb_destroy,
+       zxdg_shell_cb_positioner_create,
+       zxdg_shell_cb_surface_get,
+       zxdg_shell_cb_pong
 };
 
 static void
@@ -459,9 +459,9 @@ zxdg_shell_cb_bind(struct wl_client *client, void *data, uint32_t version, uint3
 
        /* Create resource for zxdg_shell_v6 */
        resource = wl_resource_create(client,
-                    &zxdg_shell_v6_interface,
-                    version,
-                    id);
+                       &zxdg_shell_v6_interface,
+                       version,
+                       id);
        PEPPER_CHECK(resource, goto err_shell, "fail to create the zxdg_shell_v6\n");
 
        wl_resource_set_implementation(resource, &zxdg_shell_interface, hs, NULL);