-
Notifications
You must be signed in to change notification settings - Fork 256
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NUI] Add InsetsChanged event to Window
Window insets are the inner size between window content and window edge. Window insets are required when status bar, virtual keyboard, or clipboard appears on window to avoid window content obscured by them. To notify the window insets changes, InsetsChanged event is added to Window.
- Loading branch information
1 parent
22faa21
commit 7ce4b08
Showing
3 changed files
with
263 additions
and
1 deletion.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
src/Tizen.NUI/src/internal/Interop/Interop.WindowInsetsChangedSignal.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright(c) 2023 Samsung Electronics Co., Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
using System.Runtime.InteropServices; | ||
|
||
namespace Tizen.NUI | ||
{ | ||
internal static partial class Interop | ||
{ | ||
internal static partial class WindowInsetsChangedSignal | ||
{ | ||
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_InsetsChanged_Signal")] | ||
public static extern global::System.IntPtr GetSignal(HandleRef jarg1); | ||
|
||
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_InsetsChanged_Signal_Empty")] | ||
[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] | ||
public static extern bool Empty(HandleRef jarg1); | ||
|
||
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_InsetsChanged_Signal_GetConnectionCount")] | ||
public static extern uint GetConnectionCount(HandleRef jarg1); | ||
|
||
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_InsetsChanged_Signal_Connect")] | ||
public static extern void Connect(HandleRef jarg1, HandleRef jarg2); | ||
|
||
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_InsetsChanged_Signal_Disconnect")] | ||
public static extern void Disconnect(HandleRef jarg1, HandleRef jarg2); | ||
|
||
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_InsetsChanged_Signal_Emit")] | ||
[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)] | ||
public static extern bool Emit(HandleRef jarg1); | ||
|
||
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_InsetsChanged_Signal_new")] | ||
public static extern global::System.IntPtr NewSignal(); | ||
|
||
[DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_InsetsChanged_Signal_delete")] | ||
public static extern void DeleteSignal(HandleRef jarg1); | ||
} | ||
} | ||
} |
78 changes: 78 additions & 0 deletions
78
src/Tizen.NUI/src/internal/Window/WindowInsetsChangedSignal.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/* | ||
* Copyright(c) 2023 Samsung Electronics Co., Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
namespace Tizen.NUI | ||
{ | ||
internal class WindowInsetsChangedSignal : Disposable | ||
{ | ||
|
||
internal WindowInsetsChangedSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) | ||
{ | ||
} | ||
|
||
protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr) | ||
{ | ||
Interop.WindowInsetsChangedSignal.DeleteSignal(swigCPtr); | ||
} | ||
|
||
public bool Empty() | ||
{ | ||
bool ret = Interop.WindowInsetsChangedSignal.Empty(SwigCPtr); | ||
|
||
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); | ||
return ret; | ||
} | ||
|
||
public uint GetConnectionCount() | ||
{ | ||
uint ret = Interop.WindowInsetsChangedSignal.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<System.Delegate>(func); | ||
{ | ||
Interop.WindowInsetsChangedSignal.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<System.Delegate>(func); | ||
{ | ||
Interop.WindowInsetsChangedSignal.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); | ||
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); | ||
} | ||
} | ||
|
||
public bool Emit() | ||
{ | ||
bool ret = Interop.WindowInsetsChangedSignal.Emit(SwigCPtr); | ||
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); | ||
return ret; | ||
} | ||
|
||
public WindowInsetsChangedSignal(Window window) : this(Interop.WindowInsetsChangedSignal.GetSignal(Window.getCPtr(window)), false) | ||
{ | ||
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters