--- /dev/null
+/*
+ * Copyright(c) 2021 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 static partial class Interop
+ {
+ internal static partial class WindowAuxiliaryMessageSignalType
+ {
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_Auxiliary_Message_Signal_Empty")]
+ [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
+ public static extern bool Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_Auxiliary_Message_Signal_GetConnectionCount")]
+ public static extern uint GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_Auxiliary_Message_Signal_Connect")]
+ public static extern void Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_Auxiliary_Message_Signal_Disconnect")]
+ public static extern void Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_Auxiliary_Message_Signal")]
+ public static extern global::System.IntPtr Get(global::System.Runtime.InteropServices.HandleRef window);
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright(c) 2021 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 WindowAuxiliaryMessageSignal : Disposable
+ {
+ internal WindowAuxiliaryMessageSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+ {
+ }
+
+ public WindowAuxiliaryMessageSignal(Window window) : this(Interop.WindowAuxiliaryMessageSignalType.Get(Window.getCPtr(window)), false)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ public bool Empty()
+ {
+ bool ret = Interop.WindowAuxiliaryMessageSignalType.Empty(SwigCPtr);
+
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ public uint GetConnectionCount()
+ {
+ uint ret = Interop.WindowAuxiliaryMessageSignalType.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.WindowAuxiliaryMessageSignalType.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.WindowAuxiliaryMessageSignalType.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright(c) 2021 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;
+using System.ComponentModel;
+using System.Collections.Generic;
+
+namespace Tizen.NUI
+{
+ /// <summary>
+ /// Auxiliary Message Event arguments
+ /// This has the three members as key, value and options.
+ /// Options has the list of string
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public class AuxiliaryMessageEventArgs : EventArgs
+ {
+ private string key;
+ private string val;
+ private List<string> options;
+
+ public string Key
+ {
+ get => key;
+ internal set => key = value;
+ }
+
+ public string Value
+ {
+ get => val;
+ internal set => val = value;
+ }
+
+ public List<string> Options
+ {
+ get => options;
+ internal set => options = value;
+ }
+ }
+}
using System.ComponentModel;
using System.Runtime.InteropServices;
using Tizen.NUI.BaseComponents;
+using System.Collections.Generic;
namespace Tizen.NUI
{
private WindowTransitionEffectSignal transitionEffectSignal;
private KeyboardRepeatSettingsChangedEventCallbackType keyboardRepeatSettingsChangedEventCallback;
private KeyboardRepeatSettingsChangedSignal keyboardRepeatSettingsChangedSignal;
+ private AuxiliaryMessageEventCallbackType auxiliaryMessageEventCallback;
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void WindowFocusChangedEventCallbackType(IntPtr window, bool focusGained);
private delegate void TransitionEffectEventCallbackType(IntPtr window, int state, int type);
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void KeyboardRepeatSettingsChangedEventCallbackType();
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void AuxiliaryMessageEventCallbackType(IntPtr kData, IntPtr vData, IntPtr optionsArray);
/// <summary>
/// FocusChanged event.
private event EventHandler<FocusChangedEventArgs> windowFocusChangedEventHandler2;
private event EventHandler<TransitionEffectEventArgs> transitionEffectHandler;
private event EventHandler keyboardRepeatSettingsChangedHandler;
+ private event EventHandler<AuxiliaryMessageEventArgs> auxiliaryMessageEventHandler;
internal void SendViewAdded(View view)
{
KeyboardRepeatSettingsChangedEventSignal().Disconnect(keyboardRepeatSettingsChangedEventCallback);
keyboardRepeatSettingsChangedEventCallback = null;
}
+
+ if (auxiliaryMessageEventCallback != null)
+ {
+ using var signal = new WindowAuxiliaryMessageSignal(this);
+ signal.Disconnect(auxiliaryMessageEventCallback);
+ auxiliaryMessageEventHandler= null;
+ auxiliaryMessageEventCallback = null;
+ }
}
private StageWheelSignal StageWheelEventSignal()
}
VisibilityChangedEventSignal.Emit(this, visibility);
}
+
+ private void OnAuxiliaryMessage(IntPtr kData, IntPtr vData, IntPtr optionsArray)
+ {
+ if(kData == IntPtr.Zero || vData == IntPtr.Zero)
+ {
+ return;
+ }
+
+ using var tmp = new PropertyArray(optionsArray, false);
+ var size = tmp.Size();
+
+ List<string> tmpList = new List<string>();
+
+ for (int i = 0; i < size; i++)
+ {
+ string option = "none";
+ tmp.GetElementAt((uint)i).Get(out option);
+ tmpList.Add(option);
+ }
+
+ tmp.Dispose();
+
+ AuxiliaryMessageEventArgs e = new AuxiliaryMessageEventArgs();
+ e.Key = StringToVoidSignal.GetResult(kData);
+ e.Value = StringToVoidSignal.GetResult(vData);;
+ e.Options = tmpList;
+
+ auxiliaryMessageEventHandler?.Invoke(this, e);
+ }
+
+ /// <summary>
+ /// Auxiliary message is sent by displayer server when window's auxiliary was changed then display server sent the message.
+ /// When client application added the window's auxiliary hint and if the auxiliary is changed,
+ /// display server send the auxiliary message.
+ /// Auxiliary message has the key, value and options.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<AuxiliaryMessageEventArgs> AuxiliaryMessage
+ {
+ add
+ {
+ if (auxiliaryMessageEventHandler == null)
+ {
+ auxiliaryMessageEventCallback = OnAuxiliaryMessage;
+ using var signal = new WindowAuxiliaryMessageSignal(this);
+ signal.Connect(auxiliaryMessageEventCallback);
+ }
+ auxiliaryMessageEventHandler += value;
+ }
+ remove
+ {
+ auxiliaryMessageEventHandler -= value;
+ if (auxiliaryMessageEventHandler == null)
+ {
+ if (auxiliaryMessageEventCallback != null)
+ {
+ using var signal = new WindowAuxiliaryMessageSignal(this);
+ signal.Disconnect(auxiliaryMessageEventCallback);
+
+ if (signal.Empty())
+ {
+ auxiliaryMessageEventCallback = null;
+ }
+ }
+ }
+ }
+ }
+
+
}
}
if (childViewWindow != null)
{
+
+ childViewWindow.AddAuxiliaryHint("wm.policy.win.msg.use", "1");
childViewWindow.VisibilityChanged += OnChildViewWindowVisibilityChanged;
childViewWindow.Resized += OnChildViewWindowResized;
childViewWindow.TransitionEffect += OnChildViewWindowTransitionEffect;
childViewWindow.KeyboardRepeatSettingsChanged += OnChildViewWindowKeyboardRepeatSettingsChanged;
childViewWindow.ViewAdded += OnChildViewWindowViewAdded;
+ childViewWindow.AuxiliaryMessage += OnAuxiliaryMessageEvent;
}
}
childViewWindow.TransitionEffect -= OnChildViewWindowTransitionEffect;
childViewWindow.KeyboardRepeatSettingsChanged -= OnChildViewWindowKeyboardRepeatSettingsChanged;
childViewWindow.ViewAdded -= OnChildViewWindowViewAdded;
-
+ childViewWindow.AuxiliaryMessage -= OnAuxiliaryMessageEvent;
childViewWindow = null;
}
}
log.Fatal(tag, $"OnChildViewWindowFocusChanged() called!");
}
+ private void OnAuxiliaryMessageEvent(object sender, AuxiliaryMessageEventArgs e)
+ {
+ log.Fatal(tag, $"OnAuxiliaryMessageEvent() called!");
+ if(e != null)
+ {
+ Console.WriteLine($"Key={e.Key} Value={e.Value}");
+ log.Fatal(tag, $"Key={e.Key} Value={e.Value}");
+ var cnt = 0;
+ foreach(var option in e.Options)
+ {
+ cnt++;
+ Console.WriteLine($"option[{cnt}]={option}");
+ log.Fatal(tag, $"option[{cnt}]={option}");
+ }
+ }
+ }
+
public void Deactivate()
{
if (child)