summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_widget_scroll_manager.h
blob: 07311910e069b82b80f4d4ca1d6b0ed11fa3c27f (plain) (blame)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#ifndef EFL_UI_WIDGET_SCROLL_MANAGER_H
#define EFL_UI_WIDGET_SCROLL_MANAGER_H

#include "Elementary.h"

typedef double (*Interpolator)(void *data, double progress);

typedef enum {
  LINEAR,
  ACCEL,
  DECEL,
} InterpType;

typedef struct _Efl_Ui_Scroll_Manager_Data
{
   Evas_Coord                    x, y, w, h;
   Evas_Coord                    wx, wy, ww, wh; /**< Last "wanted" geometry */

   Evas_Object                  *obj;
   Evas_Object                  *pan_obj;
   Evas_Object                  *event_rect;

   Evas_Object                  *parent;

   Efl_Ui_Scrollbar_Mode         hbar_mode, vbar_mode;

   Ecore_Timer                  *hbar_timer, *vbar_timer;
   Efl_Ui_Scroll_Block block;

   struct
   {
      Evas_Coord x, y;
      Evas_Coord sx, sy;

      struct
      {
         Evas_Coord x, y;
         double     timestamp, localtimestamp;
      } history[60];

      struct
      {
         double tadd, dxsum, dysum;
         double est_timestamp_diff;
      } hist;

      double          onhold_vx, onhold_vy;
      double          onhold_vxe, onhold_vye;
      double          onhold_tlast;

      double          last_time_x_wheel;
      double          last_time_y_wheel;

      int             hdir, vdir;

      Evas_Coord      hold_x, hold_y;
      Ecore_Idle_Enterer *hold_enterer;

      double          dragged_began_timestamp;
      Eina_Bool       dragged : 1;
      Eina_Bool       dragged_began : 1;
      Eina_Bool       hold_animator : 1;
      Eina_Bool       onhold_animator : 1;
      Eina_Bool       last_hold_x_wheel : 1;
      Eina_Bool       last_hold_y_wheel : 1;
      Eina_Bool       dir_x : 1;
      Eina_Bool       dir_y : 1;

      Eina_Bool       scroll : 1;
      Eina_Bool       hold : 1;

      Eina_Bool       now : 1;
      Eina_Bool       want_reset : 1;
   } down;

   struct
   {
      Evas_Coord w, h;
      Eina_Bool  resized : 1;
   } content_info;

   struct
   {
      Evas_Coord x, y;
   } step, page;

   struct
   {
      struct
      {
         Evas_Coord      start, end;
         Eina_Bool       animator;
         Interpolator interp;
         double start_t, dur;
      } x, y;
   } scrollto;

   struct
   {
      struct
      {
         Evas_Coord      p0, p1, p2;
         double          vel;
         Eina_Bool       animator;
         double start_t;
         double t01, t12;
      } x, y;
   } bounce;

   double       last_wheel_mul;
   unsigned int last_wheel;

   void         *event_info;

   double                         gravity_x, gravity_y;
   Evas_Coord                     prev_cw, prev_ch;

   Eina_Bool  hbar_visible : 1;
   Eina_Bool  vbar_visible : 1;
   Eina_Bool  bounce_horiz : 1;
   Eina_Bool  bounce_vert : 1;
   Eina_Bool  is_mirrored : 1;
   Eina_Bool  bouncemey : 1;
   Eina_Bool  bouncemex : 1;
   Eina_Bool  freeze : 1;
   Eina_Bool  freeze_want : 1;
   Eina_Bool  hold : 1;
   Eina_Bool  match_content_w : 1;
   Eina_Bool  match_content_h : 1;
   Eina_Bool  loop_h : 1;
   Eina_Bool  loop_v : 1;
   Eina_Bool  scrolling : 1;
} Efl_Ui_Scroll_Manager_Data;

#endif