Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(200)

Side by Side Diff: sky/engine/public/platform/WebInputEvent.h

Issue 880473003: sky-scrollable should use a reasonable fling curve (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Now with heights Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 // flag is set, the sender guarantees that no more input events will be 153 // flag is set, the sender guarantees that no more input events will be
154 // delivered until the next vsync and the receiver can schedule 154 // delivered until the next vsync and the receiver can schedule
155 // rendering accordingly. If it isn't set, the receiver should not make 155 // rendering accordingly. If it isn't set, the receiver should not make
156 // any assumptions about the delivery times of future input events 156 // any assumptions about the delivery times of future input events
157 // w.r.t. vsync. 157 // w.r.t. vsync.
158 IsLastInputEventForCurrentVSync = 1 << 13, 158 IsLastInputEventForCurrentVSync = 1 << 13,
159 }; 159 };
160 160
161 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; 161 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey;
162 162
163 double timeStampSeconds; // Seconds since epoch. 163 double timeStampMS; // Milliseconds since epoch.
164 unsigned size; // The size of this structure, for serialization. 164 unsigned size; // The size of this structure, for serialization.
165 Type type; 165 Type type;
166 int modifiers; 166 int modifiers;
167 167
168 static bool isPointerEventType(int type) 168 static bool isPointerEventType(int type)
169 { 169 {
170 return PointerTypeFirst <= type && type <= PointerTypeLast; 170 return PointerTypeFirst <= type && type <= PointerTypeLast;
171 } 171 }
172 172
173 // Returns true if the WebInputEvent |type| is a keyboard event. 173 // Returns true if the WebInputEvent |type| is a keyboard event.
174 static bool isKeyboardEventType(int type) 174 static bool isKeyboardEventType(int type)
175 { 175 {
176 return KeyboardTypeFirst <= type && type <= KeyboardTypeLast; 176 return KeyboardTypeFirst <= type && type <= KeyboardTypeLast;
177 } 177 }
178 178
179 // Returns true if the WebInputEvent is a gesture event. 179 // Returns true if the WebInputEvent is a gesture event.
180 static bool isGestureEventType(int type) 180 static bool isGestureEventType(int type)
181 { 181 {
182 return GestureTypeFirst <= type && type <= GestureTypeLast; 182 return GestureTypeFirst <= type && type <= GestureTypeLast;
183 } 183 }
184 184
185 protected: 185 protected:
186 explicit WebInputEvent(unsigned sizeParam) 186 explicit WebInputEvent(unsigned sizeParam)
187 { 187 {
188 memset(this, 0, sizeParam); 188 memset(this, 0, sizeParam);
189 timeStampSeconds = 0.0; 189 timeStampMS = 0.0;
190 size = sizeParam; 190 size = sizeParam;
191 type = Undefined; 191 type = Undefined;
192 modifiers = 0; 192 modifiers = 0;
193 } 193 }
194 }; 194 };
195 195
196 // WebPointerEvent ------------------------------------------------------------ 196 // WebPointerEvent ------------------------------------------------------------
197 197
198 class WebPointerEvent : public WebInputEvent { 198 class WebPointerEvent : public WebInputEvent {
199 public: 199 public:
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 { 327 {
328 memset(&data, 0, sizeof(data)); 328 memset(&data, 0, sizeof(data));
329 } 329 }
330 }; 330 };
331 331
332 #pragma pack(pop) 332 #pragma pack(pop)
333 333
334 } // namespace blink 334 } // namespace blink
335 335
336 #endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBINPUTEVENT_H_ 336 #endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBINPUTEVENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698