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

Unified Diff: sdk/lib/html/templates/html/impl/impl_EventTarget.darttemplate

Issue 11691009: Moved most of html lib generating scripts into tools. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/html/templates/html/impl/impl_EventTarget.darttemplate
diff --git a/sdk/lib/html/templates/html/impl/impl_EventTarget.darttemplate b/sdk/lib/html/templates/html/impl/impl_EventTarget.darttemplate
deleted file mode 100644
index 9094644ba85e67f7ce9a00c8ce2954b2124d82da..0000000000000000000000000000000000000000
--- a/sdk/lib/html/templates/html/impl/impl_EventTarget.darttemplate
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. 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 html;
-
-/**
- * Base class that supports listening for and dispatching browser events.
- *
- * Events can either be accessed by string name (using the indexed getter) or by
- * getters exposed by subclasses. Use the getters exposed by subclasses when
- * possible for better compile-time type checks.
- *
- * Using an indexed getter:
- * events['mouseover'].add((e) => print("Mouse over!"));
- *
- * Using a getter provided by a subclass:
- * elementEvents.mouseOver.add((e) => print("Mouse over!"));
- */
-class Events {
- /* Raw event target. */
- final EventTarget _ptr;
-
- Events(this._ptr);
-
- EventListenerList operator [](String type) {
- return new EventListenerList(_ptr, type);
- }
-}
-
-/**
- * Supports adding, removing, and dispatching events for a specific event type.
- */
-class EventListenerList {
-
- final EventTarget _ptr;
- final String _type;
-
- EventListenerList(this._ptr, this._type);
-
- // TODO(jacobr): implement equals.
-
- EventListenerList add(EventListener listener,
- [bool useCapture = false]) {
- _add(listener, useCapture);
- return this;
- }
-
- EventListenerList remove(EventListener listener,
- [bool useCapture = false]) {
- _remove(listener, useCapture);
- return this;
- }
-
- bool dispatch(Event evt) {
- return _ptr.$dom_dispatchEvent(evt);
- }
-
- void _add(EventListener listener, bool useCapture) {
- _ptr.$dom_addEventListener(_type, listener, useCapture);
- }
-
- void _remove(EventListener listener, bool useCapture) {
- _ptr.$dom_removeEventListener(_type, listener, useCapture);
- }
-}
-
-/// @domName $DOMNAME
-/**
- * Base class for all browser objects that support events.
- *
- * Use the [on] property to add, remove, and dispatch events (rather than
- * [$dom_addEventListener], [$dom_dispatchEvent], and
- * [$dom_removeEventListener]) for compile-time type checks and a more concise
- * API.
- */
-class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
-
- /** @domName EventTarget.addEventListener, EventTarget.removeEventListener, EventTarget.dispatchEvent */
- Events get on => new Events(this);
-$!MEMBERS
-}

Powered by Google App Engine
This is Rietveld 408576698