*/
using System;
+using System.Diagnostics;
namespace Tizen.NUI
{
//This version should be updated and synced for every Dali native release
internal static class Version
{
- public const int daliVer1 = 1;
- public const int daliVer2 = 2;
- public const int daliVer3 = 85;
- public const int nuiVer1 = 1;
- public const int nuiVer2 = 2;
- public const int nuiVer3 = 85;
- public const string nuiRelease = "";
-
+ //Lower than dali_1.2.85 : NUI internal API version 400
+ //dali_1.2.86 : NUI internal API version 401
+ public const int nuiAPIVer = 401;
+ public const int reservedVer1 = 0;
+ public const int reservedVer2 = 0;
static internal bool DaliVersionMatchWithNUI()
{
try
{
- if (NDalicManualPINVOKE.NativeVersionCheck(ref ver1, ref ver2, ref ver3))
+ if (NDalicManualPINVOKE.InternalAPIVersionCheck(ref ver1, ref ver2, ref ver3) == true)
{
- if (ver1 != daliVer1 || ver2 != daliVer2 || ver3 != daliVer3)
+ if (ver1 != nuiAPIVer)
{
- NUILog.Error($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali= { ver1 }.{ ver2}.{ ver3}");
- throw new System.InvalidOperationException($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali={ ver1 }.{ ver2}.{ ver3}");
+ NUILog.Error($"NUI API version mismatch error! NUI API Version: ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
+ throw new System.InvalidOperationException($"NUI API version mismatch error! NUI API version should be ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
}
}
else
{
- NUILog.Error($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali= { ver1 }.{ ver2}.{ ver3}");
- throw new System.InvalidOperationException($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali={ ver1 }.{ ver2}.{ ver3}");
+ NUILog.Error($"NUI API version mismatch error! NUI API Version: ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
+ throw new System.InvalidOperationException($"NUI API version mismatch error! NUI API version should be ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
}
}
catch (Exception)
{
- NUILog.Error($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali= { ver1 }.{ ver2}.{ ver3}");
- throw new System.InvalidOperationException($"Dali native version mismatch error! nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3} but dali={ ver1 }.{ ver2}.{ ver3}");
+ NUILog.Error($"NUI API version mismatch error! NUI API Version: ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
+ throw new System.InvalidOperationException($"NUI API version mismatch error! NUI API version should be ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})");
}
- NUILog.Debug($"version info: nui={ nuiVer1}.{ nuiVer2}.{ nuiVer3}, dali= { ver1 }.{ ver2}.{ ver3}");
+
+ PrintDaliNativeVersion();
return true;
}
+
+ [Conditional("DEBUG_ON")]
+ static private void PrintDaliNativeVersion()
+ {
+ int ver1 = -1;
+ int ver2 = -1;
+ int ver3 = -1;
+
+ NDalicManualPINVOKE.NativeVersionCheck(ref ver1, ref ver2, ref ver3);
+ NUILog.Debug($"DALi Version: ({ver1}.{ver2}.{ver3}), NUI API Version: ({nuiAPIVer})");
+ }
}
}