<None Include="NUISamples.TizenTV.project.json" />\r
<None Include="res\json\control-dashboard.json" />\r
<None Include="res\json\date-picker-template.json" />\r
+ <None Include="res\json\date-picker-theme.json" />\r
<None Include="res\json\date-picker.json" />\r
<None Include="res\json\spin.json" />\r
<None Include="res\json\style-example-theme-one.json" />\r
static void Main(string[] args)\r
{\r
new VisualsUsingCustomView.VisualsExample().Run(args); //o\r
- //new VisualsExample().Run(args); //o\r
//new ControlDashboard.Example().Run(args); //o\r
//new DatePickerTest.Example().Run(args); //o\r
//new HelloTest.Example().Run(args); //o\r
//new FlexContainerTest.SampleMain().Run(args); //o \r
\r
\r
- //new JsonLoaderTest.Example().Run(args); //x 우분투용\r
//new DatePickerUsingJson.Example().Run(args); //x date-picker-theme.json없음\r
//new DaliTest.Example().Run(args); //x 검은화면 나오고 죽음\r
\r
topLabel.WidthResizePolicy = ResizePolicyType.FillToParent;
topLabel.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;
topLabel.AnchorPoint = AnchorPoint.TopCenter;
- topLabel.ParentOrigin = ParentOrigin.TopCenter;
+ //topLabel.ParentOrigin = ParentOrigin.TopCenter;
topLabel.SetSizeModeFactor(new Vector3(0.0f, 0.1f, 0.0f));
topLabel.BackgroundColor = new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f);
topLabel.TextColor = Color.White;
_contentContainer.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent;
_contentContainer.SetSizeModeFactor(new Vector3(0.0f, 0.9f, 0.0f));
_contentContainer.AnchorPoint = AnchorPoint.BottomCenter;
- _contentContainer.ParentOrigin = ParentOrigin.BottomCenter;
+ //_contentContainer.ParentOrigin = ParentOrigin.BottomCenter;
+ _contentContainer.Position = new Position(0, _stage.Size.Height * 0.1f, 0);
_contentContainer.SetRelativeHeight(0, 0.07f);
_contentContainer.SetRelativeHeight(1, 0.26f);
_contentContainer.SetRelativeHeight(2, 0.07f);
{
PushButton button = new PushButton();
button.LabelText = "Popup";
- button.ParentOrigin = ParentOrigin.Center;
+ //button.ParentOrigin = ParentOrigin.Center;
button.AnchorPoint = AnchorPoint.Center;
button.MaximumSize = new Size2D(150, 100);
_popup = CreatePopup();
{
PushButton button = new PushButton();
button.LabelText = "Toast";
- button.ParentOrigin = ParentOrigin.Center;
+ //button.ParentOrigin = ParentOrigin.Center;
button.AnchorPoint = AnchorPoint.Center;
button.Clicked += (obj, ee) =>
{
footer.WidthResizePolicy = ResizePolicyType.FillToParent;
footer.HeightResizePolicy = ResizePolicyType.Fixed;
footer.Size = new Size(0.0f, 80.0f, 0.0f);
- footer.ParentOrigin = ParentOrigin.Center;
+ //footer.ParentOrigin = ParentOrigin.Center;
footer.AnchorPoint = AnchorPoint.Center;
PushButton okButton = CreateOKButton();
- okButton.ParentOrigin = ParentOrigin.Center;
+ //okButton.ParentOrigin = ParentOrigin.Center;
okButton.AnchorPoint = AnchorPoint.Center;
okButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
okButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
okButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));
PushButton cancelButton = CreateCancelButton();
- cancelButton.ParentOrigin = ParentOrigin.Center;
+ //cancelButton.ParentOrigin = ParentOrigin.Center;
cancelButton.AnchorPoint = AnchorPoint.Center;
cancelButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
cancelButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent;
cancelButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f));
TableView controlLayout = new TableView(1, 2);
- controlLayout.ParentOrigin = ParentOrigin.Center;
+ //controlLayout.ParentOrigin = ParentOrigin.Center;
controlLayout.AnchorPoint = AnchorPoint.Center;
controlLayout.WidthResizePolicy = ResizePolicyType.FillToParent;
controlLayout.HeightResizePolicy = ResizePolicyType.FillToParent;
public void Initialize()
{
-
+ InternalSetting.DefaultParentOriginAsTopLeft = false;
Stage stage = Stage.Instance;
stage.BackgroundColor = Color.White;
private void Initialize()
{
+ InternalSetting.DefaultParentOriginAsTopLeft = false;
// Connect the signal callback for stage touched signal
_stage = Stage.Instance;
_stage.Touch += OnStageTouched;
public void Initialize()
{
+ InternalSetting.DefaultParentOriginAsTopLeft = false;
Stage stage = Stage.Instance;
stage.BackgroundColor = Color.White;
stage.Touch += OnStageTouched;
public void Initialize()
{
+ InternalSetting.DefaultParentOriginAsTopLeft = false;
Log("Customized Application Initialize event handler");
stage = Stage.Instance;
stage.BackgroundColor = Color.Cyan;
+++ /dev/null
-/*
- * Copyright (c) 2016 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.Runtime.InteropServices;
-using Tizen.NUI;
-
-namespace JsonLoaderTest
-{
- class Example : NUIApplication
- {
- private Builder _builder;
- private string _jsonFileName;
-
- public Example() : base()
- {
- }
-
- public Example(string stylesheet) : base(stylesheet)
- {
- _jsonFileName = stylesheet;
- }
-
- public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode)
- {
- }
-
- protected override void OnCreate()
- {
- base.OnCreate();
- Initialize();
- }
-
- public void Initialize()
- {
- if( _jsonFileName.Length == 0)
- {
- Console.WriteLine("Please specify JSON file to load");
- return;
- }
-
- _builder = new Builder ();
-
- PropertyMap constants = new PropertyMap();
-
- // In dali-demo we have some JSON files that can be loaded, but they need 3 different macros defining.
- // The JSON folder is typically installed into dali-env/opt/share/com.samsung.dali-demo/res:
- //
- //string demoDirectory = ".../dali-env/opt/share/com.samsung.dali-demo/res";
- //constants.Insert( "DEMO_IMAGE_DIR" , new PropertyValue( demoDirectory+"/images") );
- //constants.Insert( "DEMO_MODEL_DIR" , new PropertyValue( demoDirectory+"/models") );
- //constants.Insert( "DEMO_SCRIPT_DIR", new PropertyValue( demoDirectory+"/scripts") );
- constants.Insert( "CONFIG_SCRIPT_LOG_LEVEL", new PropertyValue( "Verbose") );
-
- _builder.AddConstants( constants );
-
-
- Stage stage = Stage.Instance;
- stage.BackgroundColor = Color.White;
-
- _builder.LoadFromFile( _jsonFileName );
-
- _builder.AddActors( stage.GetDefaultLayer() );
-
- }
-
- /// <summary>
- /// The main entry point for the application.
- /// </summary>
- [STAThread]
- static void _Main(string[] args)
- {
- string fileName= "";
-
- if( args.Length > 0)
- {
- fileName = args[0];
- }
-
- Console.WriteLine("arguments = " + args.Length);
- Example example = new Example(fileName);
- example.Run(args);
- }
- }
-}
public void Initialize()
{
+ InternalSetting.DefaultParentOriginAsTopLeft = false;
CreateScrollView();
}
_text.ParentOrigin = ParentOrigin.Center;
_text.AnchorPoint = AnchorPoint.Center;
_text.HorizontalAlignment = "CENTER";
- _text.PointSize = 48.0f;
+ _text.PointSize = 20.0f;
_scrollView.Add(_text);
}
{
private VisualView _visualView = null;
private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res";
+ private Window _window;
public Example() : base()
{
_visualView.AddVisual("meshVisual1", meshVisualMap1);
/* n-patch image visual 1. */
- NpatchImageVisualMap npatchImageVisualMap1 = new NpatchImageVisualMap();
+ NPatchVisualMap npatchImageVisualMap1 = new NPatchVisualMap();
npatchImageVisualMap1.URL = resources + "/images/gallery-4.jpg";
npatchImageVisualMap1.VisualSize = new Size2D(400, 400);
npatchImageVisualMap1.Offset = new Position2D(300, 600);
npatchImageVisualMap1.Border = new Rectangle(100, 100, 100, 100);
_visualView.AddVisual("npatchImageVisual1", npatchImageVisualMap1);
+ _window = this.Window;
+ _window.WindowFocusChanged += (sender, ee) =>
+ {
+ Tizen.Log.Debug("NUI", "[WindowFocusTest] WindowFocusChanged event comes! focus gained=" + ee.FocusGained);
+ };
+
+ Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable());
+ _window.SetAcceptFocus(false);
+ Tizen.Log.Debug("NUI", "[WindowFocusTest] set focus acceptable=false!!!");
+ Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable());
+ _window.SetAcceptFocus(true);
+ Tizen.Log.Debug("NUI", "[WindowFocusTest] set focus acceptable=true!!!");
+ Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable());
}\r
[STAThread]
--- /dev/null
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *
+ * This file is part of Dali Toolkit
+ *
+ * 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.
+ */
+
+{
+ "styles": {
+ "Spin": {
+ "MinValue": 0,
+ "MaxValue": 100,
+ "Value": 50,
+ "Step": 1,
+ "TextColor": [ 1.0, 0.0, 0.0, 1.0 ]
+ }
+ }
+}
<Compile Include="src\internal\VisualTransformPolicyType.cs" />\r
<Compile Include="src\internal\VisualTransformPropertyType.cs" />\r
<Compile Include="src\internal\VisualType.cs" />\r
+ <Compile Include="src\internal\WindowFocusSignalType.cs" />\r
<Compile Include="src\internal\VoidSignal.cs" />\r
<Compile Include="src\internal\WrapModeType.cs" />\r
<Compile Include="src\public\Actor.cs" />\r
// Callback for Application InitSignal
private void OnApplicationInit(IntPtr data)
{
+ // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
+ DisposeQueue.Instance.Initialize();
NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs();
// Populate all members of "e" (NUIApplicationInitEventArgs) with real data
return ret;
}
- public bool AddIdle(System.Delegate func)
+ //Removed from v0.2.33
+ /*public bool AddIdle(System.Delegate func)
{
System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);
System.IntPtr ip2 = NDalicManualPINVOKE.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
- }
+ }*/
internal class DisposeQueue
{
- private static DisposeQueue _disposableQueue = new DisposeQueue();
+ private static readonly DisposeQueue _disposableQueue = new DisposeQueue();
private List<IDisposable> _disposables = new List<IDisposable>();
private Object _listLock = new object();
- private delegate int ProcessDisposablesDelegate(IntPtr ptr);
- private ProcessDisposablesDelegate _disposequeueProcessDisposablesDelegate;
+ private EventThreadCallback _eventThreadCallback;
+ private EventThreadCallback.CallbackDelegate _disposeQueueProcessDisposablesDelegate;
private DisposeQueue()
{
- _disposequeueProcessDisposablesDelegate = new ProcessDisposablesDelegate(ProcessDisposables);
- Application.Instance.AddIdle(_disposequeueProcessDisposablesDelegate);
}
~DisposeQueue()
get { return _disposableQueue; }
}
+ public void Initialize()
+ {
+ _disposeQueueProcessDisposablesDelegate = new EventThreadCallback.CallbackDelegate(ProcessDisposables);
+ _eventThreadCallback = new EventThreadCallback(_disposeQueueProcessDisposablesDelegate);
+ }
+
public void Add(IDisposable disposable)
{
lock(_listLock)
{
_disposables.Add(disposable);
}
+
+ _eventThreadCallback.Trigger();
}
- private int ProcessDisposables(IntPtr ptr)
+ private void ProcessDisposables()
{
lock(_listLock)
{
}
_disposables.Clear();
}
- return 0;
}
}
}
--- /dev/null
+/*
+ * Copyright (c) 2017 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
+{
+
+ public class EventThreadCallback : global::System.IDisposable
+ {
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
+ protected bool swigCMemOwn;
+ public delegate void CallbackDelegate();
+
+ internal EventThreadCallback(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(EventThreadCallback obj)
+ {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ ~EventThreadCallback()
+ {
+ Dispose();
+ }
+
+ public virtual void Dispose()
+ {
+ lock (this)
+ {
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ {
+ if (swigCMemOwn)
+ {
+ swigCMemOwn = false;
+ NDalicManualPINVOKE.delete_EventThreadCallback(swigCPtr);
+ }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
+ }
+ global::System.GC.SuppressFinalize(this);
+ }
+ }
+
+ public EventThreadCallback(CallbackDelegate func) : this(NDalicManualPINVOKE.new_EventThreadCallback(func), true)
+ {
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ public void Trigger()
+ {
+ NDalicManualPINVOKE.EventThreadCallback_Trigger(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending)
+ throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ }
+
+}
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ViewWrapperImpl_ApplyThemeStyle")]
public static extern void ViewWrapperImpl_ApplyThemeStyle(global::System.Runtime.InteropServices.HandleRef jarg1);
- [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_MakeCallback")]
- public static extern global::System.IntPtr MakeCallback(global::System.Runtime.InteropServices.HandleRef jarg1);
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_EventThreadCallback")]
+ public static extern global::System.IntPtr new_EventThreadCallback(EventThreadCallback.CallbackDelegate delegate1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_EventThreadCallback")]
+ public static extern void delete_EventThreadCallback(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_EventThreadCallback_Trigger")]
+ public static extern void EventThreadCallback_Trigger(global::System.Runtime.InteropServices.HandleRef jarg1);
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Actor_Property_SIBLING_ORDER_get")]
public static extern int Actor_Property_SIBLING_ORDER_get();
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_TimerSignalType")]
public static extern void delete_TimerSignalType(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_WindowFocusSignalType_Empty")]
+ public static extern bool WindowFocusSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_WindowFocusSignalType_GetConnectionCount")]
+ public static extern uint WindowFocusSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_WindowFocusSignalType_Connect")]
+ public static extern void WindowFocusSignalType_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_WindowFocusSignalType_Disconnect")]
+ public static extern void WindowFocusSignalType_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_WindowFocusSignalType_Emit")]
+ public static extern void WindowFocusSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2);
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_new_WindowFocusSignalType")]
+ public static extern global::System.IntPtr new_WindowFocusSignalType();
+
+ [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_delete_WindowFocusSignalType")]
+ public static extern void delete_WindowFocusSignalType(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+
+
[global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_VISUAL_PROPERTY_TYPE_get")]
public static extern int VISUAL_PROPERTY_TYPE_get();
~ViewWrapper()
{
- Dispose();
+ DisposeQueue.Instance.Add(this);
}
public override void Dispose()
{
+ if (!Stage.IsInstalled())
+ {
+ DisposeQueue.Instance.Add(this);
+ return;
+ }
lock(this)
{
if (swigCPtr.Handle != global::System.IntPtr.Zero)
--- /dev/null
+//------------------------------------------------------------------------------\r
+// <auto-generated />\r
+//\r
+// This file was automatically generated by SWIG (http://www.swig.org).\r
+// Version 3.0.9\r
+//\r
+// Do not make changes to this file unless you know what you are doing--modify\r
+// the SWIG interface file instead.\r
+//------------------------------------------------------------------------------\r
+\r
+namespace Tizen.NUI\r
+{\r
+\r
+ public class WindowFocusSignalType : global::System.IDisposable\r
+ {\r
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;\r
+ protected bool swigCMemOwn;\r
+\r
+ internal WindowFocusSignalType(global::System.IntPtr cPtr, bool cMemoryOwn)\r
+ {\r
+ swigCMemOwn = cMemoryOwn;\r
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);\r
+ }\r
+\r
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WindowFocusSignalType obj)\r
+ {\r
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;\r
+ }\r
+\r
+ ~WindowFocusSignalType()\r
+ {\r
+ Dispose();\r
+ }\r
+\r
+ public virtual void Dispose()\r
+ {\r
+ lock (this)\r
+ {\r
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)\r
+ {\r
+ if (swigCMemOwn)\r
+ {\r
+ swigCMemOwn = false;\r
+ NDalicPINVOKE.delete_WindowFocusSignalType(swigCPtr);\r
+ }\r
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);\r
+ }\r
+ global::System.GC.SuppressFinalize(this);\r
+ }\r
+ }\r
+\r
+ public bool Empty()\r
+ {\r
+ bool ret = NDalicPINVOKE.WindowFocusSignalType_Empty(swigCPtr);\r
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
+ return ret;\r
+ }\r
+\r
+ public uint GetConnectionCount()\r
+ {\r
+ uint ret = NDalicPINVOKE.WindowFocusSignalType_GetConnectionCount(swigCPtr);\r
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
+ return ret;\r
+ }\r
+\r
+ public void Connect(System.Delegate func)\r
+ {\r
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);\r
+ {\r
+ NDalicPINVOKE.WindowFocusSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));\r
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
+ }\r
+ }\r
+\r
+ public void Disconnect(System.Delegate func)\r
+ {\r
+ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func);\r
+ {\r
+ NDalicPINVOKE.WindowFocusSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));\r
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
+ }\r
+ }\r
+\r
+ public void Emit(bool arg)\r
+ {\r
+ NDalicPINVOKE.WindowFocusSignalType_Emit(swigCPtr, arg);\r
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
+ }\r
+\r
+ public WindowFocusSignalType() : this(NDalicPINVOKE.new_WindowFocusSignalType(), true)\r
+ {\r
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();\r
+ }\r
+\r
+ }\r
+\r
+}\r
Transparent = 1
}
+ public Window Window
+ {
+ get
+ {
+ return _application.GetWindow();
+ }
+ }
}
}
\ No newline at end of file
}
}
+ public Rectangle(float x, float y, float width, float height) : this( (int)x, (int)y, (int)width, (int)height )
+ {
+ }
+
/// <summary>
/// Equality operator.
/// </summary>
/// <summary>
/// X position of the rectangle
/// </summary>
- public int X
+ public float X
{
set
{
- x = value;
+ x = (int)( value );
}
get
{
return x;
}
- }
+ }
/// <summary>
/// Y position of the rectangle
/// </summary>
- public int Y
+ public float Y
{
set
{
- y = value;
+ y = (int)( value );
}
get
{
/// <summary>
/// Width of the rectangle
/// </summary>
- public int Width
+ public float Width
{
set
{
- width = value;
+ width = (int)( value );
}
get
{
/// <summary>
/// Height of the rectangle
/// </summary>
- public int Height
+ public float Height
{
set
{
- height = value;
+ height = (int)( value );
}
get
{
/// <summary>
/// A class encapsulating the property map of a n-patch image visual.
/// </summary>
- public class NpatchImageVisualMap : VisualMap
+ public class NPatchVisualMap : VisualMap
{
- public NpatchImageVisualMap() : base()
+ public NPatchVisualMap() : base()
{
}
private string _url = "";
- private FittingModeType _fittingMode = FittingModeType.ShrinkToFit;
- private SamplingModeType _samplingMode = SamplingModeType.Box;
- private int _desiredWidth = 0;
- private int _desiredHeight = 0;
- private bool _synchronousLoading = false;
private bool _borderOnly = false;
- private Vector4 _pixelArea = new Vector4(0.0f, 0.0f, 1.0f, 1.0f);
- private WrapModeType _wrapModeU = WrapModeType.ClampToEdge;
- private WrapModeType _wrapModeV = WrapModeType.ClampToEdge;
private Rectangle _border = new Rectangle(0, 0, 0, 0);
/// <summary>
}
/// <summary>
- /// Get or set fitting options, used when resizing images to fit desired dimensions.
- /// If not supplied, default is FittingMode::SHRINK_TO_FIT.
- /// For Normal Quad images only.
- /// </summary>
- public FittingModeType FittingMode
- {
- get
- {
- return _fittingMode;
- }
- set
- {
- _fittingMode = value;
- }
- }
-
- /// <summary>
- /// Get or set filtering options, used when resizing images to sample original pixels.
- /// If not supplied, default is SamplingMode::BOX.
- /// For Normal Quad images only.
- /// </summary>
- public SamplingModeType SamplingMode
- {
- get
- {
- return _samplingMode;
- }
- set
- {
- _samplingMode = value;
- }
- }
-
- /// <summary>
- /// Get or set the desired image width.
- /// If not specified, the actual image width is used.
- /// For Normal Quad images only.
- /// </summary>
- public int DesiredWidth
- {
- get
- {
- return _desiredWidth;
- }
- set
- {
- _desiredWidth = value;
- }
- }
-
- /// <summary>
- /// Get or set the desired image height.
- /// If not specified, the actual image height is used.
- /// For Normal Quad images only.
- /// </summary>
- public int DesiredHeight
- {
- get
- {
- return _desiredHeight;
- }
- set
- {
- _desiredHeight = value;
- }
- }
-
- /// <summary>
- /// Get or set whether to load the image synchronously.
- /// If not specified, the default is false, i.e. the image is loaded asynchronously.
- /// For Normal Quad images only.
- /// </summary>
- public bool SynchronousLoading
- {
- get
- {
- return _synchronousLoading;
- }
- set
- {
- _synchronousLoading = value;
- }
- }
-
- /// <summary>
/// Get or set whether to draws the borders only(If true).
/// If not specified, the default is false.
/// For N-Patch images only.
}
/// <summary>
- /// Get or set the image area to be displayed.
- /// It is a rectangular area.
- /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.
- /// If not specified, the default value is [0.0, 0.0, 1.0, 1.0], i.e. the entire area of the image.
- /// For For Normal QUAD image only.
- /// </summary>
- public Vector4 PixelArea
- {
- get
- {
- return _pixelArea;
- }
- set
- {
- _pixelArea = value;
- }
- }
-
- /// <summary>
- /// Get or set the wrap mode for u coordinate.
- /// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.
- /// If not specified, the default is CLAMP.
- /// For Normal QUAD image only.
- /// </summary>
- public WrapModeType WrapModeU
- {
- get
- {
- return _wrapModeU;
- }
- set
- {
- _wrapModeU = value;
- }
- }
-
- /// <summary>
- /// Get or set the wrap mode for v coordinate.
- /// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.
- /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.
- /// If not specified, the default is CLAMP.
- /// For Normal QUAD image only.
+ /// The border of the image in the order: left, right, bottom, top.
/// </summary>
- public WrapModeType WrapModeV
- {
- get
- {
- return _wrapModeV;
- }
- set
- {
- _wrapModeV = value;
- }
- }
-
public Rectangle Border
{
get
if (_url != "")
{
_outputVisualMap = new PropertyMap();
- _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Npatch));
+ _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch));
_outputVisualMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
- _outputVisualMap.Add(NpatchImageVisualProperty.FittingMode, new PropertyValue((int)_fittingMode));
- _outputVisualMap.Add(NpatchImageVisualProperty.SamplingMode, new PropertyValue((int)_samplingMode));
-
- if (_desiredWidth != 0)
- {
- _outputVisualMap.Add(NpatchImageVisualProperty.DesiredWidth, new PropertyValue(_desiredWidth));
- }
-
- if (_desiredHeight != 0)
- {
- _outputVisualMap.Add(NpatchImageVisualProperty.DesiredHeight, new PropertyValue(_desiredHeight));
- }
-
- _outputVisualMap.Add(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue(_synchronousLoading));
_outputVisualMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue(_borderOnly));
- _outputVisualMap.Add(NpatchImageVisualProperty.PixelArea, new PropertyValue(_pixelArea));
- _outputVisualMap.Add(NpatchImageVisualProperty.WrapModeU, new PropertyValue((int)_wrapModeU));
- _outputVisualMap.Add(NpatchImageVisualProperty.WrapModeV, new PropertyValue((int)_wrapModeV));
_outputVisualMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border));
}
}
Primitive,
Wireframe,
Text,
- Npatch
+ NPatch
}
public struct Property
namespace Tizen.NUI
{
+
+ using System;
+ using System.Runtime.InteropServices;
+
+
/// <summary>
/// The window class is used internally for drawing.
/// A Window has an orientation and indicator properties.
}
}
+
+ public void SetAcceptFocus(bool accept)
+ {
+ NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
+ public bool IsFocusAcceptable()
+ {
+ return NDalicPINVOKE.IsFocusAcceptable(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+
public void Show()
{
NDalicPINVOKE.Show(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
+ public class WindowFocusChangedEventArgs : EventArgs
+ {
+ public bool FocusGained
+ {
+ get;
+ set;
+ }
+ }
+
+ private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback;
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void WindowFocusChangedEventCallbackType(bool focusGained);
+ private event EventHandler<WindowFocusChangedEventArgs> _windowFocusChangedEventHandler;
+
+ public event EventHandler<WindowFocusChangedEventArgs> WindowFocusChanged
+ {
+ add
+ {
+ if (_windowFocusChangedEventHandler == null)
+ {
+ _windowFocusChangedEventCallback = OnWindowFocusedChanged;
+ WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback);
+ }
+
+ _windowFocusChangedEventHandler += value;
+ }
+ remove
+ {
+ _windowFocusChangedEventHandler -= value;
+
+ if (_windowFocusChangedEventHandler == null && _windowFocusChangedEventCallback != null)
+ {
+ WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback);
+ }
+ }
+ }
+
+ private void OnWindowFocusedChanged(bool focusGained)
+ {
+ WindowFocusChangedEventArgs e = new WindowFocusChangedEventArgs();
+
+ e.FocusGained = focusGained;
+
+ if (_windowFocusChangedEventHandler != null)
+ {
+ _windowFocusChangedEventHandler(this, e);
+ }
+ }
+
+ public WindowFocusSignalType WindowFocusChangedSignal()
+ {
+ WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+
+
/// <summary>
/// Creates an initialized handle to a new Window.
/// </summary>