Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 32D63200B56 for ; Sat, 30 Jul 2016 21:14:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 31514160A8A; Sat, 30 Jul 2016 19:14:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4E3AA160A63 for ; Sat, 30 Jul 2016 21:14:08 +0200 (CEST) Received: (qmail 90630 invoked by uid 500); 30 Jul 2016 19:14:07 -0000 Mailing-List: contact dev-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list dev@flex.apache.org Received: (qmail 90618 invoked by uid 99); 30 Jul 2016 19:14:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 30 Jul 2016 19:14:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 95FDDC0C09 for ; Sat, 30 Jul 2016 19:14:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.351 X-Spam-Level: *** X-Spam-Status: No, score=3.351 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SBL_CSS=3.558, RCVD_IN_SORBS_WEB=0.614, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id Cm8y8SeaiR3p for ; Sat, 30 Jul 2016 19:14:04 +0000 (UTC) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 5FCFC5F1F5 for ; Sat, 30 Jul 2016 19:14:04 +0000 (UTC) Received: by mail-wm0-f41.google.com with SMTP id q128so325246548wma.1 for ; Sat, 30 Jul 2016 12:14:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=Q/VU8jzOT2Gnz9c4/6ZqPMQRTxuxO2vA951v4cFWIV0=; b=pDs6tOPjnfyO4G+vTHqYqIsX7bX+sLFh4h5s91Lhxwi/mc1k03df14toy5hnVdt7Iz 4K9c+aKzGVlMO7KzEvxawdE6CLfRSHEwKyKaMDfrEoo0u1+wDbhxU/pjylxICyc2kV06 kFiAaN5/Q9VK/GQ6vgMIZssLZOxdfbn5Op0aykdiYuRVH4M0+C7wVe91ZeuOQDKseRyU rOLfsvxGTLGwzy5jpUCBtfaQucl3fxWvIXL8NsTMjct8D1dhKijnVEGxswYxNxnBzTIc GhjQlfEzRaY3S10Rp33rpHlJFixmsemZyws5IkzpQwv2h7qZJf+JJgzqYC0MG8AoK0Yh pX5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=Q/VU8jzOT2Gnz9c4/6ZqPMQRTxuxO2vA951v4cFWIV0=; b=G1//GVibOM1cpJTSxUa5zCj7oZgwfQuo0QtEGjfTp38T++kBLexuyTpTisdf8GtxiE LOfQ51y56I8S0w8GYJuYnH31mmqJgAenyD0VaSqO3AQ3WQXED9cSLRjdiR6vCBUXJiSq vbTaPRjt3W5sbsTiDMkg1miyQfYikSRtiHWoggOGYApY0n0ClYs0aibTLPpAwzOkuvwP xRNNKJcZ9OPjXMV08gD7BbOTNNuWvNylG96F/BcE5Vco1mj7/XBdxsq2MEv3Rovc7cdU 5O/UcOCJaXj+tk1YzeDBfL1fW/sQ2KtMc1wuQ6IXKF/MLKeuZxIpb4+/6HCWKT7Axkf6 cOZQ== X-Gm-Message-State: AEkoouswCF4Z4MlWl1ZNHcleIoM3/fGDkJ/Zpdrvw74gmxNL0meYaXxNcCjaPuzU6bsubg== X-Received: by 10.194.27.133 with SMTP id t5mr43173203wjg.15.1469906043012; Sat, 30 Jul 2016 12:14:03 -0700 (PDT) Received: from [127.0.0.1] ([185.120.126.6]) by smtp.gmail.com with ESMTPSA id gw4sm22406067wjc.45.2016.07.30.12.14.01 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Jul 2016 12:14:02 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: [FlexJS] HTMLElementWrapper extending Sprite From: Harbs In-Reply-To: Date: Sat, 30 Jul 2016 22:13:58 +0300 Content-Transfer-Encoding: quoted-printable Message-Id: References: <57064EB8-471B-4628-B7BF-F27B79D0854E@gmail.com> <247BE937-7474-4ED9-825E-8CFE2CF2282E@gmail.com> <5A405A94-DB41-44C4-B52B-323A384F7018@gmail.com> <96B04748-F78C-42D8-B4C6-CF5D5BE540E9@gmail.com> To: dev@flex.apache.org X-Mailer: Apple Mail (2.1878.6) archived-at: Sat, 30 Jul 2016 19:14:09 -0000 Combining multiple responses: >> Okay. I just implemented WrappedShape, WrappedSimpleButton, = WrappedSprite >> and WrappedTextField. I hope that helps you. >>=20 >> I did not implement a createElement method because I did not see the >> point. On the HTML side there=92s code that=92s specific to a lot of >> different individual elements, but on the Flash side it=92s really = simple. >=20 > Well, on the SWF side there is current CSSShape, UIBase, UIButtonBase, > StyleableCSSTextField, maybe others. With this change, these four = classes > can theoretically be collapsed into one (UIBase) where createElement > creates the Shape, Sprite, Button, TextField, whatever. Then the > lifecycle would be much more similar to the JS-side (or so I think). True. But having separate classes makes accessing the underlying typed = DisplayObject much easier and clearer. You could do this: b.$button.upState =3D upSprite.$sprite; instead of this: (b.$displayObject as SimpleButton).upState =3D upSprite.$displayObject; The number of possible base UI classes is pretty limited on the SWF = side, so I like this way better. Here=92s the full list of potential additional objects as I see it: Bitmap, Video, Loader, TextLine > In order to get Application to wrap the root, I will have to do more > mucking in this area. I may add createElement because it lets us = control > what gets created as the wrapped element is a more common way. = Otherwise > if a subclass wants to create a different element, the superclass will > have unnecessarily created a different element. I=92d like to see a use case before we do this. It seems like it should = be pretty clear which subclasses to start from in Flash (as is currently = being assumed with the sub-classing). > Related thought, so I don't forget: It isn't clear that CSSShape and > CSSTextField which are only used in SWF implementations needed to = become > HTMLElementWrappers. I was wondering about that myself. When I started, I did not notice that = they seem to be SWF-only. But: First of all, CSSTextField is not a SWF-only class. I=92m not sure if = it=92s used anywhere in JS, but I assume it could. It=92s also possible = that CSSShape can get a JS implementation as well. I might actually use = it for the svg primitives. (not sure yet) Even if not, it seems like it makes sense to keep the same pattern. > So now, I'm pondering a couple of deeper refactors. One is something = like: > -create a ElementWrapper class. It has an element property. > -create a UIElementWrapper class. It subclasses WrappedElement and = adds > parent, x, y, width, height, visible, alpha that proxy to the element. > -rename HTMLElementWrapper to FlexJSElementWrapper. It would add the > strand implementation. > -CSSShape and friends subclass UIElementWrapper > -HTTPService subclasses ElementWrapper > -UIBase and Application subclass FlexJSElementWrapper I assume the ElementWrapper has the Bead related code that HTTPService = seems to be implementing on the SWF side. I like this option. It seems clean and makes sense to me. UIElementWrapper would have element for cross-platform use. UIElementWrapper would have $displayObject for Flash-only use. CSSSprite and friends would have the $sprite and friends for easy typed = access to the Flash objects. The only thing I=92m not clear on is where the Flesh objects get = instantiated. I guess that could be in the UIBase constructor, or in a = createElement function (if necessary). I=92m also not clear on why to have both UIElementWrapper and = FlexJSElementWrapper. Why would you not always want the strand = implementation? Harbs=