On Wed, Jul 14, 2010 at 1:47 AM, Max Carlson <[email protected]> wrote:
Not approved.
Issues:
kernel/swf9/LzTextSprite has a Debug.info() call in setTextfieldCursor().
Does this matter?
no that was just for debugging, Ill take it out
Also, you're now setting .htmltext instead of .text - do you need to change
that?
I need to do this for the TLF text field, something is broken, when setting
just plain text
the getLineMetrics call fails immediately after. I'll conditionalize that to
just use htmltext for LzTLFTextField
for now.
kernel/swf9/LzTextSprite is missing this block in __initTextProperties():
if (this.enabled) {
textfield.type = TextFieldType.INPUT;
} else {
textfield.type = TextFieldType.DYNAMIC;
}
The textfield.type property should already be getting set at some point by
LzInputTextSprite.setEnabled, which should be getting set by LzInputText's
setter for 'enabled'.
Does kernel/swf9/LFCApplication.as really need the passthrough?
looks like it doesn't, I removed that.
LzText.useTLF should be marked as private/protected, and a @private doc
comment should probably be added to keep it from showing up in the docs.
We need some way to let the user specify which flavor of textfield to use. If I
make it private, it won't be
allowed in the schema so you can't say <text useTLF="true"/>. I'd like to leave
that in for debugging for now, until we can
figure out how we really want to enable this feature.
LzInputtext.updateLineAttribute() now comments out the line attribute
assertions. Can you add a note to put them back in?
I'll uncomment that again
Comments:
It seems like you need to add a new capability (TLF) to LzSprite across all
runtimes (directional_layout) so the LzText.direction setter can warn and avoid
calling the sprite for unsupported runtimes. See the LaszloView.rotation
setter for an example of what I mean.
OK I added a capability
Change 20100712-hqm-f by [email protected] on 2010-07-12 12:35:07 EDT
in /Users/hqm/openlaszlo/trunktlf
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: add support for bidirectional text
New Features:
Bugs Fixed: LPP-9179
Technical Reviewer: max
QA Reviewer: ptw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Overview:
A new class LzTLFTextField is added which is compatible with the
native flash.text.TextField implementation.
A flag in LzTextSprite, useTLF, says whether the instance should use
the new TextField implementation or the old native text class.
Details:
LzTLFTextField.as:
+ Implements a TextField compatible class
+ There are some TextField methods which LzTextSprite and
LzInputTextSprite need that are not yet implemented, such as the
scrolling APIs. These were largely working in the LzTLFTextSprite
implementation, and need to be ported over.
+ This implementation contains code which is supposed to optimize the
common case of simple non-HTML, non-selectable text, by bypassing the
TextFlow and HTML importer mechanism.
Currently however all LzText is using the htmlText feature, so all
text views using this will be calling the HTML import and TextFlow
layout routines. I'm leaving the 'optimized' code paths in for now so
that if we run into any efficiency issues we may want to try using it.
+ The LzTLFTextField has a model of 'invalidate and deferred render',
where if you change some attributes, it doesn't re-layout, but sets a
flag to re-render when the next frame updates. I have a flag to bypass
that and render immediately, because the implementation in
__initTextProperties and __setFormat in LzTextSprite expect to be able
to set and then measure text immediately. At initialization,
LzTextSprite sets the flag to render immediately, and after
__initTextProperties runs it sets it to deferred rendering.
LzText, LzTextSprite.as: created a flag named "useTLF" which says
whether to instantiate a new LzTLFTextField or the old
flash.text.TextField. It defaults to false, for back compatibility,
but text that needs bidirectional functionality can set this to true.
The classes LzTLFTextSprite and LzTLFInputTextSprite are not going to
be used any longer, but the implementation of scrolling from them
still needs to be copied over into LzTLFTextField, so I am leaving
them in the tree for now.
LzTLFSelectionManager.as, LzTLFEditManager.as: now have pointers to
the instance of LzTLFTextField, to allow needed control of some
mouse/cursor behavior
================
LzDebug.lzs, LzBootstrapDebugService.lzs: [not specific to bidi text
feature, but moved some things around so that the flash debugger
doesn't get errors when the app is just starting up, due to the lzx
Debugger not being fully initialized]
+ use LzBrowserKernel.getInitArg('logdebug')) instead of globalValue
+ moved the initialization of Debug.log_all_writes into LFCApplication, so that
the debugger is initialized enough to not get an error
Tests:
test/tlf/text-test.lzx
Files:
A test/tlf/text-test.lzx
M WEB-INF/lps/lfc/kernel/swf/LzSprite.as
M WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
M WEB-INF/lps/lfc/kernel/swf9/LzTLFTextSprite.as
M WEB-INF/lps/lfc/kernel/swf9/LzTLFSelectionManager.as
M WEB-INF/lps/lfc/kernel/swf9/LzTLFEditManager.as
M WEB-INF/lps/lfc/kernel/swf9/LzInputTextSprite.as
A WEB-INF/lps/lfc/kernel/swf9/LzTLFTextFieldStyleResolver.as
A WEB-INF/lps/lfc/kernel/swf9/LzTLFTextFieldHostFormat.as
M WEB-INF/lps/lfc/kernel/swf9/LzSprite.as
M WEB-INF/lps/lfc/kernel/swf9/LzTextSprite.as
M WEB-INF/lps/lfc/kernel/swf9/LFCApplication.as
M WEB-INF/lps/lfc/kernel/swf9/LzTextContainerManager.as
A WEB-INF/lps/lfc/kernel/swf9/LzTLFTextField.as
M WEB-INF/lps/lfc/kernel/swf9/LzTLFInputTextSprite.as
M WEB-INF/lps/lfc/kernel/swf9/Library.lzs
M WEB-INF/lps/lfc/debugger/LzDebug.lzs
M WEB-INF/lps/lfc/views/LzInputText.lzs
M WEB-INF/lps/lfc/views/LzText.lzs
M WEB-INF/lps/lfc/views/Library.lzs
M WEB-INF/lps/lfc/compiler/LzBootstrapDebugService.lzs
M WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100712-hqm-f.tar