Tizen C++ Coding Rules 50/74850/2 accepted/tizen/common/20160616.151839 accepted/tizen/ivi/20160616.105333 accepted/tizen/mobile/20160616.105247 accepted/tizen/tv/20160616.105303 accepted/tizen/wearable/20160616.105319 submit/tizen/20160616.035254
authorchanywa <cbible.kim@samsung.com>
Thu, 16 Jun 2016 01:35:37 +0000 (10:35 +0900)
committerSeechan Kim <cbible.kim@samsung.com>
Thu, 16 Jun 2016 03:48:38 +0000 (20:48 -0700)
Change-Id: I4d51565d6a9f55d574051b2021bfe7a5999d0a7d

src/api/maps_view.cpp
src/api/maps_view_object.cpp
src/api/maps_view_snapshot.cpp
src/view/overlay_constructor.cpp

index 42ad3ec..3f5eb6d 100644 (file)
@@ -236,9 +236,9 @@ int _maps_view_on_object_operation(maps_view_h view, maps_view_object_h object,
 
        maps_view_object_type_e type;
        maps_view_object_get_type(object, &type);
-       if (type == MAPS_VIEW_OBJECT_OVERLAY)
+       if (type == MAPS_VIEW_OBJECT_OVERLAY) {
                return _maps_view_object_overlay_operation(view, object, operation);
-       else {
+       else {
                if(!__get_plugin_interface(view)->maps_plugin_on_object)
                        return  MAPS_ERROR_INVALID_PARAMETER;
 
@@ -1503,17 +1503,17 @@ void _maps_view_invoke_event_callback(maps_view_h view, maps_view_event_data_h e
        int maps_view_object_get_type(maps_view_object_h object, maps_view_object_type_e *type);
 
        int subtype = 0;
-       if (type == MAPS_VIEW_EVENT_GESTURE)
+       if (type == MAPS_VIEW_EVENT_GESTURE) {
                maps_view_event_data_get_gesture_type(event_data, (maps_view_gesture_e*)&subtype);
-       else if (type == MAPS_VIEW_EVENT_ACTION)
+       } else if (type == MAPS_VIEW_EVENT_ACTION) {
                maps_view_event_data_get_action_type(event_data, (maps_view_action_e*)&subtype);
-       else if (type == MAPS_VIEW_EVENT_OBJECT) {
+       else if (type == MAPS_VIEW_EVENT_OBJECT) {
                maps_view_object_h object;
                maps_view_event_data_get_object(event_data, &object);
                maps_view_object_get_type(object, (maps_view_object_type_e*)&subtype);
        }
        if (type == MAPS_VIEW_EVENT_READY)
-       MAPS_LOGD("[invoked event] type=%d, subtype=%d", type, subtype);
+               MAPS_LOGD("[invoked event] type=%d, subtype=%d", type, subtype);
 #endif
 
        v->event_callbacks[type].callback(type, event_data, v->event_callbacks[type].user_data);
index a296e8b..8152e6f 100644 (file)
@@ -314,7 +314,7 @@ static int __maps_view_overlay_data_create(void **overlay)
 
                *overlay = (maps_view_overlay_data_s *) m;
                return MAPS_ERROR_NONE;
-       } while(false);
+       } while (false);
 
        __maps_view_overlay_data_destroy(m);
        return error;
@@ -1010,10 +1010,10 @@ int _maps_view_object_overlay_set_bubble(maps_view_object_h overlay)
 
        pixels = (unsigned char *)evas_object_image_data_get(m->bubble, EINA_TRUE);
        row_stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, w);
-       surface = cairo_image_surface_create_for_data(pixels,CAIRO_FORMAT_ARGB32,
+       surface = cairo_image_surface_create_for_data(pixels, CAIRO_FORMAT_ARGB32,
                                                                                                   w, h, row_stride);
        /* Create the cairo context */
-       cairo = cairo_create (surface);
+       cairo = cairo_create(surface);
 
        /* Configuration */
        cairo_set_source_rgba(cairo, 0, 0, 0, 0);
@@ -1026,19 +1026,18 @@ int _maps_view_object_overlay_set_bubble(maps_view_object_h overlay)
        int bh = h - by - _OVERLAY_BUBBLE_PIN_SIZE;
 
        /* build a path */
-       cairo_new_path (cairo);
+       cairo_new_path(cairo);
        if (m->type == MAPS_VIEW_OVERLAY_BUBBLE) {
                double r = bh / 8.;
                double d = M_PI / 180.;
-               cairo_arc (cairo, bx + bw - r, by + r, r, -90 * d, 0 * d);
-               cairo_arc (cairo, bx + bw - r, by + bh - r, r, 0 * d, 90 * d);
+               cairo_arc(cairo, bx + bw - r, by + r, r, -90 * d, 0 * d);
+               cairo_arc(cairo, bx + bw - r, by + bh - r, r, 0 * d, 90 * d);
                cairo_line_to(cairo, bx + bw / 2 + _OVERLAY_BUBBLE_PIN_SIZE, by + bh);
                cairo_line_to(cairo, bx + bw / 2, by + bh + _OVERLAY_BUBBLE_PIN_SIZE);
                cairo_line_to(cairo, bx + bw / 2 - _OVERLAY_BUBBLE_PIN_SIZE, by + bh);
-               cairo_arc (cairo, bx + r, by + bh - r, r, 90 * d, 180 * d);
-               cairo_arc (cairo, bx + r, by + r, r, 180 * d, 270 * d);
-       }
-       else {
+               cairo_arc(cairo, bx + r, by + bh - r, r, 90 * d, 180 * d);
+               cairo_arc(cairo, bx + r, by + r, r, 180 * d, 270 * d);
+       } else {
                cairo_move_to(cairo, 1., 1.);
                cairo_line_to(cairo, 1., bh);
                cairo_line_to(cairo, bw / 2 - _OVERLAY_BUBBLE_PIN_SIZE, bh);
@@ -1183,14 +1182,12 @@ static bool __maps_view_object_overlay_set_visible(maps_view_object_h overlay)
                        evas_object_hide(m->object);
                        if (m->bubble)
                                evas_object_hide(m->bubble);
-               }
-               else {
+               } else {
                        evas_object_show(m->object);
                        if (m->bubble)
                                evas_object_show(m->bubble);
                }
-       }
-       else {
+       } else {
                evas_object_hide(m->object);
                if (m->bubble)
                        evas_object_hide(m->bubble);
@@ -1240,9 +1237,9 @@ static bool __maps_view_object_overlay_move(maps_view_object_h overlay, maps_coo
                        y -= _OVERLAY_BUBBLE_MARGIN ;
                        evas_object_move(m->bubble, x, y);
                }
-       }
-       else
+       } else {
                evas_object_move(m->object, x, y);
+       }
        return true;
 }
 
@@ -1251,7 +1248,7 @@ static bool __maps_view_object_overlay_update(maps_view_object_h overlay, Evas_O
        if (!overlay || !clipper)
                return false;
 
-       bool ret = false;       
+       bool ret = false;
        maps_coordinates_h coordinates = NULL;
 
        do {
@@ -1263,7 +1260,7 @@ static bool __maps_view_object_overlay_update(maps_view_object_h overlay, Evas_O
 
                maps_view_object_overlay_get_coordinates(overlay, &coordinates);
                ret = __maps_view_object_overlay_move(overlay, coordinates);
-       } while(0);
+       } while (0);
 
        if (coordinates)
                maps_coordinates_destroy(coordinates);
index 813e9eb..7f51c92 100755 (executable)
@@ -146,8 +146,7 @@ EXPORT_API int maps_view_capture_snapshot(maps_view_h view,
                                MAPS_LOGE("Failed to encode it with JPEG format. error=%d", error);
                                error = MAPS_ERROR_INVALID_OPERATION;
                        }
-               }
-               else if (type == MAPS_VIEW_SNAPSHOT_BMP) {
+               } else if (type == MAPS_VIEW_SNAPSHOT_BMP) {
                        if (cs == MAPS_VIEW_COLORSPACE_RGBA8888) {
                                MAPS_LOGD("RGBA -> BGRA");
                                __convert_rgba_to_bgra(image_buffer, w, h);
@@ -157,18 +156,18 @@ EXPORT_API int maps_view_capture_snapshot(maps_view_h view,
                                MAPS_LOGE("Failed to store it to a file.");
                                error = MAPS_ERROR_INVALID_OPERATION;
                        }
-               }
-               else
+               } else {
                        error = MAPS_ERROR_INVALID_PARAMETER;
-       } while(0);
+               }
+       } while (0);
 
        if (fname) {
                if (error == MAPS_ERROR_NONE) {
                        remove(path);
                        rename(fname, path);
-               }
-               else
+               } else {
                        remove(fname);
+               }
                free(fname);
        }
        g_free(image_buffer);
index e50fd77..c7920dd 100644 (file)
@@ -57,8 +57,7 @@ maps_view_object_h view::overlay_constructor::construct(maps_coordinates_h coord
 
                /* SUCCESS */
                return overlay;
-
-       } while(false);
+       } while (false);
 
        /* FAILURE: Releasing objects */
        maps_view_object_destroy(overlay);