X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=plugins%2Fdali-swig%2Fproperty-wrapper.rb;h=9d6ea2dd6e5bf35f6795612d8858f6a6bad0dc4d;hp=9d8394cc8abe3138db9b7cdb652dd5e759e59e03;hb=5ae64ad505dc063c5b143b99dbcfd99350899838;hpb=02a86c5687ddabb8ff0d5e423f5adf5d53228f73 diff --git a/plugins/dali-swig/property-wrapper.rb b/plugins/dali-swig/property-wrapper.rb index 9d8394c..9d6ea2d 100755 --- a/plugins/dali-swig/property-wrapper.rb +++ b/plugins/dali-swig/property-wrapper.rb @@ -20,7 +20,7 @@ $typeTable = [ ["VECTOR4", "Vector4", "", "Vector4 temp = new Vector4(0.0f,0.0f,0.0f,0.0f);"], ["MATRIX3", "Matrix3", "", "Matrix3 temp = new Matrix3();"], ["MATRIX", "Matrix", "", "Matrix temp = new Matrix();" ], - ["RECTANGLE", "RectInteger", "", "RectInteger temp = new RectInteger(0,0,0,0);"], + ["RECTANGLE", "Rectangle", "", "Rectangle temp = new Rectangle(0,0,0,0);"], ["ROTATION", "Quaternion", "", "Quaternion temp = new Quaternion();"], ["STRING", "string", "out", "string temp;"], ["ARRAY", "Dali.Property.Array", "", "Dali.Property.Array temp = new Dali.Property.Array();"], @@ -119,6 +119,14 @@ def extractToolkitPropertyInfo( propertyMacro ) # Extract the property name, type property = $propertyStruct.new; + #First strip out any comments at the end of the macro, some have text like // deprecated + commentIndex = propertyMacro.index("//"); + + if( commentIndex ) + propertyMacro = propertyMacro.slice(0..commentIndex-1) + end + + # Split the macro definition by comma and quotes, close bracket and delete any empty segments data = propertyMacro.split(/[\s,")]/).reject { |s| s.empty? } @@ -177,6 +185,7 @@ def extractToolkitPropertyInfo( propertyMacro ) property.type = data[4] end + # last item should be property enum, e.g. INPUT_POINT_SIZE property.enum = data[data.length-1] end @@ -303,6 +312,13 @@ def writeCSharpData next end + #exception case <<< + #Tooltip gives swig build error + if( property.name == "Tooltip" ) + next + end + #exception case >>> + $totalProperties+=1 # keep track of total propertyType = propertyInfo[1] # e.g. bool or int @@ -319,9 +335,9 @@ def writeCSharpData hasChildProperties = true end - property.csharpGetter =" public #{propertyType} #{property.name} \n"\ - " { \n"\ - " get \n" \ + property.csharpGetter =" public #{propertyType} #{property.name}\n"\ + " {\n"\ + " get\n" \ " {\n"\ " #{tempDeclaration}\n"\ " GetProperty( #{propertyName}).Get( #{propertyArg} temp );\n"\ @@ -330,14 +346,31 @@ def writeCSharpData if property.writable #text.SetProperty(TextLabel.Property.HORIZONTAL_ALIGNMENT, new Property.Value("CENTER")); - property.csharpSetter = " set \n" \ - " { \n"\ + property.csharpSetter = " set\n" \ + " {\n"\ " SetProperty( #{propertyName}, new Dali.Property.Value( value ) );\n" \ " }\n"\ " }\n" else property.csharpSetter = "}" # close the opening property declaration end + + #exception case <<< + if( property.name == "Behavior" ) + property.csharpGetter =" public Layer.LayerBehavior #{property.name} \n"\ + " { \n"\ + " get \n" \ + " {\n"\ + " return GetBehavior();\n"\ + " }\n" + + property.csharpSetter = " set \n" \ + " { \n"\ + " SetBehavior( value );\n" \ + " }\n"\ + " }\n" + end + #exception case >>> end # write normal properties to the class's own csharp file writePropertiesToCSharpFile( daliClass )