Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Commit

Permalink
Rework Input device.
Browse files Browse the repository at this point in the history
Input device is responsible for mapping native events to chromium events
and dispatching them to Ozone Message pump. The class handles both keyboard
and mouse.
The patch does the following changes:
1)Move all funcionality related to Keyboard to a class named keyboard.
2)Move all mouse handling to a class named pointer.It would also need
to support touch in future

Removes any focus handling code as these classes should be only
reponsible for mapping native events and dispatching them.
input_device is a container class managing the ownerships of all classes
related to inputs.
  • Loading branch information
kalyankondapally committed Sep 2, 2013
1 parent 817aa73 commit fb1e661
Show file tree
Hide file tree
Showing 13 changed files with 589 additions and 637 deletions.
1 change: 0 additions & 1 deletion impl/desktop_root_window_host_wayland.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class VIEWS_EXPORT DesktopRootWindowHostWayland :
void HandleNativeWidgetActivationChanged(bool active);

private:
typedef unsigned WindowStateAttribute;
// Initializes our Ozone surface to draw on. This method performs all
// initialization related to talking to the Ozone server.
void InitWaylandWindow(const Widget::InitParams& params);
Expand Down
17 changes: 13 additions & 4 deletions ozone_impl.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
],
'direct_dependent_settings': {
'cflags': [
'<!@(<(pkg-config) --cflags wayland-client wayland-cursor wayland-egl xkbcommon)',
'<!@(<(pkg-config) --cflags wayland-client wayland-cursor wayland-egl xkbcommon)',
],
},
'link_settings': {
'ldflags': [
'<!@(<(pkg-config) --libs-only-L --libs-only-other wayland-client wayland-cursor wayland-egl xkbcommon)',
'<!@(<(pkg-config) --libs-only-L --libs-only-other wayland-client wayland-cursor wayland-egl xkbcommon)',
],
'libraries': [
'<!@(<(pkg-config) --libs-only-l wayland-client wayland-cursor wayland-egl xkbcommon)',
Expand All @@ -45,23 +45,32 @@
'../..',
],
'sources': [
'egl/shims.h',
'egl/egl_window.h',
'egl/egl_window.cc',
'wayland/cursor.cc',
'wayland/cursor.h',
'wayland/display.cc',
'wayland/display.h',
'wayland/dispatcher.cc',
'wayland/dispatcher.h',
'wayland/global.h',
'wayland/input_device.cc',
'wayland/input_device.h',
'wayland/input_method_event_filter.cc',
'wayland/input_method_event_filter.h',
"wayland/kbd_conversion.cc",
"wayland/kbd_conversion.h",
'wayland/pointer.cc',
'wayland/pointer.h',
'wayland/keyboard.cc',
'wayland/keyboard.h',
'wayland/screen.cc',
'wayland/screen.h',
'wayland/shell_surface.cc',
'wayland/shell_surface.h',
'wayland/surface.h',
'wayland/surface.cc',
'wayland/task.cc',
'wayland/task.h',
'wayland/window.cc',
'wayland/window.h',
],
Expand Down
4 changes: 2 additions & 2 deletions wayland/cursor.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand Down Expand Up @@ -119,6 +119,7 @@ void WaylandCursor::ValidateBuffer(CursorType type, uint32_t serial)
width_ = image->width;
height_ = image->height;
wl_pointer_set_cursor(input_pointer_, serial, pointer_surface_->wlSurface(), image->hotspot_x, image->hotspot_y);
type_ = type;
}

void WaylandCursor::Update(CursorType type, uint32_t serial)
Expand All @@ -139,4 +140,3 @@ void WaylandCursor::Clear()
}

} // namespace ui

4 changes: 2 additions & 2 deletions wayland/cursor.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Copyright 2013 The Chromium Authors. All rights reserved.
// Copyright 2013 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef OZONE_WAYLAND_CURSOR_H_
#define OZONE_WAYLAND_CURSOR_H_

#include "ozone/wayland/input_device.h"
#include "ozone/wayland/display.h"
#include <wayland-cursor.h>

namespace ui {
Expand Down
Loading

0 comments on commit fb1e661

Please sign in to comment.