summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_view_list_private.h
blob: 7560870f141e39a0a25e0d16bf8b2bf560b97e7e (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
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
#ifndef EFL_UI_VIEW_LIST_PRIVATE_H
#define EFL_UI_VIEW_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_View_List_Data Efl_Ui_View_List_Data;

int efl_ui_view_list_item_index_get(Efl_Ui_View_List_LayoutItem *item);

typedef struct _Efl_Ui_View_List_Data Efl_Ui_View_List_Data;

#include "efl_ui_view_list_segarray.h"

struct _Efl_Ui_View_List_Data
{
   Eo                           *obj;
   Eo                           *scrl_mgr;
   Efl_Ui_View_List_Pan              *pan_obj;
   Efl_Model                    *model;

   Eina_Stringshare             *style;

   struct {
      Eina_Future *future;

      int start;
      int count;
   } slice;

   Efl_Ui_Layout_Factory        *factory;
   Eina_List                    *selected_items;

   Efl_Ui_Focus_Manager         *manager;
   Efl_Ui_View_List_Relayout    *relayout;

   Efl_Orient                   orient;

   int segarray_first;
   Efl_Ui_View_List_SegArray         *segarray;

   Elm_Object_Select_Mode       select_mode;
   Elm_List_Mode                mode;

   Eina_Rect                    gmt;
   Eina_Size2D                  min;

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

typedef struct _Efl_Ui_View_List_Pan_Data Efl_Ui_View_List_Pan_Data;

struct _Efl_Ui_View_List_Pan_Data
{
   Eo                     *wobj;
   Eina_Rect              gmt;
   Evas_Coord             move_diff;

   Ecore_Job              *resize_job;
};

typedef struct _Efl_Ui_View_List_Slice Efl_Ui_View_List_Slice;

struct _Efl_Ui_View_List_Slice
{
   Efl_Ui_View_List_Data       *pd;
   int                    newstart, slicestart, newslice;
};

#define EFL_UI_VIEW_LIST_DATA_GET(o, ptr) \
  Efl_Ui_View_List_Data * ptr = efl_data_scope_get(o, EFL_UI_VIEW_LIST_CLASS)

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

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

#endif