input_handle_->Hide();
}
-void SelectionControllerEfl::OnMouseDown(
- const gfx::Point& touch_point, SelectionHandleEfl* handle) {
+void SelectionControllerEfl::HandleDragBeginNotification(SelectionHandleEfl* handle) {
// Hide context menu on mouse down
show_only_large_handle_ = false;
CancelContextMenu(0);
ShowHandleAndContextMenuIfRequired();
}
-void SelectionControllerEfl::OnMouseMove(const gfx::Point& touch_point,
- SelectionHandleEfl* handle) {
+void SelectionControllerEfl::HandleDragUpdateNotification(SelectionHandleEfl* handle) {
show_only_large_handle_ = false;
// FIXME : Check the text Direction later
Evas_Coord x, y;
}
}
-void SelectionControllerEfl::OnMouseUp(const gfx::Point& touch_point) {
+void SelectionControllerEfl::HandleDragEndNotification() {
show_only_large_handle_ = false;
mouse_press_ = false;
magnifier_->Hide();
bool UpdateSelectionDataAndShow(const gfx::Rect& left_rect,
const gfx::Rect& right_rect, bool show = true);
void GetSelectionBounds(gfx::Rect* left, gfx::Rect* right);
- // Handles the mouse press,move and relase events on selection handles
- void OnMouseDown(const gfx::Point& touch_point, SelectionHandleEfl*);
- void OnMouseMove(const gfx::Point& touch_point, SelectionHandleEfl*);
- void OnMouseUp(const gfx::Point& touch_point);
+
+ // Handles the touch press, move and relase events on selection handles
+ void HandleDragBeginNotification(SelectionHandleEfl*);
+ void HandleDragUpdateNotification(SelectionHandleEfl*);
+ void HandleDragEndNotification();
void SetCaretSelectionStatus(const bool enable);
bool GetCaretSelectionStatus() const;
}
SelectionHandleEfl::SelectionHandleEfl(SelectionControllerEfl& controller, HandleType type, Evas_Object* parent)
- : base_point_(0,0),
- current_touch_point_(0,0),
- diff_point_(0,0),
- controller_(controller),
+ : controller_(controller),
pressed_(false),
is_top_(false),
handle_type_(type) {
int delta_x = event->canvas.x - handle->diff_point_.x();
int delta_y = event->canvas.y - handle->diff_point_.y();
handle->base_point_.SetPoint(delta_x, delta_y);
-
- handle->controller_.OnMouseDown(
- gfx::Point(event->canvas.x , event->canvas.y), handle);
+ handle->controller_.HandleDragBeginNotification(handle);
}
void SelectionHandleEfl::OnMouseMove(void* data, Evas*, Evas_Object*, void* event_info) {
ecore_job_add(UpdateMouseMove, handle);
}
-void SelectionHandleEfl::OnMouseUp(void* data, Evas*, Evas_Object*, void* event_info) {
- Evas_Event_Mouse_Up* event = static_cast<Evas_Event_Mouse_Up*>(event_info);
+void SelectionHandleEfl::OnMouseUp(void* data, Evas*, Evas_Object*, void* /* event_info */) {
SelectionHandleEfl* handle = static_cast<SelectionHandleEfl*>(data);
handle->pressed_ = false;
evas_object_event_callback_del(handle->handle_, EVAS_CALLBACK_MOUSE_MOVE, OnMouseMove);
- Evas_Coord x, y;
- evas_object_geometry_get(handle->controller_.GetParentView(), &x, &y, 0, 0);
- handle->controller_.OnMouseUp(gfx::Point(event->canvas.x - x, event->canvas.y - y));
+ handle->controller_.HandleDragEndNotification();
}
void SelectionHandleEfl::UpdateMouseMove(void* data) {
int delta_x = handle->current_touch_point_.x() - handle->diff_point_.x();
int delta_y = handle->current_touch_point_.y() - handle->diff_point_.y();
handle->base_point_.SetPoint(delta_x, delta_y);
- handle->controller_.OnMouseMove(
- gfx::Point(handle->current_touch_point_.x(),
- handle->current_touch_point_.y()), handle);
+ handle->controller_.HandleDragUpdateNotification(handle);
}
SelectionHandleEfl::HandleDirection SelectionHandleEfl::CalculateDirection(