From 234f792f510e236d0ff18a98f045a5e9070403ff Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 28 Oct 2015 11:15:59 -0700 Subject: [PATCH] Remove ui.view We don't use ui.view anymore. --- sky/engine/core/core.gni | 7 ---- sky/engine/core/dart/view.dart | 46 -------------------------- sky/engine/core/dart/window.dart | 5 +-- sky/engine/core/view/EventCallback.h | 19 ----------- sky/engine/core/view/EventCallback.idl | 7 ---- sky/engine/core/view/FrameCallback.h | 18 ---------- sky/engine/core/view/FrameCallback.idl | 7 ---- sky/engine/core/view/VoidCallback.h | 41 ----------------------- sky/engine/core/view/VoidCallback.idl | 28 ---------------- 9 files changed, 3 insertions(+), 175 deletions(-) delete mode 100644 sky/engine/core/dart/view.dart delete mode 100644 sky/engine/core/view/EventCallback.h delete mode 100644 sky/engine/core/view/EventCallback.idl delete mode 100644 sky/engine/core/view/FrameCallback.h delete mode 100644 sky/engine/core/view/FrameCallback.idl delete mode 100644 sky/engine/core/view/VoidCallback.h delete mode 100644 sky/engine/core/view/VoidCallback.idl diff --git a/sky/engine/core/core.gni b/sky/engine/core/core.gni index 0b2ed085a..4995a7370 100644 --- a/sky/engine/core/core.gni +++ b/sky/engine/core/core.gni @@ -245,11 +245,8 @@ sky_core_files = [ "text/Paragraph.h", "text/ParagraphBuilder.cpp", "text/ParagraphBuilder.h", - "view/EventCallback.h", - "view/FrameCallback.h", "view/Tracing.cpp", "view/Tracing.h", - "view/VoidCallback.h", "window/window.cc", "window/window.h", ] @@ -282,10 +279,7 @@ core_idl_files = get_path_info([ "painting/Shader.idl", "text/Paragraph.idl", "text/ParagraphBuilder.idl", - "view/EventCallback.idl", - "view/FrameCallback.idl", "view/Tracing.idl", - "view/VoidCallback.idl", ], "abspath") @@ -294,7 +288,6 @@ core_dart_files = get_path_info([ "dart/natives.dart", "dart/lerp.dart", "dart/text.dart", - "dart/view.dart", "dart/window.dart", "painting/Color.dart", "painting/ColorFilter.dart", diff --git a/sky/engine/core/dart/view.dart b/sky/engine/core/dart/view.dart deleted file mode 100644 index 0178f264c..000000000 --- a/sky/engine/core/dart/view.dart +++ /dev/null @@ -1,46 +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. - -part of dart_ui; - -final Tracing tracing = new Tracing(); - -class View { - View._(); - - double get devicePixelRatio => window.devicePixelRatio; - - double get paddingTop => window.padding.top; - double get paddingRight => window.padding.right; - double get paddingBottom => window.padding.bottom; - double get paddingLeft => window.padding.left; - - double get width => window.size.width; - double get height => window.size.height; - - Scene get scene => null; - void set scene(Scene value) { - window.render(value); - } - - void setEventCallback(EventCallback callback) { - window.onEvent = callback; - } - - void setMetricsChangedCallback(VoidCallback callback) { - window.onMetricsChanged = callback; - } - - void setFrameCallback(FrameCallback callback) { - window.onBeginFrame = (Duration duration) { - callback(duration.inMicroseconds / Duration.MICROSECONDS_PER_MILLISECOND); - }; - } - - void scheduleFrame() => window.scheduleFrame(); -} - -final View view = new View._(); - -typedef EventListener(Event event); diff --git a/sky/engine/core/dart/window.dart b/sky/engine/core/dart/window.dart index e7d134600..b6e52d486 100644 --- a/sky/engine/core/dart/window.dart +++ b/sky/engine/core/dart/window.dart @@ -4,7 +4,7 @@ part of dart_ui; -typedef void _VoidCallback(); +typedef void VoidCallback(); typedef void _FrameCallback(Duration duration); typedef void _EventCallback(Event event); @@ -31,10 +31,11 @@ class Window { _FrameCallback onBeginFrame; _EventCallback onEvent; - _VoidCallback onMetricsChanged; + VoidCallback onMetricsChanged; void scheduleFrame() native "Window_scheduleFrame"; void render(Scene scene) native "Window_render"; } final Window window = new Window._(); +final Tracing tracing = new Tracing(); diff --git a/sky/engine/core/view/EventCallback.h b/sky/engine/core/view/EventCallback.h deleted file mode 100644 index f1b5f226c..000000000 --- a/sky/engine/core/view/EventCallback.h +++ /dev/null @@ -1,19 +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. - -#ifndef SKY_ENGINE_CORE_VIEW_EVENTCALLBACK_H_ -#define SKY_ENGINE_CORE_VIEW_EVENTCALLBACK_H_ - -namespace blink { -class Event; - -class EventCallback { -public: - virtual ~EventCallback() { } - virtual void handleEvent(Event* event) = 0; -}; - -} - -#endif // SKY_ENGINE_CORE_VIEW_EVENTCALLBACK_H_ diff --git a/sky/engine/core/view/EventCallback.idl b/sky/engine/core/view/EventCallback.idl deleted file mode 100644 index ee685ddbc..000000000 --- a/sky/engine/core/view/EventCallback.idl +++ /dev/null @@ -1,7 +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. - -callback interface EventCallback { - void handleEvent(Event event); -}; diff --git a/sky/engine/core/view/FrameCallback.h b/sky/engine/core/view/FrameCallback.h deleted file mode 100644 index 21d811eef..000000000 --- a/sky/engine/core/view/FrameCallback.h +++ /dev/null @@ -1,18 +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. - -#ifndef SKY_ENGINE_CORE_VIEW_FRAMECALLBACK_H_ -#define SKY_ENGINE_CORE_VIEW_FRAMECALLBACK_H_ - -namespace blink { - -class FrameCallback { -public: - virtual ~FrameCallback() { } - virtual bool handleEvent(double highResTime) = 0; -}; - -} - -#endif // SKY_ENGINE_CORE_VIEW_FRAMECALLBACK_H_ diff --git a/sky/engine/core/view/FrameCallback.idl b/sky/engine/core/view/FrameCallback.idl deleted file mode 100644 index 0f4a19525..000000000 --- a/sky/engine/core/view/FrameCallback.idl +++ /dev/null @@ -1,7 +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. - -callback interface FrameCallback { - boolean handleEvent(double highResTime); -}; diff --git a/sky/engine/core/view/VoidCallback.h b/sky/engine/core/view/VoidCallback.h deleted file mode 100644 index 273af6c56..000000000 --- a/sky/engine/core/view/VoidCallback.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef SKY_ENGINE_CORE_VIEW_VOIDCALLBACK_H_ -#define SKY_ENGINE_CORE_VIEW_VOIDCALLBACK_H_ - -#include "sky/engine/platform/heap/Handle.h" - -namespace blink { - -class VoidCallback { -public: - virtual ~VoidCallback() { } - virtual void handleEvent() = 0; -}; - -} // namespace blink - -#endif // SKY_ENGINE_CORE_VIEW_VOIDCALLBACK_H_ diff --git a/sky/engine/core/view/VoidCallback.idl b/sky/engine/core/view/VoidCallback.idl deleted file mode 100644 index 970113b02..000000000 --- a/sky/engine/core/view/VoidCallback.idl +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -callback interface VoidCallback { - void handleEvent(); -}; -- GitLab