summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_list_private.h
blob: be88bf34d162ead1d7228de05f3a882cdd3c2ad1 (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
136
#ifndef EFL_UI_LIST_PRIVATE_H
#define EFL_UI_LIST_PRIVATE_H

#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif

#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
#define ELM_INTERFACE_ATSPI_SELECTION_PROTECTED
#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED

#include <Elementary.h>
#include "elm_priv.h"

typedef struct _Efl_Ui_List_Item Efl_Ui_List_Item;
typedef struct _Efl_Ui_List_Data Efl_Ui_List_Data;

struct _Efl_Ui_List_Item
{
   Efl_Ui_List          *list;
   Efl_Model            *model;
   Efl_Ui_Layout        *layout;
   Efl_Future           *future;
   unsigned int         index;
   // Evas_Coord           x, y, minw, minh, w, h;
   // // double               h, v, wx, wy;
   // double               wx, wy;
   Ecore_Timer         *long_timer;
   Eina_Bool            selected: 1;
   Eina_Bool            down: 1;
   Eina_Bool            longpressed : 1;
};

typedef struct _Efl_Ui_List_Data Efl_Ui_List_Data;

#include "efl_ui_list_segarray.h"

struct _Efl_Ui_List_Data
{
   Eo                           *obj;
   Evas_Object                  *hit_rect;
   Efl_Model                    *model;

   Efl_Orient                   orient;

   struct {
      double                    h, v;
      Eina_Bool                 scalable: 1;
   } pad;

   struct {
      double                    h, v;
   } align;

   struct {
      double                    x, y;
   } weight;

   // struct {
   //    Evas_Coord                w, h;
   //    int                       start;
   //    int                       slice;
   // } realized;

   int segarray_first;
   Efl_Ui_List_SegArray segarray;

   Evas_Object               *pan_obj;

   Efl_Ui_Layout_Factory        *factory;
   Eina_List                    *selected_items;
   // struct {
   //   Eina_Inarray               array;
   // } items;
   Eina_Stringshare             *style;
   Elm_Object_Select_Mode       select_mode;
   Elm_List_Mode                mode;

   Efl_Ui_Focus_Manager         *manager;
   Eina_Size2D                  min;
   int                          /*average_item_size, avsom, */item_count;
   Efl_Future                   *slice_future;
   Efl_Future                   *count_future;
   Efl_Ui_List_Relayout         *relayout;
   struct {
     int slice_start;
     int slice_count;
   } outstanding_slice;

   Eina_Bool                    homogeneous : 1;
   Eina_Bool                    recalc : 1;
   Eina_Bool                    on_hold : 1;
};

typedef struct _Efl_Ui_List_Pan_Data Efl_Ui_List_Pan_Data;

struct _Efl_Ui_List_Pan_Data
{
   Eo                     *wobj;
   Evas_Coord             x, y, move_diff;

   Ecore_Job              *resize_job;
};

typedef struct _Efl_Ui_List_Slice Efl_Ui_List_Slice;

struct _Efl_Ui_List_Slice
{
   Efl_Ui_List_Data       *pd;
   int                    newstart, slicestart, newslice;
};



#define EFL_UI_LIST_DATA_GET(o, ptr) \
  Efl_Ui_List_Data * ptr = efl_data_scope_get(o, EFL_UI_LIST_CLASS)

#define EFL_UI_LIST_DATA_GET_OR_RETURN(o, ptr)       \
  EFL_UI_LIST_DATA_GET(o, ptr);                      \
  if (EINA_UNLIKELY(!ptr))                           \
    {                                                \
       CRI("No widget data for object %p (%s)",      \
           o, evas_object_type_get(o));              \
       return;                                       \
    }

#define EFL_UI_LIST_DATA_GET_OR_RETURN_VAL(o, ptr, val) \
  EFL_UI_LIST_DATA_GET(o, ptr);                         \
  if (EINA_UNLIKELY(!ptr))                              \
    {                                                   \
       CRI("No widget data for object %p (%s)",         \
           o, evas_object_type_get(o));                 \
       return val;                                      \
    }

#endif