提交 234f792f 编写于 作者: A Adam Barth

Remove ui.view

We don't use ui.view anymore.
上级 939835ea
......@@ -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",
......
// 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);
......@@ -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();
// 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_
// 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);
};
// 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_
// 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);
};
/*
* 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_
/*
* 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();
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册