renderer: Fix minor issue
[platform/core/uifw/libds-tizen.git] / examples / tinyds-tdm.c
index 31c1e2d..9c50c84 100644 (file)
@@ -623,7 +623,7 @@ output_commit(struct tinyds_output *output)
     struct ds_tdm_output_hwc_window **changed_hwc_windows = NULL;
     enum ds_tdm_output_hwc_window_composition composition;
     struct tinyds_view *view;
-    int i;
+    size_t i;
     bool need_target = false;
     bool fully_obscured = false;
     struct ds_buffer *ds_buffer;
@@ -764,7 +764,7 @@ output_commit(struct tinyds_output *output)
             return;
         }
 
-        for (i = 0; i < num_changed; i++) {
+        for (i = 0; i < (size_t)num_changed; i++) {
             composition = ds_tdm_output_hwc_window_get_composition(changed_hwc_windows[i]);
             if (composition == DS_TDM_OUTPUT_HWC_WINDOW_COMPOSITION_CLIENT) {
                 need_target = true;
@@ -805,8 +805,6 @@ output_commit(struct tinyds_output *output)
     output->target_updated = false;
 
     wl_list_for_each(view, &output->server->views, link) {
-        enum ds_tdm_output_hwc_window_composition composition;
-
         if (!view->mapped)
             continue;
 
@@ -1099,7 +1097,7 @@ static void
 keyboard_handle_key(struct wl_listener *listener, void *data)
 {
     struct tinyds_keyboard *kbd;
-    struct ds_event_keyboard_key *event = data;
+    struct ds_keyboard_event_key *event = data;
     struct ds_keyboard *ds_keyboard;
     struct xkb_state *xkb_state;
     const xkb_keysym_t *syms;
@@ -1227,7 +1225,7 @@ touch_handle_device_destroy(struct wl_listener *listener, void *data)
 static void
 touch_handle_down(struct wl_listener *listener, void *data)
 {
-    struct ds_event_touch_down *event = data;
+    struct ds_touch_event_down *event = data;
     struct tinyds_touch *touch;
     struct tinyds_view *view;
     struct tinyds_server *server;
@@ -1236,8 +1234,10 @@ touch_handle_down(struct wl_listener *listener, void *data)
     touch = wl_container_of(listener, touch, down);
 
     server = touch->server;
-    server->output_x = event->x * server->output->width;
-    server->output_y = event->y * server->output->height;
+    if (server->output) {
+        server->output_x = event->x * server->output->width;
+        server->output_y = event->y * server->output->height;
+    }
 
     ds_inf("Touch(%p) event down: id(%d) x %.3f y %.3f output_x %.1f output_y %.1f",
             touch->dev, event->id, event->x, event->y, server->output_x, server->output_y);
@@ -1260,7 +1260,7 @@ touch_handle_down(struct wl_listener *listener, void *data)
 static void
 touch_handle_up(struct wl_listener *listener, void *data)
 {
-    struct ds_event_touch_up *event = data;
+    struct ds_touch_event_up *event = data;
     struct tinyds_touch *touch;
 
     touch = wl_container_of(listener, touch, up);
@@ -1274,7 +1274,7 @@ touch_handle_up(struct wl_listener *listener, void *data)
 static void
 touch_handle_motion(struct wl_listener *listener, void *data)
 {
-    struct ds_event_touch_motion *event = data;
+    struct ds_touch_event_motion *event = data;
     struct tinyds_touch *touch;
     struct tinyds_view *view;
     struct tinyds_server *server;
@@ -1283,8 +1283,10 @@ touch_handle_motion(struct wl_listener *listener, void *data)
     touch = wl_container_of(listener, touch, motion);
 
     server = touch->server;
-    server->output_x = event->x * server->output->width;
-    server->output_y = event->y * server->output->height;
+    if (server->output) {
+        server->output_x = event->x * server->output->width;
+        server->output_y = event->y * server->output->height;
+    }
 
     ds_inf("Touch(%p) event motion: id(%d) x %.3f y %.3f output_x %.1f output_y %.1f",
             touch->dev, event->id, event->x, event->y, server->output_x, server->output_y);
@@ -1369,7 +1371,7 @@ static void
 pointer_handle_motion(struct wl_listener *listener, void *data)
 {
     struct tinyds_pointer *pointer;
-    struct ds_event_pointer_motion *event = data;
+    struct ds_pointer_event_motion *event = data;
     struct tinyds_view *view;
     struct tinyds_server *server;
     int ow = 0, oh = 0;
@@ -1433,7 +1435,7 @@ static void
 pointer_handle_button(struct wl_listener *listener, void *data)
 {
     struct tinyds_pointer *pointer;
-    struct ds_event_pointer_button *event = data;
+    struct ds_pointer_event_button *event = data;
 
     pointer = wl_container_of(listener, pointer, button);
 
@@ -2192,4 +2194,4 @@ tinyds_server_get_output_size(struct tinyds_server *server,
 {
     *output_w = server->output->width;
     *output_h = server->output->height;
-}
\ No newline at end of file
+}