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;
}
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)
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,
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;
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);
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;
}
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
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);
&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
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;
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<GetPositionListener *>(listener)->parent;
- struct ds_tizen_event_policy_surface_get_position *event =
- static_cast<struct ds_tizen_event_policy_surface_get_position *>(data);
+ reinterpret_cast<NewPositionListener *>(listener)->parent;
+ struct ds_tizen_event_policy_surface_new_position *event =
+ static_cast<struct ds_tizen_event_policy_surface_new_position *>(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);
return mPolicyVisibility;
}
- MockPolicyPosition *GetPosition()
+ MockPolicyPosition *NewPosition()
{
return mPolicyPosition;
}
bool bDestroyed;
bool bNewVisibility;
- bool bGetPosition;
+ bool bNewPosition;
bool bActivate;
bool bRaise;
bool bLower;
};
NewVisibilityListener mNewVisibilityListener;
- struct GetPositionListener : ::wl_listener {
+ struct NewPositionListener : ::wl_listener {
MockPolicySurface *parent;
};
- GetPositionListener mGetPositionListener;
+ NewPositionListener mNewPositionListener;
struct ActivateListener : ::wl_listener {
MockPolicySurface *parent;
.changed = client_tizen_position_cb_changed,
};
-TEST_F(PolicyTest, Req_PolicySurfaceGetPosition)
+TEST_F(PolicyTest, Req_PolicySurfaceNewPosition)
{
MockPolicySurface *policy_surface;
struct tizen_position *position_res;
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);
}
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);
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();