Add RotationCompletedAcknowledgement APIs in Window.
The APIs are SetNeedsRotationCompletedAcknowledgement and SendRotationCompletedAcknowledgement
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_GetLastTouchEvent")]
public static extern global::System.IntPtr GetLastTouchEvent(global::System.Runtime.InteropServices.HandleRef window);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetNeedsRotationCompletedAcknowledgement")]
+ public static extern void SetNeedsRotationCompletedAcknowledgement(global::System.Runtime.InteropServices.HandleRef window, bool needAcknowledgement);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SendRotationCompletedAcknowledgement")]
+ public static extern void SendRotationCompletedAcknowledgement(global::System.Runtime.InteropServices.HandleRef window);
}
}
}
}
/// <summary>
+ /// Sets the necessary for window rotation Acknowledgement.
+ /// After this function called, SendRotationCompletedAcknowledgement() should be called to complete window rotation.
+ ///
+ /// This function is supprot that application has the window rotation acknowledgement's control.
+ /// It means display server waits when application's rotation work is finished.
+ /// It is useful application has the other rendering engine which works asynchronous.
+ /// For instance, GlView.
+ /// </summary>
+ /// <param name="needAcknowledgement">the flag is true if window rotation acknowledge is sent.</param>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement)
+ {
+ Interop.Window.SetNeedsRotationCompletedAcknowledgement(SwigCPtr, needAcknowledgement);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
+ /// send the Acknowledgement to complete window rotation.
+ /// For this function, SetNeedsRotationCompletedAcknowledgement should be already called with true.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public void SendRotationCompletedAcknowledgement()
+ {
+ Interop.Window.SendRotationCompletedAcknowledgement(SwigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ /// <summary>
/// Add FrameUpdateCallback
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
int addingInput;
Timer tm;
+ bool manualRotation;
+ int rotationCount;
private const string KEY_NUM_1 = "1";
private const string KEY_NUM_2 = "2";
private const string KEY_NUM_3 = "3";
private const string KEY_NUM_4 = "4";
private const string KEY_NUM_5 = "5";
+ private const string KEY_NUM_6 = "6";
+ private const string KEY_NUM_7 = "7";
+ private const string KEY_NUM_8 = "8";
+ private const string KEY_NUM_9 = "9";
+ private const string KEY_NUM_0 = "0";
+
void Initialize()
{
animation.Looping = true;
animation.Play();
+ manualRotation = false;
+ rotationCount = 0;
+
tm = new Timer(100);
tm.Tick += Tm_Tick;
tm.Start();
{
bool rotating = mainWin.IsWindowRotating();
log.Fatal(tag, $"window is Rotating: {rotating}");
+ if(rotating && manualRotation)
+ {
+ rotationCount++;
+ if(rotationCount > 100)
+ {
+ log.Fatal(tag, $"call SendRotationCompletedAcknowledgement");
+ mainWin.SendRotationCompletedAcknowledgement();
+ rotationCount = 0;
+ }
+ }
return true;
}
case KEY_NUM_5:
mainWin.SetMimimumSize(new Size2D(100, 100));
break;
+ case KEY_NUM_6:
+ if(manualRotation == false)
+ {
+ manualRotation = true;
+ log.Fatal(tag, $"Enable manual rotation");
+ }
+ else
+ {
+ manualRotation = false;
+ log.Fatal(tag, $"Disable manual rotation");
+ }
+ mainWin.SetNeedsRotationCompletedAcknowledgement(manualRotation);
+ break;
+ case KEY_NUM_7:
+ mainWin.SetMimimumSize(new Size2D(100, 100));
+ break;
default:
log.Fatal(tag, $"no test!");