};
Size textArea( 100.f, 50.f );
- Size layoutSize( 100.f, 60.f );
+ Size layoutSize( 100.f, 40.f );
LayoutTextData data =
{
};
Size textArea( 100.f, 50.f );
- Size layoutSize( 100.f, 60.f );
+ Size layoutSize( 100.f, 40.f );
LayoutTextData data =
{
END_TEST;
}
+int UtcDaliTextLayoutEllipsis05(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliTextLayoutEllipsis05");
+
+ const std::string fontLatin( "TizenSans" );
+
+ // Set a known font description
+ FontDescriptionRun fontDescriptionRun01;
+ fontDescriptionRun01.characterRun.characterIndex = 0u;
+ fontDescriptionRun01.characterRun.numberOfCharacters = 51u;
+ fontDescriptionRun01.familyLength = fontLatin.size();
+ fontDescriptionRun01.familyName = new char[fontDescriptionRun01.familyLength];
+ memcpy( fontDescriptionRun01.familyName, fontLatin.c_str(), fontDescriptionRun01.familyLength );
+ fontDescriptionRun01.familyDefined = true;
+ fontDescriptionRun01.weightDefined = false;
+ fontDescriptionRun01.widthDefined = false;
+ fontDescriptionRun01.slantDefined = false;
+ fontDescriptionRun01.sizeDefined = false;
+
+ Vector<FontDescriptionRun> fontDescriptionRuns;
+ fontDescriptionRuns.PushBack( fontDescriptionRun01 );
+
+ struct LineRun line01 =
+ {
+ { 0u, 11u },
+ { 0u, 11u },
+ 80.f,
+ 15.f,
+ -5.f,
+ 0.f,
+ 0.f,
+ false,
+ true
+ };
+ Vector<LineRun> lines;
+ lines.PushBack( line01 );
+
+ float positions[] =
+ {
+ 1.f, -12.f
+ };
+
+ Size textArea( 100.f, 19.f );
+ Size layoutSize( 100.f, 20.f );
+
+ LayoutTextData data =
+ {
+ "Not enough height.",
+ "Hello world",
+ textArea,
+ 1u,
+ fontDescriptionRuns.Begin(),
+ layoutSize,
+ 1u,
+ positions,
+ 1u,
+ lines.Begin(),
+ LayoutEngine::MULTI_LINE_BOX,
+ 0u,
+ 11u,
+ true,
+ true
+ };
+
+ if( !LayoutTextTest( data ) )
+ {
+ tet_result(TET_FAIL);
+ }
+
+ tet_result(TET_PASS);
+ END_TEST;
+}
+
int UtcDaliTextReorderLayout01(void)
{
ToolkitTestApplication application;
END_TEST;
}
+
+int UtcDaliToolkitTextlabelEllipsis(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliToolkitTextlabelEllipsis");
+
+ TextLabel label = TextLabel::New("Hello world");
+ DALI_TEST_CHECK( label );
+
+ // Avoid a crash when core load gl resources.
+ application.GetGlAbstraction().SetCheckFramebufferStatusResult( GL_FRAMEBUFFER_COMPLETE );
+
+ Stage::GetCurrent().Add( label );
+
+ // Turn on all the effects
+ label.SetAnchorPoint( AnchorPoint::CENTER );
+ label.SetParentOrigin( ParentOrigin::CENTER );
+ label.SetSize( 360.0f, 10.f );
+
+ try
+ {
+ // Render the text.
+ application.SendNotification();
+ application.Render();
+ }
+ catch( ... )
+ {
+ tet_result(TET_FAIL);
+ }
+
+ END_TEST;
+}
lineRun->ellipsis = true;
layoutSize.width = layoutParameters.boundingBox.width;
- layoutSize.height += ( lineRun->ascender + -lineRun->descender );
+ if( layoutSize.height < Math::MACHINE_EPSILON_1000 )
+ {
+ layoutSize.height += ( lineRun->ascender + -lineRun->descender );
+ }
SetGlyphPositions( layoutParameters.glyphsBuffer + lineRun->glyphRun.glyphIndex,
ellipsisLayout.numberOfGlyphs,
if( lastLine.ellipsis )
{
+ if( ( 1u == numberOfLines ) &&
+ ( lastLine.ascender - lastLine.descender > mImpl->mVisualModel->mControlSize.height ) )
+ {
+ // Get the first glyph which is going to be replaced and the ellipsis glyph.
+ GlyphInfo& glyphInfo = *glyphs;
+ const GlyphInfo& ellipsisGlyph = mImpl->mFontClient.GetEllipsisGlyph( mImpl->mFontClient.GetPointSize( glyphInfo.fontId ) );
+
+ // Change the 'x' and 'y' position of the ellipsis glyph.
+ Vector2& position = *glyphPositions;
+ position.x = ellipsisGlyph.xBearing;
+ position.y = mImpl->mVisualModel->mControlSize.height - ellipsisGlyph.yBearing;
+
+ // Replace the glyph by the ellipsis glyph.
+ glyphInfo = ellipsisGlyph;
+
+ return 1u;
+ }
+
// firstPenX, penY and firstPenSet are used to position the ellipsis glyph if needed.
float firstPenX = 0.f; // Used if rtl text is elided.
float penY = 0.f;
%ignore *::Button::SetTogglableButton(bool);
%ignore *::Button::SetUnselectedImage(const std::string &);
-%rename(ControlImpl) Dali::Toolkit::Internal::Control;
+%rename(View) Dali::Toolkit::Control;
+%rename(ViewImpl) Dali::Toolkit::Internal::Control;
%rename(VisualBase) Dali::Toolkit::Visual::Base;
%rename(ControlOrientationType) Dali::Toolkit::ControlOrientation::Type;
%rename(DefaultItemLayoutType) Dali::Toolkit::DefaultItemLayout::Type;
%rename(COLOR_VISUAL_MIX_COLOR) Dali::Toolkit::Color::Visual::Property::MIX_COLOR;
%csconstvalue("PropertyRanges.PROPERTY_REGISTRATION_START_INDEX") PROPERTY_START_INDEX;
-%csconstvalue("Control.PropertyRange.PROPERTY_START_INDEX+1000") PROPERTY_END_INDEX;
+%csconstvalue("View.PropertyRange.PROPERTY_START_INDEX+1000") PROPERTY_END_INDEX;
%csconstvalue("PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX") CHILD_PROPERTY_START_INDEX;
%csconstvalue("PropertyRanges.CHILD_PROPERTY_REGISTRATION_START_INDEX+1000") CHILD_PROPERTY_END_INDEX;
%csconstvalue("PropertyRanges.ANIMATABLE_PROPERTY_REGISTRATION_START_INDEX") ANIMATABLE_PROPERTY_START_INDEX;
{
return (IntPtr)swigCPtr;
}
- %}
- %enddef
+ public Actor Parent
+ {
+ get
+ {
+ Actor parent = GetParent();
+ return parent;
+ }
+ }
+
+ public bool Vibility
+ {
+ get
+ {
+ bool visibility = IsVisible();
+ return visibility;
+ }
+ }
+
+ public float Opacity
+ {
+ set
+ {
+ SetOpacity(value);
+ }
+ }
+
+ public float CurrentOpacity
+ {
+ get
+ {
+ float ret = GetCurrentOpacity();
+ return ret;
+ }
+ }
+
+ public bool StateFocusEnable
+ {
+ set
+ {
+ SetKeyboardFocusable(value);
+ }
+ get
+ {
+ bool focusable = IsKeyboardFocusable();
+ return focusable;
+ }
+ }
+
+%}
+
+%enddef
%define DALI_ACTOR_EVENTHANDLER_PARAM( NameSpace, ClassName)
- ACTOR_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName);
- ACTOR_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName);
+ACTOR_EVENTHANDLER_TYPEMAP_EVENTARG( NameSpace, ClassName);
+ACTOR_EVENTHANDLER_TYPEMAP_HELPER( NameSpace, ClassName);
- %enddef
+%enddef
- namespace Dali
+namespace Dali
{
DALI_ACTOR_EVENTHANDLER_PARAM( Dali, Actor);
}
*/
%define Animation_EVENTHANDLER_TYPEMAP_EVENTARG(NameSpace, ClassName)
- %typemap(csimports) NameSpace::ClassName %{
- using System;
- using System.Runtime.InteropServices;
+%typemap(csimports) NameSpace::ClassName %{
+using System;
+using System.Runtime.InteropServices;
+%}
- %}
- %enddef
+%enddef
%define Animation_EVENTHANDLER_TYPEMAP_HELPER(NameSpace, ClassName)
%typemap(cscode) NameSpace::ClassName %{
-
/**
* @brief Event arguments that passed via Finished signal
*
}
- public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) {
- ClassName ret = new ClassName(cPtr, false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) {
+ ClassName ret = new ClassName(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+
+ public float Duration
+ {
+ set
+ {
+ SetDuration(value);
+ }
+ get
+ {
+ float ret = GetDuration();
+ return ret;
+ }
+ }
+
+ public AlphaFunction DefaultAlphaFunction
+ {
+ set
+ {
+ SetDefaultAlphaFunction(value);
+ }
+ get
+ {
+ AlphaFunction ret = GetDefaultAlphaFunction();
+ return ret;
+ }
+ }
+
+ public Animation.State Status
+ {
+ get
+ {
+ Animation.State ret = GetState();
+ return ret;
}
+ }
- %}
+%}
- %enddef
+%enddef
%define DALI_animation_EVENTHANDLER_PARAM( NameSpace, ClassName)
*/
public class KeyInputFocusGainedEventArgs : EventArgs
{
- private Control _control;
+ private View _view;
/**
- * @brief Control - is the control that gets Key Input Focus
+ * @brief View - is the view that gets Key Input Focus
*
*/
- public Control Control
+ public View View
{
get
{
- return _control;
+ return _view;
}
set
{
- _control = value;
+ _view = value;
}
}
}
*/
public class KeyInputFocusLostEventArgs : EventArgs
{
- private Control _control;
+ private View _view;
/**
- * @brief Control - is the control that loses Key Input Focus
+ * @brief View - is the view that loses Key Input Focus
*
*/
- public Control Control
+ public View View
{
get
{
- return _control;
+ return _view;
}
set
{
- _control = value;
+ _view = value;
}
}
}
*/
public class KeyEventArgs : EventArgs
{
- private Control _control;
+ private View _view;
private KeyEvent _keyEvent;
/**
- * @brief Control - is the control that recieves the keyevent.
+ * @brief View - is the view that recieves the keyevent.
*
*/
- public Control Control
+ public View View
{
get
{
- return _control;
+ return _view;
}
set
{
- _control = value;
+ _view = value;
}
}
/**
- * @brief KeyEvent - is the keyevent sent to the Control.
+ * @brief KeyEvent - is the keyevent sent to the View.
*
*/
public KeyEvent KeyEvent
public delegate bool KeyEventHandler(object source, KeyEventArgs e);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void KeyInputFocusGainedCallbackDelegate(IntPtr control);
+ private delegate void KeyInputFocusGainedCallbackDelegate(IntPtr view);
private KeyInputFocusGainedEventHandler _KeyInputFocusGainedEventHandler;
private KeyInputFocusGainedCallbackDelegate _KeyInputFocusGainedCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void KeyInputFocusLostCallbackDelegate(IntPtr control);
+ private delegate void KeyInputFocusLostCallbackDelegate(IntPtr view);
private KeyInputFocusLostEventHandler _KeyInputFocusLostEventHandler;
private KeyInputFocusLostCallbackDelegate _KeyInputFocusLostCallbackDelegate;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate bool KeyCallbackDelegate(IntPtr control, IntPtr keyEvent);
+ private delegate bool KeyCallbackDelegate(IntPtr view, IntPtr keyEvent);
private KeyEventHandler _KeyEventHandler;
private KeyCallbackDelegate _KeyCallbackDelegate;
/**
* @brief Event for KeyInputFocusGained signal which can be used to subscribe/unsubscribe the event handler
* (in the type of KeyInputFocusGainedEventHandler) provided by the user.
- * KeyInputFocusGained signal is emitted when the control gets Key Input Focus.
+ * KeyInputFocusGained signal is emitted when the view gets Key Input Focus.
*/
public event KeyInputFocusGainedEventHandler KeyInputFocusGained
{
}
}
- private void OnKeyInputFocusGained(IntPtr control)
+ private void OnKeyInputFocusGained(IntPtr view)
{
KeyInputFocusGainedEventArgs e = new KeyInputFocusGainedEventArgs();
// Populate all members of "e" (KeyInputFocusGainedEventArgs) with real data
- e.Control = Dali.Control.GetControlFromPtr(control);
+ e.View = Dali.View.GetViewFromPtr(view);
if (_KeyInputFocusGainedEventHandler != null)
{
/**
* @brief Event for KeyInputFocusLost signal which can be used to subscribe/unsubscribe the event handler
* (in the type of KeyInputFocusLostEventHandler) provided by the user.
- * KeyInputFocusLost signal is emitted when the control loses Key Input Focus.
+ * KeyInputFocusLost signal is emitted when the view loses Key Input Focus.
*/
public event KeyInputFocusLostEventHandler KeyInputFocusLost
{
}
}
- private void OnKeyInputFocusLost(IntPtr control)
+ private void OnKeyInputFocusLost(IntPtr view)
{
KeyInputFocusLostEventArgs e = new KeyInputFocusLostEventArgs();
// Populate all members of "e" (KeyInputFocusLostEventArgs) with real data
- e.Control = Dali.Control.GetControlFromPtr(control);
+ e.View = Dali.View.GetViewFromPtr(view);
if (_KeyInputFocusLostEventHandler != null)
{
}
}
- private bool OnKeyEvent(IntPtr control, IntPtr keyEvent)
+ private bool OnKeyEvent(IntPtr view, IntPtr keyEvent)
{
KeyEventArgs e = new KeyEventArgs();
// Populate all members of "e" (KeyEventArgs) with real data
- e.Control = Dali.Control.GetControlFromPtr(control);
- e.KeyEvent = Dali.KeyEvent.GetKeyEventFromPtr(keyEvent);
+ e.View = Dali.View.GetViewFromPtr(view);
+ e.KeyEvent = Dali.KeyEvent.GetKeyEventFromPtr(keyEvent);
if (_KeyEventHandler != null)
{
}
- public static ClassName Get ## ClassName ## FromPtr(global::System.IntPtr cPtr) {
- ClassName ret = new ClassName(cPtr, false);
+ public static View GetViewFromPtr(global::System.IntPtr cPtr) {
+ View ret = new View(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
}
+ public Vector2 Size
+ {
+ get
+ {
+ Vector2 ret = GetSize();
+ return ret;
+ }
+ }
+
+ public Vector4 BackgroundColor
+ {
+ set
+ {
+ SetBackgroundColor(value);
+ }
+ get
+ {
+ Vector4 ret = GetBackgroundColor();
+ return ret;
+ }
+ }
+
%}
%enddef
Console.WriteLine("Actor name: " + actor.Name);
Stage stage = Stage.GetCurrent();
- stage.SetBackgroundColor( NDalic.WHITE );
+ stage.BackgroundColor = NDalic.WHITE ;
- Vector2 stageSize = stage.GetSize();
+ Vector2 stageSize = stage.Size;
Console.WriteLine("Stage size: " + stageSize.x + ", " + stageSize.y);
stage.Add(actor);
{
Console.WriteLine("Customized Application Initialize event handler");
Stage stage = Stage.GetCurrent();
- stage.SetBackgroundColor( NDalic.WHITE );
+ stage.BackgroundColor = NDalic.WHITE;
stage.Touched += new Dali.Stage.TouchEventHandler(OnStageTouched);
public void AnimationFinished(object source, Animation.FinishedEventArgs e)
{
Console.WriteLine("Customized Animation Finished Event handler");
- Console.WriteLine("Animation finished: duration = " + e.Animation.GetDuration());
+ Console.WriteLine("Animation finished: duration = " + e.Animation.Duration);
}
// Callback for stage touched signal handling
private void CreateScrollView()
{
Stage stage = Stage.GetCurrent();
- stage.SetBackgroundColor(NDalic.WHITE);
+ stage.BackgroundColor = NDalic.WHITE;
// Create a scroll view
_scrollView = new ScrollView();
- Vector2 stageSize = stage.GetSize();
+ Vector2 stageSize = stage.Size;
_scrollView.Size = new Vector3(stageSize.x, stageSize.y, 0.0f);
_scrollView.ParentOrigin = NDalic.ParentOriginCenter;
_scrollView.AnchorPoint = NDalic.AnchorPointCenter;
{
for(int pageColumn = 0; pageColumn < pageColumns; pageColumn++)
{
- Control pageActor = new Control();
+ View pageActor = new View();
pageActor.SetResizePolicy(ResizePolicyType.FILL_TO_PARENT, DimensionType.ALL_DIMENSIONS);
pageActor.ParentOrigin = NDalic.ParentOriginCenter;
pageActor.AnchorPoint = NDalic.AnchorPointCenter;
_scrollView.Add(_scrollBar);
// Connect to the OnRelayout signal
- _scrollView.OnRelayoutEvent += new Dali.Actor.OnRelayoutEventHandler(OnScrollViewRelayout);
+ _scrollView.OnRelayoutEvent += new Dali.View.OnRelayoutEventHandler(OnScrollViewRelayout);
}
- private void OnScrollViewRelayout(object source, Actor.OnRelayoutEventArgs e)
+ private void OnScrollViewRelayout(object source, View.OnRelayoutEventArgs e)
{
// Set the correct scroll bar size after size negotiation of scroll view is done
_scrollBar.Size = new Vector3(0.0f, _scrollView.GetRelayoutSize(DimensionType.WIDTH), 0.0f);
{
private Actor _current;
private Actor _proposed;
- private Control.KeyboardFocus.Direction _direction;
+ private View.KeyboardFocus.Direction _direction;
/**
* @brief Actor - is the current focused Actor.
* @brief Direction - is the direction of Focus change.
*
*/
- public Control.KeyboardFocus.Direction Direction
+ public View.KeyboardFocus.Direction Direction
{
get
{
public delegate Actor PreFocusChangeEventHandler(object source, PreFocusChangeEventArgs e);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
- public delegate IntPtr PreFocusChangeEventCallbackDelegate(IntPtr current, IntPtr proposed, Control.KeyboardFocus.Direction direction);
+ public delegate IntPtr PreFocusChangeEventCallbackDelegate(IntPtr current, IntPtr proposed, View.KeyboardFocus.Direction direction);
private PreFocusChangeEventHandler _keyboardFocusManagerPreFocusChangeEventHandler;
private PreFocusChangeEventCallbackDelegate _keyboardFocusManagerPreFocusChangeEventCallbackDelegate;
}
// Callback for KeyboardFocusManager PreFocusChangeSignal
- private IntPtr OnPreFocusChange(IntPtr current, IntPtr proposed, Control.KeyboardFocus.Direction direction)
+ private IntPtr OnPreFocusChange(IntPtr current, IntPtr proposed, View.KeyboardFocus.Direction direction)
{
Actor actor = null;
PreFocusChangeEventArgs e = new PreFocusChangeEventArgs();
return ret;
}
- public bool MoveFocus(Control.KeyboardFocus.Direction direction) {
+ public bool MoveFocus(View.KeyboardFocus.Direction direction) {
bool ret = NDalicManualPINVOKE.KeyboardFocusManager_MoveFocus(swigCPtr, (int)direction);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
namespace Dali {
-public delegate IntPtr SwigDelegateKeyboardPreFocusChangeSignal(IntPtr current, IntPtr proposed, Control.KeyboardFocus.Direction direction);
+public delegate IntPtr SwigDelegateKeyboardPreFocusChangeSignal(IntPtr current, IntPtr proposed, View.KeyboardFocus.Direction direction);
public class KeyboardPreFocusChangeSignal : global::System.IDisposable {
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
}
}
- public Actor Emit(Actor arg1, Actor arg2, Control.KeyboardFocus.Direction arg3) {
+ public Actor Emit(Actor arg1, Actor arg2, View.KeyboardFocus.Direction arg3) {
Actor ret = new Actor(NDalicManualPINVOKE.KeyboardPreFocusChangeSignal_Emit(swigCPtr, Actor.getCPtr(arg1), Actor.getCPtr(arg2), (int)arg3), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;