From 424dccb4e356b919f247c4b2e87862d09dccc128 Mon Sep 17 00:00:00 2001 From: SooChan Lim Date: Wed, 7 Sep 2022 15:18:33 +0900 Subject: [PATCH] change the get_position to new_position change the symbol names Change-Id: I0b5f095ad75aa59f92ba90d9aa0dd1378309286c --- examples/tinyds-tdm.c | 18 +++++++++--------- include/libds-tizen/policy.h | 4 ++-- src/policy/policy.c | 12 ++++++------ tests/tc_policy.cpp | 38 +++++++++++++++++++------------------- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/examples/tinyds-tdm.c b/examples/tinyds-tdm.c index 60ba931..d0cac7d 100644 --- a/examples/tinyds-tdm.c +++ b/examples/tinyds-tdm.c @@ -112,7 +112,7 @@ struct tinyds_policy_surface struct wl_listener destroy; struct wl_listener new_visibility; - struct wl_listener get_position; + struct wl_listener new_position; struct wl_listener activate; struct wl_listener raise; struct wl_listener lower; @@ -2663,16 +2663,16 @@ policy_surface_handle_new_visibility(struct wl_listener *listener, void *data) } static void -policy_surface_handle_get_position(struct wl_listener *listener, void *data) +policy_surface_handle_new_position(struct wl_listener *listener, void *data) { struct tinyds_policy_surface *policy_surface; struct tinyds_policy_position *position; - struct ds_tizen_event_policy_surface_get_position *event; + struct ds_tizen_event_policy_surface_new_position *event; - policy_surface = wl_container_of(listener, policy_surface, get_position); - event = (struct ds_tizen_event_policy_surface_get_position *)data; + policy_surface = wl_container_of(listener, policy_surface, new_position); + event = (struct ds_tizen_event_policy_surface_new_position *)data; - ds_inf("Policy Info(%p) get_position", policy_surface); + ds_inf("Policy Info(%p) new_position", policy_surface); position = calloc(1, sizeof *position); if (!position) @@ -3090,9 +3090,9 @@ policy_handle_new_surface(struct wl_listener *listener, void *data) ds_tizen_policy_surface_add_new_visibility_listener(policy_surface->policy_surface, &policy_surface->new_visibility); - policy_surface->get_position.notify = policy_surface_handle_get_position; - ds_tizen_policy_surface_add_get_position_listener(policy_surface->policy_surface, - &policy_surface->get_position); + policy_surface->new_position.notify = policy_surface_handle_new_position; + ds_tizen_policy_surface_add_new_position_listener(policy_surface->policy_surface, + &policy_surface->new_position); policy_surface->activate.notify = policy_surface_handle_activate; ds_tizen_policy_surface_add_activate_listener(policy_surface->policy_surface, diff --git a/include/libds-tizen/policy.h b/include/libds-tizen/policy.h index 2dc87e4..dd3d313 100644 --- a/include/libds-tizen/policy.h +++ b/include/libds-tizen/policy.h @@ -167,7 +167,7 @@ struct ds_tizen_event_policy_surface_new_visibility struct ds_tizen_policy_visibility *visibility; }; -struct ds_tizen_event_policy_surface_get_position +struct ds_tizen_event_policy_surface_new_position { struct ds_tizen_policy_surface *policy_surface; struct ds_tizen_policy_position *position; @@ -423,7 +423,7 @@ ds_tizen_policy_surface_add_new_visibility_listener( struct wl_listener *listener); void -ds_tizen_policy_surface_add_get_position_listener( +ds_tizen_policy_surface_add_new_position_listener( struct ds_tizen_policy_surface *policy_surface, struct wl_listener *listener); diff --git a/src/policy/policy.c b/src/policy/policy.c index 5bf32a4..87cd4a1 100644 --- a/src/policy/policy.c +++ b/src/policy/policy.c @@ -78,7 +78,7 @@ struct ds_tizen_policy_surface struct { struct wl_signal destroy; struct wl_signal new_visibility; - struct wl_signal get_position; + struct wl_signal new_position; struct wl_signal activate; struct wl_signal raise; struct wl_signal lower; @@ -337,11 +337,11 @@ ds_tizen_policy_surface_add_new_visibility_listener( } WL_EXPORT void -ds_tizen_policy_surface_add_get_position_listener( +ds_tizen_policy_surface_add_new_position_listener( struct ds_tizen_policy_surface *policy_surface, struct wl_listener *listener) { - wl_signal_add(&policy_surface->events.get_position, listener); + wl_signal_add(&policy_surface->events.new_position, listener); } WL_EXPORT void @@ -948,7 +948,7 @@ tizen_policy_client_get_surface(struct wl_resource *resource, wl_signal_init(&policy_surface->events.destroy); wl_signal_init(&policy_surface->events.new_visibility); - wl_signal_init(&policy_surface->events.get_position); + wl_signal_init(&policy_surface->events.new_position); wl_signal_init(&policy_surface->events.activate); wl_signal_init(&policy_surface->events.raise); wl_signal_init(&policy_surface->events.lower); @@ -1167,11 +1167,11 @@ policy_handle_get_position(struct wl_client *wl_client, struct wl_resource *reso &position_impl, position, _tizen_policy_position_handle_destroy); - struct ds_tizen_event_policy_surface_get_position event = { + struct ds_tizen_event_policy_surface_new_position event = { .policy_surface = policy_surface, .position = position, }; - wl_signal_emit(&policy_surface->events.get_position, &event); + wl_signal_emit(&policy_surface->events.new_position, &event); } static void diff --git a/tests/tc_policy.cpp b/tests/tc_policy.cpp index f8e2d2a..dd2296f 100644 --- a/tests/tc_policy.cpp +++ b/tests/tc_policy.cpp @@ -251,10 +251,10 @@ public: ds_tizen_policy_surface_add_new_visibility_listener(policy_surface, &mNewVisibilityListener); - mGetPositionListener.notify = MockPolicySurface::GetPositionCallback; - mGetPositionListener.parent = this; - ds_tizen_policy_surface_add_get_position_listener(policy_surface, - &mGetPositionListener); + mNewPositionListener.notify = MockPolicySurface::NewPositionCallback; + mNewPositionListener.parent = this; + ds_tizen_policy_surface_add_new_position_listener(policy_surface, + &mNewPositionListener); mActivateListener.notify = MockPolicySurface::ActivateCallback; mActivateListener.parent = this; @@ -458,17 +458,17 @@ public: policySurface->mPolicyVisibility = policyVisibility; } - static void GetPositionCallback(struct wl_listener *listener, void *data) + static void NewPositionCallback(struct wl_listener *listener, void *data) { MockPolicySurface *policySurface = - reinterpret_cast(listener)->parent; - struct ds_tizen_event_policy_surface_get_position *event = - static_cast(data); + reinterpret_cast(listener)->parent; + struct ds_tizen_event_policy_surface_new_position *event = + static_cast(data); EXPECT_TRUE(policySurface->mPolicySurface == event->policy_surface); EXPECT_TRUE(event->position != NULL); - policySurface->bGetPosition = true; + policySurface->bNewPosition = true; MockPolicyPosition *policyPosition = new MockPolicyPosition(event->position); @@ -845,7 +845,7 @@ public: return mPolicyVisibility; } - MockPolicyPosition *GetPosition() + MockPolicyPosition *NewPosition() { return mPolicyPosition; } @@ -902,7 +902,7 @@ public: bool bDestroyed; bool bNewVisibility; - bool bGetPosition; + bool bNewPosition; bool bActivate; bool bRaise; bool bLower; @@ -946,10 +946,10 @@ private: }; NewVisibilityListener mNewVisibilityListener; - struct GetPositionListener : ::wl_listener { + struct NewPositionListener : ::wl_listener { MockPolicySurface *parent; }; - GetPositionListener mGetPositionListener; + NewPositionListener mNewPositionListener; struct ActivateListener : ::wl_listener { MockPolicySurface *parent; @@ -2291,7 +2291,7 @@ tizen_position_listener position_cb_listener = .changed = client_tizen_position_cb_changed, }; -TEST_F(PolicyTest, Req_PolicySurfaceGetPosition) +TEST_F(PolicyTest, Req_PolicySurfaceNewPosition) { MockPolicySurface *policy_surface; struct tizen_position *position_res; @@ -2306,7 +2306,7 @@ TEST_F(PolicyTest, Req_PolicySurfaceGetPosition) surface_res_id = wl_proxy_get_id((struct wl_proxy *)surface_res); policy_surface = comp->FindPolicySurfaceWidthResId(surface_res_id); - EXPECT_TRUE(policy_surface->bGetPosition); + EXPECT_TRUE(policy_surface->bNewPosition); tizen_position_destroy(position_res); } @@ -2330,9 +2330,9 @@ TEST_F(PolicyTest, Req_PositionSet) surface_res_id = wl_proxy_get_id((struct wl_proxy *)surface_res); policy_surface = comp->FindPolicySurfaceWidthResId(surface_res_id); - EXPECT_TRUE(policy_surface->bGetPosition); + EXPECT_TRUE(policy_surface->bNewPosition); - position = policy_surface->GetPosition(); + position = policy_surface->NewPosition(); EXPECT_TRUE(position->mX == x); EXPECT_TRUE(position->mY == y); @@ -2356,9 +2356,9 @@ TEST_F(PolicyTest, Ev_PositionChanged) surface_res_id = wl_proxy_get_id((struct wl_proxy *)surface_res); policy_surface = comp->FindPolicySurfaceWidthResId(surface_res_id); - EXPECT_TRUE(policy_surface->bGetPosition); + EXPECT_TRUE(policy_surface->bNewPosition); - position = policy_surface->GetPosition(); + position = policy_surface->NewPosition(); position->SendChanged(x, y); comp->Process(); -- 2.7.4