Ejemplo n.º 1
0
        /// <summary>
        /// Compose the out visual map.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        protected override void ComposingPropertyMap()
        {
            PropertyMap _animator = new PropertyMap();

            _animator.Add("alphaFunction", new PropertyValue(_alphaFunction));

            PropertyMap _timePeriod = new PropertyMap();

            _timePeriod.Add("duration", new PropertyValue((_endTime - _startTime) / 1000.0f));
            _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f));
            _animator.Add("timePeriod", new PropertyValue(_timePeriod));

            StringBuilder sb = new StringBuilder(_propertyIndex);

            sb[0] = (char)(sb[0] | 0x20);
            string _str = sb.ToString();

            PropertyValue val = PropertyValue.CreateFromObject(_destinationValue);

            PropertyMap _transition = new PropertyMap();

            _transition.Add("target", new PropertyValue(_target));
            _transition.Add("property", new PropertyValue(_str));
            _transition.Add("targetValue", val);
            _transition.Add("animator", new PropertyValue(_animator));

            _outputVisualMap = _transition;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Overrides the method of OnInitialize() for the CustomView class.<br />
        /// This method is called after the control has been initialized.<br />
        /// Derived classes should do any second phase initialization by overriding this method.<br />
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        public override void OnInitialize()
        {
            // Initialize the propertiesControl
            arrowImage          = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png";
            textBackgroundColor = new Color(0.6f, 0.6f, 0.6f, 1.0f);
            currentValue        = 0;
            minValue            = 0;
            maxValue            = 0;
            singleStep          = 1;
            maxTextLength       = 0;

            // Create image visual for the arrow keys
            var temp = new PropertyValue(arrowImage);

            arrowVisualPropertyIndex = RegisterProperty("ArrowImage", temp, Tizen.NUI.PropertyAccessMode.ReadWrite);
            temp.Dispose();

            var ptMap = new PropertyMap();

            temp = new PropertyValue((int)Visual.Type.Image);
            ptMap.Add(Visual.Property.Type, temp);
            temp.Dispose();

            temp = new PropertyValue(arrowImage);
            ptMap.Add(ImageVisualProperty.URL, temp);
            temp.Dispose();

            temp = new PropertyValue(150);
            ptMap.Add(ImageVisualProperty.DesiredHeight, temp);
            temp.Dispose();

            temp = new PropertyValue(150);
            ptMap.Add(ImageVisualProperty.DesiredWidth, temp);
            temp.Dispose();

            arrowVisual = VisualFactory.Instance.CreateVisual(ptMap);
            ptMap.Dispose();
            RegisterVisual(arrowVisualPropertyIndex, arrowVisual);

            // Create a text field
            textField                     = new TextField();
            textField.PivotPoint          = Tizen.NUI.PivotPoint.Center;
            textField.WidthResizePolicy   = ResizePolicyType.SizeRelativeToParent;
            textField.HeightResizePolicy  = ResizePolicyType.SizeRelativeToParent;
            textField.SizeModeFactor      = new Vector3(1.0f, 0.45f, 1.0f);
            textField.PlaceholderText     = "----";
            textField.BackgroundColor     = textBackgroundColor;
            textField.HorizontalAlignment = HorizontalAlignment.Center;
            textField.VerticalAlignment   = VerticalAlignment.Center;
            textField.Focusable           = (true);
            textField.Name                = "_textField";
            textField.Position2D          = new Position2D(0, 40);

            this.Add(textField);

            textField.FocusGained += TextFieldKeyInputFocusGained;
            textField.FocusLost   += TextFieldKeyInputFocusLost;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Compose the out visual map.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        protected override void ComposingPropertyMap()
        {
            PropertyMap   animator = new PropertyMap();
            PropertyValue temp     = new PropertyValue(alphaFunction);

            animator.Add("alphaFunction", temp);
            temp.Dispose();

            PropertyMap timePeriod = new PropertyMap();

            temp = new PropertyValue((endTime - startTime) / 1000.0f);
            timePeriod.Add("duration", temp);
            temp.Dispose();

            temp = new PropertyValue(startTime / 1000.0f);
            timePeriod.Add("delay", temp);
            temp.Dispose();

            temp = new PropertyValue(timePeriod);
            animator.Add("timePeriod", temp);
            temp.Dispose();

            StringBuilder sb = new StringBuilder(propertyIndex);

            sb[0] = (char)(sb[0] | 0x20);
            string str = sb.ToString();

            PropertyValue val = PropertyValue.CreateFromObject(destinationValue);

            PropertyMap transition = new PropertyMap();

            temp = new PropertyValue(target);
            transition.Add("target", temp);
            temp.Dispose();

            temp = new PropertyValue(str);
            transition.Add("property", temp);
            temp.Dispose();

            transition.Add("targetValue", val);
            temp = new PropertyValue(animator);
            transition.Add("animator", temp);
            temp.Dispose();

            _outputVisualMap = transition;
            base.ComposingPropertyMap();

            animator.Dispose();
            timePeriod.Dispose();
            val.Dispose();
        }
Ejemplo n.º 4
0
        private PropertyMap ComposingInputMethodMap()
        {
            PropertyMap   outputMap = new PropertyMap();
            PropertyValue temp;

            if (panelLayout != null)
            {
                temp = new PropertyValue((int)panelLayout);
                outputMap.Add("PANEL_LAYOUT", temp);
                temp.Dispose();
            }
            if (actionButton != null)
            {
                // Temporarily specify the values to match the types of ecore_imf.
                if (actionButton == InputMethod.ActionButtonTitleType.Search)
                {
                    actionButton = (InputMethod.ActionButtonTitleType.Search - 1);                                                           // 6
                }
                else if (actionButton == InputMethod.ActionButtonTitleType.Send)
                {
                    actionButton = (InputMethod.ActionButtonTitleType.Send - 1);                                                              // 7
                }
                else if (actionButton == InputMethod.ActionButtonTitleType.SignIn)
                {
                    actionButton = (InputMethod.ActionButtonTitleType.SignIn - 1);                                                                // 8
                }
                else if (actionButton == InputMethod.ActionButtonTitleType.Unspecified || actionButton == InputMethod.ActionButtonTitleType.None)
                {
                    actionButton = InputMethod.ActionButtonTitleType.Default;
                }
                temp = new PropertyValue((int)actionButton);
                outputMap.Add("BUTTON_ACTION", temp);
                temp.Dispose();
            }
            if (autoCapital != null)
            {
                temp = new PropertyValue((int)autoCapital);
                outputMap.Add("AUTO_CAPITALIZE", temp);
                temp.Dispose();
            }
            if (variation != null)
            {
                temp = new PropertyValue((int)variation);
                outputMap.Add("VARIATION", temp);
                temp.Dispose();
            }
            return(outputMap);
        }
Ejemplo n.º 5
0
 internal static PropertyMap Add <T>(this PropertyMap propertyMap, string key, T value)
 {
     using (var pv = PropertyValue.CreateFromObject(value))
     {
         propertyMap.Add(key, pv);
     }
     return(propertyMap);
 }
Ejemplo n.º 6
0
 private void ComposingTransformMap()
 {
     _visualTransformMap = new PropertyMap();
     if (_visualSize != null)
     {
         _visualTransformMap.Add((int)VisualTransformPropertyType.Size, new PropertyValue(_visualSize));
     }
     if (_visualOffset != null)
     {
         _visualTransformMap.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(_visualOffset));
     }
     if (_visualOffsetPolicy != null)
     {
         _visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(_visualOffsetPolicy));
     }
     if (_visualSizePolicy != null)
     {
         _visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(_visualSizePolicy));
     }
     if (_visualOrigin != null)
     {
         _visualTransformMap.Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)_visualOrigin));
     }
     if (_visualAnchorPoint != null)
     {
         _visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)_visualAnchorPoint));
     }
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Compose the out visual map.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        protected virtual void ComposingPropertyMap()
        {
            if (null == _outputVisualMap)
            {
                _outputVisualMap = new PropertyMap();
            }

            if (_shader != null)
            {
                _outputVisualMap.Add(Visual.Property.Shader, new PropertyValue(_shader));
            }
            if (_premultipliedAlpha != null)
            {
                _outputVisualMap.Add(Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha));
            }
            if (_mixColor != null)
            {
                _outputVisualMap.Add(Visual.Property.MixColor, new PropertyValue(_mixColor));
            }
            if (_opacity != null)
            {
                _outputVisualMap.Add(Visual.Property.Opacity, new PropertyValue((float)_opacity));
            }
            if (_visualFittingMode != null)
            {
                _outputVisualMap.Add(Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode));
            }
            if (_cornerRadius != null)
            {
                _outputVisualMap.Add(Visual.Property.CornerRadius, new PropertyValue((int)_cornerRadius));
            }
        }
Ejemplo n.º 8
0
        private PropertyMap ComposingInputMethodMap()
        {
            PropertyMap _outputMap = new PropertyMap();

            if (_panelLayout != null)
            {
                _outputMap.Add("PANEL_LAYOUT", new PropertyValue((int)_panelLayout));
            }
            if (_actionButton != null)
            {
                // Temporarily specify the values to match the types of ecore_imf.
                if (_actionButton == InputMethod.ActionButtonTitleType.Search)
                {
                    _actionButton = (InputMethod.ActionButtonTitleType.Search - 1);                                                            // 6
                }
                else if (_actionButton == InputMethod.ActionButtonTitleType.Send)
                {
                    _actionButton = (InputMethod.ActionButtonTitleType.Send - 1);                                                               // 7
                }
                else if (_actionButton == InputMethod.ActionButtonTitleType.SignIn)
                {
                    _actionButton = (InputMethod.ActionButtonTitleType.SignIn - 1);                                                                 // 8
                }
                else if (_actionButton == InputMethod.ActionButtonTitleType.Unspecified || _actionButton == InputMethod.ActionButtonTitleType.None)
                {
                    _actionButton = InputMethod.ActionButtonTitleType.Default;
                }
                _outputMap.Add("BUTTON_ACTION", new PropertyValue((int)_actionButton));
            }
            if (_autoCapital != null)
            {
                _outputMap.Add("AUTO_CAPITALIZE", new PropertyValue((int)_autoCapital));
            }
            if (_variation != null)
            {
                _outputMap.Add("VARIATION", new PropertyValue((int)_variation));
            }
            return(_outputMap);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Compose the out visual map.
 /// </summary>
 /// <since_tizen> 3 </since_tizen>
 protected override void ComposingPropertyMap()
 {
     if (_urls != null)
     {
         _outputVisualMap = new PropertyMap();
         PropertyValue temp = new PropertyValue((int)Visual.Type.AnimatedImage);
         _outputVisualMap.Add(Visual.Property.Type, temp);
         temp.Dispose();
         if (_urls.Count == 1)
         {
             temp = new PropertyValue(_urls[0]);
             _outputVisualMap.Add(ImageVisualProperty.URL, temp);
             temp.Dispose();
         }
         else
         {
             var urlArray = new PropertyArray();
             foreach (var url in _urls)
             {
                 urlArray.Add(new PropertyValue(url));
             }
             temp = new PropertyValue(urlArray);
             _outputVisualMap.Add(ImageVisualProperty.URL, temp);
             temp.Dispose();
             urlArray.Dispose();
         }
         if (_batchSize != null)
         {
             temp = new PropertyValue((int)_batchSize);
             _outputVisualMap.Add(ImageVisualProperty.BatchSize, temp);
             temp.Dispose();
         }
         if (_cacheSize != null)
         {
             temp = new PropertyValue((int)_cacheSize);
             _outputVisualMap.Add(ImageVisualProperty.CacheSize, temp);
             temp.Dispose();
         }
         if (_frameDelay != null)
         {
             temp = new PropertyValue((float)_frameDelay);
             _outputVisualMap.Add(ImageVisualProperty.FrameDelay, temp);
             temp.Dispose();
         }
         if (_loopCount != null)
         {
             temp = new PropertyValue((int)_loopCount);
             _outputVisualMap.Add(ImageVisualProperty.LoopCount, temp);
             temp.Dispose();
         }
         base.ComposingPropertyMap();
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Compose the out visual map.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        protected override void ComposingPropertyMap()
        {
            if (objectURL != null)
            {
                _outputVisualMap = new PropertyMap();
                PropertyValue temp = new PropertyValue((int)Visual.Type.Mesh);
                _outputVisualMap.Add(Visual.Property.Type, temp);
                temp.Dispose();

                temp = new PropertyValue(objectURL);
                _outputVisualMap.Add(MeshVisualProperty.ObjectURL, temp);
                temp.Dispose();

                if (materialURL != null)
                {
                    temp = new PropertyValue(materialURL);
                    _outputVisualMap.Add(MeshVisualProperty.MaterialtURL, temp);
                    temp.Dispose();
                }
                if (texturesPath != null)
                {
                    temp = new PropertyValue(texturesPath);
                    _outputVisualMap.Add(MeshVisualProperty.TexturesPath, temp);
                    temp.Dispose();
                }
                if (shadingMode != null)
                {
                    temp = new PropertyValue((int)shadingMode);
                    _outputVisualMap.Add(MeshVisualProperty.ShadingMode, temp);
                    temp.Dispose();
                }
                if (useMipmapping != null)
                {
                    temp = new PropertyValue((bool)useMipmapping);
                    _outputVisualMap.Add(MeshVisualProperty.UseMipmapping, temp);
                    temp.Dispose();
                }
                if (useSoftNormals != null)
                {
                    temp = new PropertyValue((bool)useSoftNormals);
                    _outputVisualMap.Add(MeshVisualProperty.UseSoftNormals, temp);
                    temp.Dispose();
                }
                base.ComposingPropertyMap();
            }
        }
Ejemplo n.º 11
0
        private Geometry CreateQuadGeometry()
        {
            /* Create Property buffer */
            PropertyMap vertexFormat = new PropertyMap();

            vertexFormat.Add("aPosition", new PropertyValue((int)PropertyType.Vector2));

            PropertyBuffer vertexBuffer = new PropertyBuffer(vertexFormat);

            vertexBuffer.SetData(RectangleDataPtr(), 4);


            Geometry geometry = new Geometry();

            geometry.AddVertexBuffer(vertexBuffer);
            geometry.SetType(Geometry.Type.TRIANGLE_STRIP);

            return(geometry);
        }
Ejemplo n.º 12
0
        public bool AddResponseHeaders(IDictionary <string, string> headers)
        {
            if (headers == null)
            {
                return(false);
            }
            PropertyMap headerMap = new PropertyMap();

            foreach (KeyValuePair <string, string> kvp in headers)
            {
                using (PropertyValue value = new PropertyValue(kvp.Value))
                {
                    headerMap.Add(kvp.Key, value);
                }
            }
            bool result = Interop.WebHttpRequestInterceptor.AddResponseHeaders(interceptorHandle, PropertyMap.getCPtr(headerMap));

            headerMap.Dispose();
            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(result);
        }
Ejemplo n.º 13
0
 private void ComposingTransformMap()
 {
     visualTransformMap = new PropertyMap();
     if (visualSize != null)
     {
         PropertyValue temp = new PropertyValue(visualSize);
         visualTransformMap.Add((int)VisualTransformPropertyType.Size, temp);
         temp.Dispose();
     }
     if (visualOffset != null)
     {
         PropertyValue temp = new PropertyValue(visualOffset);
         visualTransformMap.Add((int)VisualTransformPropertyType.Offset, temp);
         temp.Dispose();
     }
     if (visualOffsetPolicy != null)
     {
         PropertyValue temp = new PropertyValue(visualOffsetPolicy);
         visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, temp);
         temp.Dispose();
     }
     if (visualSizePolicy != null)
     {
         PropertyValue temp = new PropertyValue(visualSizePolicy);
         visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, temp);
         temp.Dispose();
     }
     if (visualOrigin != null)
     {
         PropertyValue temp = new PropertyValue((int)visualOrigin);
         visualTransformMap.Add((int)VisualTransformPropertyType.Origin, temp);
         temp.Dispose();
     }
     if (visualAnchorPoint != null)
     {
         PropertyValue temp = new PropertyValue((int)visualAnchorPoint);
         visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, temp);
         temp.Dispose();
     }
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Compose the out visual map.
 /// </summary>
 /// <since_tizen> 3 </since_tizen>
 protected override void ComposingPropertyMap()
 {
     if (_urls != null)
     {
         _outputVisualMap = new PropertyMap();
         _outputVisualMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.AnimatedImage));
         if (_urls.Count == 1)
         {
             _outputVisualMap.Add(ImageVisualProperty.URL, new PropertyValue(_urls[0]));
         }
         else
         {
             var urlArray = new PropertyArray();
             foreach (var url in _urls)
             {
                 urlArray.Add(new PropertyValue(url));
             }
             _outputVisualMap.Add(ImageVisualProperty.URL, (new PropertyValue(urlArray)));
         }
         if (_batchSize != null)
         {
             _outputVisualMap.Add((int)ImageVisualProperty.BatchSize, new PropertyValue((int)_batchSize));
         }
         if (_cacheSize != null)
         {
             _outputVisualMap.Add((int)ImageVisualProperty.CacheSize, new PropertyValue((int)_cacheSize));
         }
         if (_frameDelay != null)
         {
             _outputVisualMap.Add((int)ImageVisualProperty.FrameDelay, new PropertyValue((float)_frameDelay));
         }
         if (_loopCount != null)
         {
             _outputVisualMap.Add((int)ImageVisualProperty.LoopCount, new PropertyValue((int)_loopCount));
         }
         if (_shader != null)
         {
             _outputVisualMap.Add((int)Visual.Property.Shader, new PropertyValue(_shader));
         }
         if (_premultipliedAlpha != null)
         {
             _outputVisualMap.Add((int)Visual.Property.PremultipliedAlpha, new PropertyValue((bool)_premultipliedAlpha));
         }
         if (_mixColor != null)
         {
             _outputVisualMap.Add((int)Visual.Property.MixColor, new PropertyValue(_mixColor));
         }
         if (_opacity != null)
         {
             _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity));
         }
         if (_visualFittingMode != null)
         {
             _outputVisualMap.Add((int)Visual.Property.VisualFittingMode, new PropertyValue((int)_visualFittingMode));
         }
     }
 }
Ejemplo n.º 15
0
        /// <summary>
        /// Compose the out visual map.
        /// </summary>
        /// <since_tizen> 3 </since_tizen>
        protected virtual void ComposingPropertyMap()
        {
            if (null == _outputVisualMap)
            {
                _outputVisualMap = new PropertyMap();
            }

            if (_shader != null)
            {
                PropertyValue temp = new PropertyValue(_shader);
                _outputVisualMap.Add(Visual.Property.Shader, temp);
                temp.Dispose();
            }
            if (_premultipliedAlpha != null)
            {
                PropertyValue temp = new PropertyValue((bool)_premultipliedAlpha);
                _outputVisualMap.Add(Visual.Property.PremultipliedAlpha, temp);
                temp.Dispose();
            }
            if (_mixColor != null)
            {
                PropertyValue temp = new PropertyValue(_mixColor);
                _outputVisualMap.Add(Visual.Property.MixColor, temp);
                temp.Dispose();
            }
            if (_opacity != null)
            {
                PropertyValue temp = new PropertyValue((float)_opacity);
                _outputVisualMap.Add(Visual.Property.Opacity, temp);
                temp.Dispose();
            }
            if (_visualFittingMode != null)
            {
                PropertyValue temp = new PropertyValue((int)_visualFittingMode);
                _outputVisualMap.Add(Visual.Property.VisualFittingMode, temp);
                temp.Dispose();
            }
            if (cornerRadius != null)
            {
                PropertyValue temp = new PropertyValue(cornerRadius);
                _outputVisualMap.Add(Visual.Property.CornerRadius, temp);
                temp.Dispose();
            }
            if (borderlineWidth != null)
            {
                PropertyValue temp = new PropertyValue((float)borderlineWidth);
                _outputVisualMap.Add(Visual.Property.BorderlineWidth, temp);
                temp.Dispose();
            }
            if (borderlineColor != null)
            {
                PropertyValue temp = new PropertyValue(borderlineColor);
                _outputVisualMap.Add(Visual.Property.BorderlineColor, temp);
                temp.Dispose();
            }
            if (borderlineOffset != null)
            {
                PropertyValue temp = new PropertyValue((float)borderlineOffset);
                _outputVisualMap.Add(Visual.Property.BorderlineOffset, temp);
                temp.Dispose();
            }
        }