diff options
author | sadrul <sadrul@chromium.org> | 2015-10-28 18:39:16 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-29 01:40:02 +0000 |
commit | 46e2c77b5abc443e488b40e45ea648a29395e43a (patch) | |
tree | 15bf4f9e9f1e1410c558b49a01a851ee41887546 /ui | |
parent | 6598addaf1cfa4ef9bdf38d5baf0582b0f89686b (diff) | |
download | chromium_src-46e2c77b5abc443e488b40e45ea648a29395e43a.zip chromium_src-46e2c77b5abc443e488b40e45ea648a29395e43a.tar.gz chromium_src-46e2c77b5abc443e488b40e45ea648a29395e43a.tar.bz2 |
mus: Move mojo events into mus.
BUG=548376
Review URL: https://codereview.chromium.org/1409833010
Cr-Commit-Position: refs/heads/master@{#356728}
Diffstat (limited to 'ui')
-rw-r--r-- | ui/mojo/events/BUILD.gn | 18 | ||||
-rw-r--r-- | ui/mojo/events/input_event_constants.mojom | 55 | ||||
-rw-r--r-- | ui/mojo/events/input_event_matcher.mojom | 48 | ||||
-rw-r--r-- | ui/mojo/events/input_events.mojom | 116 | ||||
-rw-r--r-- | ui/mojo/events/input_key_codes.mojom | 186 |
5 files changed, 0 insertions, 423 deletions
diff --git a/ui/mojo/events/BUILD.gn b/ui/mojo/events/BUILD.gn deleted file mode 100644 index eda7307..0000000 --- a/ui/mojo/events/BUILD.gn +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni") - -mojom("interfaces") { - sources = [ - "input_event_constants.mojom", - "input_event_matcher.mojom", - "input_events.mojom", - "input_key_codes.mojom", - ] - - deps = [ - "//ui/mojo/geometry:interfaces", - ] -} diff --git a/ui/mojo/events/input_event_constants.mojom b/ui/mojo/events/input_event_constants.mojom deleted file mode 100644 index 9b22e98..0000000 --- a/ui/mojo/events/input_event_constants.mojom +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -module mojo; - -enum EventType { - UNKNOWN, - KEY_PRESSED, - KEY_RELEASED, - POINTER_CANCEL, - POINTER_DOWN, - POINTER_MOVE, - POINTER_UP, - WHEEL, -}; - -// This mirrors ui::EventFlags -// TODO(morrita): Use shift operator once it is available. -enum EventFlags { - NONE = 0, - CAPS_LOCK_DOWN = 1, - SHIFT_DOWN = 2, - CONTROL_DOWN = 4, - ALT_DOWN = 8, - LEFT_MOUSE_BUTTON = 16, - MIDDLE_MOUSE_BUTTON = 32, - RIGHT_MOUSE_BUTTON = 64, - COMMAND_DOWN = 128, - EXTENDED = 256, - IS_SYNTHESIZED = 512, - ALTGR_DOWN = 1024, - MOD3_DOWN = 2048 -}; - -enum MouseEventFlags { - IS_DOUBLE_CLICK = 65536, - IS_TRIPLE_CLICK = 131072, - IS_NON_CLIENT = 262144, - - // TODO(erg): Move accessibility flags and maybe synthetic touch events here. -}; - -enum PointerKind { - MOUSE, - PEN, - TOUCH, -}; - -enum WheelMode { - PIXEL, - LINE, - PAGE, - SCALING, -}; diff --git a/ui/mojo/events/input_event_matcher.mojom b/ui/mojo/events/input_event_matcher.mojom deleted file mode 100644 index 08676d0c..0000000 --- a/ui/mojo/events/input_event_matcher.mojom +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -module mojo; - -import "ui/mojo/events/input_event_constants.mojom"; -import "ui/mojo/events/input_key_codes.mojom"; -import "ui/mojo/geometry/geometry.mojom"; - -struct KeyEventMatcher { - KeyboardCode keyboard_code; -}; - -struct PointerKindMatcher { - PointerKind pointer_kind; -}; - -struct PointerLocationMatcher { - RectF region; -}; - -struct EventTypeMatcher { - EventType type; -}; - -struct EventFlagsMatcher { - EventFlags flags; -}; - -// If a specific matcher is missing, then an Event will match this EventMatcher -// (if relevant). For example, if |type_matcher| is missing, then events of all -// types will match this EventMatcher. Similarly, if |key_matcher| is missing, -// then all key-events will match. -// An example matcher to match the Ctrl+A accelerator would be: -// - |type_matcher.type| = mojo::EVENT_TYPE_KEY_PRESSED -// - |flags_matcher.flags| = mojo::EVENT_FLAGS_CONTROL_DOWN -// - |key_matcher.keyboard_code| = mojo::KEYBOARD_CODE_A -// -// A matcher to match any key-press event would be: -// - |type_matcher.type| = mojo::EVENT_TYPE_KEY_PRESSED -struct EventMatcher { - EventTypeMatcher? type_matcher; - EventFlagsMatcher? flags_matcher; - KeyEventMatcher? key_matcher; - PointerKindMatcher? pointer_kind_matcher; - PointerLocationMatcher? pointer_location_matcher; -}; diff --git a/ui/mojo/events/input_events.mojom b/ui/mojo/events/input_events.mojom deleted file mode 100644 index 43b55e5..0000000 --- a/ui/mojo/events/input_events.mojom +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -module mojo; - -import "ui/mojo/events/input_event_constants.mojom"; -import "ui/mojo/events/input_key_codes.mojom"; -import "ui/mojo/geometry/geometry.mojom"; - -struct KeyData { - // The chromium event key code; these values are from the ui/ KeyCode enum, - // which has the fun property of being neither consistently the Windows key - // code, nor the X11 keycodes. (This value is consistent across platforms - // for basic ASCII characters; it will differ for modifiers. We don't define - // this as a mojo enum because mojom doesn't appear to have a platform - // dependent preprocessor yet.) - // - // TODO(erg): Remove this, and declare Win32 keycodes correct by fiat. We can - // not do this until we remove ui::Event usage from within mojo. - int32 key_code; - - // Whether this is a character event, and the character value if it is. Note - // that this is different than |text|, which holds a value even when there - // isn't actually a character to insert. (For example, |text| will be set and - // have a value on backspace, and |character| won't.) - bool is_char; - uint16 character; - - // The Win32 key code. Because of the web, this is the closest thing that we - // have to a cross platform key state. - KeyboardCode windows_key_code; - - // The platform specific key code. - // - // TODO(erg): This exists only for NPAPI support, pepper USB keyboard support - // and IME on android support. Theoretically, we should be able to remove this - // in the medium to long term. - int32 native_key_code; - - // The text generated by this keystroke. Corresponds to - // blink::WebKeyboardEvent::text. - uint16 text; - - // Like |text|, but unmodified by concurrently held modifier keys (except - // shift). Corresponds to blink::WebKeyboardEvent::unmodifiedText. - uint16 unmodified_text; -}; - -struct LocationData { - // |x| and |y| are in the coordinate system of the View. - // Typically, this will be an integer-valued translation w.r.t. - // the screen and in this case, |x| and |y| are in units of physical - // pixels. However, some View embedders may apply arbitrary transformations - // of a view w.r.t. the screen. - float x; - float y; - // |screen_x| and |screen_y| are in screen coordinates in units of - // physical pixels. - float screen_x; - float screen_y; -}; - -// TODO(rjkroege,sadrul): Add gesture representation. -struct PointerData { - int32 pointer_id; - PointerKind kind; - LocationData location; - // Some devices (e.g. pen, finger) can extend across multiple pixels - // at once. |brush_data| provides additional data for this case and - // is available when |kind| is PEN or TOUCH. - BrushData? brush_data; - // Only set for |WHEEL| events. - WheelData? wheel_data; -}; - -// Information payload to support -// https://developer.mozilla.org/en-US/docs/Web/Events/wheel. -// TODO(rjkroege): Handle MacOS momentum scrolling. -struct WheelData { - WheelMode mode; - // |delta_x|, |delta_y|, |delta_z| can be in units of pixels, lines, pages - // or control scaling as controlled by |mode|. Pixel scroll is physical - // pixels in the coordinate system of the target View. - float delta_x; - float delta_y; - float delta_z; -}; - -// Supplementary data to support pointers where the pointer can -// cover multiple pixels per http://www.w3.org/TR/pointerevents/ -struct BrushData { - // |width| and |height| are in CSS pixels in the coordinate system of - // the target View. - float width; - float height; - // |pressure| range is [0,1]. For devices like mice buttons where the - // pressure is not available, it will be set to 0.5 if the button is down. - float pressure; - // |tilt_y| and |tilt_z| are in degrees. - float tilt_y; - float tilt_z; -}; - -struct Event { - // TODO(sky): rename to type. - EventType action; - // TODO(sky): parts of this should move to PointerData. - EventFlags flags; - // Time in microseconds from when the platform was started. - // This value accurately orders events w.r.t. to each other but - // does not position them at an absolute time. - int64 time_stamp; - KeyData? key_data; - PointerData? pointer_data; -}; diff --git a/ui/mojo/events/input_key_codes.mojom b/ui/mojo/events/input_key_codes.mojom deleted file mode 100644 index 695f5bd..0000000 --- a/ui/mojo/events/input_key_codes.mojom +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -module mojo; - -// Cross platform keyboard codes. -// -// Because the web has standardized on Win32 keyboard codes, so does mojo. -enum KeyboardCode { - BACK = 0x08, - TAB = 0x09, - CLEAR = 0x0C, - RETURN = 0x0D, - SHIFT = 0x10, - CONTROL = 0x11, - MENU = 0x12, // a.k.a. ALT - PAUSE = 0x13, - CAPITAL = 0x14, - KANA = 0x15, - HANGUL = 0x15, - JUNJA = 0x17, - FINAL = 0x18, - HANJA = 0x19, - KANJI = 0x19, - ESCAPE = 0x1B, - CONVERT = 0x1C, - NONCONVERT = 0x1D, - ACCEPT = 0x1E, - MODECHANGE = 0x1F, - SPACE = 0x20, - PRIOR = 0x21, - NEXT = 0x22, - END = 0x23, - HOME = 0x24, - LEFT = 0x25, - UP = 0x26, - RIGHT = 0x27, - DOWN = 0x28, - SELECT = 0x29, - PRINT = 0x2A, - EXECUTE = 0x2B, - SNAPSHOT = 0x2C, - INSERT = 0x2D, - DELETE = 0x2E, - HELP = 0x2F, - NUM_0 = 0x30, - NUM_1 = 0x31, - NUM_2 = 0x32, - NUM_3 = 0x33, - NUM_4 = 0x34, - NUM_5 = 0x35, - NUM_6 = 0x36, - NUM_7 = 0x37, - NUM_8 = 0x38, - NUM_9 = 0x39, - A = 0x41, - B = 0x42, - C = 0x43, - D = 0x44, - E = 0x45, - F = 0x46, - G = 0x47, - H = 0x48, - I = 0x49, - J = 0x4A, - K = 0x4B, - L = 0x4C, - M = 0x4D, - N = 0x4E, - O = 0x4F, - P = 0x50, - Q = 0x51, - R = 0x52, - S = 0x53, - T = 0x54, - U = 0x55, - V = 0x56, - W = 0x57, - X = 0x58, - Y = 0x59, - Z = 0x5A, - LWIN = 0x5B, - COMMAND = 0x5B, // Provide the Mac name for convenience. - RWIN = 0x5C, - APPS = 0x5D, - SLEEP = 0x5F, - NUMPAD0 = 0x60, - NUMPAD1 = 0x61, - NUMPAD2 = 0x62, - NUMPAD3 = 0x63, - NUMPAD4 = 0x64, - NUMPAD5 = 0x65, - NUMPAD6 = 0x66, - NUMPAD7 = 0x67, - NUMPAD8 = 0x68, - NUMPAD9 = 0x69, - MULTIPLY = 0x6A, - ADD = 0x6B, - SEPARATOR = 0x6C, - SUBTRACT = 0x6D, - DECIMAL = 0x6E, - DIVIDE = 0x6F, - F1 = 0x70, - F2 = 0x71, - F3 = 0x72, - F4 = 0x73, - F5 = 0x74, - F6 = 0x75, - F7 = 0x76, - F8 = 0x77, - F9 = 0x78, - F10 = 0x79, - F11 = 0x7A, - F12 = 0x7B, - F13 = 0x7C, - F14 = 0x7D, - F15 = 0x7E, - F16 = 0x7F, - F17 = 0x80, - F18 = 0x81, - F19 = 0x82, - F20 = 0x83, - F21 = 0x84, - F22 = 0x85, - F23 = 0x86, - F24 = 0x87, - NUMLOCK = 0x90, - SCROLL = 0x91, - LSHIFT = 0xA0, - RSHIFT = 0xA1, - LCONTROL = 0xA2, - RCONTROL = 0xA3, - LMENU = 0xA4, - RMENU = 0xA5, - BROWSER_BACK = 0xA6, - BROWSER_FORWARD = 0xA7, - BROWSER_REFRESH = 0xA8, - BROWSER_STOP = 0xA9, - BROWSER_SEARCH = 0xAA, - BROWSER_FAVORITES = 0xAB, - BROWSER_HOME = 0xAC, - VOLUME_MUTE = 0xAD, - VOLUME_DOWN = 0xAE, - VOLUME_UP = 0xAF, - MEDIA_NEXT_TRACK = 0xB0, - MEDIA_PREV_TRACK = 0xB1, - MEDIA_STOP = 0xB2, - MEDIA_PLAY_PAUSE = 0xB3, - MEDIA_LAUNCH_MAIL = 0xB4, - MEDIA_LAUNCH_MEDIA_SELECT = 0xB5, - MEDIA_LAUNCH_APP1 = 0xB6, - MEDIA_LAUNCH_APP2 = 0xB7, - - OEM_1 = 0xBA, - OEM_PLUS = 0xBB, - OEM_COMMA = 0xBC, - OEM_MINUS = 0xBD, - OEM_PERIOD = 0xBE, - OEM_2 = 0xBF, - OEM_3 = 0xC0, - OEM_4 = 0xDB, - OEM_5 = 0xDC, - OEM_6 = 0xDD, - OEM_7 = 0xDE, - OEM_8 = 0xDF, - OEM_102 = 0xE2, - PROCESSKEY = 0xE5, - PACKET = 0xE7, - DBE_SBCSCHAR = 0xF3, - DBE_DBCSCHAR = 0xF4, - ATTN = 0xF6, - CRSEL = 0xF7, - EXSEL = 0xF8, - EREOF = 0xF9, - PLAY = 0xFA, - ZOOM = 0xFB, - NONAME = 0xFC, - PA1 = 0xFD, - OEM_CLEAR = 0xFE, - UNKNOWN = 0, - - // Windows does not have a specific key code for AltGr. We use the unused - // VK_OEM_AX to represent AltGr, matching the behaviour of Firefox on Linux. - ALTGR = 0xE1, -}; |