VisibilityChangeTest();
ResourceReadyTest();
+
+ ViewFocusTest();
+
WindowDevelPropertyTest();
Animatable handle = new Animatable();
Window.Instance.Add(image);
}
+ public void ViewFocusTest()
+ {
+ View view1 = new View();
+ view1.BackgroundColor = Color.Red;
+ view1.Size2D = new Size2D(80, 50);
+ view1.ParentOrigin = ParentOrigin.CenterLeft;
+ view1.PivotPoint = PivotPoint.CenterLeft;
+ view1.Position = new Position(10.0f, 50.0f, 0.0f);
+ view1.Focusable = true;
+ View view2 = new View();
+ view2.BackgroundColor = Color.Cyan;
+ view2.Size2D = new Size2D(80, 50);
+ view2.ParentOrigin = ParentOrigin.CenterLeft;
+ view2.PivotPoint = PivotPoint.CenterLeft;
+ view2.Position = new Position(100.0f, 50.0f, 0.0f);
+ view2.Focusable = true;
+ view1.RightFocusableView = view2;
+ view2.LeftFocusableView = view1;
+ Window.Add(view1);
+ Window.Add(view2);
+ FocusManager.Instance.SetCurrentFocusView(view1);
+
+ PushButton button = new PushButton();
+ button.LabelText = "Focus Back";
+ button.Size2D = new Size2D(150, 50);
+ button.ParentOrigin = ParentOrigin.CenterLeft;
+ button.PivotPoint = PivotPoint.CenterLeft;
+ button.Position = new Position(190.0f, 50.0f, 0.0f);
+
+ button.Focusable = true;
+ view2.RightFocusableView = button;
+
+ button.Pressed += (obj, e) =>
+ {
+ FocusManager.Instance.MoveFocusBackward();
+ return true;
+ };
+ Window.Add(button);
+ }
+
public void WindowDevelPropertyTest()
{
Window window = Window.Instance;
window.BackgroundColor = Color.White;
window.Touched += OnWindowTouched;
window.KeyPressed += OnWindowKeyEvent;
+ window.Resized += (obj, e) =>
+ {
+ Tizen.Log.Debug("NUI", "Height: " + e.Height);
+ Tizen.Log.Debug("NUI", "Width: " + e.Width);
+ };
TextLabel pixelLabel = new TextLabel("Test Pixel Size 32.0f");
pixelLabel.Position2D = new Position2D(10, 10);
<Compile Include="src\internal\RenderTask.cs" />\r
<Compile Include="src\internal\RenderTaskList.cs" />\r
<Compile Include="src\internal\RenderTaskSignal.cs" />\r
+ <Compile Include="src\internal\ResizedSignal.cs" />\r
<Compile Include="src\internal\ResourceImage.cs" />\r
<Compile Include="src\internal\ResourceImageSignal.cs" />\r
<Compile Include="src\internal\Ruler.cs" />\r
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_KeyboardFocusManager_GetFocusIndicatorActor")]
public static extern global::System.IntPtr FocusManager_GetFocusIndicatorActor(global::System.Runtime.InteropServices.HandleRef jarg1);
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_KeyboardFocusManager_MoveFocusBackward")]
+ public static extern void FocusManager_MoveFocusBackward(global::System.Runtime.InteropServices.HandleRef jarg1);
+
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_KeyboardFocusManager_PreFocusChangeSignal")]
public static extern global::System.IntPtr FocusManager_PreFocusChangeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_ScrollStateChangedSignal")]
public static extern void delete_ScrollStateChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+ // For windows resized signal
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Window_ResizedSignal")]
+ public static extern global::System.IntPtr Window_ResizedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ResizedSignal_Empty")]
+ public static extern bool ResizedSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ResizedSignal_GetConnectionCount")]
+ public static extern uint ResizedSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ResizedSignal_Connect")]
+ public static extern void ResizedSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ResizedSignal_Disconnect")]
+ public static extern void ResizedSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ResizedSignal_Emit")]
+ public static extern void ResizedSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_ResizedSignal")]
+ public static extern global::System.IntPtr new_ResizedSignal();
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_ResizedSignal")]
+ public static extern void delete_ResizedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
}
}
--- /dev/null
+//------------------------------------------------------------------------------
+// <auto-generated />
+//
+// This file was automatically generated by SWIG (http://www.swig.org).
+// Version 3.0.12
+//
+// Do not make changes to this file unless you know what you are doing--modify
+// the SWIG interface file instead.
+//------------------------------------------------------------------------------
+
+namespace Tizen.NUI
+{
+
+ internal class ResizedSignal : global::System.IDisposable
+ {
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+ protected bool swigCMemOwn;
+
+ internal ResizedSignal(global::System.IntPtr cPtr, bool cMemoryOwn)
+ {
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ }
+
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ResizedSignal obj)
+ {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ //A Flag to check who called Dispose(). (By User or DisposeQueue)
+ private bool isDisposeQueued = false;
+ //A Flat to check if it is already disposed.
+ protected bool disposed = false;
+
+ ~ResizedSignal()
+ {
+ if (!isDisposeQueued)
+ {
+ isDisposeQueued = true;
+ DisposeQueue.Instance.Add(this);
+ }
+ }
+
+ public void Dispose()
+ {
+ //Throw excpetion if Dispose() is called in separate thread.
+ if (!Window.IsInstalled())
+ {
+ throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+ }
+
+ if (isDisposeQueued)
+ {
+ Dispose(DisposeTypes.Implicit);
+ }
+ else
+ {
+ Dispose(DisposeTypes.Explicit);
+ System.GC.SuppressFinalize(this);
+ }
+ }
+
+ protected virtual void Dispose(DisposeTypes type)
+ {
+ if (disposed)
+ {
+ return;
+ }
+
+ if (type == DisposeTypes.Explicit)
+ {
+ //Called by User
+ //Release your own managed resources here.
+ //You should release all of your own disposable objects here.
+ }
+
+ //Release your own unmanaged resources here.
+ //You should not access any managed member here except static instance.
+ //because the execution order of Finalizes is non-deterministic.
+
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ {
+ if (swigCMemOwn)
+ {
+ swigCMemOwn = false;
+ NDalicManualPINVOKE.delete_ResizedSignal(swigCPtr);
+ }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+
+ disposed = true;
+ }
+
+
+ public bool Empty()
+ {
+ bool ret = NDalicManualPINVOKE.ResizedSignal_Empty(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public uint GetConnectionCount()
+ {
+ uint ret = NDalicManualPINVOKE.ResizedSignal_GetConnectionCount(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public void Connect(System.Delegate func)
+ {
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+ {
+ NDalicManualPINVOKE.ResizedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ public void Disconnect(System.Delegate func)
+ {
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
+ {
+ NDalicManualPINVOKE.ResizedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+
+ public void Emit(int arg1, int arg2)
+ {
+ NDalicManualPINVOKE.ResizedSignal_Emit(swigCPtr, arg1, arg2);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ public ResizedSignal() : this(NDalicManualPINVOKE.new_ResizedSignal(), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ }
+
+}
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ /// <summary>
+ /// Move the focus to prev focused view.
+ /// </summary>
+ public void MoveFocusBackward()
+ {
+ NDalicManualPINVOKE.FocusManager_MoveFocusBackward(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
/// <summary>
/// Sets/Gets the status of whether the focus movement should be looped within the same focus group.<br>
/// The focus movement is not looped by default.<br>
return ret;
}
+ internal ResizedSignal ResizedSignal()
+ {
+ ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(stageCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
internal static Vector4 DEFAULT_BACKGROUND_COLOR
{
get
}
}
+ public class ResizedEventArgs : EventArgs
+ {
+ int _width;
+ int _height;
+
+ public int Width
+ {
+ get
+ {
+ return _width;
+ }
+ set
+ {
+ _width = value;
+ }
+ }
+
+ public int Height
+ {
+ get
+ {
+ return _height;
+ }
+ set
+ {
+ _height = value;
+ }
+ }
+ }
+
+ private WindowResizedEventCallbackType _windowResizedEventCallback;
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void WindowResizedEventCallbackType(int width, int height);
+ private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
+
+ public event EventHandler<ResizedEventArgs> Resized
+ {
+ add
+ {
+ if (_windowResizedEventHandler == null)
+ {
+ _windowResizedEventCallback = OnResized;
+ ResizedSignal().Connect(_windowResizedEventCallback);
+ }
+
+ _windowResizedEventHandler += value;
+ }
+ remove
+ {
+ _windowResizedEventHandler -= value;
+
+ if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null)
+ {
+ ResizedSignal().Disconnect(_windowResizedEventCallback);
+ }
+ }
+ }
+
+ private void OnResized(int width, int height)
+ {
+ ResizedEventArgs e = new ResizedEventArgs();
+ e.Width = width;
+ e.Height = height;
+
+ if (_windowResizedEventHandler != null)
+ {
+ _windowResizedEventHandler(this, e);
+ }
+ }
+
/// <summary>
/// Window size property (read-only).
/// </summary>