Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
61b16cba
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
61b16cba
编写于
12月 09, 2015
作者:
I
Ian Hickson
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2164 from Hixie/remove-back
Remove old 'back' callback, and add dartdocs.
上级
5c80bf02
954c3062
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
73 addition
and
10 deletion
+73
-10
sky/engine/core/dart/hooks.dart
sky/engine/core/dart/hooks.dart
+0
-3
sky/engine/core/dart/text.dart
sky/engine/core/dart/text.dart
+2
-2
sky/engine/core/dart/window.dart
sky/engine/core/dart/window.dart
+71
-5
未找到文件。
sky/engine/core/dart/hooks.dart
浏览文件 @
61b16cba
...
...
@@ -36,9 +36,6 @@ void _pushRoute(String route) {
void
_popRoute
(
)
{
if
(
window
.
onPopRoute
!=
null
)
window
.
onPopRoute
();
// TODO(abarth): Remove after engine roll.
if
(
window
.
onEvent
!=
null
)
window
.
onEvent
(
'back'
,
0.0
);
}
void
_dispatchPointerPacket
(
ByteData
serializedPacket
)
{
...
...
sky/engine/core/dart/text.dart
浏览文件 @
61b16cba
...
...
@@ -181,9 +181,9 @@ enum TextDecorationStyle {
//
// - Element 3: The |decorationColor| in ARGB with 8 bits per channel.
//
// - Element 4: The
enum index
of the |decorationStyle|.
// - Element 4: The
bit field
of the |decorationStyle|.
//
// - Element 5: The
enum
index of the |fontWeight|.
// - Element 5: The index of the |fontWeight|.
//
// - Element 6: The enum index of the |fontStyle|.
//
...
...
sky/engine/core/dart/window.dart
浏览文件 @
61b16cba
...
...
@@ -6,9 +6,14 @@ part of dart_ui;
typedef
void
VoidCallback
(
);
typedef
void
_FrameCallback
(
Duration
duration
);
typedef
void
_EventCallback
(
String
eventType
,
double
timeStamp
);
typedef
void
_PointerPacketCallback
(
ByteData
serializedPacket
);
/// A representation of distances for each of the four edges of a rectangle,
/// used to encode the padding that applications should place around their user
/// interface, as exposed by [Window.padding].
///
/// For a generic class that represents distances around a rectangle, see the
/// [EdgeDims] class.
class
WindowPadding
{
const
WindowPadding
.
_
({
this
.
top
,
this
.
right
,
this
.
bottom
,
this
.
left
});
...
...
@@ -18,41 +23,102 @@ class WindowPadding {
final
double
left
;
}
/// An identifier used to select a user's language and formatting preferences,
/// consisting of a language and a country. This is a subset of locale
/// identifiers as defined by BCP 47.
class
Locale
{
Locale
(
this
.
languageCode
,
this
.
countryCode
);
const
Locale
(
this
.
languageCode
,
this
.
countryCode
);
/// The primary language subtag for the locale.
final
String
languageCode
;
/// The region subtag for the locale.
final
String
countryCode
;
bool
operator
==(
dynamic
other
)
{
if
(
identical
(
this
,
other
))
return
true
;
if
(
other
is
!
Locale
)
return
false
;
final
Locale
typedOther
=
other
;
return
languageCode
==
typedOther
.
languageCode
&&
countryCode
==
typedOther
.
countryCode
;
}
int
get
hashCode
{
int
result
=
373
;
result
=
37
*
result
+
languageCode
.
hashCode
;
result
=
37
*
result
+
countryCode
.
hashCode
;
return
result
;
}
String
toString
()
=>
'
${languageCode}
_
$countryCode
'
;
}
/// The most basic interface to the host operating system's user interface.
class
Window
{
Window
.
_
();
/// The number of device pixels for each logical pixel. This number might not
/// be a power of two. Indeed, it might not even be an integer. For example,
/// the Nexus 6 has a device pixel ratio of 3.5.
double
get
devicePixelRatio
=>
_devicePixelRatio
;
double
_devicePixelRatio
;
/// The dimensions of the rectangle into which the application will be drawn,
/// in logical pixels.
Size
get
size
=>
_size
;
Size
_size
;
/// The number of pixels on each side of the display rectangle into which the
/// application can render, but over which the operating system will likely
/// place system UI (such as the Android system notification area).
WindowPadding
get
padding
=>
_padding
;
WindowPadding
_padding
;
/// A callback that is invoked whenever the [devicePixelRatio], [size], or
/// [padding] values change.
VoidCallback
onMetricsChanged
;
/// The system-reported locale. This establishes the language and formatting
/// conventions that application should, if possible, use to render their user
/// interface.
Locale
get
locale
=>
_locale
;
Locale
_locale
;
/// A callback that is invoked whenever [locale] changes value.
VoidCallback
onLocaleChanged
;
/// A callback that is invoked to notify the application that it is an
/// appropriate time to provide a scene using the [SceneBuilder] API and the
/// [render()] method. When possible, this is driven by the hardware VSync
/// signal. This is only called if [scheduleFrame()] has been called since the
/// last time this callback was invoked.
_FrameCallback
onBeginFrame
;
_EventCallback
onEvent
;
// TODO(abarth): Remove.
/// A callback that is invoked when pointer data is available. The data is
/// provided in the form of a raw byte stream containing an encoded mojo
/// PointerPacket.
_PointerPacketCallback
onPointerPacket
;
VoidCallback
onMetricsChanged
;
VoidCallback
onLocaleChanged
;
/// The route or path that the operating system requested when the application
/// was launched.
String
defaultRouteName
;
/// A callback that is invoked when the operating system requests that the
/// application goes "back" one step in its history. For example, on Android
/// this is invoked in response to the "back" button.
VoidCallback
onPopRoute
;
/// Requests that, at the next appropriate opportunity, the [onBeginFrame]
/// callback be invoked.
void
scheduleFrame
()
native
"Window_scheduleFrame"
;
/// Updates the application's rendering on the GPU with the newly provided
/// [Scene]. For optimal performance, this should only be called in response
/// to the [onBeginFrame] callback being invoked.
void
render
(
Scene
scene
)
native
"Window_render"
;
}
/// The [Window] singleton.
final
Window
window
=
new
Window
.
_
();
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录