aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Communication/PMR/Diagnostics/StartEventsNotificationResponse.pb-c.h
blob: 29c2bbc31863e1af39a0539388f8e155113bf2c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
/* Generated from: StartEventsNotificationResponse.proto */

#ifndef PROTOBUF_C_StartEventsNotificationResponse_2eproto__INCLUDED
#define PROTOBUF_C_StartEventsNotificationResponse_2eproto__INCLUDED

#include <protobuf-c/protobuf-c.h>

PROTOBUF_C__BEGIN_DECLS

#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif

#include "Event.pb-c.h"

typedef struct _StartEventsNotificationResponse StartEventsNotificationResponse;


/* --- enums --- */


/* --- messages --- */

struct  _StartEventsNotificationResponse
{
  ProtobufCMessage base;
  size_t n_events;
  Event **events;
};
#define START_EVENTS_NOTIFICATION_RESPONSE__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&start_events_notification_response__descriptor) \
    , 0,NULL }


/* StartEventsNotificationResponse methods */
void   start_events_notification_response__init
                     (StartEventsNotificationResponse         *message);
size_t start_events_notification_response__get_packed_size
                     (const StartEventsNotificationResponse   *message);
size_t start_events_notification_response__pack
                     (const StartEventsNotificationResponse   *message,
                      uint8_t             *out);
size_t start_events_notification_response__pack_to_buffer
                     (const StartEventsNotificationResponse   *message,
                      ProtobufCBuffer     *buffer);
StartEventsNotificationResponse *
       start_events_notification_response__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   start_events_notification_response__free_unpacked
                     (StartEventsNotificationResponse *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*StartEventsNotificationResponse_Closure)
                 (const StartEventsNotificationResponse *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCMessageDescriptor start_events_notification_response__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_StartEventsNotificationResponse_2eproto__INCLUDED */
an>; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Markup; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using Tango.SharedUI.Helpers; using Tango.Touch.Controls; namespace Tango.Touch.Components { [ContentProperty(nameof(Content))] [TemplatePart(Name = PART_EllipseName, Type = typeof(Ellipse))] [TemplatePart(Name = PART_ScaleName, Type = typeof(ScaleTransform))] public class Ripple : Control { private const String PART_ScaleName = "PART_scale"; private const String PART_EllipseName = "PART_ellipse"; private ScaleTransform _scale; private Ellipse _ellipse; private bool _isAnimating; public UIElement Content { get { return (UIElement)GetValue(ContentProperty); } set { SetValue(ContentProperty, value); } } public static readonly DependencyProperty ContentProperty = DependencyProperty.Register("Content", typeof(UIElement), typeof(Ripple), new PropertyMetadata(null)); public CornerRadius CornerRadius { get { return (CornerRadius)GetValue(CornerRadiusProperty); } set { SetValue(CornerRadiusProperty, value); } } public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(Ripple), new PropertyMetadata(new CornerRadius())); public Brush RippleBrush { get { return (Brush)GetValue(RippleBrushProperty); } set { SetValue(RippleBrushProperty, value); } } public static readonly DependencyProperty RippleBrushProperty = DependencyProperty.Register("RippleBrush", typeof(Brush), typeof(Ripple), new PropertyMetadata(null)); public ScrollViewer SynchedScrollViewer { get { return (ScrollViewer)GetValue(SynchedScrollViewerProperty); } set { SetValue(SynchedScrollViewerProperty, value); } } public static readonly DependencyProperty SynchedScrollViewerProperty = DependencyProperty.Register("SynchedScrollViewer", typeof(ScrollViewer), typeof(Ripple), new PropertyMetadata(null)); public double RippleFactor { get { return (double)GetValue(RippleFactorProperty); } set { SetValue(RippleFactorProperty, value); } } public static readonly DependencyProperty RippleFactorProperty = DependencyProperty.Register("RippleFactor", typeof(double), typeof(Ripple), new PropertyMetadata(5.0)); public bool Centered { get { return (bool)GetValue(CenteredProperty); } set { SetValue(CenteredProperty, value); } } public static readonly DependencyProperty CenteredProperty = DependencyProperty.Register("Centered", typeof(bool), typeof(Ripple), new PropertyMetadata(false)); public bool Disabled { get { return (bool)GetValue(DisabledProperty); } set { SetValue(DisabledProperty, value); } } public static readonly DependencyProperty DisabledProperty = DependencyProperty.Register("Disabled", typeof(bool), typeof(Ripple), new PropertyMetadata(false,(d,e) => (d as Ripple).OnDisabledChanged())); private void OnDisabledChanged() { if (Disabled) { CancelRipple(true); } } #region Attached Properties #region PreventRipple /// <summary> /// Determines whether an element is a dropable target by the drag and drop service. /// </summary> public static readonly DependencyProperty PreventRippleProperty = DependencyProperty.RegisterAttached("PreventRipple", typeof(bool), typeof(Ripple), new FrameworkPropertyMetadata(false)); /// <summary> /// Sets the PreventRipple attached property. /// </summary> /// <param name="element">The element.</param> /// <param name="value">if set to <c>true</c> [value].</param> public static void SetPreventRipple(FrameworkElement element, bool value) { element.SetValue(PreventRippleProperty, value); } /// <summary> /// Gets the PreventRipple attached property. /// </summary> /// <param name="element">The element.</param> /// <returns></returns> public static bool GetPreventRipple(FrameworkElement element) { if (element != null) { return (bool)element.GetValue(PreventRippleProperty); } else { return false; } } #endregion #endregion static Ripple() { DefaultStyleKeyProperty.OverrideMetadata(typeof(Ripple), new FrameworkPropertyMetadata(typeof(Ripple))); } public Ripple() { this.Loaded += Ripple_Loaded; } private void Ripple_Loaded(object sender, RoutedEventArgs e) { if (SynchedScrollViewer != null) { SynchedScrollViewer.ScrollChanged += (_, __) => CancelRipple(true); } } public override void OnApplyTemplate() { base.OnApplyTemplate(); _scale = GetTemplateChild(PART_ScaleName) as ScaleTransform; _ellipse = GetTemplateChild(PART_EllipseName) as Ellipse; FrameworkElement parent = this.FindAncestor<Button>(); if (parent == null) { parent = this.FindAncestor<ListBoxItem>(); } if (parent == null) { parent = this.FindAncestor<DataGridRow>(); } if (parent == null) { parent = this.FindAncestor<TouchListBoxItem>(); } if (parent == null) { parent = this.FindAncestor<Border>(); } if (parent == null) { parent = this.FindAncestor<FrameworkElement>(); } //parent.PreviewTouchDown += Parent_PreviewTouchDown; //parent.TouchMove += (_, __) => CancelRipple(); //parent.PreviewTouchUp += Parent_PreviewTouchUp; if (parent != null) { parent.RegisterForPreviewMouseOrTouchDown(this, (x, e) => { if (!GetPreventRipple(e.OriginalSource as FrameworkElement)) { OnRippleDown(e.Location); } }); parent.PreviewMouseUp += Parent_PreviewMouseUp; } //parent.PreviewMouseDown += Parent_PreviewMouseDown; //parent.PreviewTouchDown += Parent_PreviewTouchDown; //parent.TouchMove += (_, __) => CancelRipple(); //parent.PreviewTouchUp += Parent_PreviewTouchUp; } private void Parent_PreviewMouseUp(object sender, MouseButtonEventArgs e) { OnRippleUp(new Point(e.GetPosition(this).X, e.GetPosition(this).Y)); } private void Parent_PreviewTouchUp(object sender, TouchEventArgs e) { OnRippleUp(new Point(e.GetTouchPoint(this).Position.X, e.GetTouchPoint(this).Position.Y)); } private void Parent_PreviewMouseDown(object sender, MouseButtonEventArgs e) { OnRippleDown(new Point(e.GetPosition(this).X, e.GetPosition(this).Y)); } private void Parent_PreviewTouchDown(object sender, TouchEventArgs e) { OnRippleDown(new Point(e.GetTouchPoint(this).Position.X, e.GetTouchPoint(this).Position.Y)); } public void CancelRipple(bool immidiate = false) { if (_isAnimating) { _isAnimating = false; DoubleAnimation ani = new DoubleAnimation(); ani.To = 0; ani.Duration = TimeSpan.FromSeconds(immidiate ? 0 : 0.1); _scale.BeginAnimation(ScaleTransform.ScaleXProperty, ani); _scale.BeginAnimation(ScaleTransform.ScaleYProperty, ani); } } private void OnRippleUp(Point position) { if (!(position.X >= 0 && position.X <= ActualWidth && position.Y >= 0 && position.Y <= ActualHeight)) { CancelRipple(); } } private void OnRippleDown(Point position) { if (Disabled) return; _isAnimating = true; if (!Centered) { Canvas.SetLeft(_ellipse, position.X - (_ellipse.Width / 2)); Canvas.SetTop(_ellipse, position.Y - (_ellipse.Height / 2)); } else { Canvas.SetLeft(_ellipse, (ActualWidth / 2) - (_ellipse.Width / 2)); Canvas.SetTop(_ellipse, (ActualHeight / 2) - (_ellipse.Height / 2)); } DoubleAnimation ani = new DoubleAnimation(); ani.From = 0; ani.To = RippleFactor; ani.AutoReverse = true; ani.Duration = TimeSpan.FromSeconds(0.3); ani.AccelerationRatio = 0.2; ani.DecelerationRatio = 0.2; _scale.BeginAnimation(ScaleTransform.ScaleXProperty, ani); _scale.BeginAnimation(ScaleTransform.ScaleYProperty, ani); } } }